:root {
  --azul: #003b73;
  --azul-escuro: #002b54;
  --amarelo: #f0b323;
  --cinza-fundo: #f2f4f7;
  --cinza-borda: #d7dce2;
  --texto: #1f2937;
  --verde-eja: #1f8f4d;
  --pei: #f0b323;
  --regular: #003b73;
  --card-bg: #ffffff;
  --sombra: 0 2px 10px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--cinza-fundo);
  color: var(--texto);
}

.topo {
  background: var(--azul);
  color: #fff;
  padding: 18px 20px;
}

.topo-conteudo {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-topo {
  width: 84px;
  height: 84px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
  flex-shrink: 0;
}

.topo-texto h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.topo-texto p {
  margin: 8px 0 0;
  opacity: 0.92;
}

.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px;
}

.filtros {
  display: grid;
  grid-template-columns: 220px 220px 1fr;
  gap: 14px;
  background: #fff;
  padding: 16px;
  border: 1px solid var(--cinza-borda);
  border-radius: 12px;
  box-shadow: var(--sombra);
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.campo-busca {
  min-width: 260px;
}

.campo label {
  font-weight: 700;
  font-size: 0.95rem;
}

.campo select,
.campo input {
  height: 42px;
  border: 1px solid #b8c2cc;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 0.96rem;
  background: #fff;
}

.acoes {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  margin-bottom: 16px;
  background: #fff;
  padding: 14px 16px;
  border: 1px solid var(--cinza-borda);
  border-left: 5px solid var(--amarelo);
  border-radius: 12px;
  box-shadow: var(--sombra);
}

.acoes-esquerda {
  font-weight: 700;
  color: var(--azul-escuro);
}

.acoes-direita {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--azul);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

button:hover {
  opacity: 0.92;
}

button:active {
  transform: translateY(1px);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  border-left: 6px solid var(--regular);
  padding: 18px;
  box-shadow: var(--sombra);
  min-height: 220px;
}

.card.pei {
  border-left-color: var(--pei);
}

.card.eja {
  box-shadow: 0 0 0 2px rgba(31, 143, 77, 0.18), var(--sombra);
}

.card h3 {
  margin: 0 0 12px;
  color: var(--azul-escuro);
  font-size: 1.2rem;
  line-height: 1.3;
}

.card p {
  margin: 0 0 10px;
  line-height: 1.45;
}

.badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #eaf0f8;
  color: var(--azul-escuro);
}

.badge-pei {
  background: #fff3cc;
  color: #7a5700;
}

.badge-eja {
  background: #dff5e8;
  color: #0d6a32;
}

.card a,
.tabela-link {
  color: var(--azul);
  font-weight: 700;
  text-decoration: underline;
  word-break: break-word;
}

.lista-wrapper {
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: 12px;
  box-shadow: var(--sombra);
  overflow: hidden;
}

.tabela-container {
  width: 100%;
  overflow-x: auto;
}

#resultadoLista {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

#resultadoLista th,
#resultadoLista td {
  border-bottom: 1px solid #e6e9ee;
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
  font-size: 0.95rem;
}

#resultadoLista th {
  background: #edf3fa;
  color: var(--azul-escuro);
  position: sticky;
  top: 0;
  z-index: 1;
}

.linha-pei td:first-child {
  border-left: 5px solid var(--pei);
}

.linha-eja td:first-child {
  box-shadow: inset 5px 0 0 var(--verde-eja);
}

.mapa-section {
  margin-top: 22px;
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: 12px;
  box-shadow: var(--sombra);
  padding: 16px;
}

.mapa-titulo h2 {
  margin: 0 0 6px;
  color: var(--azul-escuro);
}

.mapa-status {
  margin: 0 0 14px;
  color: #4b5563;
  font-size: 0.95rem;
}

#mapa {
  height: 460px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #dbe2ea;
}

.rodape {
  text-align: center;
  padding: 20px;
  color: #5b6775;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.vazio {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  border: 1px dashed #c8d0da;
  text-align: center;
  color: #5b6775;
  box-shadow: var(--sombra);
}

/* Responsividade */
@media (max-width: 980px) {
  .filtros {
    grid-template-columns: 1fr 1fr;
  }

  .campo-busca {
    grid-column: 1 / -1;
  }

  .topo-conteudo {
    align-items: center;
  }
}

@media (max-width: 640px) {
  .topo-conteudo {
    flex-direction: column;
    text-align: center;
  }

  .logo-topo {
    width: 76px;
    height: 76px;
  }

  .topo-texto h1 {
    font-size: 1.6rem;
  }

  .filtros {
    grid-template-columns: 1fr;
  }

  .acoes {
    flex-direction: column;
    align-items: flex-start;
  }

  .acoes-direita {
    width: 100%;
  }

  .acoes-direita button {
    flex: 1;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}