/* ChatBot HBR — mesma linguagem visual do PortalHBR: lateral em azul-marinho
   com a marca da holding, área de conversa clara e sóbria. */
:root {
  --navy-950: #06263d;
  --navy-900: #073653;
  --navy-800: #0a466a;
  --ink: #152c3b;
  --muted: #687d8b;
  --line: #dfe7eb;
  --canvas: #f3f6f8;
  --rail: 258px;
  --shadow-sm: 0 6px 24px rgba(7, 54, 83, .06);
  --shadow-lg: 0 18px 50px rgba(3, 32, 51, .16);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; background: var(--canvas); }

/* --- Lateral ------------------------------------------------------------- */
.rail { position: fixed; z-index: 20; inset: 0 auto 0 0; width: var(--rail);
  display: flex; flex-direction: column; padding: 24px 16px; color: #d6e2e8; background: var(--navy-950); }
.holding-brand { display: grid; justify-items: start; gap: 12px; padding: 8px 10px 4px; text-decoration: none; }
.holding-logo { display: block; width: 100%; max-width: 168px; height: auto; }
.produto { padding: 5px 11px; border: 1px solid rgba(255,255,255,.22); border-radius: 30px;
  color: #b3cbd9; font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; line-height: 1; }

.nova { width: 100%; margin-top: 26px; padding: 12px 14px; display: flex; align-items: center; gap: 9px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 11px; color: #eaf2f6; background: rgba(255,255,255,.05);
  font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; transition: .18s ease; }
.nova:hover { color: #fff; border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.11); }
.nova span { font-size: 15px; }

nav { flex: 1; min-height: 0; overflow-y: auto; margin-top: 26px; }
.secao { margin: 0 12px 8px; color: #6f93a6; font-size: 9px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.linha { display: grid; grid-template-columns: 1fr auto; align-items: center; border-radius: 9px; transition: .16s ease; }
.linha:hover { background: rgba(255,255,255,.06); }
.linha.ativa { background: #124b6b; box-shadow: inset 3px 0 #8db2c5; }
.linha a { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 10px 4px 10px 12px;
  color: #adc2cd; text-decoration: none; font-size: 12px; font-weight: 600; }
.linha.ativa a, .linha:hover a { color: #fff; }
.titulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contagem { flex: none; padding: 1px 6px; border-radius: 20px; color: #9fb6c3;
  background: rgba(255,255,255,.09); font-size: 9px; font-weight: 700; }
.apagar { padding: 8px 11px 8px 6px; border: 0; background: none; color: #5f8195;
  font: inherit; font-size: 11px; line-height: 1; cursor: pointer; opacity: 0; transition: .16s ease; }
.linha:hover .apagar, .apagar:focus-visible { opacity: 1; }
.apagar:hover { color: #ffb4b4; }

.rodape { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
  margin-top: 14px; padding: 15px 11px 4px; border-top: 1px solid rgba(255,255,255,.1); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  color: #fff; background: var(--navy-800); font-size: 12px; font-weight: 800; }
.quem { min-width: 0; display: grid; gap: 2px; }
.quem strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d6e2e8; font-size: 11px; }
.quem small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #708f9f; font-size: 9px; }
.avatar-link, .perfil-link { text-decoration:none; }
.perfil-link:hover strong { color:#fff; text-decoration:underline; }
.sair { color: #8bb0c2; text-decoration: none; font-size: 10px; font-weight: 650; }
.sair:hover { color: #fff; }
/* Atalho de volta ao Portal, logo acima do rodapé: vai para a home do Portal
   SEM deslogar (o "Sair" continua sendo o único que encerra a sessão). */
.portal-voltar-rodape { display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; margin-bottom: 8px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.16);
  border-radius: 9px; font-size: 13px; font-weight: 600; color: #d6e2e8; text-decoration: none; }
.portal-voltar-rodape img { width: 16px; height: 16px; border-radius: 3px; }
.portal-voltar-rodape:hover { color: #fff; background: rgba(255,255,255,.08); }
.portal-voltar-rodape + .rodape { margin-top: 0; }

/* --- Cabeçalho ----------------------------------------------------------- */
main { grid-column: 2; min-width: 0; }
main > header { position: sticky; top: 0; z-index: 5; min-height: 70px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 0 30px; border-bottom: 1px solid var(--line);
  background: rgba(243, 246, 248, .86); backdrop-filter: blur(8px); }
.cabecalho-titulo { min-width: 0; display: flex; align-items: center; gap: 12px; }
.cabecalho-titulo b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.selo { flex: none; padding: 4px 10px; border: 1px solid #e2d3a8; border-radius: 30px;
  color: #806629; background: #fff5dc; font-size: 9.5px; font-weight: 750; }

/* --- Conversa ------------------------------------------------------------ */
.mensagens { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 210px; }
.vazio { text-align: center; padding-top: 9vh; }
.marca { display: inline-block; padding: 10px 13px; border-radius: 13px; color: #fff;
  background: var(--navy-900); font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.marca small { margin-left: 5px; color: #8db2c5; font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.vazio h1 { margin: 24px 0 12px; font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
.vazio p { max-width: 500px; margin: 0 auto; color: var(--muted); font-size: 13.5px; line-height: 1.75; }

article { display: grid; grid-template-columns: 32px 1fr; gap: 13px; margin: 0 0 26px; }
.bolha-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  color: #fff; background: #4d7184; font-size: 10px; font-weight: 800; }
article.assistente .bolha-avatar { background: var(--navy-900); }
article > div { min-width: 0; }
article strong { font-size: 11.5px; font-weight: 750; }
article p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
article.assistente > div { padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; box-shadow: var(--shadow-sm); }
article.assistente p { color: #35505f; }

/* --- Compositor ---------------------------------------------------------- */
/* Centralizado na área de conversa, mas com o canto direito preservado: o
   espaço do mascote é fixo e o balão não pode passar por cima dele. */
.compositor { position: fixed; z-index: 4; bottom: 26px;
  left: calc(var(--rail) + (100% - var(--rail)) / 2); transform: translateX(-50%);
  width: min(760px, calc(100% - var(--rail) - 60px));
  display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px 14px;
  border: 1px solid #d7e0e6; border-radius: 18px; background: #fff; box-shadow: var(--shadow-lg); }
textarea { min-height: 76px; max-height: 260px; padding: 6px 2px; border: 0; outline: 0;
  resize: none; font: inherit; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
textarea::placeholder { color: #9aabb5; }
.compositor button { align-self: end; width: 38px; height: 38px; border: 0; border-radius: 11px;
  color: #fff; background: var(--navy-800); font-size: 17px; cursor: pointer; transition: .18s ease; }
.compositor button:hover { background: var(--navy-900); }
.compositor small { grid-column: 1 / -1; padding: 8px 2px 0; color: #93a4ae; font-size: 9.5px; }
.compositor small a { color: var(--navy-800); font-weight: 650; }

/* --- Mascote ------------------------------------------------------------- */
/* Mora no cabeçalho, ao lado do nome da conversa: presente sem disputar
   espaço com a leitura. O rótulo embaixo marca o espaço como reservado — sem
   arte no lugar, ele continua lá com um ícone neutro. */
.mascote-slot { flex: none; display: grid; justify-items: center; gap: 2px; }
.mascote-slot img { width: 38px; height: 38px; object-fit: contain; }
.mascote-slot .sem-arte { display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px dashed #c6d4dc; border-radius: 10px; font-size: 17px; opacity: .5; }
.mascote-slot small { color: #9aabb5; font-size: 6.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }

/* --- Aviso de privacidade ------------------------------------------------ */
.tela-aviso { display: block; background: var(--canvas); }
.aviso { width: min(680px, calc(100% - 36px)); margin: 0 auto; padding: 46px 0 70px; }
.aviso-topo { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.aviso-mascote { flex: none; width: 76px; height: 76px; object-fit: contain; }
.aviso-etiqueta { display: inline-block; margin-bottom: 8px; padding: 4px 11px; border-radius: 30px;
  color: #fff; background: var(--navy-900); font-size: 9px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; }
.aviso h1 { margin: 0; font-size: 26px; font-weight: 650; line-height: 1.25; letter-spacing: -.02em; }
.aviso-texto { padding: 26px 28px; border: 1px solid var(--line); border-radius: 18px;
  background: #fff; box-shadow: var(--shadow-sm); }
.aviso-texto h2 { margin: 22px 0 6px; color: var(--navy-800); font-size: 12px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; }
.aviso-texto h2:first-child { margin-top: 0; }
.aviso-texto p { margin: 0; color: #35505f; font-size: 13.5px; line-height: 1.72; }
.aviso-versao { margin-top: 24px !important; padding-top: 16px; border-top: 1px solid var(--line);
  color: var(--muted) !important; font-size: 12px !important; }
.aviso-forma { margin-top: 22px; }
.aviso-caixa { display: flex; align-items: flex-start; gap: 11px; padding: 16px 18px;
  border: 1px solid #cbd9e1; border-radius: 14px; background: #fff; cursor: pointer; }
.aviso-caixa input { flex: none; width: 17px; height: 17px; margin-top: 1px; accent-color: var(--navy-800); }
.aviso-caixa span { font-size: 13px; line-height: 1.6; }
.aviso-acoes { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.aviso-botao { display: inline-block; padding: 13px 24px; border: 0; border-radius: 12px;
  color: #fff; background: var(--navy-800); font: inherit; font-size: 13.5px; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: .18s ease; }
.aviso-botao:hover { background: var(--navy-900); }
.aviso-recusa { color: var(--muted); font-size: 12px; text-decoration: none; }
.aviso-recusa:hover { color: var(--navy-800); text-decoration: underline; }
.aviso-ok { margin: 22px 0 18px; padding: 13px 16px; border: 1px solid #b9dfcd; border-radius: 12px;
  color: #1d6b4f; background: #e7f5ef; font-size: 13px; }
/* Texto ainda não validado pelo jurídico (versão com "rascunho"). */
.aviso-rascunho { margin: 0 0 18px; padding: 11px 16px; border: 1px solid #e8c46a; border-radius: 12px;
  color: #6b4b00; background: #fff6dc; font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.aviso-texto a { color: var(--navy-800); }

/* --- Telas estreitas ----------------------------------------------------- */
@media (max-width: 760px) {
  body { display: block; }
  .rail { position: static; width: 100%; height: auto; flex-direction: row; align-items: center;
    gap: 14px; padding: 12px 16px; }
  .holding-brand { padding: 0; margin-right: auto; }
  .holding-logo { max-width: 116px; }
  .rail nav, .rodape { display: none; }
  .nova { width: auto; margin-top: 0; }
  main { grid-column: auto; }
  main > header { padding: 0 18px; }
  .selo, .portal-voltar-rodape { display: none; }
  .mensagens { padding-top: 28px; }
  .compositor { left: 14px; right: 14px; width: auto; transform: none; }
}

/* --- Porta de entrada ---------------------------------------------------- */
/* Sem sessão a pessoa vê uma porta com a marca, não um redirecionamento mudo. */
.tela-porta { display: grid; place-items: center; min-height: 100vh; background: var(--navy-950); }
.porta { width: min(430px, calc(100% - 40px)); display: grid; justify-items: center;
  text-align: center; padding: 40px 0; color: #d6e2e8; }
.porta-logo { width: 168px; height: auto; }
.porta-produto { margin-top: 12px; padding: 5px 12px; border: 1px solid rgba(255,255,255,.24);
  border-radius: 30px; color: #b3cbd9; font-size: 9px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; }
.porta-mascote { width: 108px; height: 108px; margin-top: 28px; object-fit: contain; }
.porta h1 { margin: 20px 0 10px; color: #fff; font-size: 21px; font-weight: 650;
  letter-spacing: -.02em; }
.porta p { max-width: 36ch; margin: 0; color: #8fadbd; font-size: 13px; line-height: 1.7; }
.porta-botao { display: inline-flex; align-items: center; gap: 9px; margin-top: 26px;
  padding: 14px 26px; border-radius: 12px; color: var(--navy-950); background: #fff;
  font-size: 13.5px; font-weight: 750; text-decoration: none; transition: .18s ease; }
.porta-botao:hover { transform: translateY(-1px); background: #e4eef3; }
.porta-formulario { width: 100%; display: grid; gap: 12px; margin-top: 16px; text-align: left; }
.porta-formulario label { display: grid; gap: 5px; color: #b3cbd9; font-size: 11px; }
.porta-formulario input { width: 100%; padding: 11px 12px; border: 1px solid rgba(255,255,255,.24);
  border-radius: 9px; color: #fff; background: rgba(255,255,255,.07); font: inherit; }
.porta-formulario .porta-botao { width: 100%; margin-top: 2px; border: 0; }
.porta-divisor { width: 100%; margin-top: 18px; color: #64879b; font-size: 10px;
  text-transform: uppercase; letter-spacing: .14em; }
.porta .erro { margin-top: 12px; color: #ffb4ab; }
.porta-nota { max-width: 40ch; margin-top: 22px; color: #64879b; font-size: 10.5px; line-height: 1.65; }
/* Invólucro do login local: some do layout quando visível (os filhos seguem
   sendo itens da grade da porta) e some de vez com `hidden`. */
.porta-local:not([hidden]) { display: contents; }

/* Meu perfil: uma tela curta, separada da administração. */
.profile-body { display:block; min-height:100vh; background:var(--canvas); }
.profile-page { width:min(920px,calc(100% - 40px)); margin:0 auto; padding:24px 0 64px; }
.profile-topbar { display:flex; justify-content:space-between; padding:12px 0 24px; border-bottom:1px solid var(--line); }
.profile-topbar a { color:var(--navy-800); font-size:12px; font-weight:700; text-decoration:none; }
.profile-hero { display:flex; align-items:center; gap:18px; padding:34px 0 24px; }
.profile-avatar { display:grid; place-items:center; width:68px; height:68px; border-radius:20px; color:#fff; background:var(--navy-900); font-size:24px; font-weight:850; }
.profile-kicker { color:var(--navy-800); font-size:9px; font-weight:850; letter-spacing:.15em; text-transform:uppercase; }
.profile-hero h1 { margin:5px 0 3px; font-size:28px; }.profile-hero p { margin:0; color:var(--muted); font-size:13px; }
.profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.profile-card { padding:23px; border:1px solid var(--line); border-radius:16px; background:#fff; box-shadow:var(--shadow-sm); }
.profile-card h2 { margin:6px 0 18px; font-size:18px; }.profile-card dl { display:grid; gap:12px; margin:0; }
.profile-card dl div { display:flex; justify-content:space-between; gap:16px; padding-bottom:10px; border-bottom:1px solid var(--line); }
.profile-card dt { color:var(--muted); font-size:11px; }.profile-card dd { margin:0; font-size:11px; font-weight:750; text-align:right; }
.profile-help,.profile-card>p { color:var(--muted); font-size:12px; line-height:1.65; }
.profile-chips { display:flex; flex-wrap:wrap; gap:7px; margin:12px 0; }.profile-chips span { padding:6px 10px; border-radius:20px; color:#fff; background:var(--navy-800); font-size:10px; font-weight:750; }
.profile-card details { color:var(--muted); font-size:11px; }.profile-card details li { margin:5px 0; font-family:ui-monospace,monospace; }
.profile-wide { grid-column:1/-1; }.profile-actions { display:flex; gap:9px; margin-top:17px; }.profile-actions a { padding:9px 13px; border:1px solid var(--line); border-radius:9px; color:var(--navy-800); font-size:11px; font-weight:750; text-decoration:none; }.profile-actions a.danger { color:#983642; }
@media(max-width:700px){.profile-grid{grid-template-columns:1fr}.profile-wide{grid-column:auto}}

/* --- Administração do módulo --------------------------------------------- */
.link-admin { margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #adc2cd;
  text-decoration: none; font-size: 12px; font-weight: 650; }
.link-admin:hover { color: #fff; background: rgba(255,255,255,.06); }
.painel { width: min(1000px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 70px; }
.painel-intro { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.painel-intro a { color: var(--navy-800); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tabela-admin { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tabela-admin th, .tabela-admin td { padding: 12px 14px; border-bottom: 1px solid var(--line);
  text-align: left; vertical-align: top; }
.tabela-admin th { color: var(--muted); font-size: 9px; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; }
.tabela-admin tr:last-child td { border-bottom: 0; }
.tabela-admin td strong { display: block; font-size: 13px; }
.tabela-admin td small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.tabela-admin .quando { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabela-admin .quebra { overflow-wrap: anywhere; }
.tabela-admin .vazio { padding: 30px; color: var(--muted); text-align: center; }
.travada { background: #fafcfd; }
.nivel-selo { display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--canvas); color: var(--navy-800);
  font-size: 10px; font-weight: 800; }
.role-botoes { display: flex; flex-wrap: wrap; gap: 6px; }
.role-botoes form { display: inline; }
.chip { display: inline-block; padding: 6px 12px; border: 1px solid #cbd9e1; border-radius: 20px;
  background: #fff; color: var(--muted); font: inherit; font-size: 10.5px; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: .16s ease; }
.chip:hover { border-color: var(--navy-800); color: var(--navy-800); }
.chip.on { border-color: var(--navy-800); background: var(--navy-800); color: #fff; }
.somente-leitura { color: var(--muted); font-size: 10.5px; font-style: italic; }
.excecoes-linha td { padding-top: 0; }
.excecoes-titulo { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px;
  font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.excecoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.excecoes form { display: grid; gap: 4px; padding: 9px 11px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--canvas); }
.excecoes label { color: var(--ink); font-size: 10.5px; font-weight: 650; }
.excecoes select { padding: 6px 7px; border: 1px solid #cbd9e1; border-radius: 7px;
  background: #fff; font: inherit; font-size: 10.5px; }
.excecoes label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.efetivo { color: var(--muted); font-size: 8.5px; font-weight: 800;
  letter-spacing: .09em; text-transform: uppercase; }
.transcricao { display: grid; gap: 10px; }
.transcricao-item { padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; box-shadow: var(--shadow-sm); }
.transcricao-item.assistente { background: var(--canvas); box-shadow: none; }
.transcricao-item header { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 6px; }
.transcricao-item strong { color: var(--navy-800); font-size: 9px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; }
.transcricao-item time { color: var(--muted); font-size: 8.5px; }
.transcricao-item p { margin: 0; font-size: 12.5px; line-height: 1.7; white-space: pre-wrap;
  overflow-wrap: anywhere; }
