:root {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #283449;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --prod: #22c55e;
  --hml: #facc15;
  --rejeitada: #ef4444;
  --substituida: #64748b;
  --revertida: #f97316;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code {
  background: #0b1220;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.topo {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem;
}
.topo-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.topo h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 600;
}
.subtitulo {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.loading,
.erro,
.vazio {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.erro {
  color: var(--rejeitada);
}

section {
  margin-bottom: 2.5rem;
}

.rotulo {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.15s ease;
}
.card-prod {
  border-color: var(--prod);
}
.card-hml {
  border-color: var(--hml);
}

.card-cabecalho {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.versao {
  font-size: 1.5rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.meta {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.botoes-download {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
  flex-wrap: wrap;
}
.botao {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #082f49;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}
.botao:hover {
  filter: brightness(1.08);
  text-decoration: none;
}
.botao-secundario {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.changelog {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  overflow-x: auto;
}
.changelog h1,
.changelog h2,
.changelog h3 {
  margin: 0.6rem 0 0.4rem;
  font-size: 1rem;
}
.changelog ul,
.changelog ol {
  margin: 0.4rem 0;
  padding-left: 1.5rem;
}
.changelog p {
  margin: 0.4rem 0;
}
.changelog code {
  font-size: 0.85em;
}

.historico {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.historico th,
.historico td {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.historico th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.85rem;
}
.historico tr:hover td {
  background: var(--bg-card-hover);
}
.historico td:first-child {
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--border);
  color: var(--text);
}
.badge-ativa {
  background: var(--prod);
  color: #052e16;
}
.badge-aguardando_aprovacao {
  background: var(--hml);
  color: #422006;
}
.badge-rejeitada {
  background: var(--rejeitada);
  color: #450a0a;
}
.badge-substituida {
  background: var(--substituida);
  color: #f1f5f9;
}
.badge-revertida {
  background: var(--revertida);
  color: #431407;
}
.badge-promovida_para_prod {
  background: var(--prod);
  color: #052e16;
  opacity: 0.7;
}

.rodape {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 640px) {
  .historico {
    font-size: 0.8rem;
  }
  .historico th:nth-child(4),
  .historico td:nth-child(4) {
    display: none;
  }
  .versao {
    font-size: 1.2rem;
  }
}
