/* ============================================================
   AS-Performance - Styles principaux
   Design premium dark/light mode
   ============================================================ */

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

/* ── Variables thème sombre (défaut) ── */
:root {
  --font-main: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Couleurs sombres */
  --bg-body:       #0a0e1a;
  --bg-surface:    #111827;
  --bg-surface2:   #1c2333;
  --bg-surface3:   #242d3d;
  --bg-hover:      #2d3748;

  --border:        #2a3347;
  --border-light:  #374151;

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;

  --accent:        #f97316;
  --accent-hover:  #ea6c0a;
  --accent-glow:   rgba(249,115,22,0.15);

  --blue:          #3b82f6;
  --green:         #10b981;
  --yellow:        #f59e0b;
  --red:           #ef4444;
  --purple:        #8b5cf6;
  --cyan:          #06b6d4;

  --sidebar-w:     260px;
  --header-h:      60px;
  --radius:        10px;
  --radius-lg:     16px;
  --shadow:        0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.5);
  --transition:    0.2s ease;
}

/* ── Thème clair ── */
[data-theme="light"] {
  --bg-body:       #f1f5f9;
  --bg-surface:    #ffffff;
  --bg-surface2:   #f8fafc;
  --bg-surface3:   #f1f5f9;
  --bg-hover:      #e2e8f0;
  --border:        #e2e8f0;
  --border-light:  #cbd5e1;
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --accent-glow:   rgba(249,115,22,0.08);
  --shadow:        0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg:     0 8px 24px rgba(0,0,0,0.12);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition), width var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--accent), #dc2626);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: white;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(249,115,22,0.4);
}

.sidebar-logo .logo-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.sidebar-logo .logo-text small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-section {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  margin: 1px 8px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  margin-left: -8px;
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ── Header / Topbar ── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 999;
}

.topbar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--bg-surface2);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  text-decoration: none;
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.topbar-btn .badge-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-primary);
  text-decoration: none;
}
.user-menu:hover { background: var(--bg-hover); color: var(--text-primary); }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
}
.user-info { font-size: 12.5px; }
.user-info .name { font-weight: 600; line-height: 1.2; }
.user-info .role { color: var(--text-muted); font-size: 11px; }

/* ── Main content ── */
.main-content {
  margin-left: var(--sidebar-w);
  padding-top: var(--header-h);
  min-height: 100vh;
}

.page-content {
  padding: 24px;
  max-width: 1600px;
}

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-title .icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--accent-glow);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 16px;
}
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Cards ── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex; align-items: center; gap: 8px;
}

/* ── Stat cards (dashboard) ── */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--stat-color, var(--accent));
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--stat-color, var(--accent)) 15%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--stat-color, var(--accent));
  flex-shrink: 0;
}
.stat-info { flex: 1; min-width: 0; }
.stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.stat-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.stat-trend.up { color: var(--green); background: rgba(16,185,129,0.12); }
.stat-trend.down { color: var(--red); background: rgba(239,68,68,0.12); }

