/* ============================================================
   UDSHED — Espace Étudiant
   Design system : Bleu Universitaire / Émeraude / Or
   Organisé : tokens → base → composants → layout → pages → responsive
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Couleurs de marque UDSHED (inspirées du logo universitaire) */
  --brand-navy: #0B1D3A;        /* Bleu marine profond */
  --brand-navy-light: #132A4E;  /* Marine éclairci */
  --brand-blue: #1E40AF;        /* Bleu principal */
  --brand-blue-light: #3B82F6;  /* Bleu clair */
  --brand-emerald: #059669;     /* Émeraude réussite */
  --brand-emerald-light: #10B981;
  --brand-gold: #D4A843;        /* Or excellence */
  --brand-gold-light: #F59E0B;

  /* Palettes d'interface */
  --bg-page: #F0F3F8;
  --bg-card: #FFFFFF;
  --bg-sidebar: var(--brand-navy);
  --bg-sidebar-hover: rgba(255,255,255,0.08);
  --bg-sidebar-active: var(--brand-blue);
  --bg-table-header: #F1F5F9;
  --bg-input: #FFFFFF;
  --bg-badge: #EFF6FF;
  --bg-alert: #FEF3C7;
  --bg-subtle: #F8FAFC;
  --bg-success: #ECFDF5;
  --bg-warning: #FFFAEB;

  /* Textes */
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-white: #FFFFFF;
  --text-on-dark: rgba(255,255,255,0.85);
  --text-brand: var(--brand-blue);

  /* Bordures */
  --border-color: #E2E8F0;
  --border-input: #CBD5E1;
  --separator: #F1F5F9;

  /* Boutons */
  --btn-primary: var(--brand-blue);
  --btn-primary-hover: #1D4ED8;
  --btn-primary-active: #1E3A8A;
  --btn-secondary-bg: transparent;
  --btn-secondary-border: var(--brand-blue);
  --btn-secondary-color: var(--brand-blue);
  --btn-secondary-hover: var(--brand-blue);
  --btn-secondary-hover-color: var(--text-white);

  /* États */
  --focus-ring: 0 0 0 3px rgba(30,64,175,0.25);

  /* Radii */
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 68px;
  --content-pad: 32px;

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 12px -2px rgba(15,23,42,0.08);
  --shadow-lg: 0 12px 32px -8px rgba(15,23,42,0.12);
  --shadow-xl: 0 20px 48px -12px rgba(15,23,42,0.18);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--text-primary);
  color: var(--text-white);
}

a {
  color: inherit;
}

/* ---------- Typographie ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-white { color: var(--text-white); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ============================================================
   COMPOSANTS
   ============================================================ */

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease),
              border-color 0.15s var(--ease), box-shadow 0.15s var(--ease),
              transform 0.05s var(--ease);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--btn-primary) 0%, #2563EB 100%);
  color: var(--text-white);
  border-color: var(--btn-primary);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--btn-primary-hover) 0%, var(--btn-primary) 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-color);
  border-color: var(--btn-secondary-border);
}
.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  color: var(--btn-secondary-hover-color);
  border-color: var(--btn-secondary-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-badge);
  color: var(--text-primary);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn-dark {
  background: var(--text-primary);
  color: var(--text-white);
  border-color: var(--text-primary);
}
.btn-dark:hover {
  background: #000;
}

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Champs de formulaire ---------- */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 10px 13px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  height: 42px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

textarea.form-control {
  height: auto;
  resize: vertical;
}

.form-control:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(26,26,26,0.10);
}

.form-control::placeholder { color: var(--text-light); }

.form-control[readonly] {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: default;
}

select.form-control {
  appearance: none;
  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='%235F6672' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-blue);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--separator);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
  color: var(--text-white);
  border-radius: var(--radius-full);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(30,64,175,0.2);
}

.badge-soft {
  background: var(--bg-badge);
  border: 1px solid var(--brand-blue);
  color: var(--brand-blue);
  font-weight: 500;
}

.badge-solid {
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
  color: var(--text-white);
}

.badge-success {
  background: linear-gradient(135deg, var(--brand-emerald) 0%, var(--brand-emerald-light) 100%);
  color: var(--text-white);
}
.badge-warning {
  background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-light) 100%);
  color: #1A1A1A;
}
.badge-danger {
  background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
  color: var(--text-white);
}

/* ---------- Tables ---------- */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

table { width: 100%; border-collapse: collapse; }

