/* ---- ESTILOS DEL DASHBOARD ----*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  display: flex;
  min-height: 100vh;
  background-color: #f5f5f5;
}

/* ======= SIDEBAR ======= */
.sidebar {
  width: 250px;
  background-color: #1b2a49;
  color: white;
  position: fixed;
  height: 100vh;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.3s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: 70px;
}

.sidebar .logo {
  text-align: center;
  margin-bottom: 20px;
  padding: 10px;
  /* Añade un poco de espacio interno */
}

.sidebar .logo img {
  width: 100%;
  /* Ocupará todo el ancho disponible */
  max-width: 300px;
  /* Mayor tamaño permitido */
  height: auto;
  display: block;
  margin: 0 auto;
  /* Mantener centrado */
}

/* Ajuste cuando la barra lateral está colapsada */
.sidebar.collapsed .logo img {
  width: 70px;
  /* Aumentamos el tamaño en el modo colapsado */
  max-width: 70px;
}

.sidebar .nav li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  transition: background 0.3s;
  border-radius: 8px;
}

.sidebar .nav li.active {
  background-color: #343a40;
  /* Color de fondo distinto */
  border-left: 4px solid #ffc107;
  /* O cualquier otro detalle */
}

.sidebar .nav li:hover {
  background: #2d3e5d;
}

.sidebar.collapsed .nav li span {
  display: none;
}

.sidebar.collapsed .logout span {
  display: none;
}

.logout {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ff4d4d;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.logout:hover {
  background-color: #cc0000;
}

/* ======= CONTENIDO ======= */
.content {
  margin-left: 250px;
  width: calc(100% - 250px);
  padding: 20px;
  transition: margin-left 0.3s;
}

.content.adjusted {
  margin-left: 70px;
  width: calc(100% - 70px);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
}

/* ======= BOTÓN DE HAMBURGUESA ======= */
.top-bar .toggle-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  margin-right: auto;
  /* Lo mueve a la izquierda */
}

/* ======= FILTROS ======= */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

select,
input {
  width: 100%;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  outline: none;
}

/* ======= BOTONES ======= */
.buttons {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.btn-qr {
  background: #3498db;
  color: white;
}

.btn-bars {
  background: #2d3e5d;
  color: white;
}

.btn-new {
  background: #8e44ad;
  color: white;
}

/* ======= TABLA ======= */
.table-container {
  margin-top: 20px;
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
}

table th,
table td {
  text-align: left;
  padding: 12px;
}

.folio-solicitud {
  white-space: nowrap;
}

table th {
  background: #2d3e5d;
  color: white;
}

table td {
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
  cursor: pointer;
}

table tr:hover td {
  background: #d7ecff;
}

@media (max-width: 768px) {
  .content {
    margin-left: 70px;
    width: calc(100% - 70px);
  }

  .sidebar .nav li span {
    display: none;
  }
}

.filter-btn {
  width: 100%;
  background: none;
  border: none;
  padding: 10px;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: white;
  transition: background 0.3s;
}

.filter-btn .check-icon {
  display: none;
}

.filter-btn.selected .check-icon {
  display: inline;
}

/* Colores según el estado */
.open {
  background: #1abc9c;
}

.completed {
  background: #8e44ad;
}

.reserved {
  background: #e74c3c;
}

.not-proceed {
  background: #3498db;
}

.filter-btn:hover {
  opacity: 0.8;
}

/* Estilos del modal */
.modal {
  display: none;
  /* Oculto por defecto */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 400px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  position: relative;
}

.modal-content h2 {
  margin-bottom: 15px;
}

.modal-content label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
}

.modal-content input {
  width: 100%;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #ccc;
  margin-bottom: 15px;
}

.btn-search {
  background: #8e44ad;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}

.btn-search:hover {
  background: #732d91;
}

/* Botón de cierre */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  font-weight: bold;
}

/* Contenedor de la paginación centrado */
#pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 8px;
}

/* Estilos para los botones de paginación */
#pagination button {
  background-color: #2d3e5d;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  font-size: 14px;
}

