/* Estilo mínimo, só pra tela ser legível e utilizável no piloto. Sem framework de CSS. */

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f4f5f7;
  color: #1c1e21;
}

.tela-login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.cartao-login {
  background: #fff;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  width: 320px;
}
.cartao-login h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.cartao-login .subtitulo { margin: 0 0 1.5rem; color: #666; font-size: 0.9rem; }
.cartao-login form { display: flex; flex-direction: column; gap: 1rem; }
.cartao-login label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: #444; }
.cartao-login input { padding: 0.6rem; border: 1px solid #ccc; border-radius: 6px; font-size: 1rem; }
.cartao-login button { padding: 0.7rem; border: none; border-radius: 6px; background: #128c7e; color: #fff; font-size: 1rem; cursor: pointer; }
.erro { color: #c0392b; font-size: 0.85rem; }

.tela-fila { display: flex; flex-direction: column; height: 100vh; }
.topo {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.8rem 1.5rem; background: #075e54; color: #fff;
}
.topo h1 { font-size: 1.1rem; margin: 0; }
.tag-piloto { font-weight: normal; font-size: 0.75rem; opacity: 0.8; margin-left: 0.5rem; }
.usuario-logado { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.badge-notificacao {
  background: #25d366; color: #04380f; padding: 0.2rem 0.6rem; border-radius: 12px; font-size: 0.75rem;
}
.link { background: none; border: none; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

.corpo { flex: 1; display: flex; overflow: hidden; }
.coluna-fila { width: 360px; flex-shrink: 0; border-right: 1px solid #ddd; overflow-y: auto; background: #fff; display: flex; flex-direction: column; }
.coluna-detalhe { flex: 1; overflow-y: auto; padding: 1.5rem; }

/* Busca / filtro / ordenação no topo da lista de conversas */
.controles-fila { position: sticky; top: 0; background: #fff; border-bottom: 1px solid #eee; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; z-index: 1; }
.campo-busca { width: 100%; padding: 0.55rem 0.8rem; border: 1px solid #ddd; border-radius: 20px; font-size: 0.85rem; background: #f4f5f7; }
.campo-busca:focus { outline: none; border-color: #128c7e; background: #fff; }
.linha-filtros { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.segmentado { display: flex; background: #f0f1f3; border-radius: 20px; padding: 2px; }
.seg-opcao { border: none; background: none; padding: 0.35rem 0.8rem; border-radius: 18px; font-size: 0.78rem; color: #555; cursor: pointer; }
.seg-opcao.ativo { background: #128c7e; color: #fff; font-weight: 600; }
.seletor-ordenar { border: 1px solid #ddd; border-radius: 8px; padding: 0.35rem 0.5rem; font-size: 0.78rem; color: #444; background: #fff; }

.lista-conversas { list-style: none; margin: 0; padding: 0; flex: 1; }
.lista-vazia { padding: 1.5rem 1rem; color: #888; font-size: 0.85rem; text-align: center; }
.item-conversa { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.8rem 1rem; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.item-conversa:hover { background: #f7f7f7; }
.item-conversa.selecionado { background: #e8f5f1; border-left: 3px solid #128c7e; }
.item-conversa-corpo { flex: 1; min-width: 0; }

/* Avatar circular -- foto real quando existe, senão círculo com a inicial (nunca vazio) */
.avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; object-fit: cover; display: flex; align-items: center; justify-content: center; }
.avatar-letra { color: #fff; font-weight: 700; font-size: 1.1rem; text-transform: uppercase; }
.avatar-grande { width: 64px; height: 64px; font-size: 1.6rem; }

.linha1 { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.nome-lista { font-size: 0.92rem; color: #1c1e21; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.espera-lista { font-size: 0.72rem; color: #888; flex-shrink: 0; }
.linha-secundaria { margin-top: 0.15rem; display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: #777; }
.telefone-lista { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-etiquetas { margin-top: 0.35rem; display: flex; gap: 0.3rem; flex-wrap: wrap; }
.linha2 { margin-top: 0.35rem; font-size: 0.75rem; color: #777; display: flex; gap: 0.4rem; flex-wrap: wrap; }

.setor { font-size: 0.7rem; padding: 0.15rem 0.5rem; border-radius: 10px; background: #eee; color: #444; flex-shrink: 0; }
.setor-TI { background: #dbeeff; color: #0b5cad; }
.setor-RH { background: #ffe6d9; color: #b6540c; }
.setor-nao_identificado { background: #f0e6ff; color: #6b3fa0; }

.marca { padding: 0.1rem 0.5rem; border-radius: 8px; background: #f1f1f1; }
.marca-pendente { background: #fff3cd; color: #8a6d00; }
.marca-reservada { background: #fde2e2; color: #a12727; }

/* Etiquetas -- mesma paleta usada no chip mini (lista) e no chip grande (editor) */
.chip-etiqueta-mini { font-size: 0.68rem; padding: 0.1rem 0.5rem; border-radius: 8px; font-weight: 600; }
.etiqueta-urgente { background: #fde2e2; color: #a12727; }
.etiqueta-aguardando { background: #fff3cd; color: #8a6d00; }
.etiqueta-resolvido { background: #d9fdd3; color: #1f9c53; }
.etiqueta-importante { background: #ece1ff; color: #6b3fa0; }

.vazio { color: #888; }
.erro { color: #c0392b; }

/* Cabeçalho da conversa selecionada */
.cabecalho-detalhe { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.cabecalho-info { display: flex; gap: 0.9rem; align-items: center; }
.cabecalho-textos { display: flex; flex-direction: column; gap: 0.3rem; }
.nome-editavel { display: flex; align-items: center; gap: 0.5rem; }
.nome-exibicao { font-size: 1.15rem; font-weight: 700; }
.btn-icone { border: 1px solid #ddd; background: #fff; color: #128c7e; font-size: 0.72rem; padding: 0.2rem 0.55rem; border-radius: 6px; cursor: pointer; }
.btn-icone:hover { background: #f0f7f5; }
.input-apelido { padding: 0.35rem 0.6rem; border: 1px solid #128c7e; border-radius: 6px; font-size: 0.95rem; min-width: 220px; }
.linha-meta-detalhe { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: #777; }
.telefone-secundario { color: #777; }
.cabecalho-acoes { display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.botao-status { padding: 0.45rem 0.9rem; border-radius: 18px; border: 1px solid #128c7e; background: #128c7e; color: #fff; font-size: 0.82rem; cursor: pointer; font-weight: 600; }
.botao-status.esta-resolvida { background: #fff; color: #555; border-color: #ccc; }

/* Layout principal (mensagens/respostas) + barra lateral (etiquetas/notas) */
.detalhe-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
.detalhe-principal { min-width: 0; }
.detalhe-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.bloco-lateral { background: #fff; border-radius: 10px; padding: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.bloco-lateral h3 { margin: 0 0 0.6rem; font-size: 0.85rem; text-transform: uppercase; color: #666; }

.chips-etiquetas { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip-etiqueta { border: 1px solid #ddd; background: #fafafa; color: #777; font-size: 0.78rem; padding: 0.3rem 0.7rem; border-radius: 14px; cursor: pointer; font-weight: 600; }
.chip-etiqueta.ativa.etiqueta-urgente { background: #fde2e2; color: #a12727; border-color: #f3b8b8; }
.chip-etiqueta.ativa.etiqueta-aguardando { background: #fff3cd; color: #8a6d00; border-color: #f0dd9a; }
.chip-etiqueta.ativa.etiqueta-resolvido { background: #d9fdd3; color: #1f9c53; border-color: #a9e9a0; }
.chip-etiqueta.ativa.etiqueta-importante { background: #ece1ff; color: #6b3fa0; border-color: #cdb8f5; }

/* Notas internas -- visual de "nota adesiva", pra nunca confundir com mensagem enviada */
.bloco-notas { background: #fffdf5; border: 1px solid #f5eac9; }
.aviso-interno { margin: -0.3rem 0 0.7rem; font-size: 0.72rem; color: #9a7d1f; font-style: italic; }
.lista-notas { display: flex; flex-direction: column; gap: 0.5rem; max-height: 220px; overflow-y: auto; margin-bottom: 0.7rem; }
.nota-interna { background: #fff8e1; border-left: 3px solid #e0c04a; border-radius: 6px; padding: 0.5rem 0.7rem; }
.nota-meta { display: flex; justify-content: space-between; font-size: 0.72rem; color: #8a7233; margin-bottom: 0.2rem; }
.nota-interna p { margin: 0; font-size: 0.85rem; color: #4a3f1f; }
.form-nota { display: flex; flex-direction: column; gap: 0.5rem; }
.form-nota textarea { width: 100%; padding: 0.5rem; border: 1px solid #e0d5a8; border-radius: 6px; font: inherit; resize: vertical; background: #fffef8; }

.mensagens { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.mensagem { max-width: 60%; padding: 0.6rem 0.9rem; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.mensagem p { margin: 0 0 0.2rem; white-space: pre-wrap; }
.mensagem time { font-size: 0.7rem; color: #999; }
.mensagem-in { align-self: flex-start; }
.mensagem-out { align-self: flex-end; background: #d9fdd3; }

.resposta { background: #fff; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.resposta-meta { display: flex; gap: 0.6rem; font-size: 0.75rem; color: #666; margin-bottom: 0.5rem; flex-wrap: wrap; }
.status-tag { text-transform: uppercase; font-weight: 600; }
.resposta textarea { width: 100%; padding: 0.6rem; border: 1px solid #ccc; border-radius: 6px; font: inherit; resize: vertical; }
.resposta-acoes { margin-top: 0.6rem; display: flex; gap: 0.6rem; }
.resposta-acoes button { padding: 0.5rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-size: 0.85rem; }
.primario { background: #128c7e; color: #fff; }
.secundario { background: #eee; color: #444; }

/* Tela de pipeline */
.nav-topo { display: flex; gap: 1rem; }
.nav-topo a { color: #cfece6; text-decoration: none; font-size: 0.9rem; padding: 0.3rem 0; }
.nav-topo a.ativo { color: #fff; border-bottom: 2px solid #25d366; font-weight: 600; }

.tela-pipeline { display: flex; flex-direction: column; min-height: 100vh; background: #f4f5f7; }
.corpo-pipeline { padding: 1.5rem 2rem; }
.explicacao { color: #666; font-size: 0.9rem; max-width: 65ch; margin: 0 0 1.5rem; }

.trilho-pipeline { display: flex; align-items: stretch; flex-wrap: wrap; gap: 0.5rem; }
.cartao-estagio {
  flex: 1; min-width: 150px; background: #fff; border-radius: 10px; padding: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08); text-align: center; border-top: 4px solid #ddd;
}
.cartao-estagio-numero { font-size: 2.2rem; font-weight: 700; }
.cartao-estagio-rotulo { font-size: 0.8rem; color: #666; margin-top: 0.3rem; }
.seta-estagio { display: flex; align-items: center; color: #bbb; font-size: 1.3rem; }

.estagio-neutro { border-top-color: #128c7e; }
.estagio-neutro .cartao-estagio-numero { color: #128c7e; }
.estagio-atencao { border-top-color: #b6540c; }
.estagio-atencao.tem-item .cartao-estagio-numero { color: #b6540c; }
.estagio-critico { border-top-color: #a12727; }
.estagio-critico.tem-item .cartao-estagio-numero { color: #a12727; }
.estagio-ok { border-top-color: #25d366; }
.estagio-ok .cartao-estagio-numero { color: #1f9c53; }

.rodape-pipeline { margin-top: 1.5rem; font-size: 0.8rem; color: #888; }

/* Resumo (tempo médio de resposta) + gráfico de volume por dia */
.cartoes-resumo { display: flex; gap: 0.8rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.cartao-resumo { background: #fff; border-radius: 10px; padding: 1rem 1.4rem; box-shadow: 0 1px 2px rgba(0,0,0,0.08); min-width: 220px; }
.cartao-resumo-numero { font-size: 1.8rem; font-weight: 700; color: #128c7e; }
.cartao-resumo-rotulo { font-size: 0.8rem; color: #666; margin-top: 0.2rem; }

.secao-volume { margin-top: 1.8rem; }
.secao-volume h2 { font-size: 0.9rem; text-transform: uppercase; color: #666; margin: 0 0 0.8rem; }
.grafico-volume {
  background: #fff; border-radius: 10px; padding: 1.2rem 1rem 0.8rem; box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  display: flex; align-items: stretch; gap: 0.6rem; height: 190px;
}
.barra-coluna { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 0.3rem; }
.barra-valor { font-size: 0.78rem; font-weight: 600; color: #444; }
.barra-trilho { flex: 1; width: 100%; max-width: 42px; display: flex; align-items: flex-end; background: #f4f5f7; border-radius: 6px; overflow: hidden; }
.barra { width: 100%; background: linear-gradient(180deg, #25d366, #128c7e); border-radius: 6px 6px 0 0; min-height: 4px; }
.barra-rotulo { font-size: 0.72rem; color: #888; }
