/* ============================================================
   DirPil — Feuille de styles principale
   Thème : bleu contemporain, sobre et professionnel
   ============================================================ */

/* ─── Variables de couleur ───────────────────────────────── */
:root {
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --green-500: #10b981;
  --green-600: #059669;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --red-500:   #ef4444;
  --red-600:   #dc2626;
  --purple-500: #8b5cf6;
  --purple-600: #7c3aed;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);
  --shadow:    0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);

  --radius-sm: .375rem;
  --radius:    .5rem;
  --radius-lg: .75rem;
  --radius-xl: 1rem;

  --transition: .15s ease;
}

/* ─── Reset de base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-700); }

img { max-width: 100%; }

/* ─── Barre de navigation supérieure ────────────────────── */
.navbar {
  background: linear-gradient(135deg, var(--blue-800) 0%, var(--blue-700) 100%);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px;
}

.navbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
  text-decoration: none;
}

.navbar-brand:hover { color: var(--blue-100); }

.navbar-brand .brand-icon {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  flex: 1;
  list-style: none;
}

.nav-link {
  color: rgba(255,255,255,.85);
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  display: flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,.15);
  color: #fff;
}

.nav-link.active {
  background: rgba(255,255,255,.2);
}

/* Dropdown menu */
.nav-item { position: relative; }

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  z-index: 1001;
  padding: .25rem 0;
}

.nav-item:hover .nav-dropdown { display: block; }

.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  color: var(--gray-700);
  font-size: .875rem;
  transition: background var(--transition);
}

.nav-dropdown a:hover { background: var(--blue-50); color: var(--blue-700); }

/* Zone utilisateur */
.navbar-user {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: auto;
}

.user-avatar {
  width: 32px; height: 32px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: .875rem;
}

.user-menu-btn {
  color: rgba(255,255,255,.85);
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem .5rem;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: .35rem;
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--transition);
}
.user-menu-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 200px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  z-index: 1001;
  padding: .25rem 0;
}

.navbar-user:hover .user-dropdown,
.navbar-user.open .user-dropdown { display: block; }

.user-dropdown a, .user-dropdown button {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  color: var(--gray-700);
  font-size: .875rem;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
  text-decoration: none;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--blue-50); color: var(--blue-700); }
.user-dropdown .divider { height: 1px; background: var(--gray-200); margin: .25rem 0; }
.user-dropdown .danger:hover { background: #fef2f2; color: var(--red-600); }

/* ─── Mise en page principale ────────────────────────────── */
.main-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  flex: 1;
}

/* ─── En-tête de page ────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.page-subtitle {
  color: var(--gray-500);
  font-size: .9rem;
  margin-top: .2rem;
}

/* ─── Cartes ─────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--gray-50);
}

.card-title {
  font-weight: 600;
  font-size: .95rem;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: .4rem;
}

.card-body { padding: 1.25rem; }

.card-footer {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* ─── Grilles ────────────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.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-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ─── Boutons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg { padding: .65rem 1.25rem; font-size: 1rem; }

.btn-primary {
  background: var(--blue-600);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--blue-700); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.btn-secondary:hover { background: var(--gray-200); color: var(--gray-800); }

.btn-success { background: var(--green-500); color: #fff; }
.btn-success:hover { background: var(--green-600); color: #fff; }

.btn-warning { background: var(--amber-500); color: #fff; }
.btn-warning:hover { background: var(--amber-600); color: #fff; }

.btn-danger { background: var(--red-500); color: #fff; }
.btn-danger:hover { background: var(--red-600); color: #fff; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--blue-300);
  color: var(--blue-600);
}
.btn-outline:hover { background: var(--blue-50); }

.btn-ghost { background: transparent; color: var(--gray-600); }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }

.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ─── Formulaires ────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: .375rem;
}

.form-label .required { color: var(--red-500); margin-left: .2rem; }

.form-control, .form-select, .form-textarea {
  display: block;
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  color: var(--gray-800);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  line-height: 1.5;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}

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

.form-hint {
  font-size: .8rem;
  color: var(--gray-500);
  margin-top: .3rem;
}

.form-row { display: grid; gap: 1rem; }
.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .875rem;
  color: var(--gray-700);
}

.form-check input[type="checkbox"], .form-check input[type="radio"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--blue-600);
  cursor: pointer;
}

/* Select multiple */
select[multiple] { min-height: 120px; }

