/* ============================================================
   PRESSING MANAGER CI - Styles principaux
   Thème: Luxury Business | Élégant & Professionnel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  /* Palette principale */
  --primary: #1a6ef7;
  --primary-dark: #1558d1;
  --primary-light: #4a91ff;
  --primary-glow: rgba(26, 110, 247, 0.15);

  --accent: #f7a81a;
  --accent-dark: #d18d10;
  --success: #10c96d;
  --danger: #f7341a;
  --warning: #f7a81a;
  --info: #1ab8f7;
  --purple: #8b5cf6;

  /* Fond & surfaces */
  --bg: #0d1117;
  --bg-2: #161b22;
  --bg-3: #1e2530;
  --bg-4: #252d3a;
  --card: #1a2235;
  --card-border: rgba(255,255,255,0.07);
  --card-hover: #1f2940;

  /* Textes */
  --text: #e6edf3;
  --text-2: #8b949e;
  --text-3: #545d6b;
  --text-accent: #1a6ef7;

  /* Sidebar */
  --sidebar-w: 260px;
  --sidebar-collapsed: 70px;
  --sidebar-bg: #0d1520;

  /* Spacing */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  /* Shadows */
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-glow: 0 0 30px rgba(26,110,247,0.2);

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================ RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 15px; }

body {
  font-family: 'Sora', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img { max-width: 100%; }

/* ============================================================ SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

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

/* ============================================================ SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 1000;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-logo {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 70px;
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(26,110,247,0.4);
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}

.logo-text span { color: var(--primary-light); }
.logo-text small { display: block; font-size: 10px; color: var(--text-3); font-weight: 400; }

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

.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 8px 10px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: var(--transition);
}

.collapsed .nav-section-title { opacity: 0; height: 0; padding: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
  white-space: nowrap;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}

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

.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary-light);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 24px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}

.nav-item .nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}

.nav-item .nav-label { overflow: hidden; }

.nav-item .badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-user:hover { background: rgba(255,255,255,0.05); }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
  color: white;
}

.user-info { flex: 1; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--text-3); }

/* ============================================================ MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded { margin-left: var(--sidebar-collapsed); }

/* ============================================================ TOPBAR */
.topbar {
  height: 70px;
  background: rgba(13,17,23,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0; z-index: 100;
}

.topbar-toggle {
  width: 36px; height: 36px;
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: var(--transition);
  flex-shrink: 0;
}

.topbar-toggle:hover { background: var(--bg-4); color: var(--text); }

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

.topbar-search input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 9px 16px 9px 42px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.topbar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.topbar-search input::placeholder { color: var(--text-3); }

.topbar-search .search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.topbar-btn {
  width: 38px; height: 38px;
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover { background: var(--bg-4); color: var(--text); }

.topbar-btn .notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

/* ============================================================ PAGE CONTENT */
.page-content {
  flex: 1;
  padding: 28px 24px;
}

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

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 2px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.breadcrumb span { color: var(--text-2); }
.breadcrumb .sep { color: var(--text-3); }

/* ============================================================ CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}

.card:hover { border-color: rgba(255,255,255,0.1); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
}

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* STATS CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(20px, -20px);
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--accent); }
.stat-card.red::before { background: var(--danger); }
.stat-card.purple::before { background: var(--purple); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  font-size: 20px;
}

.stat-card.blue .stat-icon { background: rgba(26,110,247,0.15); color: var(--primary-light); }
.stat-card.green .stat-icon { background: rgba(16,201,109,0.15); color: var(--success); }
.stat-card.orange .stat-icon { background: rgba(247,168,26,0.15); color: var(--accent); }
.stat-card.red .stat-icon { background: rgba(247,52,26,0.15); color: var(--danger); }
.stat-card.purple .stat-icon { background: rgba(139,92,246,0.15); color: var(--purple); }

.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-label { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }

.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ============================================================ BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); color: white; box-shadow: 0 4px 15px rgba(26,110,247,0.4); }

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover { opacity: 0.9; }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-warning {
  background: var(--accent);
  color: #000;
}
.btn-warning:hover { opacity: 0.9; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-2);
}
.btn-outline:hover { background: var(--bg-3); color: var(--text); }

.btn-ghost {
  background: var(--bg-3);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-4); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 9px; }
.btn-icon.btn-sm { padding: 6px; }

/* ============================================================ FORMS */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: ' *';
  color: var(--danger);
}

.form-control {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-control::placeholder { color: var(--text-3); }

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

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b949e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  appearance: none;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.input-group {
  position: relative;
}

.input-group .form-control { padding-left: 42px; }
.input-group .input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

/* ============================================================ TABLE */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg-3);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--text);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child td { border-bottom: none; }

/* ============================================================ BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: rgba(26,110,247,0.15); color: var(--primary-light); }
.badge-success { background: rgba(16,201,109,0.15); color: var(--success); }
.badge-danger { background: rgba(247,52,26,0.15); color: var(--danger); }
.badge-warning { background: rgba(247,168,26,0.15); color: var(--accent); }
.badge-info { background: rgba(26,184,247,0.15); color: var(--info); }
.badge-secondary { background: rgba(255,255,255,0.08); color: var(--text-2); }
.badge-purple { background: rgba(139,92,246,0.15); color: var(--purple); }

/* ============================================================ MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-lg { max-width: 900px; }
.modal-sm { max-width: 420px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-3);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  transition: var(--transition);
}

.modal-close:hover { background: var(--danger); color: white; border-color: var(--danger); }

.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
}

/* ============================================================ ALERTS */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success { background: rgba(16,201,109,0.1); border: 1px solid rgba(16,201,109,0.3); color: var(--success); }
.alert-danger { background: rgba(247,52,26,0.1); border: 1px solid rgba(247,52,26,0.3); color: var(--danger); }
.alert-warning { background: rgba(247,168,26,0.1); border: 1px solid rgba(247,168,26,0.3); color: var(--accent); }
.alert-info { background: rgba(26,184,247,0.1); border: 1px solid rgba(26,184,247,0.3); color: var(--info); }

/* ============================================================ TOAST */
#toast-container {
  position: fixed;
  top: 80px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transform: translateX(100px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.toast-message { font-size: 12px; color: var(--text-3); }

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--accent); }
.toast.info .toast-icon { color: var(--info); }

