/* ============================================
   HIREWATCHERS ADMIN PANEL - DISEÑO UNIFICADO
   ============================================
   Sin gradientes, fondos claros, diseño profesional
   Siguiendo principios de CLAUDE.md
*/

/* ============================================
   VARIABLES DEL SISTEMA
   ============================================ */
:root {
  --admin-bg: #f5f8fa;
  --card-bg: #ffffff;
  --border-color: #efecf3;
  --text-primary: #1f1b2d;
  --text-secondary: #666276;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-hover: 0 6px 20px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.admin-layout {
  background: var(--admin-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-container {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.admin-content {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  border: 0;
  margin-left: 0 !important;
  margin-right: 0;
}

/* ============================================
   HEADER ADMIN UNIFICADO
   ============================================ */
.admin-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 0 2.5rem;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid #dee2e6;
  padding: 8px 12px;
  border-radius: 6px;
  color: #1f1b2d;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:hover {
  background: #f5f8fa;
  border-color: #0d6efd;
  color: #0d6efd;
}

/* Mobile menu wrapper */
.mobile-menu-wrapper {
  position: fixed;
  top: 72px;
  left: 0;
  width: 280px;
  height: calc(100vh - 72px);
  background: #ffffff;
  box-shadow: 2px 0 15px rgba(0,0,0,0.2);
  z-index: 10000;
  overflow-y: auto;
  border-right: 2px solid #dee2e6;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mobile-menu {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.mobile-menu-item:hover {
  background: #f5f8fa;
  border-color: #efecf3;
  color: #1f1b2d;
  transform: translateX(4px);
}

.mobile-menu-item.active {
  background: #0d6efd;
  color: white;
  border-color: #0d6efd;
}

.mobile-menu-item i {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

/* Mobile menu backdrop */
.mobile-menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile menu divider */
.mobile-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.75rem 0;
  width: 100%;
}

/* Mobile menu logout button */
.logout-item {
  background: rgba(220, 53, 69, 0.05) !important;
  border-color: transparent !important;
}

/* =========================================================
   REFRESCOS DE UI GENERALES EN PÁGINAS DE ADMIN
   ========================================================= */
.admin-section {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.admin-section .admin-table table {
  border-spacing: 0;
  border-collapse: separate;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.02);
}

.admin-section .admin-table thead {
  background: #f8fafc;
}

.admin-section .admin-table thead th {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 700;
}

.admin-section .admin-table tbody tr:nth-child(even) {
  background: #fff;
}

.admin-section .admin-table tbody tr:nth-child(odd) {
  background: #fbfdff;
}

.admin-section .admin-table tbody tr:hover {
  background: #f2f7ff;
  transition: background 0.2s ease;
}

.admin-section h4,
.admin-section h5 {
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.admin-section p.text-muted {
  margin-bottom: 0;
}

.admin-section .btn {
  border-radius: 10px;
}

.admin-section .btn-outline-secondary,
.admin-section .btn-outline-primary {
  background-color: #fff;
}

.admin-section .badge {
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 600;
}

.logout-item:hover {
  background: rgba(220, 53, 69, 0.15) !important;
  color: #dc3545 !important;
  border-color: transparent !important;
}

.mobile-menu-logout i {
  color: #dc3545;
}

/* Logo Section */
.admin-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  min-width: 140px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition);
}

.admin-logo img {
  height: 40px;
  max-height: 40px !important;
  width: auto;
  max-width: 200px !important;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  object-fit: contain;
}

.admin-logo:hover {
  background: var(--admin-bg);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Desktop only elements */
.desktop-only {
  display: flex;
}

/* Navigation Central */
.admin-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
  max-width: 680px;
  margin: 0 auto;
  background: var(--admin-bg);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.nav-item {
  background: transparent;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.nav-item::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: #0d6efd;
  transition: var(--transition);
  transform: translateX(-50%);
}

.nav-item:hover {
  background: rgba(13, 110, 253, 0.08);
  color: #0d6efd;
}

.nav-item.active {
  background: #0d6efd;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
  font-weight: 500;
}

.nav-item.active::before {
  width: 0;
}

.nav-item i {
  font-size: 17px;
}

.nav-item:hover i {
  transform: scale(1.1);
}

.nav-item.active i {
  transform: scale(1.05);
}

/* Logout Button */
.admin-logout,
.desktop-logout {
  background: transparent;
  border: 2px solid #dc3545;
  color: #dc3545;
  padding: 9px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  overflow: hidden;
}

.admin-logout::before,
.desktop-logout::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.2);
  transition: left 0.5s ease;
}

