body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background: #f0f4f3;
  color: #222;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: linear-gradient(90deg, #7b2e8b, #7b2e8b);
  color: white;
  padding: 20px;
  text-align: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

main {
  flex: 1;
}

footer {
  background: #1f1f1f;
  color: #ddd;
  text-align: center;
  padding: 15px;
  font-size: 14px;
  margin-top: auto;
}

footer p {
  margin: 5px 0;
}

.note {
  font-size: 14px;
  color: #444;
  text-align: center;
  margin: 10px 0;
}

#admin {
  text-align: center;
  margin: 20px 0;
}

#admin form {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  display: inline-block;
}

#admin input {
  padding: 10px;
  margin: 8px;
  border: 1px solid #bbb;
  border-radius: 6px;
}

#admin button {
  padding: 10px 18px;
  background: #7b2e8b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

#admin button:hover,
#controles button:hover {
  background: #e06700;
}

#controles button {
  margin: 10px;
  padding: 10px 18px;
  background: #7b2e8b;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s ease;
}

#candidatos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.card {
  width: 240px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  text-align: center;
  padding: 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.card h3 {
  margin: 5px 0 10px;
  font-size: 17px;
  font-weight: bold;
  color: #000000;
}

.foto {
  width: 100%;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px dashed #7b2e8b;
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  background: #fff;
}

.foto img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
  background-color: #fff;
  transition: transform 0.3s ease;
}

.card:hover .foto img {
  transform: scale(1.05);
}

.datos {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  font-size: 14px;
  font-weight: bold;
}

.datos label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
}

.datos input {
  width: 100%;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-weight: normal;
}

.codigo {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #7b2e8b;
  font-weight: bold;
}

.oculto {
  display: none;
}

#resultados {
  padding: 20px;
  text-align: center;
}

.tabla-resultados {
  margin: 20px auto;
  border-collapse: collapse;
  width: 60%;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.tabla-resultados th,
.tabla-resultados td {
  border: 1px solid #ddd;
  padding: 12px;
  text-align: center;
  font-size: 15px;
}

.tabla-resultados th {
  background: linear-gradient(90deg, #7b2e8b, #7b2e8b);
  color: #fff;
  font-size: 17px;
}

.tabla-resultados tr:nth-child(even) {
  background: #f9f9f9;
}

.tabla-resultados tr.destacado {
  background: #ffe5cc;
  font-weight: bold;
  color: #7b2e8b;
}

@media (max-width: 600px) {
  .card {
    width: 90%;
  }
  .tabla-resultados {
    width: 100%;
    font-size: 14px;
  }
}