/* ============================================================ PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 0;
}

.pagination-btn {
  min-width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.pagination-btn:hover { background: var(--bg-4); color: var(--text); }
.pagination-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.pagination-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ============================================================ DROPDOWN */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.dropdown-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: var(--transition);
}

.dropdown-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.dropdown-item.danger:hover { background: rgba(247,52,26,0.1); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--card-border); margin: 4px 0; }

/* ============================================================ PROGRESS */
.progress {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ============================================================ TICKET PREVIEW */
.ticket-preview {
  background: white;
  color: #000;
  padding: 20px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  border-radius: var(--radius);
  max-width: 300px;
  margin: 0 auto;
}

.ticket-preview .ticket-header { text-align: center; margin-bottom: 12px; border-bottom: 2px dashed #000; padding-bottom: 10px; }
.ticket-preview .ticket-title { font-size: 16px; font-weight: bold; }
.ticket-preview .ticket-row { display: flex; justify-content: space-between; margin: 4px 0; }
.ticket-preview .ticket-divider { border-top: 1px dashed #000; margin: 8px 0; }
.ticket-preview .ticket-total { font-weight: bold; font-size: 14px; }
.ticket-preview .ticket-footer { text-align: center; margin-top: 12px; font-size: 10px; }

/* ============================================================ EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 { color: var(--text-2); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ============================================================ LOADING */
.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 14px;
}

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

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

.skeleton {
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================ COMMANDE STATUS STEPS */
.status-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 16px 0;
  position: relative;
}

.status-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.status-step::before {
  content: '';
  position: absolute;
  top: 18px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--bg-4);
  z-index: 0;
}

.status-step:first-child::before { display: none; }

.status-step.done::before { background: var(--success); }
.status-step.active::before { background: linear-gradient(90deg, var(--success), var(--primary)); }

.step-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-4);
  border: 2px solid var(--bg-4);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  position: relative;
  z-index: 1;
  transition: var(--transition);
  font-size: 14px;
}

.status-step.done .step-dot { background: var(--success); border-color: var(--success); }
.status-step.active .step-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); }

.step-label { font-size: 11px; color: var(--text-3); font-weight: 500; }
.status-step.done .step-label { color: var(--success); }
.status-step.active .step-label { color: var(--primary-light); }

/* ============================================================ RESPONSIVE */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
  }

  .main-content { margin-left: 0 !important; }

  .topbar { padding: 0 16px; }

  .page-content { padding: 16px; }

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

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

  .modal { max-width: 100%; max-height: 95vh; }

  .page-header { flex-direction: column; align-items: flex-start; }

  .table-wrapper { margin: 0 -16px; border-radius: 0; border-left: none; border-right: none; }

  .topbar-search { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column; }
  .modal-footer .btn { width: 100%; }
}

/* ============================================================ PRINT */
@media print {
  .sidebar, .topbar, .page-header .btn, .btn, .no-print { display: none !important; }
  .main-content { margin: 0; }
  body { background: white; color: black; }
  .card { border: 1px solid #ddd; box-shadow: none; }
}

/* ============================================================ ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease forwards; }

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

.slide-in { animation: slideIn 0.3s ease forwards; }

/* ============================================================ UTILITIES */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.w-full { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-3); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--accent); }
.text-primary { color: var(--primary-light); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.rounded { border-radius: var(--radius); }
.rounded-full { border-radius: 50%; }
.border-t { border-top: 1px solid var(--card-border); }
.p-0 { padding: 0; }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.sidebar-overlay.active { display: block; }