thead th {
  background: linear-gradient(90deg, var(--bg-table-header) 0%, #EFF6FF 100%);
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 2px solid var(--brand-blue);
}

tbody td {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--separator);
  transition: background 0.15s var(--ease);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-subtle); }

/* ---------- Alertes ---------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  background: linear-gradient(90deg, var(--bg-alert) 0%, #FEF9C3 100%);
  border: 1px solid var(--brand-gold);
  border-left: 4px solid var(--brand-gold);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.alert-success {
  background: linear-gradient(90deg, var(--bg-success) 0%, #D1FAE5 100%);
  border-left-color: var(--brand-emerald);
  border-color: var(--brand-emerald);
}
.alert-info {
  background: linear-gradient(90deg, var(--bg-badge) 0%, #DBEAFE 100%);
  border-left-color: var(--brand-blue);
  border-color: var(--brand-blue);
}

/* ---------- Checkbox group ---------- */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px;
  background: var(--bg-alert);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.checkbox-group:hover { border-color: var(--border-input); }

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--btn-primary);
}

.checkbox-group label {
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

/* ---------- Séparateur ---------- */
.separator {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

/* ---------- Icônes pastille (stat cards) ---------- */
.icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-white);
  box-shadow: 0 4px 16px rgba(30,64,175,0.3);
}
.icon-wrap.lg {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
}
.icon-wrap .icon { font-size: 20px; }
.icon-wrap.lg .icon { font-size: 24px; }

/* ---------- Cartes statistiques ---------- */
.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-emerald));
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-blue);
}
.stat-card:hover::before {
  opacity: 1;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.stat-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
  margin-top: 2px;
}

/* ---------- Cartes raccourcis ---------- */
.shortcut-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  min-width: 260px;
  flex: 1;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.shortcut-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-emerald));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.25s var(--ease-spring);
}
.shortcut-card:hover {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  text-decoration: none;
  color: var(--text-primary);
}
.shortcut-card:hover::before {
  transform: scaleY(1);
}
.shortcut-card .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-white);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(30,64,175,0.3);
  transition: transform 0.2s var(--ease);
}
.shortcut-card:hover .icon {
  transform: scale(1.05);
}
.shortcut-title { font-weight: 700; font-size: 16px; }
.shortcut-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Actions / icônes boutons ---------- */
.actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.icon-btn {
  background: none;
  border: none;
  padding: 7px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--bg-badge); color: var(--text-primary); }

/* ---------- Filtres ---------- */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}
.filters-bar .form-control { width: auto; min-width: 160px; }

/* ---------- Progress bar ---------- */
.progress-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 24px;
}
.progress-step {
  flex: 1;
  height: 6px;
  background: var(--border-input);
  border-radius: var(--radius-full);
  transition: all 0.3s var(--ease);
  position: relative;
}
.progress-step::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--border-input);
  transform: translate(-50%, -50%);
  transition: all 0.3s var(--ease);
}
.progress-step.active {
  background: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
}
.progress-step.active::before {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(30,64,175,0.2);
}
.progress-step.completed {
  background: linear-gradient(90deg, var(--brand-emerald) 0%, var(--brand-blue) 100%);
}
.progress-step.completed::before {
  background: var(--brand-emerald);
  border-color: var(--brand-emerald);
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.progress-label { font-size: 12px; color: var(--text-secondary); }
.progress-label.active { color: var(--text-primary); font-weight: 600; }

/* ---------- Lien retour ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 16px;
  transition: color 0.15s var(--ease);
}
.back-link:hover { color: var(--text-primary); }

/* ---------- Page succès ---------- */
.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-badge);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.success-icon svg { width: 40px; height: 40px; color: var(--text-primary); }

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(16,24,40,0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease), visibility 0.2s var(--ease);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--bg-card);
  width: 500px;
  max-width: calc(100vw - 32px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.2s var(--ease);
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-title { font-size: 17px; font-weight: 650; }
.modal-close {
  background: none; border: none; font-size: 22px;
  color: var(--text-secondary); cursor: pointer; padding: 4px; line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

/* ---------- Grille planning ---------- */
.schedule-grid {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.schedule-grid table { width: 100%; }
.schedule-grid th,
.schedule-grid td {
  padding: 12px 16px;
  text-align: center;
  border: 1px solid var(--border-color);
}
.schedule-grid th {
  background: var(--bg-table-header);
  font-size: 12px;
  font-weight: 650;
  color: var(--text-primary);
}
.schedule-grid td { font-size: 14px; color: var(--text-secondary); }
.schedule-grid td.empty { color: var(--text-light); font-style: italic; }
.schedule-grid td.filled {
  color: var(--text-primary);
  font-weight: 550;
}

/* ============================================================
   LAYOUT : SIDEBAR + MAIN
   ============================================================ */
.layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-light) 100%);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  box-shadow: var(--shadow-xl);
  border-right: 1px solid rgba(255,255,255,0.05);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-white);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03));
}

