:root {
  --fundo: #f0f2f5; --superficie: #fff; --texto: #1a1a1a; --sutil: #64748b;
  --borda: #e2e8f0; --marca: #0f172a; --destaque: #2563eb; --erro: #b91c1c; --erro-fundo: #fef2f2;
}
* { box-sizing: border-box; }
html { height: 100%; }
body {
  min-height: 100%; margin: 0; display: flex; flex-direction: column; background: var(--fundo); color: var(--texto);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
h1 { font-size: 1.25rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 0; }
.topo {
  display: flex; align-items: center; gap: 12px; background: var(--marca); color: #fff;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
}
.marca { font-size: 1rem; }
.menu { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.menu a { color: #cbd5e1; text-decoration: none; padding: 10px 12px; border-radius: 8px; white-space: nowrap; }
.menu a[aria-current="page"] { background: rgba(255, 255, 255, .15); color: #fff; }
.topo form { margin: 0; }
.botao-texto { background: none; border: 0; color: #cbd5e1; font: inherit; cursor: pointer; padding: 10px 6px; }
.botao {
  display: inline-block; background: var(--destaque); color: #fff; border: 0; border-radius: 8px;
  font: inherit; font-weight: 600; min-height: 44px; padding: 10px 14px; cursor: pointer; text-decoration: none;
}
.botao.secundario { background: #e2e8f0; color: var(--marca); }
.botao:disabled { opacity: .6; cursor: progress; }
.barra {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 16px;
  background: var(--superficie); border-bottom: 1px solid var(--borda);
}
.sutil { color: var(--sutil); font-size: .85rem; }
.andamento {
  margin: 0; padding: 10px 16px; max-height: 30vh; overflow: auto; white-space: pre-wrap;
  background: #f8fafc; border-bottom: 1px solid var(--borda); font-size: .82rem;
}
.relatorio { flex: 1; width: 100%; min-height: 0; border: 0; }
.conteudo { width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 16px; }
.cartao {
  background: var(--superficie); border-radius: 12px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .07);
}
.mensagem {
  margin: 10px 0; padding: 10px; background: #f8fafc; border-radius: 8px;
  white-space: pre-wrap; word-break: break-word; font: inherit; font-size: .88rem;
}
.acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.aviso { background: var(--superficie); border-radius: 8px; padding: 12px; margin: 0 0 12px; }
.aviso.erro { background: var(--erro-fundo); color: var(--erro); }
.log {
  background: var(--marca); color: #e2e8f0; border-radius: 8px; padding: 12px; overflow-x: auto;
  white-space: pre-wrap; word-break: break-word; font-size: .78rem;
}
.tela-login { align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 340px; margin: 0; }
.login label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .88rem; }
.login input:not([type="hidden"]) {
  display: block; width: 100%; margin-top: 4px; padding: 10px; font: inherit; font-size: 16px;
  border: 1px solid var(--borda); border-radius: 8px;
}
.login .botao { width: 100%; }
.pagina-cheia { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }

/* Celular */
@media (max-width: 420px) {
  .topo { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .marca { display: none; }
  .menu { gap: 0; }
  .menu a { padding: 10px 7px; font-size: .9rem; }
  .acoes .botao { flex: 1; padding-left: 8px; padding-right: 8px; text-align: center; white-space: nowrap; }
}