/* Efecto hover */
#pagination button:hover {
  background-color: #1abc9c;
  transform: scale(1.05);
}

/* Botón activo */
#pagination button.active {
  background-color: #ffc107;
  color: #2d3e5d;
  font-weight: bold;
}

.filters-section {
  margin-top: 20px;
}

.filters-container {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  width: 100%;
}

.filters-container div {
  flex: 1;
  min-width: 220px;
  text-align: center;
}

h3 {
  color: white;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  font-size: 16px;
  text-align: center;
}

.open {
  background: #dc3545;
}

.completed {
  background: #28a745;
}

.reserved {
  background: #ffc107;
}

.not-proceed {
  background: #dc3545;
}

select,
input {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border-radius: 5px;
  border: 1px solid #ccc;
  outline: none;
}

li[data-url="subir_excel.html"]:hover {
  background: #d0e7ff;
  transform: scale(1.02);
}

.date-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date-group span {
  padding: 0 5px;
  font-weight: bold;
}

.date-input {
  width: 48%;
  /* Ajusta el tamaño para que queden parejos */
}

.buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: right;
}

.btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.btn-qr {
  background: #1abc9c;
  color: white;
}

.btn-bars {
  background: #3498db;
  color: white;
}

.btn-new {
  background: #8e44ad;
  color: white;
}


@media screen and (max-width: 768px) {
  .sidebar {
    width: 250px;
    transition: width 0.3s ease;
  }

  .content {
    margin-left: 250px;
    transition: margin-left 0.3s ease;
  }

  .sidebar.collapsed {
    width: 70px;
  }

  .sidebar.collapsed .logo,
  .sidebar.collapsed .nav li span,
  .sidebar.collapsed .logout span {
    display: none;
  }

  .content.adjusted {
    margin-left: 70px;
  }

  .top-bar h1 {
    font-size: 18px;
  }

  .filters-container {
    flex-direction: column;
    gap: 10px;
  }

  .filters-container div {
    width: 100%;
  }

  .buttons {
    flex-wrap: wrap;
    justify-content: center;
  }

  .table-container {
    overflow-x: auto;
  }

  table {
    min-width: 600px;
  }

  .modal-content {
    width: 90%;
  }

  .date-group {
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
  }

  .date-input {
    width: 100%;
  }
}


body.collapsed .sidebar {
  width: 70px;
}

body.collapsed .sidebar .logo,
body.collapsed .sidebar .nav li span,
body.collapsed .sidebar .logout span {
  display: none;
}

body.collapsed .content {
  margin-left: 70px;
  width: calc(100% - 70px);
}


/* Estilos base para Select2 */
.select2-container {
  width: 100% !important; /* Ocupa el ancho completo */
  margin-bottom: 15px;
}

.select2-container--default .select2-selection--single {
  background-color: #f9f9f9;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  height: 45px;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 14px;
  color: #333;
  transition: border-color 0.3s ease;
}

.select2-container--default .select2-selection--single:hover {
  border-color: #4CAF50; /* Color al pasar el mouse */
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 43px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 45px;
  right: 8px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #4CAF50 transparent transparent transparent; /* Flecha verde */
}

/* Estilos para el dropdown */
.select2-dropdown {
  border-radius: 8px;
  border: 1px solid #d1d1d1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.select2-results__option {
  padding: 10px;
  color: #333;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.select2-results__option--highlighted {
  background-color: #4CAF50 !important; /* Color de selección */
  color: white;
}

/* Adaptabilidad para móviles */
@media (max-width: 768px) {
  .select2-container--default .select2-selection--single {
      font-size: 12px;
  }
  .select2-results__option {
      font-size: 12px;
  }
}

/* Botón para limpiar filtros */
.btn-clear-filters {
  background-color: #ff6b6b;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 15px;
  font-size: 14px;
  margin-bottom: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background-color 0.3s ease;
}

.btn-clear-filters i {
  font-size: 16px;
}

.btn-clear-filters:hover {
  background-color: #ff4c4c;
}
