/**
 * users.css - Styles pour la page Gestion des Utilisateurs
 * Thème cohérent avec app-unified.css
 */

/* ============================================================
   VARIABLES (cohérentes avec app-unified)
   ============================================================ */
:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-darker: #111827;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #5eead4;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #22c55e;
  --info: #3b82f6;
  --header-height: 56px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  scrollbar-width: none; /* Firefox */
}

body::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

/* ============================================================
   HEADER - voir header-admin.css pour les styles communs
   ============================================================ */

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(58, 157, 147, 0.1);
  border: 1px solid rgba(58, 157, 147, 0.3);
  border-radius: 8px;
  color: var(--accent-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.back-link:hover {
  background: rgba(58, 157, 147, 0.2);
  border-color: var(--accent);
}

.header-center h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-center h1 i {
  color: var(--accent);
}

/* Header Right - styles spécifiques users */
.header-btn-audit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--warning);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  transition: all 0.2s;
}

.header-btn-audit:hover {
  background: #d97706;
  transform: scale(1.05);
}

.header-separator {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  padding: 24px;
  padding-top: calc(var(--header-height) + 24px);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================================
   USERS STATS
   ============================================================ */
.users-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.users-stat {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
}

.users-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.users-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}

.users-stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.users-stat-admin .users-stat-value {
  color: var(--success);
}

.users-stat-soc .users-stat-value {
  color: var(--warning);
}

.users-stat-user .users-stat-value {
  color: #8b5cf6;
}

/* ============================================================
   USERS TOOLBAR
   ============================================================ */
.users-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.users-search {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.users-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.9rem;
}

.users-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
}

.users-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 157, 147, 0.15);
}

.users-search input::placeholder {
  color: var(--muted);
}

/* Croix de réinitialisation du champ de recherche */
.users-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23f87171'%3E%3Cpath d='M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z'/%3E%3C/svg%3E") center/contain no-repeat;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.users-search input[type="search"]::-webkit-search-cancel-button:hover {
  opacity: 1;
}

.users-add-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.users-add-btn:hover {
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

/* ============================================================
   USER FORM PANEL
   ============================================================ */

/* Overlay pour mode édition */
.user-form-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 999;
}

.user-form-overlay.hidden {
  display: none;
}

/* Mode normal (ajout) - panneau intégré */
.user-form-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 20px;
  overflow: hidden;
  animation: slideDown 0.2s ease-out;
}

/* Mode édition - modale centrée */
.user-form-panel.edit-mode {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  margin-bottom: 0;
  animation: modalFadeIn 0.2s ease-out;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Masquer le bouton X en mode édition */
.user-form-panel.edit-mode .user-form-close {
  display: none;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(139, 92, 246, 0.1);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.user-form-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-form-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.user-form-close:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

.user-form {
  padding: 20px;
}

/* ============================================================
   AD SEARCH SECTION
   ============================================================ */
.ad-search-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border);
}

.ad-search-section label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-light);
  margin-bottom: 10px;
}

.ad-search-section label i {
  margin-right: 8px;
}

.ad-search-wrapper {
  position: relative;
}

.ad-search-wrapper input {
  width: 100%;
  padding: 12px 16px;
  padding-right: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
}

.ad-search-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 157, 147, 0.15);
}

.ad-search-wrapper input::placeholder {
  color: var(--muted);
}

.ad-search-spinner {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
}

.ad-search-results {
  margin-top: 10px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.ad-search-results.hidden {
  display: none;
}

.ad-result-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.ad-result-item:last-child {
  border-bottom: none;
}

.ad-result-item:hover {
  background: rgba(58, 157, 147, 0.1);
}

/* Utilisateur déjà existant dans la base */
.ad-result-item.ad-result-existing {
  opacity: 0.6;
  background: rgba(100, 100, 100, 0.1);
  cursor: not-allowed;
}

.ad-result-item.ad-result-existing:hover {
  background: rgba(100, 100, 100, 0.15);
}

.ad-result-item.ad-result-existing .ad-result-avatar.existing {
  background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
}

.ad-result-existing-badge {
  font-size: 0.75rem;
  color: var(--primary);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ad-result-existing-badge i {
  font-size: 0.7rem;
}

.ad-result-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  margin-right: 14px;
  flex-shrink: 0;
}

.ad-result-info {
  flex: 1;
  min-width: 0;
}

.ad-result-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 2px;
}

.ad-result-email {
  font-size: 0.8rem;
  color: var(--muted);
}

.ad-result-siglum {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
  border-radius: 6px;
  margin-left: 12px;
}

.ad-no-results {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.ad-no-results i {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* Champs readonly (provenant de l'AD) */
.user-form-field input.ad-readonly {
  background: rgba(58, 157, 147, 0.08);
  color: var(--text);
  cursor: not-allowed;
  border-color: rgba(58, 157, 147, 0.3);
}

.user-form-field input.ad-readonly:focus {
  outline: none;
  box-shadow: none;
  border-color: rgba(58, 157, 147, 0.3);
}

/* Indicateur AD */
.ad-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--accent-light);
  background: rgba(58, 157, 147, 0.15);
  padding: 4px 10px;
  border-radius: 6px;
  margin-left: 10px;
}

.ad-source-badge i {
  font-size: 0.7rem;
}

/* Formulaire LDAP dans la modale */
.ldap-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.ldap-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ldap-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.ldap-field input {
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.ldap-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 157, 147, 0.15);
}

