/* ============================
   ESTILO GENERAL
============================ */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: #f3f6fa;
  color: #333;
  min-height: 100vh;
}

/* ============================
   LOGIN
============================ */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
}

.login-box {
  background-color: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  width: 100%;
  max-width: 350px;
}

.login-box h2 {
  margin-bottom: 1.5rem;
  color: #1e3c72;
}

.login-box input {
  width: 100%;
  padding: 0.75rem;
  margin: 0.5rem 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
}

.login-box button {
  width: 100%;
  padding: 0.75rem;
  background: #1e3c72;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: 0.3s;
}

.login-box button:hover {
  background: #2a5298;
}

.error {
  color: red;
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* ============================
   TOPBAR (ADMIN/EMPLEADO)
============================ */
.topbar {
  background: #1e3c72;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.topbar h1 {
  margin: 0;
  font-size: 1.3rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logout-btn {
  background: #e63946;
  color: white;
  text-decoration: none;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.3s;
}

.logout-btn:hover {
  background: #c62828;
}

/* ============================
   DASHBOARD (ADMIN/EMPLEADO)
============================ */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
}

.dashboard section {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 300px;
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.3s;
}

.dashboard section:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.dashboard h2 {
  color: #1e3c72;
  margin-bottom: 0.5rem;
}

.dashboard p {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1rem;
}

.dashboard button {
  background: #1e3c72;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.3rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s;
}

.dashboard button:hover {
  background: #2a5298;
}

/* ============================
   TABLAS GENERALES
============================ */
.table-container {
  max-width: 95%;
  margin: 2rem auto;
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

table th, table td {
  padding: 0.8rem;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

table th {
  background: #1e3c72;
  color: white;
}

table tr:hover {
  background: #f5f7fa;
}

/* ============================
   BOTONES SECUNDARIOS
============================ */
.btn {
  display: inline-block;
  text-decoration: none;
  color: white;
  background: #1e3c72;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.btn:hover {
  background: #2a5298;
}

/* ============================
   ERROR PAGE
============================ */
.error-container {
  text-align: center;
  color: #1e3c72;
  background: white;
  border-radius: 16px;
  padding: 2rem;
  margin: 5rem auto;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.2);
}
.back-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background: #1e3c72;
  color: white;
  border-radius: 8px;
  text-decoration: none;
}
.back-btn:hover {
  background: #2a5298;
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 768px) {
  .dashboard {
    flex-direction: column;
    align-items: center;
  }
  .dashboard section {
    width: 90%;
  }
}

form label {
  display: block;
  margin-top: 1rem;
  color: #1e3c72;
  font-weight: 500;
}

form input, form select {
  width: 90%;
  padding: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin: 0.3rem;
  font-size: 1rem;
}

/* ============================
   TABLAS RESPONSIVE
============================ */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  background: white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.table-responsive table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* evita que se rompa el formato */
}

.table-responsive th,
.table-responsive td {
  padding: 0.75rem;
  border-bottom: 1px solid #ddd;
  text-align: left;
  white-space: nowrap;
}

.table-responsive th {
  background: #1e3c72;
  color: white;
  font-weight: 600;
}

.table-responsive tr:hover {
  background: #f5f7fa;
}

/* ============================
   VERSIÓN MÓVIL (sin scroll)
============================ */
@media (max-width: 700px) {
  .table-responsive table {
    border: 0;
    min-width: unset;
  }

  .table-responsive thead {
    display: none;
  }

  .table-responsive tr {
    display: block;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    padding: 1rem;
  }

  .table-responsive td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: 0.5rem 0;
  }

  .table-responsive td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #1e3c72;
    margin-right: 0.5rem;
    text-transform: capitalize;
  }
}