/* === Reset y tipografía === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  padding: 1rem;
}

/* === Contenedor principal === */
.container {
  max-width: 500px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  padding: 2rem;
}

/* === Encabezado === */
h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: #0056b3;
  font-weight: 700;
}

/* === Información del usuario === */
.user-info {
  text-align: center;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  color: #666;
}

/* === Enlaces de acción en tarjetas === */
.card-item {
  border-left: 4px solid #0056b3;
  background-color: #f9fbff;
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  transition: background 0.3s, transform 0.2s;
}
.card-item:hover {
  background-color: #eef4ff;
  transform: translateX(2px);
}
.card-item a {
  color: #0056b3;
  text-decoration: none;
  font-weight: 500;
  display: block;
}
.card-item a:hover {
  text-decoration: underline;
}

/* === Logout especial === */
.card-item.logout {
  border-left-color: #d9534f;
}
.card-item.logout a {
  color: #d9534f;
}

/* === Bloque de acciones tipo app === */
.action-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.action {
  display: block;
  background-color: #e9f0fb;
  color: #0056b3;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.action:hover {
  background-color: #d6e8fc;
  transform: translateY(-1px);
}

.action.logout {
  background-color: #fde0e0;
  color: #a60000;
}
.action.logout:hover {
  background-color: #f9cfcf;
}

/* === Formularios === */
form {
  margin-top: 1rem;
}

form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: #333;
}

form input[type="text"],
form input[type="number"] {
  width: 100%;
  padding: 0.65rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* === Botones === */
form button.btn,
.btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  background-color: #0056b3;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}
form button.btn:hover,
.btn:hover {
  background-color: #004494;
}

/* === Mensajes === */
.alert {
  padding: 0.75rem;
  border-radius: 5px;
  margin-bottom: 1rem;
  font-weight: 500;
}
.alert.success {
  background: #e6f9e6;
  color: #2d6a2d;
}
.alert.error {
  background: #fde0e0;
  color: #a60000;
}

/* === Responsive === */
@media (max-width: 480px) {
  .container {
    padding: 1.2rem;
    margin: 0.5rem;
  }

  .action,
  .btn {
    font-size: 0.95rem;
    padding: 0.7rem 1rem;
  }
}

.scroll-table {
  overflow-x: auto;
}
table input[type="text"],
table input[type="number"] {
  width: 100%;
  padding: 0.3rem;
  font-size: 0.95rem;
}
table td,
table th {
  vertical-align: middle;
}

@media screen and (max-width: 768px) {
  table td input[type="text"],
  table td input[type="number"] {
    width: 100%;
    box-sizing: border-box;
  }

  .action-bar input, .action-bar select, .action-bar button {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.4rem;
  }

  table th, table td {
    font-size: 14px;
    padding: 8px;
  }
}

