/**
 * public/css/style.css
 * ========================================
 * AURA - Plateforme SaaS Vendeurs
 * Style Principal
 * ========================================
 * Palette:
 * - #253337 : Fond principal / Sidebar
 * - #5C6C73 : Textes secondaires
 * - #9DB5C0 : Éléments UI
 * - #C2E0E3 : Surfaces / Cartes
 * - #E0FCFC : Accents / Hover
 * ========================================
 */

/* ========================================
   RESET & BASE
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #253337;
  --color-secondary: #5C6C73;
  --color-tertiary: #9DB5C0;
  --color-surface: #C2E0E3;
  --color-accent: #E0FCFC;
  --color-white: #FFFFFF;
  --color-success: #4CAF50;
  --color-warning: #FF9800;
  --color-error: #F44336;
  --color-info: #2196F3;
  
  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 8px rgba(37, 51, 55, 0.08);
  --shadow-md: 0 4px 16px rgba(37, 51, 55, 0.12);
  --shadow-lg: 0 8px 24px rgba(37, 51, 55, 0.16);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-primary);
  background: #F5F7F9;
  overflow-x: visible;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-primary);
  color: var(--color-white);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
}

.sidebar-logo {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-surface));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 24px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section {
  margin-bottom: 32px;
}

.nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-tertiary);
  padding: 0 24px;
  margin-bottom: 12px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--color-surface);
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--color-accent);
  transform: scaleY(0);
  transition: var(--transition);
}

.nav-item:hover {
  background: rgba(224, 252, 252, 0.08);
  color: var(--color-accent);
}

.nav-item.active {
  background: rgba(224, 252, 252, 0.12);
  color: var(--color-accent);
  font-weight: 600;
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-icon {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  opacity: 0.9;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 12px;
  color: var(--color-tertiary);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
  position: relative;
  z-index: 1;
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
}

/* ========================================
   HEADER
   ======================================== */
.header {
  height: var(--header-height);
  background: var(--color-white);
  border-bottom: 1px solid rgba(37, 51, 55, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 32px);
  position: sticky; 
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-title {
  font-size: clamp(18px, 5vw, 24px);
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-notification {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  flex-shrink: 0;
}

.header-notification:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--color-error);
  color: var(--color-white);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-white);
}

/* ========================================
   CONTENT AREA
   ======================================== */
.content {
  flex: 1;
  padding: clamp(16px, 4vw, 32px);
}

.page-header {
  margin-bottom: clamp(20px, 4vw, 32px);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: clamp(14px, 3vw, 16px);
  color: var(--color-secondary);
}

/* ========================================
   STATS CARDS - Responsive Grid
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 3vw, 24px);
  margin-bottom: clamp(20px, 4vw, 32px);
}

.stat-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid transparent;
  min-width: 0;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.stat-label {
  font-size: clamp(12px, 2.5vw, 14px);
  color: var(--color-secondary);
  font-weight: 500;
}

.stat-icon {
  width: clamp(32px, 8vw, 40px);
  height: clamp(32px, 8vw, 40px);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  color: var(--color-primary);
  flex-shrink: 0;
}

.stat-value {
  font-size: clamp(24px, 6vw, 32px);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  word-break: break-word;
}

.stat-change {
  font-size: clamp(11px, 2.5vw, 13px);
  font-weight: 600;
}

.stat-change.positive {
  color: var(--color-success);
}

.stat-change.negative {
  color: var(--color-error);
}

/* ========================================
   CARDS
   ======================================== */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: clamp(16px, 3vw, 24px);
  box-shadow: var(--shadow-sm);
  margin-bottom: clamp(16px, 3vw, 24px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(16px, 3vw, 24px);
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(37, 51, 55, 0.08);
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 700;
  color: var(--color-primary);
}

.card-action {
  font-size: clamp(12px, 3vw, 14px);
  color: var(--color-tertiary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}

.card-action:hover {
  color: var(--color-primary);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 12px) clamp(16px, 3vw, 24px);
  border-radius: var(--radius-sm);
  font-size: clamp(13px, 2.5vw, 14px);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-accent);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

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

