:root {
  --verde: #009048;
  --verde-escuro: #006b3a;
  --verde-claro: #e8f7ef;
  --menu: #0e1714;
  --fundo: #f3f5f4;
  --branco: #fff;
  --texto: #15211b;
  --suave: #67736c;
  --borda: #e2e7e4;
  --alerta: #d93a3f;
  --nota: #fff6d9;
  --nota-borda: #f0dc9a;
  --raio: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--texto); background: var(--fundo); -webkit-font-smoothing: antialiased;
}
#app { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--verde-escuro); }
h2 { font-size: 18px; margin: 0; }
h3 { margin: 0 0 6px; font-size: 15px; }
.sutil { color: var(--suave); }
.carregando { display: grid; place-items: center; height: 100%; color: var(--suave); }

.primario, .secundario, .perigo {
  border-radius: 9px; padding: 8px 14px; font-weight: 600; font-size: 13.5px; border: 1px solid transparent; white-space: nowrap;
}
.primario { background: var(--verde); color: #fff; }
.primario:hover { background: var(--verde-escuro); }
.primario:disabled { opacity: .6; cursor: default; }
.secundario { background: var(--branco); border-color: var(--borda); }
.secundario:hover { background: var(--fundo); }
.perigo { background: var(--branco); border-color: #f2c4c6; color: #b4262b; }
.perigo:hover { background: #fdeeee; }
.icone-botao {
  width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--suave);
  display: inline-grid; place-items: center; flex: none; cursor: pointer;
}
.icone-botao:hover, .icone-botao.ligado { background: var(--fundo); color: var(--texto); }
.icone-botao svg { width: 21px; height: 21px; }
.erro { background: #fdecec; color: #9f1d22; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.erro.faixa { border-radius: 0; }
.ok { background: var(--verde-claro); color: #0b5a33; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.chip { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #edf0ee; color: #4b5650; white-space: nowrap; }
.chip-espera { background: #fff3d6; color: #8a5a00; }
.chip-alerta { background: #fde3e4; color: #a3171c; font-weight: 600; }
.chip-ok { background: var(--verde-claro); color: #0b5a33; font-weight: 600; }
.chip-info { background: #e3ecfb; color: #1e4fa3; }
.chip-perigo { background: #fde3e4; color: #a3171c; font-weight: 600; }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--alerta); color: #fff;
  font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; flex: none;
}

/* ------------------------------------------------------------ avatar */

.avatar {
  position: relative; border-radius: 50%; color: #fff; font-weight: 700; flex: none;
  display: inline-grid; place-items: center; letter-spacing: .02em;
}
.avatar i {
  position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 10px; min-height: 10px;
  border-radius: 50%; background: #b5beb9; border: 2px solid #fff;
}
.avatar i.on { background: #22c55e; }

/* ------------------------------------------------------------ login */

.login { min-height: 100%; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 30% 20%, #0f3a26, var(--menu) 60%); }
.login-caixa { width: 100%; max-width: 360px; background: #fff; border-radius: 18px; padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-logo { width: 56px; height: 56px; border-radius: 14px; }
.login h1 { margin: 0; font-size: 22px; }
.login p { margin: -8px 0 4px; }
.login label, .formulario label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13px; }
.login input, .formulario input, .formulario textarea, .formulario select {
  border: 1px solid var(--borda); border-radius: 9px; padding: 10px 12px; font-weight: 400; background: #fff; outline: none;
}
.login input:focus, .formulario input:focus, .formulario textarea:focus { border-color: var(--verde); box-shadow: 0 0 0 3px rgba(0,144,72,.12); }
.login .primario { padding: 11px; font-size: 15px; }

/* ------------------------------------------------------------ estrutura */

.painel { display: flex; height: 100%; overflow: hidden; position: relative; }
.faixa-conexao { position: absolute; top: 0; left: 72px; right: 0; z-index: 10; background: #fff1cc; color: #7a5300; text-align: center; padding: 6px; font-size: 13px; }

.menu {
  width: 72px; flex: none; background: var(--menu); display: flex; flex-direction: column; align-items: center;
  padding: 14px 0; gap: 6px;
}
.menu-logo { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 12px; }
.menu-item {
  position: relative; width: 56px; padding: 8px 0 6px; border: 0; border-radius: 12px; background: transparent; color: #8fa198;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.menu-item svg { width: 23px; height: 23px; }
.menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.menu-item.ativo { background: rgba(0,144,72,.22); color: #fff; }
.menu-item .badge { position: absolute; top: 2px; right: 4px; }
.menu-rotulo { font-size: 10.5px; font-weight: 600; }
.menu-espaco { flex: 1; }
.status-botao { position: relative; border: 0; background: transparent; padding: 4px; border-radius: 50%; }
.status-botao > i { position: absolute; right: 2px; bottom: 2px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--menu); background: #22c55e; }
.status-botao.ausente > i { background: #f59e0b; }

/* ------------------------------------------------------------ lista */

.lista { width: 340px; flex: none; background: var(--branco); border-right: 1px solid var(--borda); display: flex; flex-direction: column; min-height: 0; }
.lista-topo { padding: 18px 16px 10px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--borda); }
.abas { display: flex; gap: 4px; background: var(--fundo); padding: 4px; border-radius: 10px; }
.abas button { flex: 1; border: 0; background: transparent; padding: 6px 4px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--suave); }
.abas button.ativa { background: #fff; color: var(--texto); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.abas button span { color: var(--suave); font-weight: 500; }
.busca { display: flex; align-items: center; gap: 8px; border: 1px solid var(--borda); border-radius: 9px; padding: 0 10px; color: var(--suave); }
.busca svg { width: 17px; height: 17px; flex: none; }
.busca input { flex: 1; border: 0; outline: none; padding: 9px 0; background: transparent; min-width: 0; }
.itens { flex: 1; overflow-y: auto; }
.vazio-lista { padding: 28px 16px; text-align: center; color: var(--suave); }
.item {
  width: 100%; display: flex; gap: 12px; padding: 12px 16px; border: 0; border-bottom: 1px solid #eef1ef; background: #fff; text-align: left;
  border-left: 3px solid transparent;
}
.item:hover { background: #f7f9f8; }
.item.ativa { background: var(--verde-claro); border-left-color: var(--verde); }
.item-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-linha { display: flex; align-items: center; gap: 8px; min-width: 0; }
.item-linha strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-linha time { font-size: 12px; color: var(--suave); flex: none; }
.previa { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--suave); font-size: 13px; }
.item.nao-lida .previa { color: var(--texto); font-weight: 600; }
.digitando-txt { color: var(--verde) !important; font-style: italic; }
.etiquetas { gap: 5px; flex-wrap: wrap; }

/* ------------------------------------------------------------ conversa */

.conversa { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--fundo); }
.conversa-topo { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--borda); }
.conversa-titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conversa-titulo strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conversa-titulo .sutil { font-size: 12.5px; }
.conversa-acoes { display: flex; align-items: center; gap: 8px; }
.conversa-acoes select { border: 1px solid var(--borda); border-radius: 9px; padding: 7px 10px; background: #fff; max-width: 180px; }
.so-celular { display: none; }

.mensagens { flex: 1; overflow-y: auto; padding: 20px 24px 10px; display: flex; flex-direction: column; gap: 2px; }
.m { display: flex; flex-direction: column; max-width: min(68%, 560px); }
.m-grupo { margin-top: 10px; }
.m-cliente { align-self: flex-start; }
.m-eu { align-self: flex-end; align-items: flex-end; }
.m-autor { font-size: 12px; color: var(--suave); margin: 0 6px 3px; }
.m-balao { padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.m-cliente .m-balao { background: #fff; border: 1px solid var(--borda); border-bottom-left-radius: 5px; }
.m-eu .m-balao { background: var(--verde); color: #fff; border-bottom-right-radius: 5px; }
.m-eu .m-balao a { color: #fff; }
.m-nota .m-balao { background: var(--nota); color: #5b4500; border: 1px dashed var(--nota-borda); }
.m-nota .m-balao a { color: #5b4500; }
.m-imagem { padding: 3px !important; background: transparent !important; border: 0 !important; }
.m-imagem img { display: block; max-width: 260px; max-height: 280px; border-radius: 12px; background: #dde3e0; }
.m-hora { font-size: 11px; color: var(--suave); margin: 3px 6px 0; }
.m-bot .m-balao { background: #e3efe8; color: #1e3a2b; border: 1px dashed #b7d6c3; border-bottom-right-radius: 5px; }
.m-sistema { align-self: center; margin: 14px 0 6px; font-size: 12px; color: var(--suave); background: #e7ebe9; padding: 3px 12px; border-radius: 999px; }
.m-digitando { display: inline-flex; gap: 4px; padding: 12px 14px !important; }
.m-digitando i { width: 7px; height: 7px; border-radius: 50%; background: #9aa59f; animation: ponto 1.2s infinite; }
.m-digitando i:nth-child(2) { animation-delay: .15s; }
.m-digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes ponto { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.compositor { position: relative; background: #fff; border-top: 1px solid var(--borda); padding: 8px 14px 12px; }
.compositor.modo-nota { background: #fffbea; }
.compositor-abas { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.compositor-abas button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-weight: 600; font-size: 12.5px; color: var(--suave); }
.compositor-abas button.ativa { background: var(--fundo); color: var(--texto); }
.modo-nota .compositor-abas button.ativa { background: var(--nota); color: #6b5100; }
.dica { margin-left: auto; font-size: 12px; }
.compositor-linha { display: flex; align-items: flex-end; gap: 8px; }
.compositor textarea {
  flex: 1; resize: none; border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; outline: none;
  min-height: 42px; max-height: 180px; background: #fff; line-height: 1.4;
}
.compositor textarea:focus { border-color: var(--verde); }
.modo-nota textarea:focus { border-color: #e2c45a; }
.enviar { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--verde); color: #fff; display: grid; place-items: center; flex: none; }
.enviar:disabled { opacity: .35; cursor: default; }
.enviar svg { width: 20px; height: 20px; }
.compositor .erro { margin-top: 8px; }
.sugestoes {
  position: absolute; left: 14px; right: 14px; bottom: calc(100% - 4px); background: #fff; border: 1px solid var(--borda);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); overflow: hidden; max-height: 280px; overflow-y: auto;
}
.sugestoes button { display: flex; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: #fff; text-align: left; }
.sugestoes button.ativa, .sugestoes button:hover { background: var(--verde-claro); }
.sugestoes strong { color: var(--verde-escuro); flex: none; }
.sugestoes span { color: var(--suave); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------------------------------------ dados do jogador */

.info { width: 300px; flex: none; background: #fff; border-left: 1px solid var(--borda); overflow-y: auto; }
.info-topo { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px 18px; border-bottom: 1px solid var(--borda); text-align: center; }
.info-topo strong { font-size: 16px; word-break: break-word; }
.estado { font-size: 12.5px; color: var(--suave); }
.estado.on { color: #15803d; font-weight: 600; }
.campos { padding: 8px 16px 20px; }
.campo { padding: 10px 0; border-bottom: 1px solid #f0f2f1; }
.campo > span { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); margin-bottom: 2px; }
.campo > div { word-break: break-word; }

.vazio { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 6px; }
.vazio img { width: 64px; height: 64px; border-radius: 16px; opacity: .9; margin-bottom: 8px; }
.vazio p { max-width: 420px; margin: 0; }

/* ------------------------------------------------------------ páginas */

.pagina { flex: 1; overflow-y: auto; padding: 28px 32px; display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.pagina > p { margin: -8px 0 0; }
.cartao { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 18px; }
.cartao > p { margin: 0 0 10px; }
.formulario { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.formulario .primario { align-self: flex-start; }
.formulario.grade { display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; }
.formulario.grade .primario { grid-column: 1 / -1; }
.cor { display: flex; align-items: center; gap: 10px; }
.cor input { width: 52px; height: 38px; padding: 2px; }
.codigo { background: var(--menu); color: #b8f5d0; padding: 12px 14px; border-radius: 9px; overflow-x: auto; font-size: 13px; margin: 0 0 10px; }
.tabela { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden; }
.linha { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #eef1ef; flex-wrap: wrap; }
.linha:last-child { border-bottom: 0; }
.linha.inativo { opacity: .55; }
.atalho { color: var(--verde-escuro); min-width: 110px; }
.texto-resposta { flex: 1; min-width: 200px; white-space: pre-wrap; color: #3c4842; }
.pessoa { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.status-pessoa { min-width: 80px; font-size: 12.5px; }
.acoes-linha { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.acoes-linha input { border: 1px solid var(--borda); border-radius: 8px; padding: 7px 10px; width: 150px; }

/* ------------------------------------------------------------ telas menores */

@media (max-width: 1180px) {
  .info { position: absolute; right: 0; top: 0; bottom: 0; z-index: 5; box-shadow: -10px 0 30px rgba(0,0,0,.12); }
}
@media (max-width: 860px) {
  .menu { width: 60px; }
  .menu-rotulo { display: none; }
  .faixa-conexao { left: 60px; }
  .lista { width: auto; flex: 1; }
  .painel.com-conversa .lista { display: none; }
  .so-celular { display: inline-grid; }
  .conversa-acoes select { max-width: 120px; }
  .formulario.grade { grid-template-columns: 1fr 1fr; }
  .pagina { padding: 20px 16px; }
  .m { max-width: 85%; }
  .mensagens { padding: 14px 12px 8px; }
}
@media (max-width: 560px) {
  .conversa-acoes .secundario:not(:last-child) { display: none; }
  .conversa-acoes select { display: none; }
  .formulario.grade { grid-template-columns: 1fr; }
}

.liga { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; cursor: pointer; }
.liga input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--verde); flex: none; }
.com-acao { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copiar { border: 1px solid var(--borda); background: #fff; border-radius: 7px; padding: 1px 8px; font-size: 12px; color: var(--suave); }
.copiar:hover { background: var(--fundo); color: var(--texto); }

/* ------------------------------------------------------------ IA */

.m-ia .m-balao { background: #e8eefc; color: #1c2c55; border: 1px solid #c9d6f5; border-bottom-right-radius: 5px; }
.m-barrada { background: #fde3e4 !important; color: #7c1d20 !important; }
.sugestao-ia { border: 1px solid #c9d6f5; background: #f3f6fe; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.sugestao-topo { display: flex; align-items: center; gap: 8px; color: #1e4fa3; margin-bottom: 6px; flex-wrap: wrap; }
.sugestao-topo svg { width: 18px; height: 18px; }
.sugestao-texto { white-space: pre-wrap; margin-bottom: 8px; color: #1c2c55; }
.alertas { position: absolute; top: 12px; right: 16px; z-index: 20; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.alerta-ia { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid #f2c4c6; border-left: 4px solid var(--alerta);
  border-radius: 12px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.15); font-size: 13px; }
.alerta-ia > svg { width: 22px; height: 22px; color: var(--alerta); flex: none; }
.alerta-ia span { flex: 1; }
.pagina-ia { max-width: 1040px; }
.titulo-ia { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.abas-ia { max-width: 760px; flex-wrap: wrap; }
.opcoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opcao { position: relative; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--borda); border-radius: 12px; padding: 12px; cursor: pointer; }
.opcao input { position: absolute; opacity: 0; pointer-events: none; }
.opcao.marcada { border-color: var(--verde); background: var(--verde-claro); box-shadow: 0 0 0 2px rgba(0,144,72,.15); }
.opcao .sutil { font-size: 12.5px; }
.dias { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; }
.dia { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px !important; border: 1px solid var(--borda); border-radius: 8px; padding: 6px 10px; font-weight: 500 !important; }
.linha-chave { display: flex; gap: 8px; margin: 8px 0; }
.linha-chave input { flex: 1; border: 1px solid var(--borda); border-radius: 9px; padding: 9px 12px; }
.numeros { display: flex; flex-direction: column; gap: 8px; }
.numeros .sutil { display: inline-block; min-width: 130px; }
.protecoes { background: var(--fundo); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.protecoes ul { margin: 6px 0 0; padding-left: 18px; }
.barra-salvar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--fundo) 30%); padding: 16px 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.simulador .sim-mensagens { display: flex; flex-direction: column; gap: 2px; min-height: 160px; max-height: 420px; overflow-y: auto; background: var(--fundo); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.simulador .compositor-linha textarea { flex: 1; resize: none; border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; min-height: 42px; }
.instrucoes { white-space: pre-wrap; max-height: 360px; overflow: auto; margin-top: 8px; }
.historico .quando { min-width: 92px; font-size: 12.5px; }
.motivo { color: #8a5a00; font-size: 12.5px; }
@media (max-width: 860px) { .opcoes { grid-template-columns: 1fr; } .alertas { left: 76px; right: 12px; } }

/* ------------------------------------------------------------ acesso pelo Claude */

.pagina-acesso h4 { margin: 14px 0 8px; font-size: 13.5px; }
.passos { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.passos code, .pagina-acesso .sutil code { background: var(--fundo); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; }
.token-novo { margin-top: 12px; border: 1px solid #f0dc9a; background: #fffbea; border-radius: 12px; padding: 12px 14px; }
.token-novo .codigo { white-space: pre-wrap; word-break: break-all; margin: 6px 0 10px; }
