/* variables.css - Palette de couleurs moderne */
:root {
  /* Couleurs principales */
  --primary: #4361ee;
  --primary-focus: #3a56d4;
  --primary-lighter: #7b94ff;
  --primary-rgb: 67, 97, 238;
  --secondary: #6c757d;
  --accent: #ff9800;
  --success: #2ecc71;
  --warning: #f1c40f;
  --error: #e74c3c;
  --info: #3498db;
  
  /* Neutres */
  --neutral-50: #f8f9fa;
  --neutral-100: #f1f3f5;
  --neutral-200: #e9ecef;
  --neutral-300: #dee2e6;
  --neutral-400: #ced4da;
  --neutral-500: #adb5bd;
  --neutral-600: #6c757d;
  --neutral-700: #495057;
  --neutral-800: #343a40;
  --neutral-900: #212529;
  
  /* Ombres */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 16px 24px rgba(0, 0, 0, 0.1);
  
  /* Espacements */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  
  /* Arrondis */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* === STYLES GÉNÉRAUX === */
body {
  background-color: var(--neutral-100);
  color: var(--neutral-800);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-focus);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--neutral-900);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* === BARRE LATÉRALE === */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  width: 280px;
  background-color: white;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal);
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  padding: var(--space-6) var(--space-6);
  background: linear-gradient(135deg, var(--primary), var(--primary-focus));
  color: white;
}

.sidebar-header h3 {
  margin-bottom: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: white;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-6);
  color: var(--neutral-700);
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.sidebar .nav-link:hover {
  color: var(--primary);
  background-color: var(--neutral-50);
}

.sidebar .nav-link.active {
  color: var(--primary);
  background-color: var(--neutral-100);
  border-left-color: var(--primary);
}

.sidebar .nav-link i {
  margin-right: var(--space-3);
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  transition: transform var(--transition-fast);
}

.sidebar .nav-link:hover i {
  transform: translateX(2px);
}

.main-content {
  margin-left: 280px;
  padding: 0;
  min-height: 100vh;
  transition: margin var(--transition-normal);
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
    z-index: 1040;
  }
  
  .main-content {
    margin-left: 0;
  }
}

/* === NAVBAR === */
.navbar {
  background-color: white;
  box-shadow: var(--shadow-sm);
  z-index: 50;
  padding: 0.75rem 1.5rem;
}

.navbar-toggler {
  border: none;
  padding: 0.25rem;
  font-size: 1.25rem;
  color: var(--neutral-700);
  border-radius: var(--radius-md);
}

.navbar-toggler:focus {
  box-shadow: none;
}

.nav-item .dropdown-toggle::after {
  margin-left: 0.5rem;
}

.dropdown-menu {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  padding: 0.5rem 0;
}

.dropdown-item {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
}

.dropdown-item:hover {
  background-color: var(--neutral-100);
  color: var(--primary);
}

.dropdown-item i {
  margin-right: 0.5rem;
  color: var(--neutral-500);
}

/* === CONTENT WRAPPER === */
.content-wrapper {
  padding: var(--space-6);
}

/* === ALERTES ET NOTIFICATIONS === */
.alert {
  position: relative;
  padding: var(--space-4) var(--space-6);
  margin-bottom: var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.3s;
}

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

.alert-success {
  background-color: rgba(46, 204, 113, 0.1);
  color: #1e8449;
  border-left: 4px solid var(--success);
}

.alert-info {
  background-color: rgba(52, 152, 219, 0.1);
  color: #2574a9;
  border-left: 4px solid var(--info);
}

.alert-warning {
  background-color: rgba(241, 196, 15, 0.1);
  color: #b7950b;
  border-left: 4px solid var(--warning);
}

.alert-danger {
  background-color: rgba(231, 76, 60, 0.1);
  color: #a93226;
  border-left: 4px solid var(--error);
}

/* === CARDS === */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal);
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  background-color: white;
  border-bottom: 1px solid var(--neutral-200);
  padding: 1rem 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

/* === STATISTIQUES CARDS === */
.stat-card {
  display: flex;
  align-items: center;
  padding: var(--space-6);
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  overflow: hidden;
  height: 100%;
  position: relative;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-card .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-right: var(--space-4);
  background: linear-gradient(135deg, var(--primary-lighter), var(--primary));
  color: white;
  font-size: 1.5rem;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: var(--space-1);
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === TABLEAUX === */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--neutral-800);
  vertical-align: middle;
  border-color: var(--neutral-200);
}

.table > :not(:first-child) {
  border-top: 1px solid var(--neutral-200);
}

