/* Reset básico */
body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: #e9edf4;
  color: #212529;
}

/* Cabeçalho fixo */
header {
  background: #004085;
  color: #fff;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  margin: 0;
  font-size: 20px;
}

/* Barra de pesquisa */
.search-bar {
  background: #fff;
  padding: 20px;
  border-bottom: 1px solid #dbe2ea;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Formulário responsivo */
.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
}

.search-form input,
.search-form select {
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
}

.search-form button {
  background: #004085;
  color: #fff;
  font-weight: bold;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
  width: 100%;
}

.search-form button:hover {
  background: #003066;
}

/* Containers principais */
.container-geral,
.grupo-emenda {
  max-width: 1100px;
  margin: 20px auto;
  background: #f5f7fa;
  padding: 14px;
  border-radius: 6px;
}

/* Topo do grupo de emendas */
.header-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  background: #fff;
  padding: 12px 20px;
  border-radius: 6px 6px 0 0;
  margin-bottom: 1px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.header-top-left span {
  font-size: 16px;
  font-weight: 600;
  color: #004085;
}

.header-top-left .badge {
  background: #ffc107;
  color: #212529;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 10px;
  margin-left: 12px;
  vertical-align: middle;
  white-space: nowrap;
}

/* Créditos da emenda */
.credits-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: #495057;
  font-weight: 500;
}

.credits-row > div small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: #888;
  margin-bottom: 2px;
}

/* Subtítulo com parlamentar */
.header-sub {
  background: #fff;
  padding: 10px 20px;
  font-weight: 600;
  margin-bottom: 1px;
}

.header-sub a {
  color: #004085;
  text-decoration: none;
  font-weight: 700;
}

/* Cabeçalho da tabela */
.table-header {
  display: grid;
  grid-template-columns: 3fr 4fr 2fr 1fr;
  gap: 10px;
  background: #fff;
  padding: 14px 20px;
  font-weight: 600;
  color: #495057;
  border-radius: 0 0 6px 6px;
}

/* Linha de dados da tabela */
.row {
  display: grid;
  grid-template-columns: 3fr 4fr 2fr 1fr;
  gap: 10px;
  background: #fff;
  padding: 16px 20px;
  border-bottom: 1px solid #d9dadb;
  align-items: center;
  font-size: 14px;
}

.row:last-child {
  border-bottom: none;
  border-radius: 0 0 6px 6px;
}

/* Links e dotação */
.dotacao-link {
  color: #004085;
  font-weight: 500;
  text-decoration: none;
}

.dotacao-link:hover {
  text-decoration: underline;
}

.dotacao-text {
  font-weight: 400;
  margin-top: 4px;
  text-transform: uppercase;
  color: #212529;
  font-size: 12px;
}

/* Etiquetas */
.labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.label-blue {
  background: #004085;
  color: white;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 12px;
  text-transform: uppercase;
  white-space: nowrap;
}

.label-grey {
  background: #d9dadb;
  color: #404040;
  font-weight: 500;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Valor do crédito */
.credit-value {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

/* Rodapé fixo */
footer {
  background: #f8f9fa;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: #6c757d;
  position: fixed;
  width: 100%;
  bottom: 0;
}

/* Bloco do Parlamentar (novo agrupador visual) */
.grupo-parlamentar {
  max-width: 1100px;
  margin: 30px auto;
  background: transparent;
  padding: 0 0 10px 0;
  border-left: 6px solid #004085;
  border-radius: 6px;
}

/* Remover margem duplicada nas emendas internas */
.grupo-parlamentar .grupo-emenda {
  margin: 10px 0;
  padding: 0;
  background: #f5f7fa;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

/* Ajuste visual no header do parlamentar */
.grupo-parlamentar .header-top {
  border-radius: 6px 6px 0 0;
  margin-bottom: 0;
  background: #e6f0fa;
  border-bottom: 1px solid #c8d6e5;
}

/* Afastar bem o bloco de cada parlamentar */
.grupo-parlamentar + .grupo-parlamentar {
  margin-top: 40px;
}

/* Suavizar transições de entrada (opcional) */
.grupo-parlamentar,
.grupo-emenda {
  transition: all 0.2s ease-in-out;
}

/* Responsivo para telas menores */
@media (max-width: 768px) {
  .table-header,
  .row {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }

  .credit-value {
    text-align: left;
    margin-top: 6px;
  }

  .header-top,
  .header-sub {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .credits-row {
    flex-direction: column;
    gap: 10px;
  }
}