.admin-logout:hover,
.desktop-logout:hover {
  background: #dc3545;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3);
  border-color: #dc3545;
}

.admin-logout:hover::before,
.desktop-logout:hover::before {
  left: 100%;
}

.admin-logout:disabled,
.desktop-logout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  background: var(--card-bg);
  margin: -2rem -2rem 2rem -2rem;
  padding: 1.75rem 2rem 1.25rem 2rem;
  border-bottom: 2px solid var(--admin-bg);
  border-radius: 8px 8px 0 0;
}

.section-header-row {
  margin-bottom: 0.75rem;
}

.section-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(239, 236, 243, 0.5);
}

.control-item {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.section-title h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.section-title p {
  color: var(--text-secondary);
  margin: 0.25rem 0 0 0;
  font-size: 0.9rem;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

.section-actions > * {
  margin: 0;
}

.section-actions .btn-group {
  display: flex;
  gap: 2px;
}

.section-actions .dropdown {
  display: inline-flex;
}

.section-actions .form-check,
.control-item .form-check {
  margin: 0;
  padding: 0;
  min-height: auto;
  display: flex;
  align-items: center;
}

.section-actions .form-check-input,
.control-item .form-check-input {
  width: 2.5rem;
  height: 1.3rem;
  margin-top: 0;
  margin-right: 0.5rem;
  background-color: #dee2e6;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.section-actions .form-check-input:checked,
.control-item .form-check-input:checked {
  background-color: #0d6efd !important;
  border-color: #0d6efd !important;
}

.section-actions .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
  outline: none;
}

.section-actions .form-check-input:hover {
  background-color: #ced4da;
}

.section-actions .form-check-input:checked:hover {
  background-color: #0b5ed7;
}

.section-actions .form-check-label,
.control-item .form-check-label {
  margin: 0;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  user-select: none;
  white-space: nowrap;
}

/* ============================================
   CARDS UNIFICADAS
   ============================================ */
.metric-card,
.stat-card,
.info-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: var(--transition);
  height: 100%;
}

.metric-card:hover,
.stat-card:hover,
.info-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #0d6efd;
}

/* Metric Card Specific */
.metric-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  position: relative;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #0d6efd;
  border-radius: 8px 8px 0 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.metric-title {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin: 0;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  background: rgba(13, 110, 253, 0.1);
}

.metric-icon i {
  font-size: 24px;
  color: #0d6efd;
}

/* Status Card */
.status-card {
  padding: 1.25rem;
}