.btn-danger:hover {
  background: #d32f2f;
  transform: translateY(-2px);
}

.btn-sm {
  padding: clamp(6px, 1.5vw, 8px) clamp(12px, 2.5vw, 16px);
  font-size: clamp(11px, 2vw, 13px);
}

.btn-lg {
  padding: clamp(14px, 3vw, 16px) clamp(24px, 5vw, 32px);
  font-size: clamp(14px, 3vw, 16px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
  margin-bottom: clamp(16px, 3vw, 24px);
}

.form-label {
  display: block;
  font-size: clamp(13px, 2.5vw, 14px);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.form-label.required::after {
  content: '*';
  color: var(--color-error);
  margin-left: 4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: clamp(10px, 2vw, 12px) clamp(12px, 2.5vw, 16px);
  font-size: clamp(13px, 2.5vw, 14px);
  color: var(--color-primary);
  background: var(--color-white);
  border: 2px solid var(--color-surface);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(224, 252, 252, 0.2);
}

.form-input::placeholder {
  color: var(--color-tertiary);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-help {
  font-size: clamp(11px, 2vw, 13px);
  color: var(--color-secondary);
  margin-top: 6px;
}

.form-error {
  font-size: clamp(11px, 2vw, 13px);
  color: var(--color-error);
  margin-top: 6px;
  font-weight: 500;
}

.form-input.error {
  border-color: var(--color-error);
}

/* ========================================
   TABLE - Responsive
   ======================================== */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: var(--color-white);
}

.table thead {
  background: var(--color-surface);
}

.table th {
  padding: clamp(12px, 2.5vw, 16px);
  text-align: left;
  font-size: clamp(11px, 2vw, 13px);
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.table td {
  padding: clamp(12px, 2.5vw, 16px);
  border-top: 1px solid rgba(37, 51, 55, 0.06);
  font-size: clamp(12px, 2.5vw, 14px);
  color: var(--color-primary);
}

.table tbody tr {
  transition: var(--transition);
}

.table tbody tr:hover {
  background: rgba(224, 252, 252, 0.2);
}

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

.table-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: var(--color-surface);
  color: var(--color-primary);
  flex-shrink: 0;
}

.table-action-btn:hover {
  background: var(--color-accent);
  transform: scale(1.1);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: clamp(4px, 1vw, 6px) clamp(8px, 2vw, 12px);
  border-radius: 100px;
  font-size: clamp(10px, 2vw, 12px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-success {
  background: rgba(76, 175, 80, 0.15);
  color: var(--color-success);
}

.badge-warning {
  background: rgba(255, 152, 0, 0.15);
  color: var(--color-warning);
}

.badge-error {
  background: rgba(244, 67, 54, 0.15);
  color: var(--color-error);
}

.badge-info {
  background: rgba(33, 150, 243, 0.15);
  color: var(--color-info);
}

.badge-neutral {
  background: var(--color-surface);
  color: var(--color-primary);
}

/* ========================================
   MODAL - Responsive
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(37, 51, 55, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: min(90vw, 600px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: clamp(16px, 3vw, 24px);
  border-bottom: 1px solid rgba(37, 51, 55, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 700;
  color: var(--color-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-surface);
  color: var(--color-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--color-error);
  color: var(--color-white);
  transform: rotate(90deg);
}

.modal-body {
  padding: clamp(16px, 3vw, 24px);
}

.modal-footer {
  padding: clamp(16px, 3vw, 24px);
  border-top: 1px solid rgba(37, 51, 55, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.category-filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--custom-primary, #253337);
  background: white;
  color: var(--custom-primary, #253337);
  border-radius: 100px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.category-filter-btn:hover {
  background: var(--custom-primary, #253337);
  color: white;
  transform: translateY(-2px);
}

.category-filter-btn.active {
  background: var(--custom-primary, #253337);
  color: white;
}

@media (max-width: 768px) {
  .category-filter-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* 
  Ajoutez ces styles dans votre fichier CSS principal (public/css/style.css)
  ou directement dans categories.ejs dans une balise <style>
*/

/* ========================================
   STYLES POUR LA PAGE CATÉGORIES
   ======================================== */

.category-item {
  padding: 20px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  border: 2px solid transparent;
}

.category-item:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-drag-handle {
  cursor: grab;
  color: var(--color-secondary);
  font-size: 24px;
  padding: 8px;
  user-select: none;
}

.category-drag-handle:active {
  cursor: grabbing;
}

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

.category-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.category-description {
  font-size: 14px;
  color: var(--color-secondary);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-stats {
  font-size: 13px;
  color: var(--color-tertiary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.category-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.category-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* États vides */
.empty-categories {
  text-align: center;
  padding: 80px 24px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
}

.empty-categories-icon {
  font-size: 80px;
  margin-bottom: 24px;
  opacity: 0.8;
}

.empty-categories-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.empty-categories-text {
  font-size: 16px;
  color: var(--color-secondary);
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* Badge compteur */
.category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-accent);
  color: var(--color-primary);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

/* Responsive */
@media (max-width: 768px) {
  .category-item {
    flex-wrap: wrap;
    padding: 16px;
  }

  .category-drag-handle {
    display: none;
  }

  .category-actions {
    width: 100%;
    justify-content: stretch;
  }

  .category-actions button {
    flex: 1;
  }

  .empty-categories {
    padding: 48px 16px;
  }

  .empty-categories-icon {
    font-size: 64px;
  }

  .empty-categories-title {
    font-size: 20px;
  }
}

/* Animation d'apparition */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-item {
  animation: fadeInUp 0.3s ease-out;
}

.category-item:nth-child(1) { animation-delay: 0.05s; }
.category-item:nth-child(2) { animation-delay: 0.1s; }
.category-item:nth-child(3) { animation-delay: 0.15s; }
.category-item:nth-child(4) { animation-delay: 0.2s; }
.category-item:nth-child(5) { animation-delay: 0.25s; }

/* ========================================
   NOTIFICATIONS
   ======================================== */
.notification-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: calc(100vw - 48px);
}

.notification {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(320px, calc(100vw - 48px));
  max-width: 400px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  border-left-color: var(--color-success);
}

.notification.error {
  border-left-color: var(--color-error);
}

.notification.info {
  border-left-color: var(--color-info);
}

.notification.warning {
  border-left-color: var(--color-warning);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: clamp(12px, 2.5vw, 14px);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.notification-message {
  font-size: clamp(11px, 2vw, 13px);
  color: var(--color-secondary);
  word-break: break-word;
}

/* ========================================
   LOADER
   ======================================== */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  backdrop-filter: blur(4px);
}

.loader {
  width: 50px;
  height: 50px;
  border: 4px solid var(--color-surface);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
  text-align: center;
  padding: clamp(32px, 8vw, 64px) clamp(16px, 4vw, 32px);
}

.empty-state-icon {
  width: clamp(80px, 20vw, 120px);
  height: clamp(80px, 20vw, 120px);
  margin: 0 auto 24px;
  opacity: 0.3;
}

.empty-state-title {
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: clamp(12px, 3vw, 14px);
  color: var(--color-secondary);
  margin-bottom: 24px;
}

/* ========================================
   AUTH PAGES
   ======================================== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  padding: clamp(16px, 4vw, 24px);
}

.auth-box {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 6vw, 48px);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: clamp(24px, 5vw, 32px);
}

.auth-logo h1 {
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 700;
  letter-spacing: 3px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: clamp(12px, 3vw, 14px);
  color: var(--color-secondary);
}

.auth-divider {
  text-align: center;
  margin: 24px 0;
  position: relative;
}

.auth-divider::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background: var(--color-surface);
}

.auth-divider span {
  background: var(--color-white);
  padding: 0 16px;
  position: relative;
  font-size: clamp(11px, 2.5vw, 13px);
  color: var(--color-secondary);
}

.auth-link {
  text-align: center;
  margin-top: 24px;
  font-size: clamp(12px, 3vw, 14px);
  color: var(--color-secondary);
}

.auth-link a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.auth-link a:hover {
  color: var(--color-accent);
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center {
  text-align: center;
}

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

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex {
  display: flex;
}

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

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full {
  width: 100%;
}

.hidden {
  display: none;
}
.grille2{
  display: grid; 
  grid-template-columns: 2fr 1fr; 
  gap: 24px; 
  margin-bottom: 24px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ========================================
   RESPONSIVE - OPTIMISATIONS COMPLÈTES
   ======================================== */

/* Tablettes et moins (≤ 900px) */
@media (max-width: 900px) {
  :root {
    --sidebar-width: 260px;
    --header-height: 60px;
  }

  /* Sidebar en off-canvas */
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  /* Overlay pour fermer la sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Main content occupe toute la largeur */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Header adaptatif */
  .header {
    padding: 0 16px;
  }

  /* Menu mobile visible */
  #mobileMenuBtn {
    display: flex !important;
  }

  /* Content padding réduit */
  .content {
    padding: 16px;
  }

  /* Stats grid une seule colonne sur mobile étroit */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .grille2,
  .form-grid-2 {
    grid-template-columns: 1fr;
  }

  /* Page header stack */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Modals full width sur mobile */
  .modal {
    max-width: 95vw;
    max-height: calc(100vh - 16px);
  }

  /* Footer modal stack */
  .modal-footer {
    flex-direction: column-reverse;
  }

  .modal-footer .btn {
    width: 100%;
  }

  /* Notifications repositionnées */
  .notification-container {
    top: 16px;
    right: 16px;
    left: 16px;
  }
}

/* Mobile (≤ 480px) */
@media (max-width: 480px) {
  /* Typography réduite */
  .page-title {
    font-size: 20px;
  }

  .page-subtitle {
    font-size: 13px;
  }

  /* Cartes padding réduit */
  .card {
    padding: 12px;
  }

  /* Stat cards compacts */
  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 20px;
  }

  /* Buttons full width sur très petit écran */
  .btn {
    width: 100%;
    justify-content: center;
  }

  /* Tables scroll horizontal */
  .table {
    min-width: 600px;
  }

  .table th,
  .table td {
    padding: 8px;
    font-size: 11px;
  }

  /* Auth box padding réduit */
  .auth-box {
    padding: 24px 16px;
  }

  /* Form inputs plus compacts */
  .form-input,
  .form-select,
  .form-textarea {
    padding: 10px 12px;
  }

  /* Modal plus compact */
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }

  .cardOrders {
    width: 90vw;
  }
}

/* Très petits écrans (≤ 360px) */
@media (max-width: 360px) {
  .sidebar {
    width: 240px;
  }

  .sidebar.active::after {
    left: 240px;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
  }

  .header-notification {
    width: 36px;
    height: 36px;
  }

  .table-action-btn {
    width: 28px;
    height: 28px;
  }
}

/* Tablettes paysage (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }
}

/* Desktop (≥ 1280px) */
@media (min-width: 1280px) {
  .content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 48px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Print styles */
@media print {
  .sidebar,
  .header,
  .btn,
  .modal-overlay,
  .notification-container {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .content {
    padding: 0;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Accessibilité - focus visible */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Amélioration des performances d'animation */
.sidebar,
.modal,
.notification,
.stat-card {
  will-change: transform;
}

/* Correction overflow horizontal global */
body,
html {
  overflow-x: visible;
  max-width: 100vw;
}

::-webkit-scrollbar {
  width: 11px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-primary);
  border-radius: 10px;
}

::-webkit-scrollbar-track {
  background-color: var(--color-accent) ;
}