
body {
  font-family: Arial, sans-serif;
  background-color: #f4f6f8;
  color: #333;
  margin: 0;
  padding: 20px;
}

/* 🔝 Barra de navegación fija */
.sticky-menu {
  position: sticky;
  top: 0;
  background-color: #f5f5f5;
  border-bottom: 1px solid #ddd;
  padding: 10px;
  display: flex;
  gap: 15px;
  justify-content: center;
  z-index: 1000;
}

/* 🌐 Mejorar sticky-menu en móviles */
@media (max-width: 768px) {
  .sticky-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 15px;
  }

  .sticky-menu a {
    display: block;
    width: 100%;
    background-color: #e9ecef;
    padding: 10px;
    border-radius: 6px;
    font-size: 16px;
  }

  .sticky-menu a:hover {
    background-color: #dcdcdc;
  }
}

.sticky-menu a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.sticky-menu a:hover {
  background-color: #ddd;
}

h2, h3 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.bloque {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* 🔴 Sección de gastos destacada */
.seccion-gastos {
  background-color: #fff0f0;
  border: 1px solid #f5c2c7;
  padding: 20px;
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

th, td {
  padding: 10px;
  border: 1px solid #ddd;
  text-align: left;
}

th {
  background-color: #3498db;
  color: white;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select {
  padding: 10px;
  width: 100%;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 15px;
}


button, input[type="submit"] {
  background-color: #27ae60;
  color: white;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 5px;
}

button:hover, input[type="submit"]:hover {
  background-color: #219150;
}

.resumen {
  font-weight: bold;
  margin-top: 10px;
}

.success {
  color: green;
  font-weight: bold;
  margin-top: 10px;
}

.logout {
  margin-top: 40px;
}

.logout form {
  display: inline;
}

/* 🔘 Botón "Ir arriba" */
#btnTop {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  font-size: 20px;
  background-color: #28a745;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 50%;
  display: none;
  cursor: pointer;
  width: auto;          /* ✅ evita que se estire */
  height: auto;         /* ✅ evita altura forzada */
  line-height: 1;       /* ✅ centra verticalmente */
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}


/* 🏷️ Etiquetas visuales para métodos de pago */
.metodo-efectivo {
  background-color: #d4edda;
  color: #155724;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.metodo-yape,
.metodo-plin {
  background-color: #d1ecf1;
  color: #0c5460;
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* 📱 Responsivo */
@media (max-width: 768px) {
  .bloque {
    padding: 15px;
  }

  table {
    font-size: 14px;
  }

  .sticky-menu {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .sticky-menu a {
    margin-bottom: 5px;
  }

  input[type="text"],
  input[type="number"],
  select,
  button {
    width: 100%;
    margin: 8px 0;
  }

  #btnTop {
    padding: 14px;
    font-size: 24px;
  }

  button, input[type="submit"] {
    font-size: 16px;
  }
}

/* 🎯 Centrado del formulario de login */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh; /* altura completa de la ventana */
}

.login-box {
  background-color: white;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
}

.login-box form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-box input[type="text"],
.login-box input[type="password"],
.login-box button {
  width: 100%;
  box-sizing: border-box;
}

form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

form label {
  display: flex;
  flex-direction: column;
  font-weight: bold;
}

form input[type="text"],
form input[type="number"],
form input[type="password"],
form input[type="email"],
form select {
  width: auto;
  min-width: 160px;
  flex: 1;
  margin: 0;
}

form button,
form input[type="submit"] {
  white-space: nowrap;
  height: 42px;
  padding: 8px 16px;
}

@media (max-width: 768px) {
  form {
    flex-direction: column;
    align-items: stretch;
  }

  form input,
  form select,
  form button {
    width: 100%;
  }
}
