* {
  box-sizing: border-box;
}
.titulo-centrado {
  text-align: center;
}
.titulo-izquierda {
  margin: 0 auto;
  max-width: 900px;
  text-align: center;
}
nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  margin: 0;
  justify-content: center;
}
nav a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
}
.contenedor-tabla {
  display: block; 
  margin-top: 50px;
  padding: 0 1rem;
  overflow-x: auto; 
}
table {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  border-collapse: collapse;
  background-color: #ffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}
table input {
  width: 100%;
  min-width: 70px; 
  padding: 8px;
  box-sizing: border-box;
}
th, td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}
th {
  background-color: #6aaa2f;
  color: white;
}
tbody tr:hover {
  background-color: #a1afbd;
}
footer {
  background-color: #236405;
  color: #f8fafc;
  text-align: center;
  padding: 20px 0;
  margin-top: 50px;
}

.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 0;
  margin-top: 10px;
}

.footer-links a {
  color: #93c5fd;            
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.contenedor-boton {
  display: flex;
  justify-content: center;
  margin-top: 30px;
  padding: 0 1rem;
}
.contenedor-boton-agregar {
  display: flex;
  justify-content: center;
  margin: 30px auto 0;
  padding: 0 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

#btn-calcular {
  background-color: #6aaa2f;
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


#btn-calcular:hover {
  background-color: #6aaa2f;
}

#btn-calcular:active {
  transform: scale(0.98);
}

.contenedor-resultado {
  text-align: center;
  margin-top: 25px;
}

#texto-resultado {
  font-size: 36px;
  color: #1e293b;
}
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem;
}

#btn-agregar {
  background-color: #2563eb;
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


#btn-agregar:hover {
  background-color: #1d4ed8;
}

#btn-agregar:active {
  transform: scale(0.98);
}

@media (max-width: 600px) {
  nav ul {
    gap: 0.5rem;
  }

  .titulo-izquierda {
    text-align: center;
    max-width: 100%;
  }

  .contenedor-boton-agregar,
  .contenedor-boton {
    justify-content: center;
  }

  .contenedor-tabla {
    margin-top: 30px;
    padding: 0 0.5rem;
  }

  table {
    width: 100%;
  }

  th, td {
    padding: 10px 12px;
  }

  #texto-resultado {
    font-size: 20px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
  }
}

.cajon-error {
  border: 2px solid #e74c3c !important;
  outline: 2px solid #e74c3c !important;
  background-color: #fceceb !important;
}

.btn-eliminar {
  background-color: #dc2626; 
  color: white;
  border: none;
  border-radius: 8px; 
  width: 32px; 
  height: 32px; 
  font-size: 14px; 
  font-weight: bold;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease, transform 0.1s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 
}

.btn-eliminar:hover {
  background-color: #b91c1c; 
}

.btn-eliminar:active {
  transform: scale(0.90); 
}