* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #222;
  min-height: 100vh;
}

/* Header */
.header {
  background: #1a5276;
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header h1 { font-size: 18px; font-weight: 600; }
.header .usuario { font-size: 13px; opacity: 0.85; }
.btn-sair { background: rgba(255,255,255,0.2); border: none; color: white; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }

/* Telas */
.tela { display: none; padding: 20px; max-width: 500px; margin: 0 auto; }
.tela.ativa { display: block; }

/* Login */
.login-box {
  background: white;
  border-radius: 16px;
  padding: 40px 30px;
  text-align: center;
  margin-top: 60px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.login-box .logo { font-size: 40px; margin-bottom: 8px; }
.login-box h2 { color: #1a5276; font-size: 22px; margin-bottom: 4px; }
.login-box p { color: #666; font-size: 14px; margin-bottom: 30px; }

/* PIN pad */
.pin-display {
  font-size: 32px;
  letter-spacing: 16px;
  color: #1a5276;
  min-height: 48px;
  margin-bottom: 20px;
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 240px;
  margin: 0 auto;
}
.pin-btn {
  background: #f0f2f5;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.1s;
}
.pin-btn:active { background: #dde1e7; }
.pin-btn.apagar { font-size: 18px; color: #e74c3c; }
.pin-btn.entrar { background: #1a5276; color: white; }
.pin-btn.entrar:active { background: #154360; }

/* Cards do menu */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}
.menu-card {
  background: white;
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 2px solid transparent;
  transition: border 0.15s;
}
.menu-card:active { border-color: #1a5276; }
.menu-card .icone { font-size: 32px; margin-bottom: 8px; }
.menu-card .titulo { font-size: 14px; font-weight: 600; color: #1a5276; }
.menu-card .sub { font-size: 12px; color: #888; margin-top: 4px; }

/* Badge sync */
.badge {
  display: inline-block;
  background: #e74c3c;
  color: white;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-left: 4px;
}
.badge.verde { background: #27ae60; }

/* Formulário */
.form-titulo {
  font-size: 18px;
  font-weight: 700;
  color: #1a5276;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-voltar {
  background: #e8f4fd;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #1a5276;
  padding: 6px 14px;
  border-radius: 10px;
  min-width: 48px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.campo { margin-bottom: 16px; }
.campo label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.campo input, .campo select, .campo textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #dde1e7;
  border-radius: 10px;
  font-size: 15px;
  background: white;
  appearance: none;
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: #1a5276;
}
.campo-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.campo.opcional label::after { content: ' (opcional)'; font-weight: 400; color: #aaa; }

/* Botões */
.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.btn-primario { background: #1a5276; color: white; }
.btn-primario:active { background: #154360; }
.btn-andamento { background: #f39c12; color: white; }
.btn-andamento:active { background: #d68910; }
.btn-secundario { background: #f0f2f5; color: #333; }

/* Lista de lançamentos pendentes */
.lista-item {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lista-item .info { flex: 1; }
.lista-item .info strong { font-size: 14px; display: block; }
.lista-item .info span { font-size: 12px; color: #888; }
.status-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
}
.status-pendente { background: #fef3cd; color: #856404; }
.status-enviado { background: #d4edda; color: #155724; }
.status-andamento { background: #d1ecf1; color: #0c5460; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.visivel { opacity: 1; }
.toast.sucesso { background: #27ae60; }
.toast.erro { background: #e74c3c; }

/* Status de conexão */
.status-conn {
  text-align: center;
  font-size: 12px;
  padding: 6px;
  background: #fef3cd;
  color: #856404;
}
.status-conn.online { background: #d4edda; color: #155724; }

.vazio { text-align: center; color: #aaa; padding: 40px 20px; font-size: 14px; }
