/* =====================================================================
   Chamados de atendimento: conversa (cliente, visitante e admin), caixa de
   entrada do Admin > Chamados e páginas públicas (/contato e página do
   chamado). O botão "Ajuda" flutuante do site fica no modern_layout.css.
   Prefixos: ch- (conversa e listas), ct- (páginas públicas).
   As cores vêm das variáveis do tema (--vz-*), com valor padrão.
   ===================================================================== */

:root {
    --ch-primaria: #405189;
    --ch-primaria-suave: rgba(64, 81, 137, .10);
    --ch-borda: var(--vz-border-color, #e9ebec);
    --ch-fundo-suave: var(--vz-light, #f3f6f9);
    --ch-texto: var(--vz-body-color, #212529);
    --ch-texto-suave: var(--vz-secondary-color, #878a99);
    --ch-cartao: var(--vz-card-bg, #fff);
}

/* ---------- Conversa ---------- */

.ch-conversa {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ch-msg {
    display: flex;
    gap: 10px;
    max-width: 88%;
    align-self: flex-start;
}

.ch-msg.ch-minha {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ch-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background: var(--ch-fundo-suave);
    color: var(--ch-texto-suave);
    border: 1px solid var(--ch-borda);
}

.ch-avatar.ch-avatar-equipe {
    background: var(--ch-primaria);
    color: #fff;
    border-color: var(--ch-primaria);
}

.ch-msg-corpo {
    min-width: 0;
}

.ch-meta {
    font-size: 12px;
    color: var(--ch-texto-suave);
    margin-bottom: 4px;
}

.ch-minha .ch-meta {
    text-align: right;
}

.ch-meta strong {
    color: var(--ch-texto);
    font-weight: 600;
}

.ch-balao {
    padding: 12px 15px;
    border-radius: 14px;
    border-top-left-radius: 4px;
    background: var(--ch-fundo-suave);
    color: var(--ch-texto);
    line-height: 1.6;
    font-size: 14.5px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ch-minha .ch-balao {
    background: var(--ch-primaria-suave);
    border-top-left-radius: 14px;
    border-top-right-radius: 4px;
}

.ch-balao p { margin: 0 0 8px 0; }
.ch-balao p:last-child { margin-bottom: 0; }
.ch-balao ul, .ch-balao ol { margin: 4px 0 8px 0; padding-left: 20px; }
.ch-balao blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--ch-borda); color: var(--ch-texto-suave); }
.ch-balao a { text-decoration: underline; word-break: break-all; }

/* Evento do sistema (finalizado, reaberto): no meio da conversa, sem balão */
.ch-evento {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ch-texto-suave);
    background: var(--ch-fundo-suave);
    border: 1px dashed var(--ch-borda);
    border-radius: 999px;
    padding: 4px 12px;
    text-align: center;
}

/* Mensagem recém-enviada */
.ch-msg.ch-nova .ch-balao { animation: chEntrada .35s ease; }

@keyframes chEntrada {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Situação do chamado ---------- */

.ch-situacao {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--ch-fundo-suave);
    border: 1px solid var(--ch-borda);
    font-size: 14px;
    color: var(--ch-texto);
}

.ch-situacao i { font-size: 20px; line-height: 1; margin-top: 1px; }
.ch-situacao-1 { background: rgba(247, 184, 75, .12); border-color: rgba(247, 184, 75, .35); }
.ch-situacao-1 i { color: #c27c0e; }
.ch-situacao-2 { background: rgba(10, 179, 156, .10); border-color: rgba(10, 179, 156, .30); }
.ch-situacao-2 i { color: #0a9e8a; }
.ch-situacao-3 i { color: var(--ch-texto-suave); }

/* ---------- Caixa de resposta ---------- */

.ch-resposta textarea {
    resize: vertical;
    min-height: 110px;
}

.ch-resposta-rodape {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}

.ch-contador {
    font-size: 12px;
    color: var(--ch-texto-suave);
}

.ch-contador.ch-contador-limite { color: #f06548; font-weight: 600; }

/* ---------- Listas (Minha Conta e Admin) ---------- */

.ch-lista {
    display: flex;
    flex-direction: column;
}

.ch-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--ch-borda);
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s;
    position: relative;
}

.ch-item:hover { background: var(--ch-fundo-suave); color: inherit; }
.ch-item.ativo { background: var(--ch-primaria-suave); }
.ch-item.ativo::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ch-primaria); }

.ch-item-corpo { min-width: 0; flex: 1; }

.ch-item-topo {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.ch-item-nome {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-item-tempo { font-size: 12px; color: var(--ch-texto-suave); white-space: nowrap; }

.ch-item-assunto {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-item-resumo {
    font-size: 13px;
    color: var(--ch-texto-suave);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 2px;
}

.ch-item-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ch-item-tags .badge { font-weight: 500; }

/* Bolinha "tem resposta para você / cliente aguardando" */
.ch-ponto {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f7b84b;
    margin-right: 4px;
    vertical-align: middle;
}

.ch-ponto.ch-ponto-novo { background: #0ab39c; }

.ch-vazio {
    text-align: center;
    padding: 48px 20px;
    color: var(--ch-texto-suave);
}

.ch-vazio i { font-size: 44px; display: block; margin-bottom: 8px; opacity: .6; }

/* ---------- Admin > Chamados ---------- */

.ch-resumo-card { cursor: pointer; transition: box-shadow .2s, background-color .2s; margin-bottom: 0; }
.ch-resumo-card.ativo { background-color: rgba(64, 81, 137, .06); box-shadow: inset 0 0 0 2px rgba(64, 81, 137, .45); }

.ch-inbox { overflow: hidden; }

.ch-inbox-lista {
    border-right: 1px solid var(--ch-borda);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.ch-inbox-filtros { padding: 14px 16px; border-bottom: 1px solid var(--ch-borda); }
.ch-inbox-filtros .nav-pills .nav-link { padding: 5px 10px; font-size: 13px; }
.ch-inbox-filtros .nav-pills .badge { margin-left: 4px; }

.ch-inbox-itens { overflow-y: auto; flex: 1; }

.ch-inbox-detalhe { display: flex; flex-direction: column; min-height: 0; }

.ch-detalhe-topo {
    padding: 14px 20px;
    border-bottom: 1px solid var(--ch-borda);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.ch-detalhe-titulo { min-width: 0; }
.ch-detalhe-titulo h5 { margin: 0 0 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ch-detalhe-corpo { flex: 1; overflow-y: auto; padding: 20px; min-height: 0; }

.ch-detalhe-resposta { border-top: 1px solid var(--ch-borda); padding: 14px 20px; background: var(--ch-cartao); }

.ch-info dt { font-weight: 500; color: var(--ch-texto-suave); font-size: 12px; text-transform: uppercase; letter-spacing: .3px; margin-top: 12px; }
.ch-info dt:first-child { margin-top: 0; }
.ch-info dd { margin: 2px 0 0 0; font-size: 14px; overflow-wrap: anywhere; }

@media (min-width: 992px) {
    /* Lista e conversa rolam por dentro, a resposta fica sempre à vista */
    .ch-inbox .ch-inbox-lista,
    .ch-inbox .ch-inbox-detalhe { height: calc(100vh - 290px); min-height: 520px; }
}

@media (max-width: 991.98px) {
    .ch-inbox-lista { border-right: 0; }
    .ch-inbox-itens { max-height: none; }
    /* No celular: ou a lista, ou o chamado aberto */
    .ch-inbox.ch-com-detalhe .ch-inbox-lista { display: none; }
    .ch-inbox:not(.ch-com-detalhe) .ch-inbox-detalhe { display: none; }
    .ch-msg { max-width: 100%; }
}

/* ---------- Páginas públicas (/contato e /atendimento/chamado) ---------- */

.ct-hero { padding-bottom: 56px !important; }
.ct-hero .hero-title { margin-bottom: 12px; }
.ct-hero .hero-subtitle { margin-bottom: 0; max-width: 680px; }
.ct-hero-compacto { padding-bottom: 40px !important; }

.ct-selo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
}

.ct-voltar { color: rgba(255, 255, 255, .85); font-size: 14px; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.ct-voltar:hover { color: #fff; }

.ct-secao { padding: 40px 0 64px; background: #f8f9fa; }

.ct-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(30, 58, 95, .05);
}

.ct-titulo {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.ct-passo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1e3a5f;
    color: #fff;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
}

.ct-topicos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ct-topico {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: left;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
    width: 100%;
}

.ct-topico:hover { border-color: #1e3a5f; box-shadow: 0 4px 12px rgba(30, 58, 95, .08); }
.ct-topico i { font-size: 22px; color: #ff7b54; }
.ct-topico strong { color: #1e3a5f; font-size: 15px; }
.ct-topico span { color: #6c757d; font-size: 13px; line-height: 1.4; }

.ct-faq .accordion-button { font-weight: 600; color: #1e3a5f; font-size: 15px; }
.ct-faq .accordion-button:not(.collapsed) { background: rgba(30, 58, 95, .05); box-shadow: none; }
.ct-faq .accordion-body { color: #4b5563; line-height: 1.6; }

/* Um quadro por vez (/contato): entra com um leve deslize */
.ct-quadro:not(.d-none) { animation: ctEntrada .25s ease; }

@keyframes ctEntrada {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* Assunto escolhido, no topo das respostas rápidas */
.ct-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(30, 58, 95, .06);
    color: #1e3a5f;
    font-weight: 600;
    font-size: 13px;
}

.ct-chip i { color: #ff7b54; font-size: 16px; }

/* Fim das respostas rápidas: Voltar + Falar com a equipe */
.ct-acoes {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 123, 84, .08);
    border: 1px solid rgba(255, 123, 84, .25);
}

.ct-acoes-botoes { display: flex; flex-wrap: wrap; gap: 8px; }

/* Rodapé dos quadros: Voltar à esquerda, ação principal à direita */
.ct-rodape-quadro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

@media (max-width: 575.98px) {
    .ct-acoes-botoes, .ct-acoes-botoes .btn { width: 100%; }
    .ct-rodape-quadro { flex-direction: column-reverse; align-items: stretch; }
    .ct-rodape-quadro .btn { width: 100%; }
    .ct-rodape-quadro > div { justify-content: center !important; flex-direction: column-reverse; }
}

.ct-logado {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(30, 58, 95, .05);
    margin-bottom: 18px;
    font-size: 14px;
}

.ct-logado .ch-avatar { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }

/* Campo para robôs: fora da tela, sem display:none (alguns robôs ignoram campos escondidos assim) */
.ct-campo-robo { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.ct-sucesso { text-align: center; padding: 40px 24px; }
.ct-sucesso .ct-sucesso-icone {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(76, 175, 80, .12);
    color: #4caf50;
    font-size: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.ct-lateral h3 { font-size: 1rem; font-weight: 700; color: #1e3a5f; margin-bottom: 14px; }
.ct-etapas { list-style: none; padding: 0; margin: 0; }
.ct-etapas li { display: flex; gap: 12px; margin-bottom: 14px; font-size: 14px; color: #4b5563; }
.ct-etapas li:last-child { margin-bottom: 0; }
.ct-etapas i { color: #1e3a5f; font-size: 18px; flex: 0 0 auto; }
.ct-atalhos a { display: flex; align-items: center; gap: 8px; padding: 8px 0; color: #1e3a5f; text-decoration: none; font-size: 14px; border-bottom: 1px solid #f1f3f5; }
.ct-atalhos a:last-child { border-bottom: 0; }
.ct-atalhos a:hover { color: #ff7b54; }

/* Conversa nas páginas públicas: cores do site */
.ct-card .ch-minha .ch-balao { background: rgba(30, 58, 95, .08); }
.ct-card .ch-avatar.ch-avatar-equipe { background: #1e3a5f; border-color: #1e3a5f; }

@media (max-width: 991.98px) {
    .ct-topicos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
    .ct-topicos { grid-template-columns: 1fr; }
    .ct-card { padding: 18px; border-radius: 12px; }
    .ct-secao { padding: 24px 0 40px; }
}