/* ─── Tableaux ───────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-lg); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  text-transform: uppercase;
  font-size: .75rem;
  letter-spacing: .05em;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

tbody td {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--blue-50); }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .55rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue   { background: var(--blue-100);   color: var(--blue-700); }
.badge-green  { background: #d1fae5;            color: #065f46; }
.badge-amber  { background: #fef3c7;            color: #92400e; }
.badge-red    { background: #fee2e2;            color: #991b1b; }
.badge-purple { background: #ede9fe;            color: #6d28d9; }
.badge-gray   { background: var(--gray-100);    color: var(--gray-600); }

/* ─── Alertes ────────────────────────────────────────────── */
.alert {
  padding: .875rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .625rem;
  margin-bottom: 1rem;
}

.alert-info    { background: var(--blue-50);  color: var(--blue-800);  border: 1px solid var(--blue-200); }
.alert-success { background: #f0fdf4;         color: #166534;          border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb;         color: #92400e;          border: 1px solid #fde68a; }
.alert-danger  { background: #fef2f2;         color: #991b1b;          border: 1px solid #fecaca; }

/* ─── Statistiques Dashboard ─────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--blue-500);
}

.stat-card.green::before  { background: var(--green-500); }
.stat-card.amber::before  { background: var(--amber-500); }
.stat-card.red::before    { background: var(--red-500); }
.stat-card.purple::before { background: var(--purple-500); }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  margin-bottom: .3rem;
}

.stat-label {
  font-size: .8rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}

.stat-icon {
  position: absolute;
  top: 1rem; right: 1rem;
  font-size: 1.75rem;
  opacity: .15;
}

/* ─── Réunions / Calendrier ──────────────────────────────── */
.meeting-card {
  display: flex;
  gap: 1rem;
  padding: .875rem 1rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
  text-decoration: none;
  color: inherit;
}

.meeting-card:hover {
  border-color: var(--blue-300);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.meeting-time {
  min-width: 56px;
  text-align: center;
  font-weight: 700;
  color: var(--blue-600);
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
}

.meeting-time .time-hour { font-size: 1.1rem; }
.meeting-time .time-day { font-size: .75rem; color: var(--gray-400); }

.meeting-info { flex: 1; min-width: 0; }
.meeting-title { font-weight: 600; color: var(--gray-900); margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meeting-meta { font-size: .8rem; color: var(--gray-500); display: flex; flex-wrap: wrap; gap: .5rem; }

/* ─── Tâches ─────────────────────────────────────────────── */
.task-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.task-item:last-child { border-bottom: none; }

.task-priority {
  width: .25rem;
  align-self: stretch;
  border-radius: 9999px;
  flex-shrink: 0;
}
.priority-basse    { background: var(--gray-300); }
.priority-normale  { background: var(--blue-400); }
.priority-haute    { background: var(--amber-500); }
.priority-critique { background: var(--red-500); }

.task-content { flex: 1; min-width: 0; }
.task-title { font-weight: 500; color: var(--gray-800); font-size: .9rem; }
.task-meta { font-size: .8rem; color: var(--gray-500); margin-top: .15rem; }

/* Indicateur d'échéance */
.deadline-ok      { color: var(--gray-500); }
.deadline-soon    { color: var(--amber-600); font-weight: 500; }
.deadline-urgent  { color: var(--red-600); font-weight: 600; }
.deadline-overdue { color: var(--red-700); font-weight: 700; }

/* ─── Organigramme ───────────────────────────────────────── */
.org-node {
  background: #fff;
  border: 2px solid var(--blue-200);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  position: relative;
  transition: all var(--transition);
}

.org-node:hover { border-color: var(--blue-400); box-shadow: var(--shadow-md); }
.org-node-title { font-weight: 600; color: var(--gray-800); }
.org-node-type { font-size: .75rem; color: var(--blue-500); text-transform: uppercase; letter-spacing: .05em; }
.org-node-resp { font-size: .8rem; color: var(--gray-500); margin-top: .25rem; }

.org-children {
  margin-left: 2rem;
  border-left: 2px solid var(--blue-100);
  padding-left: 1.5rem;
  margin-top: .5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ─── Avancement ─────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: var(--blue-500);
  transition: width .3s ease;
}

.progress-fill.green { background: var(--green-500); }
.progress-fill.amber { background: var(--amber-500); }
.progress-fill.red   { background: var(--red-500); }

/* ─── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  margin-top: 1.5rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.page-btn:hover { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-600); }
.page-btn.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }

/* ─── Onglets ────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: .125rem;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.25rem;
}

.tab-btn {
  padding: .6rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-600);
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  transition: color var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab-btn:hover { color: var(--blue-600); }
.tab-btn.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

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

.modal {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(.95);
  transition: transform .2s ease;
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-weight: 700; font-size: 1.1rem; color: var(--gray-900); }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--gray-400);
  font-size: 1.25rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.modal-close:hover { color: var(--gray-700); background: var(--gray-100); }

.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; gap: .75rem; justify-content: flex-end; }

/* ─── Drag-and-drop ──────────────────────────────────────── */
.sortable-item {
  cursor: grab;
  transition: all var(--transition);
  position: relative;
}
.sortable-item:active { cursor: grabbing; }
.sortable-item.dragging {
  opacity: .5;
  transform: scale(.98);
  box-shadow: var(--shadow-lg);
}
.sortable-item.drag-over { border-color: var(--blue-400); background: var(--blue-50); }

.drag-handle {
  color: var(--gray-300);
  cursor: grab;
  padding: .25rem;
  display: inline-flex;
}
.drag-handle:hover { color: var(--gray-500); }

/* ─── IA : indicateur de chargement ─────────────────────── */
.ai-loading {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--blue-600);
  font-size: .875rem;
}

.ai-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--blue-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.ai-suggestion {
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: .875rem;
  color: var(--blue-900);
  white-space: pre-wrap;
  line-height: 1.6;
  position: relative;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: var(--blue-100);
  color: var(--blue-700);
  padding: .15rem .5rem;
  border-radius: 9999px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ─── Page de connexion ──────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
  padding: 2rem;
}

.login-card {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
}

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

.login-logo h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--blue-700);
  letter-spacing: -.02em;
}

.login-logo p { color: var(--gray-500); font-size: .875rem; margin-top: .25rem; }

/* ─── Admin : tuiles ─────────────────────────────────────── */
.admin-tile {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .75rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.admin-tile:hover {
  border-color: var(--blue-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.admin-tile-icon {
  width: 48px; height: 48px;
  background: var(--blue-50);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--blue-600);
}

.admin-tile-title { font-weight: 600; color: var(--gray-800); }
.admin-tile-desc { font-size: .8rem; color: var(--gray-500); }

/* ─── Utilitaires ────────────────────────────────────────── */
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: .8rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.font-bold   { font-weight: 700; }
.font-medium { font-weight: 500; }

.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: .25rem; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none; }

.divider {
  height: 1px;
  background: var(--gray-200);
  margin: 1rem 0;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ─── Toast notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 380px;
}

.toast {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  padding: .875rem 1rem;
  font-size: .875rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  animation: slideIn .3s ease;
}

.toast.success { border-left: 3px solid var(--green-500); }
.toast.error   { border-left: 3px solid var(--red-500); }
.toast.info    { border-left: 3px solid var(--blue-500); }

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

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar-nav.open { display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--blue-800); padding: .5rem; z-index: 999; }
  .main-wrapper { padding: 1rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-overlay { align-items: flex-end; }
  table { font-size: .8rem; }
  thead th, tbody td { padding: .5rem .75rem; }
}

/* ─── Print ──────────────────────────────────────────────── */
@media print {
  .navbar, .btn, .pagination, .toast-container { display: none !important; }
  .main-wrapper { max-width: 100%; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