/* ── Boutons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

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

.btn-secondary { background: var(--bg-surface2); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-hover); }

.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #0ea371; color: white; }

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }

.btn-warning { background: var(--yellow); color: #1a1a1a; }
.btn-warning:hover { background: #d97706; }

.btn-info { background: var(--cyan); color: white; }
.btn-info:hover { background: #0891b2; color: white; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 8px; }

/* ── Formulaires ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-label .required { color: var(--red); margin-left: 2px; }

.form-control, .form-select {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-main);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: var(--bg-surface);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { opacity: 0.6; cursor: not-allowed; }

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select option { background: var(--bg-surface); }

.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .form-control { border-radius: 8px 0 0 8px; flex: 1; }
.input-group .btn { border-radius: 0 8px 8px 0; flex-shrink: 0; }
.input-group-text {
  padding: 9px 12px;
  background: var(--bg-surface3);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text-muted);
  border-radius: 8px 0 0 8px;
  font-size: 14px;
  display: flex; align-items: center;
}

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.invalid-feedback { color: var(--red); font-size: 12px; margin-top: 4px; display: block; }
.is-invalid { border-color: var(--red) !important; }

/* ── Tableaux ── */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  background: var(--bg-surface2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-hover); }
.table-striped tbody tr:nth-child(even) { background: var(--bg-surface2); }

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

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.badge-primary   { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.badge-success   { background: rgba(16,185,129,0.15);  color: #34d399; }
.badge-warning   { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.badge-danger    { background: rgba(239,68,68,0.15);   color: #f87171; }
.badge-info      { background: rgba(6,182,212,0.15);   color: #22d3ee; }
.badge-secondary { background: rgba(148,163,184,0.15); color: #94a3b8; }
.badge-orange    { background: rgba(249,115,22,0.15);  color: #fb923c; }

/* ── Alertes ── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #34d399; }
.alert-danger   { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: #f87171; }
.alert-warning  { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: #fbbf24; }
.alert-info     { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }

/* ── Modals ── */
.modal-backdrop {
  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: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-backdrop.show { opacity: 1; }
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px);
  transition: transform 0.2s;
}
.modal-backdrop.show .modal-box { transform: translateY(0); }
.modal-box.modal-lg { max-width: 800px; }
.modal-box.modal-xl { max-width: 1100px; }
.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; margin: 0; }
.modal-close {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: none;
  background: var(--bg-surface2);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
  flex-shrink: 0;
}

/* ── Dropdown ── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  padding: 6px;
  display: none;
}
.dropdown-menu.show { display: block; animation: fadeDown 0.15s ease; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: rgba(239,68,68,0.1); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 0; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  top: 70px; right: 16px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  min-width: 280px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  border-left: 4px solid currentColor;
}
.toast-success { background: var(--bg-surface); color: var(--green); }
.toast-error   { background: var(--bg-surface); color: var(--red); }
.toast-warning { background: var(--bg-surface); color: var(--yellow); }
.toast-info    { background: var(--bg-surface); color: var(--blue); }

/* ── Grille responsive ── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ── Utilitaires ── */
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-1 { flex: 1; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted) !important; }
.text-success { color: var(--green) !important; }
.text-danger { color: var(--red) !important; }
.text-warning { color: var(--yellow) !important; }
.text-accent { color: var(--accent) !important; }
.fw-bold { font-weight: 700; }
.fw-medium { font-weight: 500; }
.fs-sm { font-size: 12px; }
.fs-xs { font-size: 11px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
.p-0 { padding: 0; }
.hidden { display: none !important; }
.w-100 { width: 100%; }

/* ── Séparateur ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── Loader ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.loading-overlay {
  position: absolute; inset: 0;
  background: rgba(var(--bg-body-rgb, 10,14,26), 0.8);
  display: flex; align-items: center; justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text-primary); font-weight: 500; }

/* ── Notification dropdown ── */
.notif-dropdown {
  min-width: 340px;
  max-height: 420px;
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  transition: background var(--transition);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: var(--accent-glow); }
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 4px;
  flex-shrink: 0;
}
.notif-content .notif-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-content .notif-msg { font-size: 12px; color: var(--text-muted); }
.notif-content .notif-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Search bar ── */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 400px;
}
.search-bar input {
  padding-left: 38px;
  background: var(--bg-surface2);
}
.search-bar .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
  display: none;
}
.search-results.show { display: block; }
.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg-hover); }

/* ── Planning colors ── */
.event-en_attente  { --event-color: var(--yellow); }
.event-confirme    { --event-color: var(--blue); }
.event-en_cours    { --event-color: var(--accent); }
.event-termine     { --event-color: var(--green); }
.event-annule      { --event-color: var(--text-muted); }

.calendar-event {
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  background: color-mix(in srgb, var(--event-color) 20%, transparent);
  border-left: 3px solid var(--event-color);
  color: var(--event-color);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.calendar-event:hover {
  background: color-mix(in srgb, var(--event-color) 30%, transparent);
  transform: scale(1.01);
}

/* ── Progress bar ── */
.progress {
  height: 6px;
  background: var(--bg-surface3);
  border-radius: 10px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: 10px;
  background: var(--accent);
  transition: width 0.6s ease;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Animations ── */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s infinite; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state .empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state .empty-msg {
  font-size: 13px;
  margin-bottom: 20px;
}

/* ── Login page ── */
.login-page {
  min-height: 100vh;
  background: var(--bg-body);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(249,115,22,0.08) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
  bottom: -150px; left: -100px;
  pointer-events: none;
}
.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo .logo-big {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--accent), #dc2626);
  border-radius: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: white;
  box-shadow: 0 8px 24px rgba(249,115,22,0.4);
  margin-bottom: 16px;
}
.login-logo h1 {
  font-size: 22px; font-weight: 800;
  margin: 0 0 4px;
}
.login-logo p { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ── Responsive ── */
@media (max-width: 1200px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 992px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.open { transform: translateX(0); }
  .topbar, .main-content { left: 0 !important; margin-left: 0 !important; }
  .topbar-toggle { display: flex !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
  }
  .sidebar-overlay.show { display: block; }
}
@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .table-container { overflow-x: auto; }
  .modal-box { margin: 10px; max-height: 95vh; }
  .login-card { padding: 28px 20px; }
}

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