/* ================================================== */
/* 🎨 SISTEMA DE TABLAS PROFESIONALES                 */
/* ================================================== */

.modern-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.modern-table {
  margin: 0;
  border: none;
  font-size: 0.9rem;
}

.modern-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
}

.modern-table thead th {
  border: none;
  padding: 1rem 1.5rem;
  font-weight: 600;
  color: #495057;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  position: relative;
}

.modern-table thead th:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #dee2e6, transparent);
}

.modern-table tbody tr {
  border: none;
  transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
  background-color: #f8f9fa;
}

.modern-table tbody tr:nth-child(even) {
  background-color: #fdfdfd;
}

.modern-table tbody tr:nth-child(even):hover {
  background-color: #f8f9fa;
}

.modern-table tbody td {
  border: none;
  padding: 1rem 1.5rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f3f4;
  color: #495057;
}

/* ================================================== */
/* 🎨 AVATARES PROFESIONALES                          */
/* ================================================== */

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #6c757d;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 1rem;
  border: 2px solid #e9ecef;
  text-transform: uppercase;
}

/* Variantes de color más profesionales */
.user-avatar.avatar-primary {
  background: #0d6efd;
  border-color: #0d6efd;
}

.user-avatar.avatar-success {
  background: #198754;
  border-color: #198754;
}

.user-avatar.avatar-info {
  background: #0dcaf0;
  border-color: #0dcaf0;
  color: #000;
}

.user-avatar.avatar-warning {
  background: #ffc107;
  border-color: #ffc107;
  color: #000;
}

/* ================================================== */
/* 🎨 BADGES PROFESIONALES PARA ROLES                 */
/* ================================================== */

.role-badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid;
  text-align: center;
  min-width: 80px;
}

.role-badge--propietario {
  background: #fff5f5;
  color: #c53030;
  border-color: #fed7d7;
}

.role-badge--administrador {
  background: #f7fafc;
  color: #2d3748;
  border-color: #e2e8f0;
}

.role-badge--usuario {
  background: #f0fff4;
  color: #22543d;
  border-color: #c6f6d5;
}

.role-badge--invitado {
  background: #f7fafc;
  color: #4a5568;
  border-color: #e2e8f0;
}

/* ================================================== */
/* 🎨 BOTONES DE ACCIÓN PROFESIONALES                 */
/* ================================================== */

.action-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 0.85rem;
  color: #6c757d;
}

.action-btn:hover {
  border-color: #adb5bd;
  background: #f8f9fa;
  transform: translateY(-1px);
}

.action-btn--edit {
  color: #0d6efd;
}

.action-btn--edit:hover {
  background: #e7f1ff;
  border-color: #0d6efd;
  color: #0d6efd;
}

.action-btn--delete {
  color: #dc3545;
}

.action-btn--delete:hover {
  background: #f8d7da;
  border-color: #dc3545;
  color: #dc3545;
}

.action-btn--view {
  color: #198754;
}

.action-btn--view:hover {
  background: #d1e7dd;
  border-color: #198754;
  color: #198754;
}

/* ================================================== */
/* 🎨 STATUS INDICATORS PROFESIONALES                 */
/* ================================================== */

.status-indicator {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid;
}

.status-indicator--active {
  background: #d4edda;
  color: #155724;
  border-color: #c3e6cb;
}

.status-indicator--active::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #28a745;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-indicator--inactive {
  background: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}

.status-indicator--inactive::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #dc3545;
  border-radius: 50%;
  margin-right: 0.5rem;
}

.status-indicator--pending {
  background: #fff3cd;
  color: #856404;
  border-color: #ffeaa7;
}

.status-indicator--pending::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #ffc107;
  border-radius: 50%;
  margin-right: 0.5rem;
}

/* ================================================== */
/* 🎨 USER INFO LAYOUT PROFESIONAL                    */
/* ================================================== */

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

.user-details h6 {
  margin: 0 0 0.2rem 0;
  font-weight: 600;
  color: #212529;
  font-size: 0.9rem;
}

.user-details p {
  margin: 0;
  color: #6c757d;
  font-size: 0.8rem;
}

.user-details .user-meta {
  font-size: 0.75rem;
  color: #adb5bd;
  margin-top: 0.1rem;
}

/* ================================================== */
/* 🎨 SORTING HEADERS                                 */
/* ================================================== */

.sortable-header {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.5rem !important;
}

.sortable-header:hover {
  background: #e9ecef;
}

.sortable-header::after {
  content: '↕';
  position: absolute;
  right: 0.5rem;
  opacity: 0.5;
  font-size: 0.7rem;
}

.sortable-header.sort-asc::after {
  content: '↑';
  opacity: 1;
}

.sortable-header.sort-desc::after {
  content: '↓';
  opacity: 1;
}

/* ================================================== */
/* 🎨 EMPTY STATE                                     */
/* ================================================== */

.table-empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #6c757d;
}

.table-empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.table-empty-state h6 {
  margin-bottom: 0.5rem;
  color: #495057;
}

.table-empty-state p {
  margin: 0;
  font-size: 0.9rem;
}

/* ================================================== */
/* 🎨 LOADING STATE                                   */
/* ================================================== */

.table-loading {
  position: relative;
}

.table-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
}

.table-loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin-left: -16px;
  margin-top: -16px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #0d6efd;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 11;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ================================================== */
/* 🎨 RESPONSIVE DESIGN                               */
/* ================================================== */

@media (max-width: 768px) {
  .modern-table thead th,
  .modern-table tbody td {
    padding: 0.75rem;
  }
  
  .user-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .action-btn {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
  
  .role-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    min-width: 70px;
  }
}

@media (max-width: 576px) {
  .modern-table-container {
    border-radius: 4px;
  }
  
  .modern-table thead th {
    padding: 0.5rem;
    font-size: 0.7rem;
  }
  
  .modern-table tbody td {
    padding: 0.5rem;
  }
  
  .user-info {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .user-avatar {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
}

/* ================================================== */
/* 🎨 UTILITY CLASSES                                 */
/* ================================================== */

.table-cell-nowrap {
  white-space: nowrap;
}

.table-cell-center {
  text-align: center;
}

.table-cell-right {
  text-align: right;
}

.table-row-selected {
  background: #e7f1ff !important;
}

.table-row-disabled {
  opacity: 0.6;
  pointer-events: none;
}

/* ================================================== */
/* 🎨 PAGINATION (si la necesitas)                    */
/* ================================================== */

.table-pagination {
  display: flex;
  justify-content: between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
}

.table-pagination-info {
  font-size: 0.85rem;
  color: #6c757d;
}

.table-pagination-controls {
  display: flex;
  gap: 0.5rem;
}

.table-pagination-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.table-pagination-btn:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.table-pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-pagination-btn.active {
  background: #0d6efd;
  color: white;
  border-color: #0d6efd;
}