.ldap-field input::placeholder {
  color: var(--muted);
}

.user-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.user-form-row:last-of-type {
  margin-bottom: 0;
}

.user-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-form-field label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.user-form-field .required {
  color: var(--danger);
}

.user-form-field input[type="text"],
.user-form-field input[type="email"] {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.95rem;
}

.user-form-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58, 157, 147, 0.15);
}

.user-form-field-role {
  grid-column: span 2;
}

.user-role-options {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.user-role-option {
  cursor: pointer;
}

.user-role-option input {
  display: none;
}

.role-badge {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.role-badge.role-user {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}

.role-badge.role-admin {
  background: rgba(34, 197, 94, 0.15);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.3);
}

.role-badge.role-soc {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.user-role-option input:checked + .role-badge {
  border-width: 2px;
}

.user-role-option input:checked + .role-badge.role-user {
  background: rgba(139, 92, 246, 0.3);
  border-color: #8b5cf6;
}

.user-role-option input:checked + .role-badge.role-admin {
  background: rgba(34, 197, 94, 0.3);
  border-color: var(--success);
}

.user-role-option input:checked + .role-badge.role-soc {
  background: rgba(245, 158, 11, 0.3);
  border-color: var(--warning);
}

.user-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #2dd4bf 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(58, 157, 147, 0.4);
}

/* ============================================================
   USERS LIST
   ============================================================ */
.users-list-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.users-list-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 24px;
  color: var(--muted);
  font-size: 1rem;
}

.users-list-message i {
  font-size: 1.2rem;
}

.users-list {
  display: flex;
  flex-direction: column;
}

.user-card {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.user-card:last-child {
  border-bottom: none;
}

.user-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.6) 0%, rgba(167, 139, 250, 0.6) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  margin-right: 16px;
  flex-shrink: 0;
}

/* Avatar couleurs par rôle (tons pastels) */
.user-avatar.role-superadmin {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.7) 0%, rgba(249, 115, 22, 0.7) 100%);
}

.user-avatar.role-admin {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.6) 0%, rgba(74, 222, 128, 0.6) 100%);
}

.user-avatar.role-soc {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.6) 0%, rgba(251, 191, 36, 0.6) 100%);
}

.user-avatar.role-user {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.6) 0%, rgba(167, 139, 250, 0.6) 100%);
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.user-email {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: 16px;
}

.user-login {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 6px;
}

.user-role-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-role-tag.role-superadmin {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.user-role-tag.role-admin {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.user-role-tag.role-soc {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.user-role-tag.role-user {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

.user-actions {
  display: flex;
  gap: 8px;
}

.user-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.user-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.user-action-btn.edit:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning);
  color: var(--warning);
}

.user-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
  color: var(--danger);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.toast.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.toast.info {
  border-color: var(--info);
  background: rgba(59, 130, 246, 0.1);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 420px;
  overflow: hidden;
  animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header-danger {
  background: rgba(239, 68, 68, 0.1);
  border-bottom-color: rgba(239, 68, 68, 0.3);
}

.modal-header-danger h3 {
  color: #fca5a5;
}

.modal-header-danger h3 i {
  color: var(--danger);
}

.modal-body {
  padding: 24px;
}

.modal-description {
  margin: 0 0 12px 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.modal-description strong {
  color: var(--accent-light);
}

.modal-warning {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-style: italic;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
/* Masquer scrollbar sur html/body */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

html, body {
  scrollbar-width: none;
}

/* Style scrollbar pour les autres éléments */
*:not(html):not(body)::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*:not(html):not(body)::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 5px;
}

*:not(html):not(body)::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
  border: 2px solid var(--bg);
}

*:not(html):not(body)::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Firefox - éléments internes uniquement */
*:not(html):not(body) {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.users-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--panel-darker);
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.pagination-size select {
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.pagination-size select:focus {
  outline: none;
  border-color: var(--accent);
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: rgba(58, 157, 147, 0.1);
  border-color: var(--accent);
  color: var(--accent-light);
}

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

.pagination-current {
  padding: 0 12px;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .app-header {
    padding: 0 16px;
    flex-wrap: wrap;
    height: auto;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .header-center {
    order: 3;
    width: 100%;
    margin-top: 12px;
    justify-content: center;
  }

  .users-stats {
    flex-wrap: wrap;
  }

  .users-stat {
    flex: 1 1 calc(50% - 8px);
    min-width: 120px;
  }

  .users-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .users-search {
    max-width: none;
  }

  .user-form-row {
    grid-template-columns: 1fr;
  }

  .user-form-field-role {
    grid-column: span 1;
  }

  .user-role-options {
    flex-wrap: wrap;
  }

  .user-card {
    flex-wrap: wrap;
    gap: 12px;
  }

  .user-meta {
    width: 100%;
    margin-right: 0;
    justify-content: flex-start;
  }

  .user-actions {
    width: 100%;
    justify-content: flex-end;
  }

  /* Pagination responsive */
  .users-pagination {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .pagination-controls {
    flex-direction: column;
    gap: 12px;
  }

  .pagination-size {
    order: 2;
  }
}
