/* Portal de Briefing: estilo único, sem framework. */
:root {
  --fundo: #f6f7f9;
  --cartao: #ffffff;
  --texto: #1d2330;
  --sutil: #667085;
  --borda: #e3e6eb;
  --marca: #5b3fd6;
  --marca-escura: #4630a8;
  --ok: #117a4a;       --ok-fundo: #e7f6ee;
  --alerta: #8a5a00;   --alerta-fundo: #fff4d6;
  --erro: #b42318;     --erro-fundo: #fdecea;
  --raio: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fundo); color: var(--texto);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--marca); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
.sutil { color: var(--sutil); font-size: .9rem; }
.centro { max-width: 420px; margin: 12vh auto; padding: 0 16px; text-align: center; }

/* Topo */
.topo {
  background: var(--cartao); border-bottom: 1px solid var(--borda);
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: .6rem 16px;
}
.topo .marca { font-weight: 700; color: var(--texto); }
.topo nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.topo form { margin: 0; }
.selo {
  display: inline-block; font-size: .78rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--borda); color: var(--texto); white-space: nowrap;
}
.selo.marca { background: var(--marca); color: #fff; }
.selo.ok { background: var(--ok-fundo); color: var(--ok); }
.selo.alerta { background: var(--alerta-fundo); color: var(--alerta); }
.selo.erro { background: var(--erro-fundo); color: var(--erro); }

main.pagina { max-width: 1200px; margin: 0 auto; padding: 1.25rem 16px 4rem; }
.cabecalho { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* Mensagens */
.aviso { padding: .6rem .9rem; border-radius: var(--raio); margin: 0 0 .6rem; }
.aviso.ok { background: var(--ok-fundo); color: var(--ok); }
.aviso.alerta { background: var(--alerta-fundo); color: var(--alerta); }
.aviso.erro { background: var(--erro-fundo); color: var(--erro); }

/* Cartões e formulários */
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); padding: 1rem 1.1rem; margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin: .75rem 0 .25rem; font-size: .92rem; }
label.inline { display: flex; gap: .5rem; align-items: center; font-weight: 400; margin: .35rem 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=url], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--borda); border-radius: 8px;
  font: inherit; background: #fff; color: var(--texto);
}
textarea { min-height: 4.5rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--marca); outline-offset: 0; border-color: transparent; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
.acoes { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

button, .botao {
  display: inline-block; border: 0; border-radius: 8px; padding: .55rem 1rem; cursor: pointer;
  background: var(--marca); color: #fff; font: inherit; font-weight: 600; text-decoration: none;
}
button:hover, .botao:hover { background: var(--marca-escura); text-decoration: none; }
button.secundario, .botao.secundario { background: var(--cartao); color: var(--texto); border: 1px solid var(--borda); }
button.link { background: none; color: var(--marca); padding: 0; font-weight: 400; }
button.pequeno { padding: .2rem .55rem; font-size: .85rem; }

/* Tabelas */
.rolagem { overflow-x: auto; border: 1px solid var(--borda); border-radius: var(--raio); background: var(--cartao); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .65rem; border-bottom: 1px solid var(--borda); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--sutil); background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
table.topicos { min-width: 1180px; }
table.topicos td { padding: .4rem; }
table.topicos textarea { min-height: 4.2rem; font-size: .88rem; }
table.topicos .c-titulo { width: 190px; }
table.topicos .c-texto { width: 300px; }
table.topicos .c-curta { width: 1%; white-space: nowrap; }
table.topicos input[type=number] { width: 4.5rem; }
table.topicos .chave { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
tr.novo td { background: #faf9ff; }

.barra { height: 6px; background: var(--borda); border-radius: 999px; overflow: hidden; min-width: 80px; }
.barra > span { display: block; height: 100%; background: var(--marca); }

/* Acesso gerado */
.credencial { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; background: var(--fundo); padding: .3rem .6rem; border-radius: 6px; }
pre.mensagem { white-space: pre-wrap; background: var(--fundo); padding: .8rem; border-radius: 8px; font: inherit; }

.lista-reg { columns: 2 260px; }
.lista-reg label { break-inside: avoid; }

@media (max-width: 640px) {
  th, td { padding: .45rem; }
}

/* ============================================================ Área do cliente */
body.cliente { background: #eef0f4; }
.cliente-topo {
  position: sticky; top: 0; z-index: 2; background: var(--cartao); border-bottom: 1px solid var(--borda);
  padding: .6rem 16px; display: flex; align-items: center; gap: .75rem;
}
.cliente-topo .titulo { font-weight: 700; flex: 1; min-width: 0; }
.cliente-topo .titulo small { display: block; font-weight: 400; color: var(--sutil); font-size: .8rem; }
.cliente-topo form { margin: 0; }
.progresso-rotulo { font-size: .8rem; color: var(--sutil); white-space: nowrap; }
.cliente-topo .barra { width: 90px; }

.chat { max-width: 720px; margin: 0 auto; padding: 1rem 12px 7rem; display: flex; flex-direction: column; gap: .5rem; }
.balao {
  max-width: 85%; padding: .6rem .8rem; border-radius: 14px; white-space: pre-wrap;
  overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.balao.assistant { background: var(--cartao); align-self: flex-start; border-bottom-left-radius: 4px; }
.balao.user { background: #dcd4ff; align-self: flex-end; border-bottom-right-radius: 4px; }
.balao.aviso-sistema { background: var(--alerta-fundo); color: var(--alerta); align-self: center; font-size: .9rem; }
.digitando { color: var(--sutil); font-style: italic; align-self: flex-start; padding: .3rem .8rem; }

.compositor {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--cartao); border-top: 1px solid var(--borda);
  padding: .6rem 12px calc(.6rem + env(safe-area-inset-bottom));
}
.compositor form { max-width: 720px; margin: 0 auto; display: flex; gap: .5rem; align-items: flex-end; }
.compositor textarea { min-height: 2.6rem; max-height: 9rem; border-radius: 20px; padding: .55rem .9rem; font-size: 16px; }
.compositor button { border-radius: 20px; }
.compositor button:disabled { opacity: .5; cursor: default; }

.privacidade { font-size: .85rem; color: var(--sutil); margin-top: 1rem; }
.compositor #anexar { padding: .55rem .7rem; font-size: 1.1rem; line-height: 1; }
.balao.falhou { opacity: .6; text-decoration: line-through; }