.status-card h6 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.status-card .progress {
  height: 6px;
  background-color: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.status-card small {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

/* Dashboard Card */
.dashboard-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
  box-shadow: var(--shadow-sm);
}

.dashboard-card .card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

/* ============================================
   TABLAS
   ============================================ */
.admin-table {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-top: 1.5rem;
}

.admin-table .table {
  margin-bottom: 0;
}

.admin-table thead {
  background: #f8f9fa;
  border-bottom: 2px solid var(--border-color);
}

.admin-table thead th {
  padding: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.75px;
  color: #6c757d;
  border: none;
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  color: var(--text-secondary);
  border-bottom: 1px solid #f5f8fa;
  font-size: 0.9rem;
}

.admin-table tbody tr {
  transition: all 0.2s ease;
}

.admin-table tbody tr:hover {
  background: rgba(13, 110, 253, 0.03);
  transform: scale(1.002);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================
   FILTROS
   ============================================ */
.advanced-filters {
  background: var(--card-bg);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.filter-panel {
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.filter-panel .card-body {
  padding: 1.25rem;
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
  transition: all 0.2s ease;
  padding: 0.5rem 1.1rem;
  font-weight: 500;
  border-radius: 6px;
  font-size: 0.875rem;
  position: relative;
  overflow: hidden;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: #0d6efd;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

.btn-primary:hover {
  background: #0b5ed7;
  box-shadow: 0 4px 16px rgba(13, 110, 253, 0.4);
  transform: translateY(-2px) scale(1.01);
}

.btn-outline-primary {
  border: 1.5px solid #0d6efd;
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.05);
  font-weight: 500;
}

.btn-outline-primary:hover {
  background: #0d6efd;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(13, 110, 253, 0.25);
  border-color: #0d6efd;
}

.btn-outline-secondary {
  border: 1.5px solid var(--border-color);
  color: var(--text-secondary);
  background: var(--card-bg);
}

.btn-outline-secondary:hover {
  background: var(--admin-bg);
  border-color: var(--text-secondary);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.btn-sm {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: 5px;
}

.btn-success {
  background: #07c98b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(7, 201, 139, 0.25);
}

.btn-success:hover {
  background: #06a571;
  box-shadow: 0 4px 16px rgba(7, 201, 139, 0.4);
  transform: translateY(-2px) scale(1.01);
}

.btn-danger {
  background: #dc3545;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.btn-danger:hover {
  background: #c82333;
  box-shadow: 0 4px 16px rgba(220, 53, 69, 0.4);
  transform: translateY(-2px) scale(1.01);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  padding: 0.35rem 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  font-size: 0.75rem;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge.rounded-pill {
  padding: 0.375rem 0.875rem;
  border-radius: 50px;
}

/* Garantizar contraste adecuado */
.badge.bg-primary,
.badge.bg-success,
.badge.bg-danger,
.badge.bg-info,
.badge.bg-dark {
  color: #ffffff !important;
}

.badge.bg-warning,
.badge.bg-light,
.badge.bg-secondary {
  color: var(--text-primary) !important;
}

.badge.bg-light {
  border: 1px solid var(--border-color);
}

/* ============================================
   FORM CONTROLS
   ============================================ */
.form-control,
.form-select {
  background: var(--admin-bg);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
  background: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
  border-color: #0d6efd;
  outline: none;
}

.form-label {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-check-input:checked {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

/* ============================================
   ESTADOS VACÍOS
   ============================================ */
.empty-state {
  background: var(--admin-bg);
  border-radius: 8px;
  padding: 4rem 2rem;
  text-align: center;
  border: 1px solid var(--border-color);
}

.empty-state-icon {
  font-size: 3rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.empty-state p {
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* ============================================
   LISTAS RECIENTES
   ============================================ */
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-item {
  padding: 0.75rem;
  background: var(--admin-bg);
  border-radius: 6px;
  transition: var(--transition);
}

.recent-item:hover {
  background: #e9ecef;
  transform: translateX(4px);
}

.avatar-sm {
  width: 40px;
  height: 40px;
  background: var(--card-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0d6efd;
}

/* ============================================
   MÉTRICAS DE CONVERSIÓN
   ============================================ */
.conversion-metric {
  padding: 1.5rem;
  background: var(--admin-bg);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.conversion-metric .display-4 {
  font-size: 3rem;
  font-weight: 700;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Large desktop (1400px and up) */
@media (min-width: 1400px) {
  .admin-container {
    max-width: 1400px;
  }
}

/* Desktop (1200px and down) */
@media (max-width: 1200px) {
  .admin-container {
    max-width: 100%;
    padding: 1.5rem;
  }
  
  .admin-nav {
    max-width: 600px;
  }
}

/* Tablet (991px and down) */
@media (max-width: 991px) {
  .admin-header {
    padding: 0 1.5rem;
    height: 64px;
  }
  
  /* Show mobile menu button */
  .mobile-menu-btn {
    display: flex !important;
  }
  
  /* Hide desktop nav text, keep icons */
  .admin-nav {
    display: none !important;
  }
  
  .mobile-menu-wrapper {
    top: 64px;
    height: calc(100vh - 64px);
  }
  
  .admin-logo img {
    max-height: 38px !important;
  }
  
  .metric-card {
    padding: 1.25rem;
  }
  
  .section-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
  }
  
  /* Grid adjustments for tablets */
  .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
  }
  
  .col-md-6, .col-lg-4, .col-lg-3 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  /* Make 2 columns on tablets */
  .col-lg-3, .col-lg-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Mobile (768px and down) */
@media (max-width: 768px) {
  .admin-header {
    padding: 0 0.75rem;
    height: 60px;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: space-between;
  }
  
  /* Show mobile menu button - already handled above */
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    order: 1;
    margin-right: 0;
  }
  
  /* Hide desktop elements */
  .desktop-only {
    display: none !important;
  }
  
  /* Center logo */
  .admin-logo {
    flex: 0 1 auto;
    justify-content: center;
    padding: 0;
    order: 2;
    margin: 0 auto;
  }
  
  .admin-logo img {
    max-height: 35px !important;
    height: 35px !important;
  }
  
  /* Hide desktop logout */
  .admin-logout {
    display: none !important;
  }
  
  /* Empty spacer for balance */
  .admin-header > div:last-child {
    order: 3;
    width: 44px;
    flex-shrink: 0;
  }
  
  /* Mobile menu wrapper adjustments */
  .mobile-menu-wrapper {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    width: 75%;
    max-width: 300px;
  }
  
  .admin-container {
    padding: 1rem;
  }
  
  .admin-content {
    padding: 1.25rem;
    border-radius: 8px;
  }
  
  .section-header {
    margin: -1.25rem -1.25rem 1.5rem -1.25rem;
    padding: 1rem 1.25rem;
    flex-direction: column;
    gap: 1rem;
  }
  
  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .section-title {
    width: 100%;
  }
  
  .section-title h2 {
    font-size: 1.25rem;
  }
  
  .section-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding-top: 1rem;
    width: 100%;
  }
  
  .control-item {
    width: 100%;
  }
  
  .section-actions {
    width: 100%;
    margin-left: 0;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: stretch;
  }
  
  .section-actions > * {
    flex: 1 1 auto;
    min-width: 120px;
  }
  
  /* Advanced filters button full width on mobile */
  .advanced-filters-controls {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  
  .advanced-filters-controls .btn {
    flex: 1;
  }
  
  /* Table responsive */
  .admin-table {
    font-size: 0.8125rem;
    overflow-x: auto;
    display: block;
  }
  
  .admin-table .table {
    min-width: 600px;
  }
  
  .admin-table td,
  .admin-table th {
    padding: 0.625rem 0.5rem;
    font-size: 0.8125rem;
  }
  
  /* Metric cards */
  .metric-card {
    padding: 1rem;
    min-height: 100px;
  }
  
  .metric-value {
    font-size: 1.5rem;
  }
  
  .metric-title {
    font-size: 0.75rem;
  }
  
  /* Grid columns for mobile */
  .col-md-6, .col-lg-4, .col-lg-3 {
    margin-bottom: 1rem;
  }
  
  /* Dashboard specific */
  .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  /* Hide elements on mobile */
  .hide-mobile {
    display: none !important;
  }
}

/* Small mobile (576px and down) */
@media (max-width: 576px) {
  .admin-header {
    height: 56px;
    padding: 0 0.75rem;
  }
  
  .nav-item {
    padding: 6px 8px;
  }
  
  .nav-item i {
    font-size: 18px;
  }
  
  .admin-logout {
    padding: 6px 10px;
  }
  
  .admin-logout i {
    font-size: 18px;
  }
  
  .admin-container {
    padding: 0.75rem;
  }
  
  .admin-content {
    padding: 1rem;
    border-radius: 8px;
    box-shadow: none;
    border: 1px solid var(--border-color);
  }
  
  .section-header {
    margin: -1rem -1rem 1rem -1rem;
    padding: 0.875rem 1rem;
  }
  
  .section-title h2 {
    font-size: 1.125rem;
  }
  
  .section-title p {
    font-size: 0.8125rem;
  }
  
  /* Buttons smaller on small screens */
  .btn {
    padding: 0.425rem 0.875rem;
    font-size: 0.8125rem;
  }
  
  .btn-sm {
    padding: 0.3rem 0.625rem;
    font-size: 0.75rem;
  }
  
  /* Cards single column on very small screens */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-card {
    padding: 0.875rem;
    min-height: 90px;
  }
  
  .metric-value {
    font-size: 1.25rem;
  }
  
  /* Table font smaller */
  .admin-table {
    font-size: 0.75rem;
  }
  
  .admin-table td,
  .admin-table th {
    padding: 0.5rem 0.375rem;
    font-size: 0.75rem;
  }
  
  /* Badge smaller */
  .badge {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Extra small mobile (400px and down) */
@media (max-width: 400px) {
  .admin-header {
    gap: 0.25rem;
  }
  
  .admin-logo img {
    max-height: 30px !important;
    height: 30px !important;
  }
  
  .nav-item {
    padding: 5px 6px;
  }
  
  .nav-item i {
    font-size: 16px;
  }
  
  .admin-nav {
    padding: 2px;
    gap: 1px;
  }
  
  .admin-logout {
    padding: 5px 8px;
  }
  
  .admin-logout i {
    font-size: 16px;
  }
  
  /* Tablas responsivas en móviles muy pequeños */
  .table-responsive {
    font-size: 0.7rem;
  }
  
  /* Ajustes de padding para móviles pequeños */
  .admin-container {
    padding: 0.5rem;
  }
  
  .admin-content {
    padding: 0.75rem;
  }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  .admin-header {
    height: 52px;
  }
  
  .admin-container {
    padding: 0.75rem;
  }
  
  .section-header {
    padding: 0.75rem 1rem;
  }
  
  .dashboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   RESPONSIVE TABLES & SCROLLING
   ============================================ */
/* Make tables horizontally scrollable on mobile */
@media (max-width: 991px) {
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table-responsive > .table {
    min-width: 700px;
  }
  
  /* Custom scrollbar for tables */
  .table-responsive::-webkit-scrollbar {
    height: 6px;
  }
  
  .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
  }
  
  .table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
  }
  
  .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
}

/* Responsive cards grid */
@media (max-width: 768px) {
  .row.g-4 {
    --bs-gutter-y: 1rem;
    --bs-gutter-x: 0.75rem;
  }
  
  /* Force full width for columns on mobile */
  .col-12,
  .col-md-6,
  .col-lg-3,
  .col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (min-width: 576px) and (max-width: 768px) {
  /* Two columns on larger phones/small tablets */
  .col-md-6,
  .col-lg-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Responsive modals */
.modal {
  padding-left: 0 !important;
}

@media (max-width: 576px) {
  .modal-dialog {
    margin: 0;
    max-width: 100%;
    min-height: 100vh;
  }
  
  .modal-content {
    min-height: 100vh;
    border-radius: 0;
  }
  
  .modal-header {
    border-radius: 0;
  }
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-purple {
  color: #6f42c1;
}

.bg-purple {
  background-color: #6f42c1;
  color: #ffffff;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-group {
  display: flex;
  gap: 4px;
}

.btn-group .btn {
  border-radius: 5px;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.loading-skeleton {
  background: #e9ecef;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

.loading-skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.5) 50%,
    rgba(255,255,255,0) 100%
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============================================
   FIXES GLOBALES PARA LOGO
   ============================================ */
/* Prevenir logo gigante en todas las páginas */
img[src*="logo.png"],
img[src*="logoi.png"],
img[src*="logow.png"],
img[alt*="Hirewatchers"],
img[alt*="hirewatchers"] {
  max-height: 50px !important;
  max-width: 250px !important;
  height: auto !important;
  width: auto !important;
  object-fit: contain !important;
  display: inline-block !important;
  visibility: visible !important;
}

/* Logo específico del admin */
.admin-header img[src*="logo"] {
  max-height: 40px !important;
  height: 40px !important;
}

/* Durante transiciones de página */
body img[src*="logo"],
html img[src*="logo"],
#__next img[src*="logo"],
div img[src*="logo"] {
  max-height: 50px !important;
  max-width: 250px !important;
  position: static !important;
  z-index: 1 !important;
}

/* Prevenir que el logo se escale durante animaciones */
@keyframes * {
  * {
    img[src*="logo"] {
      max-height: 50px !important;
      max-width: 250px !important;
    }
  }
}

/* Fix para imágenes flotantes o absolutas */
img[src*="logo"][style*="position: absolute"],
img[src*="logo"][style*="position: fixed"] {
  max-height: 50px !important;
  max-width: 250px !important;
  transform: scale(1) !important;
}

/* ============================================
   BOOTSTRAP UTILITIES OVERRIDE
   ============================================ */
/* Display utilities for responsive design */
@media (min-width: 992px) {
  .d-lg-none {
    display: none !important;
  }
  .d-lg-block {
    display: block !important;
  }
  .d-lg-flex {
    display: flex !important;
  }
}

@media (max-width: 991px) {
  .d-none.d-lg-block,
  .d-none.d-lg-flex {
    display: none !important;
  }
  .d-block.d-lg-none {
    display: block !important;
  }
}

@media (min-width: 768px) {
  .d-md-none {
    display: none !important;
  }
  .d-md-block {
    display: block !important;
  }
  .d-md-flex {
    display: flex !important;
  }
}

@media (max-width: 767px) {
  .d-none.d-md-block,
  .d-none.d-md-flex {
    display: none !important;
  }
  .d-block.d-md-none {
    display: block !important;
  }
}

@media (min-width: 576px) {
  .d-sm-inline {
    display: inline !important;
  }
}

@media (max-width: 575px) {
  .d-none.d-sm-inline {
    display: none !important;
  }
}

/* ============================================
   MEJORAS RESPONSIVE ADICIONALES
   ============================================ */

/* Scroll horizontal para tablas en móvil */
@media (max-width: 768px) {
  .table-responsive {
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
  }
  
  .table-responsive::-webkit-scrollbar {
    height: 8px;
  }
  
  .table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 8px;
  }
  
  .table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 8px;
  }
  
  .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
  
  /* Cards en grid responsivo */
  .row > [class*='col-'] {
    margin-bottom: 1rem;
  }
  
  /* Hacer los formularios más tocables en móvil */
  .form-control,
  .form-select,
  .btn {
    min-height: 44px; /* Tamaño mínimo recomendado para touch */
  }
  
  /* Mejorar spacing en móvil */
  .mb-3 {
    margin-bottom: 1rem !important;
  }
  
  .mb-4 {
    margin-bottom: 1.5rem !important;
  }
  
  /* Dashboard cards apiladas en móvil */
  .dashboard-metrics .col-md-6,
  .dashboard-metrics .col-lg-3 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  /* Botones de acción responsivos */
  .btn-group-vertical {
    width: 100%;
  }
  
  .btn-group-vertical .btn {
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
  }
  
  /* Dropdowns responsivos */
  .dropdown-menu {
    width: calc(100vw - 2rem);
    max-width: 300px;
  }
  
  /* Modales responsivos */
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .modal-content {
    border-radius: 12px;
  }
  
  /* Navegación tabs responsiva */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }
  
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .nav-tabs .nav-link {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Footer sticky en móvil */
  .admin-footer {
    position: sticky;
    bottom: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    z-index: 10;
  }
}

/* Tablets en landscape (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Ajuste de columnas para tablets */
  .col-lg-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  .col-lg-4 {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  /* Dashboard optimizado para tablet */
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

/* iPhone X y dispositivos con notch */
@supports (padding-top: env(safe-area-inset-top)) {
  .admin-header {
    padding-top: env(safe-area-inset-top);
  }
  
  .mobile-menu-wrapper {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Alto contraste */
@media (prefers-contrast: high) {
  .admin-content {
    border-width: 2px;
  }
  
  .btn {
    border-width: 2px;
  }
  
  .form-control,
  .form-select {
    border-width: 2px;
  }
}

/* Modo oscuro del sistema */
@media (prefers-color-scheme: dark) {
  [data-bs-theme="auto"] {
    /* Variables para modo oscuro automático */
    --admin-bg: #1a1d20;
    --card-bg: #212529;
    --border-color: #495057;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
  }
}

/* ============================================
   FIN DEL ARCHIVO
   ============================================ */

/* Hirewatchers table: highlight unverified rows */
.hw-row-unverified {
  background-color: #f4f8ff !important; /* muy leve blanco azulado */
  --bs-table-bg: #f4f8ff !important;
}

.table-hover tbody tr.hw-row-unverified:hover {
  background-color: #e9f1ff !important;
}