.sidebar-logo::before {
  content: "";
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(30,64,175,0.4);
}
.sidebar-logo::after {
  content: "UDSHED";
  background: linear-gradient(90deg, var(--text-white) 0%, var(--brand-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sidebar-logo-img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.sidebar-menu {
  flex: 1;
  padding: 16px 14px;
  list-style: none;
  overflow-y: auto;
}

.sidebar-label {
  padding: 16px 16px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.sidebar-menu li { margin-bottom: 4px; }

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.sidebar-menu li a::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand-emerald), var(--brand-gold));
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.25s var(--ease-spring);
}

.sidebar-menu li a:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-white);
  transform: translateX(4px);
}
.sidebar-menu li a:hover::before {
  transform: scaleY(1);
}

.sidebar-menu li a.active {
  background: linear-gradient(90deg, rgba(30,64,175,0.25) 0%, rgba(5,150,105,0.15) 100%);
  color: var(--text-white);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--brand-blue);
}
.sidebar-menu li a.active::before {
  transform: scaleY(1);
}

.sidebar-menu li a .icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  opacity: 0.9;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
}
.sidebar-menu li a:hover .icon {
  transform: scale(1.1);
}

.sidebar-menu li a.locked {
  color: rgba(255,255,255,0.35);
  cursor: not-allowed;
  opacity: 0.6;
}
.sidebar-menu li a.locked:hover {
  background: transparent;
  color: rgba(255,255,255,0.35);
  transform: none;
}
.sidebar-menu li a.locked::before {
  display: none;
}

/* ==== DASHBOARD COMPONENTS ==== */
.dashboard-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, #F8FAFC 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--content-pad);
  margin-bottom: var(--content-pad);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.dashboard-hero::before {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(30,64,175,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.dashboard-hero .welcome-text { font-size: 15px; color: var(--text-secondary); margin-top: 2px; }
.dashboard-avatar-large { 
  width: 52px; 
  height: 52px; 
  font-size: 18px; 
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(30,64,175,0.3);
}

.stat-card { transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.badge-solid { padding: 5px 8px; font-size: 10px; }
.badge-soft { padding: 5px 8px; font-size: 10px; border: 1px solid var(--border-color); }

.shortcut-card { transition: all 0.2s var(--ease); }
.shortcut-card:hover { transform: translateY(-1px); }

.progress-step.active { box-shadow: 0 0 0 1000px var(--btn-primary); }

.modal-dashboard-header {
  padding: 18px 24px;
  background: var(--bg-table-header);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ---------- Footer Sidebar ---------- */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02));
}

.sidebar-footer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-white);
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(30,64,175,0.4);
  border: 2px solid rgba(255,255,255,0.1);
}
.sidebar-footer .sf-info { min-width: 0; }
.sidebar-footer .name {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-footer .level {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ---------- Main ---------- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-page);
}

/* ---------- Header ---------- */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 var(--content-pad);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.header-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-emerald) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  box-shadow: 0 2px 8px rgba(30,64,175,0.3);
  border: 2px solid var(--bg-card);
}

/* ---------- Contenu ---------- */
.content {
  padding: var(--content-pad);
  flex: 1;
}

.content-header {
  margin-bottom: 24px;
}
.content-header h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.content-header p {
  color: var(--text-secondary);
  margin-top: 4px;
}

.content-centered {
  max-width: 760px;
  margin: 0 auto;
}

/* ---------- Grilles utilitaires ---------- */
.grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================================
   PAGE LOGIN
   ============================================================ */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-page);
  padding: 16px;
}

.login-container {
  background: var(--bg-card);
  width: 400px;
  max-width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  text-align: center;
}

.login-logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--brand-navy) 0%, var(--brand-blue) 50%, var(--brand-emerald) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.login-divider {
  height: 1px;
  background: var(--border-color);
  margin: 20px 0;
}
.login-title {
  font-size: 18px;
  font-weight: 650;
  color: var(--text-primary);
  margin-bottom: 24px;
}
.login-footer {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-light);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --content-pad: 16px; }

  .sidebar { display: none; }
  .main-content { margin-left: 0; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  .login-container {
    width: 100%;
    margin: 16px;
    padding: 24px;
  }

  .shortcut-card { min-width: 100%; }
}
