:root {
  --azul: #0b5cad; --azul-esc: #083f78; --azul-claro: #e8f1fb;
  --fundo: #f3f5f8; --cartao: #fff; --texto: #1b2430; --suave: #677385; --linha: #e3e7ee;
  --verde: #1f8a4c; --verde-claro: #e5f5ec; --vermelho: #c0392b; --vermelho-claro: #fdecea;
  --amarelo: #a86b00; --amarelo-claro: #fff4dc;
  --raio: 14px; --sombra: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fundo); color: var(--texto); }
a { color: var(--azul); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 0 0 .75rem; }
h2 { font-size: 1.05rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: .95rem; margin: 0 0 .4rem; }
small, .suave { color: var(--suave); }
img { max-width: 100%; }

/* layout */
.topo { position: sticky; top: 0; z-index: 10; background: var(--azul); color: #fff;
  display: flex; align-items: center; gap: .75rem; padding: .65rem 1rem; }
.topo .marca { font-weight: 700; color: #fff; letter-spacing: -.01em; }
.topo .marca span { font-weight: 400; opacity: .8; }
.sino { position: relative; color: #fff; font-size: 1.25rem; padding: .1rem .3rem; }
.sino b { position: absolute; top: -4px; right: -6px; background: #e5484d; color: #fff; font-size: .68rem; min-width: 18px; height: 18px;
  border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.sino b[hidden] { display: none; }
.topo .eu { display: flex; align-items: center; gap: .5rem; color: #fff; font-size: .9rem; }
.casca { display: flex; max-width: 1180px; margin: 0 auto; }
.lateral { display: none; }
main { flex: 1; min-width: 0; padding: 1rem 16px 6rem; }
.baixo { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: #fff; border-top: 1px solid var(--linha);
  display: flex; justify-content: space-around; padding: .35rem 0 calc(.35rem + env(safe-area-inset-bottom)); }
.baixo a { display: flex; flex-direction: column; align-items: center; font-size: .72rem; color: var(--suave); padding: .2rem .5rem; }
.baixo a b { font-size: 1.3rem; line-height: 1.2; font-weight: 400; }
.baixo a.ativo { color: var(--azul); }
.baixo a.mais b { background: var(--azul); color: #fff; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  display: grid; place-items: center; margin-top: -.9rem; box-shadow: var(--sombra); }
@media (min-width: 900px) {
  .baixo { display: none; }
  .lateral { display: block; width: 220px; flex-shrink: 0; padding: 1rem .5rem 1rem 16px; position: sticky; top: 52px; align-self: flex-start; }
  .lateral a { display: flex; gap: .6rem; padding: .55rem .75rem; border-radius: 10px; color: var(--texto); }
  .lateral a:hover { background: #e9edf3; }
  .lateral a.ativo { background: var(--azul-claro); color: var(--azul); font-weight: 600; }
  .lateral .publicar { background: var(--azul); color: #fff; justify-content: center; margin-bottom: .75rem; font-weight: 600; }
  .lateral .publicar:hover { background: var(--azul-esc); }
  main { padding-bottom: 2rem; }
}

/* componentes */
.cartao { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: 1rem; margin-bottom: .8rem; }
.grade { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .grade { grid-template-columns: repeat(4, 1fr); } }
.num { background: var(--cartao); border-radius: var(--raio); box-shadow: var(--sombra); padding: .8rem .9rem; display: block; color: var(--texto); }
.num b { display: block; font-size: 1.45rem; letter-spacing: -.02em; }
.num small { font-size: .78rem; }
.num.alerta b { color: var(--vermelho); }
.num.dinheiro b { color: var(--azul); }
.av { width: 38px; height: 38px; border-radius: 50%; background: var(--azul-claro); color: var(--azul); font-weight: 700;
  font-size: .85rem; display: inline-grid; place-items: center; flex-shrink: 0; object-fit: cover; }
.av.g { width: 72px; height: 72px; font-size: 1.4rem; }
.av.p { width: 28px; height: 28px; font-size: .7rem; }
.topo .av { background: rgba(255,255,255,.2); color: #fff; }

.item { display: flex; gap: .7rem; }
.item .corpo { flex: 1; min-width: 0; }
.item .meta { font-size: .8rem; color: var(--suave); }
.item .tit { font-weight: 600; margin: .1rem 0; color: var(--texto); display: block; }
.item .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.fotos { display: flex; gap: .4rem; margin-top: .5rem; flex-wrap: wrap; }
.fotos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.fotos.grandes img { width: 100%; height: auto; max-height: 520px; object-fit: contain; background: #000; }

.selo { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px;
  background: #eef1f5; color: var(--suave); vertical-align: middle; }
.selo.aberto { background: var(--amarelo-claro); color: var(--amarelo); }
.selo.andamento { background: var(--azul-claro); color: var(--azul); }
.selo.resolvido { background: var(--verde-claro); color: var(--verde); }
.selo.critica, .selo.alta { background: var(--vermelho-claro); color: var(--vermelho); }
.selo.tipo-reconhecimento, .selo.tipo-conquista { background: var(--verde-claro); color: var(--verde); }
.selo.tipo-ocorrencia, .selo.tipo-advertencia, .selo.tipo-reclamacao_cliente { background: var(--vermelho-claro); color: var(--vermelho); }

.abas { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .6rem; scrollbar-width: none; }
.abas a { white-space: nowrap; padding: .35rem .8rem; border-radius: 99px; background: #fff; border: 1px solid var(--linha);
  color: var(--texto); font-size: .85rem; }
.abas a.ativo { background: var(--azul); color: #fff; border-color: var(--azul); }

form.f label { display: block; font-size: .85rem; font-weight: 600; margin: .8rem 0 .25rem; }
input, select, textarea { width: 100%; font: inherit; padding: .65rem .75rem; border: 1px solid #cfd6e0; border-radius: 10px;
  background: #fff; color: var(--texto); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--azul-claro); border-color: var(--azul); }
.linha { display: flex; gap: .6rem; flex-wrap: wrap; }
.linha > * { flex: 1; min-width: 130px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600;
  padding: .65rem 1.1rem; border-radius: 10px; border: 0; background: var(--azul); color: #fff; cursor: pointer; }
.btn:hover { background: var(--azul-esc); }
.btn.claro { background: #fff; color: var(--azul); border: 1px solid #cfd6e0; }
.btn.perigo { background: #fff; color: var(--vermelho); border: 1px solid #f0c6c0; }
.btn.peq { padding: .35rem .7rem; font-size: .85rem; }
.btn.cheio { width: 100%; margin-top: 1rem; }
.aviso { padding: .7rem .9rem; border-radius: 10px; margin-bottom: .8rem; background: var(--verde-claro); color: var(--verde); }
.aviso.erro { background: var(--vermelho-claro); color: var(--vermelho); }
.aviso.amarelo { background: var(--amarelo-claro); color: var(--amarelo); }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; color: var(--suave); letter-spacing: .03em; }
td.v { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rolar { overflow-x: auto; }

.lista-p a { display: flex; align-items: center; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--linha); color: var(--texto); }
.lista-p a:last-child { border: 0; }
.lista-p .dir { margin-left: auto; text-align: right; font-size: .85rem; }

.perfil-topo { display: flex; gap: 1rem; align-items: center; }
.perfil-topo h1 { margin: 0; }
details > summary { cursor: pointer; font-weight: 600; color: var(--azul); padding: .3rem 0; }

/* chat IA */
.chat { display: flex; flex-direction: column; height: calc(100dvh - 52px - 2rem - 4.5rem); min-height: 380px; }
@media (min-width: 900px) { .chat { height: calc(100dvh - 52px - 2rem); } }
.msgs { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .6rem; padding: .3rem 0 1rem; }
.bolha { max-width: 85%; padding: .6rem .85rem; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--sombra); }
.bolha.user { align-self: flex-end; background: var(--azul); color: #fff; border-bottom-right-radius: 4px; }
.bolha.assistant { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.bolha .acoes { margin-top: .5rem; padding-top: .45rem; border-top: 1px solid var(--linha); font-size: .8rem; color: var(--verde); }
.bolha img { width: 120px; border-radius: 8px; display: block; margin-bottom: .3rem; }
.compor { display: flex; gap: .4rem; align-items: flex-end; background: #fff; border-radius: 16px; padding: .4rem; box-shadow: var(--sombra); }
.compor textarea { border: 0; min-height: 44px; max-height: 160px; padding: .55rem; outline: none; }
.compor .icone { background: none; border: 0; font-size: 1.35rem; cursor: pointer; padding: .4rem; }
.digitando { color: var(--suave); font-size: .85rem; }
.sugestoes { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.sugestoes button { font: inherit; font-size: .85rem; background: #fff; border: 1px solid var(--linha); border-radius: 99px; padding: .4rem .8rem; cursor: pointer; color: var(--texto); }

/* versão de bolso */
.botoes-bolso { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 640px) { .botoes-bolso { grid-template-columns: repeat(4, 1fr); } }
.botao-bolso { background: #fff; border-radius: var(--raio); box-shadow: var(--sombra); padding: 1rem .8rem; min-height: 104px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: .35rem;
  color: var(--texto); font-weight: 600; font-size: .92rem; line-height: 1.2; }
.botao-bolso span { font-size: 2rem; line-height: 1; }
.botao-bolso:active { transform: scale(.97); background: var(--azul-claro); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips label { margin: 0 !important; font-weight: 400 !important; }
.chips span { display: inline-block; padding: .45rem .8rem; border-radius: 99px; border: 1px solid #cfd6e0; background: #fff; cursor: pointer; font-size: .88rem; }
.chips input:checked + span { background: var(--azul); border-color: var(--azul); color: #fff; }
.foto-grande { display: block; border: 2px dashed #b9c4d3; border-radius: var(--raio); padding: 1.8rem 1rem; text-align: center;
  font-size: 2.6rem; cursor: pointer; background: #fafbfd; font-weight: 400 !important; margin-top: 0 !important; }
.foto-grande span { font-size: .95rem; color: var(--suave); }

.senha-olho { position: relative; }
.senha-olho input { padding-right: 3rem; }
.senha-olho button { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); background: none; border: 0;
  font-size: 1.2rem; padding: .35rem .5rem; cursor: pointer; line-height: 1; }