.table th {
  font-weight: 600;
  color: var(--neutral-700);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.table td, .table th {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}

.table-hover tbody tr {
  transition: background-color var(--transition-fast);
}

.table-hover tbody tr:hover {
  background-color: rgba(var(--primary-rgb), 0.05);
}

.table .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* === BOUTONS === */
.btn {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:active::after {
  opacity: 0.4;
  transform: scale(20, 20) translate(-50%, -50%);
  transition: transform 0.5s, opacity 1s;
}

.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: var(--primary-focus);
  border-color: var(--primary-focus);
  box-shadow: 0 6px 15px rgba(var(--primary-rgb), 0.3);
}

.btn-success {
  background-color: var(--success);
  border-color: var(--success);
  box-shadow: 0 4px 10px rgba(46, 204, 113, 0.2);
}

.btn-success:hover, .btn-success:focus {
  background-color: #27ae60;
  border-color: #27ae60;
  box-shadow: 0 6px 15px rgba(46, 204, 113, 0.3);
}

.btn-danger {
  background-color: var(--error);
  border-color: var(--error);
  box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2);
}

.btn-danger:hover, .btn-danger:focus {
  background-color: #c0392b;
  border-color: #c0392b;
  box-shadow: 0 6px 15px rgba(231, 76, 60, 0.3);
}

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}

.btn-outline-danger {
  color: var(--error);
  border-color: var(--error);
}

.btn-outline-danger:hover {
  background-color: var(--error);
  border-color: var(--error);
  box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2);
}

.btn-sm {
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  border-radius: var(--radius-lg);
}

.btn-rounded {
  border-radius: 50px;
}

/* === FORMULAIRES === */
.form-label {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--neutral-700);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.875rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--neutral-800);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: var(--neutral-800);
  background-color: #fff;
  border-color: var(--primary-lighter);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.5rem 2.25rem 0.5rem 0.875rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--neutral-800);
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  appearance: none;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select:focus {
  border-color: var(--primary-lighter);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.input-group > .form-control,
.input-group > .form-select {
  position: relative;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--neutral-700);
  text-align: center;
  white-space: nowrap;
  background-color: var(--neutral-100);
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
}

/* === MODAL === */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--neutral-200);
}

.modal-title {
  font-weight: 600;
  font-size: 1.1rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--neutral-200);
}

/* === ÉTATS VIDES === */
.empty-state {
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.empty-icon {
  font-size: 4rem;
  color: var(--neutral-300);
  margin-bottom: 1.5rem;
}

/* === SELECT2 === */
.select2-container {
  width: 100% !important;
}

.select2-container--default .select2-selection--single {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  height: auto;
  min-height: 38px;
  padding: 0.25rem 0.5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--default .select2-selection--single:hover {
  border-color: var(--primary-lighter);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--primary-lighter);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--neutral-800);
  line-height: 1.5;
  padding-left: 0.25rem;
  font-size: 0.95rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px;
}

.select2-dropdown {
  border-color: var(--primary-lighter);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-md);
  padding: 0.5rem;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--primary-lighter);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--primary);
}

/* === LOGIN === */
.login-container {
  max-width: 450px;
  margin: 3rem auto;
  background-color: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  overflow: hidden;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo h2 {
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.login-form .btn {
  padding: 0.75rem 0;
  width: 100%;
  font-weight: 600;
  margin-top: 0.5rem;
}

/* === AUTRES UTILITAIRES === */
.badge {
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.badge-success {
  background-color: var(--success);
}

.badge-warning {
  background-color: var(--warning);
  color: var(--neutral-800);
}

.badge-danger {
  background-color: var(--error);
}

.badge-info {
  background-color: var(--info);
}

.text-muted {
  color: var(--neutral-500) !important;
}

.text-primary {
  color: var(--primary) !important;
}

.text-success {
  color: var(--success) !important;
}

.text-warning {
  color: var(--warning) !important;
}

.text-danger {
  color: var(--error) !important;
}

.bg-light {
  background-color: var(--neutral-100) !important;
}

.bg-primary {
  background-color: var(--primary) !important;
}

.bg-success {
  background-color: var(--success) !important;
}

.bg-warning {
  background-color: var(--warning) !important;
}

.bg-danger {
  background-color: var(--error) !important;
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
  .content-wrapper {
    padding: var(--space-4);
  }
  
  .navbar-toggler {
    display: block;
  }
}

@media (max-width: 768px) {
  .stat-card {
    margin-bottom: var(--space-4);
  }
  
  .table td, 
  .table th {
    padding: 0.75rem;
  }
  
  .btn {
    padding: 0.4rem 0.8rem;
  }
}

@media (max-width: 576px) {
  .content-wrapper {
    padding: var(--space-3);
  }
  
  .modal-header, 
  .modal-body, 
  .modal-footer {
    padding: 1rem;
  }
  
  .login-container {
    padding: 1.5rem;
    margin: 1.5rem auto;
  }
}