/* ==========================================
   ESTILOS PARA SISTEMA DE GESTIÓN DE USUARIOS
   ========================================== */

/* ==========================================
   TABLAS RESPONSIVE
   ========================================== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
}

/* Mejoras para DataTables */
.dataTables_wrapper {
  padding: 1rem 0;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
  margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #ced4da;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  transition: all 0.3s ease;
}

.dataTables_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Responsive para móviles */
@media screen and (max-width: 767px) {
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    text-align: center;
    float: none !important;
  }
  
  .dataTables_wrapper .dataTables_info,
  .dataTables_wrapper .dataTables_paginate {
    text-align: center;
    float: none !important;
    margin-top: 1rem;
  }
}

/* Estilos de tabla */
.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 1rem 0.75rem;
  vertical-align: middle;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.table tbody td {
  vertical-align: middle;
  padding: 0.875rem 0.75rem;
}

/* ==========================================
   CHECKBOXES PERSONALIZADOS
   ========================================== */
.check-admin,
.check-jefe,
.check-all {
  cursor: pointer;
  width: 20px;
  height: 20px;
  margin: 0;
  transition: transform 0.2s ease;
}

.check-admin:hover,
.check-jefe:hover,
.check-all:hover {
  transform: scale(1.1);
}

/* ==========================================
   BOTONES DE ACCIÓN
   ========================================== */
.btn-edit-user {
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-edit-user:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

/* ==========================================
   PESTAÑAS DE NAVEGACIÓN
   ========================================== */
.nav-tabs {
  border-bottom: 2px solid #e9ecef;
  margin-bottom: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 8px 8px 0 0;
  padding: 0.5rem 0.5rem 0;
}

.nav-tabs .nav-item {
  margin-bottom: -2px;
}

.nav-tabs .nav-link {
  border: none;
  color: #6c757d;
  font-weight: 500;
  padding: 0.875rem 1.5rem;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s ease;
  position: relative;
}

.nav-tabs .nav-link:hover:not(.disabled) {
  color: #0d6efd;
  background-color: rgba(13, 110, 253, 0.1);
}

.nav-tabs .nav-link.active {
  color: #0d6efd;
  background-color: #fff;
  border-bottom: 3px solid #0d6efd;
  font-weight: 600;
}

.nav-tabs .nav-link.disabled {
  color: #adb5bd;
  cursor: not-allowed;
}

/* ==========================================
   CARDS
   ========================================== */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.card-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* ==========================================
   MODAL MEJORADO
   ========================================== */
#exampleModalScrollable .modal-dialog {
  max-width: 700px;
  margin: 1.75rem auto;
}

#exampleModalScrollable .modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#exampleModalScrollable .modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 1.5rem 2rem;
  border-radius: 16px 16px 0 0;
}

#exampleModalScrollable .modal-title {
  font-weight: 600;
  font-size: 1.25rem;
}

#exampleModalScrollable .btn-close {
  filter: invert(1);
  opacity: 0.8;
}

#exampleModalScrollable .btn-close:hover {
  opacity: 1;
}

#exampleModalScrollable .modal-body {
  padding: 2rem;
  background-color: #f8f9fa;
}

#exampleModalScrollable .modal-footer {
  border-top: 1px solid #e9ecef;
  padding: 1.25rem 2rem;
  background-color: #fff;
}

/* ==========================================
   FOTO DE USUARIO EN MODAL
   ========================================== */
.user-photo-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 1.5rem;
}

.user-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

.user-photo:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.photo-upload-btn {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 45px;
  height: 45px;
  padding: 0;
  border-radius: 50% !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-upload-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.photo-upload-btn i {
  font-size: 1.1rem;
}

/* ==========================================
   FORMULARIO EN MODAL
   ========================================== */
#formUsuario {
  background-color: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

#formUsuario .form-label {
  margin-bottom: 0.5rem;
  color: #495057;
  font-weight: 600;
  font-size: 0.95rem;
}

#formUsuario .form-label i {
  font-size: 1.1rem;
}

#formUsuario .form-control,
#formUsuario .form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

#formUsuario .form-control-lg,
#formUsuario .form-select-lg {
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
}

#formUsuario .form-control:focus,
#formUsuario .form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
  outline: none;
}

#formUsuario .form-control:read-only {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

#formUsuario .invalid-feedback {
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ==========================================
   SELECT2 PERSONALIZADO
   ========================================== */
.select2-container--default .select2-selection--single {
  height: 42px;
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.select2-container--default .select2-selection--single:hover {
  border-color: #ced4da;
}

.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #667eea;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 42px;
  padding-left: 1rem;
  color: #495057;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
  right: 8px;
}

.select2-dropdown {
  border: 2px solid #667eea;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.select2-search--dropdown .select2-search__field {
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 0.5rem;
}

.select2-results__option--highlighted {
  background-color: #667eea !important;
}

/* ==========================================
   BREADCRUMB
   ========================================== */
.breadcrumb {
  background-color: transparent;
  padding: 0.75rem 0;
  margin-bottom: 1.5rem;
}

.breadcrumb-item {
  font-size: 0.95rem;
}

.breadcrumb-item.active {
  color: #6c757d;
  font-weight: 500;
}

.breadcrumb-item img {
  vertical-align: middle;
}

/* ==========================================
   LOADING SPINNER
   ========================================== */
#loadingSpinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1050;
  background-color: rgba(255, 255, 255, 0.95);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

#loadingSpinner i {
  color: #667eea;
}

#loadingSpinner p {
  margin-top: 1rem;
  margin-bottom: 0;
  color: #6c757d;
  font-weight: 500;
}

/* ==========================================
   UTILIDADES Y ANIMACIONES
   ========================================== */
.animated {
  animation-duration: 0.5s;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fadeInRight {
  animation-name: fadeInRight;
}

/* Ocultar elemento */
.d-none {
  display: none !important;
}

/* ==========================================
   RESPONSIVE ADICIONAL
   ========================================== */
@media screen and (max-width: 576px) {
  /* Ocultar columnas menos importantes en móvil */
  .table thead th:nth-child(2),
  .table tbody td:nth-child(2),
  .table thead th:nth-child(5),
  .table tbody td:nth-child(5),
  .table thead th:nth-child(6),
  .table tbody td:nth-child(6) {
    display: none;
  }
  
  /* Modal en móvil */
  #exampleModalScrollable .modal-dialog {
    margin: 0.5rem;
  }
  
  #exampleModalScrollable .modal-body {
    padding: 1.25rem;
  }
  
  .user-photo {
    width: 140px;
    height: 140px;
  }
  
  /* Pestañas en móvil */
  .nav-tabs .nav-link {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }
  
  /* Cards en móvil */
  .card-body {
    padding: 1rem;
  }
}

@media screen and (max-width: 768px) {
  #formUsuario .col-md-6 {
    margin-bottom: 0.5rem;
  }
}

/* ==========================================
   MEJORAS DE ACCESIBILIDAD
   ========================================== */
*:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

button:focus,
.btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ==========================================
   SCROLLBAR PERSONALIZADO
   ========================================== */
.modal-body::-webkit-scrollbar {
  width: 8px;
}

.modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
  background: #764ba2;
}
.contenedor-tabla {
    border-radius: 12px;       /* Esquinas redondeadas */
    border: 1px solid #dee2e6; /* Borde gris sutil alrededor de la tabla */
}