* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --azul: #1e3a8a;
  --azul-escuro: #172d6b;
  --verde: #16a34a;
  --verde-escuro: #15803d;
  --cinza-fundo: #f3f4f6;
  --cinza-borda: #e5e7eb;
  --cinza-texto: #4b5563;
  --texto: #111827;
  --vermelho-bg: #fee2e2;
  --vermelho-texto: #b91c1c;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--cinza-fundo);
  color: var(--texto);
  min-height: 100vh;
  padding: 16px;
}

.container {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* HEADER (Justiça Eleitoral) */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid var(--cinza-borda);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand .logo {
  width: 150px;
  height: 56px;
  flex-shrink: 0;
  background-image: url('/img/logo-tse.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: left center;
}

/* A nova logo já traz "Justiça Eleitoral"; escondemos o <h1> repetido */
.brand-text h1 {
  display: none;
}

.brand-text small {
  font-size: 9px;
  color: var(--cinza-texto);
  letter-spacing: 0.8px;
  line-height: 1.1;
}

.menu {
  font-size: 24px;
  color: var(--azul);
  cursor: pointer;
  user-select: none;
}

/* HERO */
.hero {
  background: var(--azul);
  color: #fff;
  padding: 24px 20px;
}

.hero h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.hero p {
  font-size: 14px;
  opacity: 0.95;
  line-height: 1.4;
}

/* CARD */
.card {
  padding: 20px;
}

.field {
  margin-bottom: 16px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.field-label .icon {
  width: 20px;
  height: 20px;
  background: var(--azul);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.field input,
.field-read {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--cinza-borda);
  font-size: 16px;
  background: #fff;
  color: var(--texto);
}

.field input:focus {
  outline: 2px solid var(--azul);
  border-color: var(--azul);
}

.field-read {
  background: #eef0f3;
  color: #333;
}

.row {
  display: flex;
  gap: 12px;
}

.row .field {
  flex: 1;
}

/* BOTÕES */
.btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-verde {
  background: var(--verde);
  color: #fff;
}

.btn-verde:hover {
  background: var(--verde-escuro);
}

.btn-azul {
  background: var(--azul);
  color: #fff;
}

.btn-azul:hover {
  background: var(--azul-escuro);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* AVISOS */
.aviso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  color: var(--cinza-texto);
  margin-top: 14px;
}

.info-box {
  background: #e0ecff;
  padding: 12px;
  border-radius: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: #1e3a8a;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.info-box .info-icon {
  background: var(--azul);
  color: #fff;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.alerta {
  background: var(--vermelho-bg);
  color: var(--vermelho-texto);
  padding: 14px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.35;
}

.alerta .alerta-icon {
  min-width: 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--vermelho-texto);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.valor-box {
  background: #f3f4f6;
  text-align: center;
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.valor-box small {
  display: block;
  color: var(--cinza-texto);
  font-size: 13px;
  margin-bottom: 4px;
}

.valor-box .valor {
  font-size: 28px;
  font-weight: 800;
  color: var(--texto);
}

/* DADOS DO ELEITOR — cabeçalho azul */
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 0;
}

.card-header .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--azul);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.card-header h3 {
  font-size: 22px;
}

/* ERRO */
.erro {
  background: var(--vermelho-bg);
  color: var(--vermelho-texto);
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 10px;
  display: none;
}

.erro.show {
  display: block;
}

/* SUCESSO */
.sucesso-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--verde);
  color: #fff;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
}

/* QR CODE */
.qr-container {
  text-align: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
}

.qr-container img {
  max-width: 220px;
  width: 100%;
  height: auto;
}

.pix-copia {
  margin-top: 12px;
  padding: 10px;
  background: #f9fafb;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  font-family: monospace;
  font-size: 11px;
  word-break: break-all;
  max-height: 100px;
  overflow-y: auto;
}

.btn-copiar {
  margin-top: 8px;
  background: #6b7280;
  color: #fff;
  border: 0;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

/* SPINNER */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ADMIN */
.admin-body {
  background: #f1f5f9;
  padding: 0;
}

.admin-header {
  background: var(--azul);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h1 {
  font-size: 18px;
}

.admin-header button {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 0;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.admin-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  background: #fff;
  padding: 18px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat small {
  color: var(--cinza-texto);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat .num {
  font-size: 26px;
  font-weight: 700;
  color: var(--azul);
  margin-top: 4px;
}

.tabela-container {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tabela-toolbar {
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--cinza-borda);
  flex-wrap: wrap;
}

.tabela-toolbar input,
.tabela-toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--cinza-borda);
  border-radius: 6px;
  font-size: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--cinza-borda);
}

th {
  background: #f9fafb;
  font-weight: 700;
  color: var(--cinza-texto);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-pendente {
  background: #fef3c7;
  color: #92400e;
}

.badge-pago {
  background: #d1fae5;
  color: #065f46;
}

.acoes button {
  background: transparent;
  border: 1px solid var(--cinza-borda);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 4px;
}

.acoes button:hover {
  background: #f3f4f6;
}

.acoes .danger {
  color: #b91c1c;
  border-color: #fecaca;
}
