/* ═══════════════════════════════════════════════════════════
   MDB MANAGER — Design System
   Thème clair uniquement · Gamification · Responsive
═══════════════════════════════════════════════════════════ */

/* ── VARIABLES ─────────────────────────────────────────── */
:root {
  /* Couleurs principales */
  --primary:       #2D1B8E;   /* Indigo profond */
  --primary-light: #EEF0FF;   /* Indigo pastel */
  --primary-mid:   #4F35C7;   /* Indigo medium */
  --primary-glow:  rgba(45,27,142,0.12);

  --gold:          #F59E0B;   /* Or — récompenses */
  --gold-light:    #FFFBEB;
  --gold-text:     #92400E;

  --green:         #059669;   /* Succès */
  --green-light:   #ECFDF5;
  --green-text:    #065F46;

  --red:           #EF4444;
  --red-light:     #FEF2F2;
  --red-text:      #991B1B;

  --orange:        #F97316;
  --orange-light:  #FFF7ED;
  --orange-text:   #9A3412;

  /* Neutres */
  --bg:            #F8F7FF;   /* Fond légèrement violet */
  --bg2:           #FFFFFF;
  --bg3:           #F1F0F9;
  --text:          #111827;
  --text2:         #6B7280;
  --text3:         #9CA3AF;
  --border:        #E5E4F0;
  --border2:       #D1D0E8;

  /* Sidebar */
  --sidebar-w:     220px;
  --sidebar-w-sm:  64px;

  /* Misc */
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --shadow-sm:     0 1px 3px rgba(45,27,142,0.08);
  --shadow:        0 4px 16px rgba(45,27,142,0.10);
  --shadow-lg:     0 8px 32px rgba(45,27,142,0.15);
  --transition:    all 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ── INPUTS ─────────────────────────────────────────────── */
input, select, textarea {
  font-family: inherit;
  font-size: 13px;
  background: var(--bg2);
  color: var(--text);
  border: 1.5px solid var(--border2);
  border-radius: var(--radius);
  padding: 9px 12px;
  outline: none;
  transition: var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
input::placeholder { color: var(--text3); }

/* ── BUTTONS ────────────────────────────────────────────── */
button {
  font-family: inherit;
  cursor: pointer;
  font-size: 13px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  padding: 8px 16px;
  transition: var(--transition);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover { background: var(--bg3); border-color: var(--border2); }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-mid); border-color: var(--primary-mid); }

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}
.btn-secondary:hover { background: #E0DEFF; }

.btn-danger {
  background: var(--red-light);
  color: var(--red-text);
  border-color: #FECACA;
}
.btn-danger:hover { background: #FEE2E2; }

.btn-gold {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,0.4); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 8px; border-radius: var(--radius); }

/* ══════════════════════════════════════════════════════════
   LAYOUT — Sidebar + Content
══════════════════════════════════════════════════════════ */
#loginScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1a0f5e 0%, #2D1B8E 50%, #4F35C7 100%);
}

/* ── LOGIN CARD ─────────────────────────────────────────── */
.login-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  width: 380px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.4s ease;
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}
.login-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.login-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #2D1B8E, #4F35C7);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 18px;
}
.login-logo-text { font-size: 20px; font-weight: 700; color: var(--primary); }
.login-sub { font-size: 13px; color: var(--text2); margin-bottom: 1.75rem; }
.login-card input { margin-bottom: 0.75rem; }
.login-err { color: var(--red); font-size: 12px; margin-bottom: 0.5rem; padding: 8px 10px; background: var(--red-light); border-radius: var(--radius); }
.login-btn {
  width: 100%;
  background: linear-gradient(135deg, #2D1B8E, #4F35C7);
  color: #fff;
  border: none;
  padding: 11px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  margin-top: 0.25rem;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(45,27,142,0.25); }

/* ── APP SHELL ──────────────────────────────────────────── */
#app { display: none; min-height: 100vh; }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow: visible;
}
.sidebar.collapsed { width: var(--sidebar-w-sm); }

/* Logo sidebar */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  min-height: 64px;
  transition: padding 0.25s;
}
.sidebar.collapsed .sidebar-logo {
  justify-content: center;
  padding: 20px 0 16px;
  gap: 0;
}
.sidebar-logo-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff;
}
.sidebar-logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  opacity: 1;
  max-width: 140px;
  overflow: hidden;
  transition: opacity 0.2s, max-width 0.2s;
}
.sidebar.collapsed .sidebar-logo-text { opacity: 0; max-width: 0; pointer-events: none; }

/* Toggle button */
.sidebar-toggle {
  position: fixed;
  top: 50vh;
  left: calc(var(--sidebar-w) - 1px);
  transform: translateY(-50%);
  width: 18px;
  height: 56px;
  background: var(--primary-mid);
  border: none;
  border-radius: 0 10px 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, left 0.25s cubic-bezier(0.4,0,0.2,1);
  z-index: 101;
  box-shadow: 3px 0 10px rgba(0,0,0,0.22);
  padding: 0;
  overflow: visible;
}
.sidebar.collapsed .sidebar-toggle {
  left: calc(var(--sidebar-w-sm) - 1px);
}
.sidebar-toggle:hover {
  background: #6B52E0;
}
/* Rotation du SVG quand sidebar réduite */
.sidebar-toggle #toggleIcon {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-toggle #toggleIcon {
  transform: rotate(180deg);
}
/* Tooltip au survol */
.sidebar-toggle::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(17,24,39,0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.sidebar-toggle:hover::after { opacity: 1; }

/* Nav items */
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  overflow-x: hidden;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: rgba(255,255,255,0.65);
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
}
.nav-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  border-radius: 10px;
  transition: background 0.2s;
}
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  background: rgba(255,255,255,0.12);
}
.nav-label {
  font-size: 13px;
  opacity: 1;
  max-width: 140px;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s, max-width 0.2s;
}
.sidebar.collapsed .nav-label {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  display: none;
}
.nav-badge.visible { display: inline-block; }
.sidebar.collapsed .nav-badge { display: none !important; }

/* Nav-item collapsed : centrage icône propre */
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
  gap: 0;
}
.sidebar.collapsed .nav-item.active::before {
  display: none;
}
.sidebar.collapsed .nav-item.active .nav-icon {
  background: rgba(255,255,255,0.22);
  box-shadow: 0 0 0 2px var(--gold);
}

/* Tooltip au survol en mode collapsed */
.sidebar.collapsed .nav-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(var(--sidebar-w-sm) + 8px);
  background: var(--primary);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
  box-shadow: var(--shadow);
}

/* Sidebar bottom — user info */
.sidebar-user {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: padding 0.25s, justify-content 0.25s;
}
.sidebar.collapsed .sidebar-user {
  justify-content: center;
  padding: 12px 0;
  gap: 0;
}
.sidebar-avatar {
  width: 32px; height: 32px; flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: rgba(255,255,255,0.5); font-size: 10px; }
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar-user-actions { margin-left: auto; display: flex; gap: 4px; }
.sidebar.collapsed .sidebar-user-actions { display: none; }
.sidebar-user-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.6);
  padding: 4px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}
.sidebar-user-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

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

/* Topbar (mobile) */
.topbar-mobile {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--primary);
  padding: 0 16px;
  height: 52px;
  align-items: center;
  gap: 12px;
}
.topbar-mobile-logo { color: #fff; font-weight: 700; font-size: 15px; flex: 1; }
.hamburger {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  padding: 4px;
  cursor: pointer;
}

/* Page content area */
.page-content {
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

/* ── MOBILE OVERLAY ─────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.visible { display: block; }

/* ══════════════════════════════════════════════════════════
   COMPONENTS
══════════════════════════════════════════════════════════ */

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* ── METRICS GRID ───────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric-accent { position: absolute; top: 0; left: 0; width: 4px; bottom: 0; border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.metric-icon {
  position: absolute;
  right: 14px; top: 12px;
  font-size: 24px;
  opacity: 0.12;
}
.metric-label { font-size: 11px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; font-weight: 500; }
.metric-val { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.1; }
.metric-unit { font-size: 10px; color: var(--text3); font-weight: 400; margin-left: 2px; }
.metric-sub { font-size: 11px; color: var(--text3); margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.metric-up { color: var(--green); font-weight: 600; }
.metric-down { color: var(--red); font-weight: 600; }

/* Accent colors */
.metric.accent-primary .metric-accent { background: var(--primary); }
.metric.accent-green   .metric-accent { background: var(--green); }
.metric.accent-gold    .metric-accent { background: var(--gold); }
.metric.accent-red     .metric-accent { background: var(--red); }
.metric.accent-orange  .metric-accent { background: var(--orange); }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-title-icon { font-size: 16px; margin-right: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── TABLES ─────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--bg3); }
th {
  text-align: left;
  color: var(--text2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 12px;
  border-bottom: 1.5px solid var(--border);
  white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--primary); }
th.sort-asc::after  { content: ' ↑'; font-size: 10px; color: var(--primary); }
th.sort-desc::after { content: ' ↓'; font-size: 10px; color: var(--primary); }
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--primary-light); }
.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-ml       { background: var(--primary-light); color: var(--primary); }
.badge-mdb      { background: var(--gold-light); color: var(--gold-text); }
.badge-da       { background: #F0FFFE; color: #065F46; }
.badge-admin    { background: var(--red-light); color: var(--red-text); }
.badge-off      { background: var(--bg3); color: var(--text2); }
.badge-attente  { background: var(--orange-light); color: var(--orange-text); }
.badge-accepte  { background: var(--green-light); color: var(--green-text); }
.badge-refuse   { background: var(--red-light); color: var(--red-text); }

/* ── RANKING (Gamification) ─────────────────────────────── */
.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.3s ease both;
}
.rank-row:last-child { border-bottom: none; }
.rank-n {
  font-size: 13px;
  font-weight: 700;
  color: var(--text3);
  width: 24px;
  flex-shrink: 0;
  text-align: center;
}
.rank-n.gold   { color: #F59E0B; }
.rank-n.silver { color: #9CA3AF; }
.rank-n.bronze { color: #D97706; }
.rank-medal    { font-size: 16px; }
.rank-name { font-size: 13px; font-weight: 500; min-width: 100px; flex-shrink: 0; }
.rank-bar-bg { flex: 1; background: var(--bg3); border-radius: 6px; height: 8px; overflow: hidden; }
.rank-bar {
  height: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.rank-row:nth-child(1) .rank-bar { background: linear-gradient(90deg, #F59E0B, #D97706); }
.rank-row:nth-child(2) .rank-bar { background: linear-gradient(90deg, #9CA3AF, #6B7280); }
.rank-row:nth-child(3) .rank-bar { background: linear-gradient(90deg, #D97706, #B45309); }
.rank-val { font-size: 13px; font-weight: 600; min-width: 90px; text-align: right; flex-shrink: 0; color: var(--primary); }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.progress-wrap { margin: 6px 0; }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.progress-track { height: 8px; background: var(--bg3); border-radius: 10px; overflow: hidden; }
.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--primary), var(--primary-mid));
  transition: width 1s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.progress-fill.gold-gradient { background: linear-gradient(90deg, var(--gold), #D97706); }
.progress-fill.green-gradient { background: linear-gradient(90deg, var(--green), #047857); }
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  border-radius: 0 10px 10px 0;
}

/* ── RECRUIT ACTIVITY GRID ──────────────────────────────── */
.recruit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.recruit-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.recruit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.recruit-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.recruit-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-mid));
}
.recruit-name { font-weight: 600; font-size: 13px; }
.recruit-taux { font-size: 11px; color: var(--text2); }
.activity-dot {
  position: absolute;
  top: 12px; right: 12px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg2);
}
.activity-dot.green  { background: var(--green); box-shadow: 0 0 6px rgba(5,150,105,0.5); }
.activity-dot.orange { background: var(--orange); }
.activity-dot.red    { background: var(--red); }
.activity-dot.gray   { background: var(--text3); }
.recruit-last-sale { font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.recruit-ca { font-size: 15px; font-weight: 700; color: var(--text); }
.recruit-ca-unit { font-size: 10px; color: var(--text3); font-weight: 400; margin-left: 2px; }
.recruit-progress-mini { margin-top: 8px; }

/* ── FILTER BAR ─────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
}
.filter-bar-label { font-size: 12px; color: var(--text2); font-weight: 600; margin-right: 4px; }
.filter-select-group { display: flex; gap: 4px; align-items: center; }
.filter-select-group select { width: auto; padding: 6px 8px; font-size: 12px; border-radius: 8px; }
.filter-presets { display: flex; gap: 6px; margin-left: 4px; }
.filter-preset {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  transition: var(--transition);
}
.filter-preset:hover, .filter-preset.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg2);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 16px; color: var(--primary); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg3);
  color: var(--text2);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal { position: relative; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.3px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.preview-comm {
  font-size: 12px;
  padding: 10px 12px;
  background: var(--primary-light);
  border-radius: var(--radius);
  margin-top: 8px;
  border-left: 3px solid var(--primary);
  color: var(--primary);
}
.preview-comm strong { font-weight: 700; }

/* ── APPORTEURS D'AFFAIRE ─────────────────────────────── */
.aa-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.aa-row input { font-size: 13px; }

/* ── FORM SECTION (sous-bloc dans modal) ─────────────────── */
.form-section {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--bg3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.form-section-title {
  font-weight: 600;
  font-size: 12px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* ── RÉSEAU EMAIL ROW ─────────────────────────────────── */
.reseau-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
}

/* ── ANTI-DOUBLON ROW ─────────────────────────────────── */
.anti-doublon-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.empty-state { color: var(--text3); font-size: 13px; padding: 3rem; text-align: center; }
.empty-state-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.info-box {
  background: var(--primary-light);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 10px 13px;
  font-size: 12px;
  color: var(--primary);
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

/* ── TOAST ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.err  { background: var(--red); }
.toast.success { background: var(--green); }
.toast-icon { font-size: 16px; }

/* ── PAGINATION ─────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--text2);
}
.pagination button { padding: 5px 12px; font-size: 12px; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── SPINNER ────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(45,27,142,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  gap: 10px;
  color: var(--text2);
}

/* ── CHARTS ─────────────────────────────────────────────── */
.chart-wrap { position: relative; width: 100%; }

/* ── TREE ───────────────────────────────────────────────── */
#treeCanvas { display: block; cursor: grab; border-radius: var(--radius); }
#treeCanvas.grabbing { cursor: grabbing; }
.tree-controls { display: flex; gap: 6px; margin-bottom: 10px; }

/* ── DEMANDES ALERT ─────────────────────────────────────── */
.alert-card {
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid;
}
.alert-card.warn { background: var(--gold-light); border-color: #FDE68A; color: var(--gold-text); }
.alert-card.info { background: var(--primary-light); border-color: #C7D2FE; color: var(--primary); }
.alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.alert-body { font-size: 12px; opacity: 0.8; }

/* ── GAMIFICATION — STREAK & OBJECTIF ──────────────────── */
.objective-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.objective-section::before {
  content: '🎯';
  position: absolute;
  right: 20px; top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  opacity: 0.15;
}
.objective-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.7; margin-bottom: 4px; }
.objective-value { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.objective-progress-track { height: 10px; background: rgba(255,255,255,0.2); border-radius: 10px; overflow: hidden; }
.objective-progress-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--gold), #FBBF24);
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 10px rgba(245,158,11,0.5);
}
.objective-labels { display: flex; justify-content: space-between; font-size: 11px; opacity: 0.7; margin-top: 5px; }

/* ── ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes countUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.animate-in { animation: countUp 0.4s ease both; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .metrics { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 768px) {
  /* Sidebar → drawer mobile */
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
    transition: transform 0.3s ease, width 0s;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-toggle { display: none; }
  .sidebar .sidebar-logo-text { opacity: 1 !important; }
  .sidebar .nav-label { opacity: 1 !important; }

  .app-content { margin-left: 0 !important; }
  .topbar-mobile { display: flex; }

  .page-content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-val { font-size: 20px; }
  .recruit-grid { grid-template-columns: 1fr 1fr; }

  .modal { padding: 20px 16px; border-radius: var(--radius-lg); max-height: 92vh; }
  .toast { bottom: 16px; right: 16px; left: 16px; max-width: none; }
  .filter-bar { gap: 6px; }
  .filter-presets { width: 100%; }
}

@media (max-width: 480px) {
  .metrics { grid-template-columns: 1fr; }
  .recruit-grid { grid-template-columns: 1fr; }
  .filter-select-group select { width: 80px; }
}

/* ══════════════════════════════════════════════════════════
   TABLEAUX RESPONSIVE — Cards sur mobile
══════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Cacher les tableaux standards sur mobile */
  table.tbl-mobile-cards,
  .tbl-wrap table.tbl-mobile-cards { display: block; }

  table.tbl-mobile-cards thead { display: none; }

  table.tbl-mobile-cards tbody { display: block; }

  table.tbl-mobile-cards tr {
    display: block;
    background: var(--bg2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }
  table.tbl-mobile-cards tr:hover td { background: transparent; }

  table.tbl-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none;
    font-size: 13px;
    min-height: 28px;
    gap: 8px;
  }

  /* Label via data-label — défini inline dans le JS */
  table.tbl-mobile-cards td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
    min-width: 100px;
  }

  /* Première td = titre de la carte */
  table.tbl-mobile-cards td:first-child {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 4px;
    justify-content: flex-start;
  }
  table.tbl-mobile-cards td:first-child::before { display: none; }

  /* Dernière td = actions */
  table.tbl-mobile-cards td:last-child {
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    margin-top: 4px;
  }
  table.tbl-mobile-cards td:last-child::before { display: none; }

  /* Pagination mobile */
  .pagination { justify-content: center; flex-wrap: wrap; gap: 6px; }
}
/* ═══════════════════════════════════════════════════════════
   PILOTAGE — Module alertes actionnables
═══════════════════════════════════════════════════════════ */

/* Résumé compteurs */
.pilotage-resume {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.pilotage-resume-card {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-align: center;
  border: 1.5px solid transparent;
}
.pilotage-resume-card.rouge {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.25);
}
.pilotage-resume-card.jaune {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.25);
}
.pilotage-resume-card.vert {
  background: rgba(34,197,94,.08);
  border-color: rgba(34,197,94,.25);
}
.pilotage-resume-count {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.pilotage-resume-card.rouge .pilotage-resume-count { color: #ef4444; }
.pilotage-resume-card.jaune .pilotage-resume-count { color: #f59e0b; }
.pilotage-resume-card.vert  .pilotage-resume-count { color: #22c55e; }
.pilotage-resume-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}

/* Groupe */
.pilotage-group {
  margin-bottom: 28px;
}
.pilotage-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pilotage-group-count {
  background: var(--bg3);
  color: var(--text2);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}

/* Grille cartes */
.pilotage-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

/* Carte alerte */
.pilotage-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  border-left: 4px solid transparent;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s;
}
.pilotage-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.pilotage-card--rouge { border-left: 4px solid #ef4444; }
.pilotage-card--jaune { border-left: 4px solid #f59e0b; }
.pilotage-card--vert  { border-left: 4px solid #22c55e; }

.pilotage-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pilotage-card-nom {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.pilotage-card-categorie {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  background: var(--bg3);
  border-radius: 99px;
  padding: 2px 9px;
  white-space: nowrap;
}
.pilotage-card-message {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.5;
}
.pilotage-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}
.pilotage-card-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.pilotage-seuils-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text2);
  cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.pilotage-seuils-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Mobile */
@media (max-width: 600px) {
  .pilotage-resume { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .pilotage-resume-count { font-size: 26px; }
  .pilotage-cards { grid-template-columns: 1fr; }
}

/* ─── BLOC PILOTAGE DASHBOARD ─────────────────────────────── */
.pilotage-bloc {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
}
.pilotage-bloc:hover {
  box-shadow: 0 4px 18px rgba(45,27,142,.1);
  border-color: var(--primary);
}
.pilotage-bloc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pilotage-bloc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.pilotage-bloc-cta {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}
.pilotage-bloc-items {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pilotage-bloc-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 13px;
  flex: 1;
  min-width: 140px;
}
.pilotage-bloc-item.rouge { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.2); }
.pilotage-bloc-item.jaune { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2); }
.pilotage-bloc-item.vert  { background: rgba(34,197,94,.08);  border: 1px solid rgba(34,197,94,.2); }
.pilotage-bloc-count {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}
.pilotage-bloc-item.rouge .pilotage-bloc-count { color: #ef4444; }
.pilotage-bloc-item.jaune .pilotage-bloc-count { color: #f59e0b; }
.pilotage-bloc-item.vert  .pilotage-bloc-count { color: #22c55e; }
.pilotage-bloc-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}
.pilotage-bloc-names {
  font-size: 11px;
  color: var(--text3);
  margin-left: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
@media (max-width: 600px) {
  .pilotage-bloc-items { flex-direction: column; }
  .pilotage-bloc-item  { min-width: unset; }
}

/* ─── PROJECTION REVENUS ──────────────────────────────────── */
.projection-bloc {
  background: linear-gradient(135deg, var(--primary-light) 0%, rgba(45,27,142,.04) 100%);
  border: 1.5px solid #C7D2FE;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
}
.projection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.projection-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.projection-base {
  font-size: 11px;
  color: var(--text3);
}
.projection-items {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.projection-item {
  flex: 1;
  min-width: 160px;
  background: #fff;
  border-radius: var(--radius);
  padding: 10px 14px;
  border: 1px solid #E0E7FF;
}
.projection-item-label {
  font-size: 11px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 4px;
  font-weight: 600;
}
.projection-item-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.projection-item-sub {
  font-size: 11px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 6px;
}
@media (max-width: 600px) {
  .projection-items { flex-direction: column; }
  .projection-item  { min-width: unset; }
}

/* ─── GRILLE RECRUES — CODE COULEUR + TRI ─────────────────── */

/* Bordure gauche colorée selon statut */
.recruit-card--red    { border-left: 4px solid #ef4444; background: rgba(239,68,68,.03); }
.recruit-card--orange { border-left: 4px solid #f59e0b; background: rgba(245,158,11,.03); }
.recruit-card--green  { border-left: 4px solid #22c55e; }
.recruit-card--gray   { border-left: 4px solid var(--text3); }

/* Badge statut */
.recruit-status {
  font-size: 10px;
  font-weight: 600;
  border-radius: 99px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.recruit-status--red    { background: rgba(239,68,68,.12);  color: #ef4444; }
.recruit-status--orange { background: rgba(245,158,11,.12); color: #d97706; }
.recruit-status--green  { background: rgba(34,197,94,.12);  color: #16a34a; }
.recruit-status--gray   { background: var(--bg3);           color: var(--text3); }

/* Barre de tri */
.recruit-sort-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.recruit-sort-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  font-weight: 500;
  transition: background .12s, color .12s, border-color .12s;
}
.recruit-sort-btn:hover {
  background: var(--bg2);
  color: var(--text);
}
.recruit-sort-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════════
   PERSONNALISATION DASHBOARD — Panneau drag & drop
═══════════════════════════════════════════════════════════ */

.dpc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

.dpc-item {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  cursor: grab;
  transition: box-shadow .15s, border-color .15s, opacity .15s;
  user-select: none;
}
.dpc-item.active {
  background: var(--card);
  border-color: var(--primary);
}
.dpc-item.dpc-dragging {
  opacity: .4;
  cursor: grabbing;
}
.dpc-item.dpc-drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(45,27,142,.2);
}

.dpc-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dpc-drag-handle {
  font-size: 16px;
  color: var(--text3);
  cursor: grab;
  flex-shrink: 0;
}
.dpc-item-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Toggle switch */
.dpc-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.dpc-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  pointer-events: none;
}
.dpc-toggle-track {
  width: 44px;
  height: 24px;
  background: #94A3B8 !important;
  border-radius: 99px;
  transition: background .2s;
  position: relative;
  flex-shrink: 0;
  display: block;
}
.dpc-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.dpc-toggle-switch input:checked + .dpc-toggle-track {
  background: #22c55e !important;
}
.dpc-toggle-switch input:checked + .dpc-toggle-track::after {
  transform: translateX(20px);
}

/* Styles de visualisation */
.dpc-styles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dpc-style-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text2);
  cursor: pointer;
  font-weight: 500;
  transition: background .12s, color .12s, border-color .12s;
}
.dpc-style-btn:hover { background: var(--bg2); color: var(--text); }
.dpc-style-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Métriques KPI */
.dpc-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dpc-metric-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 10px;
  transition: background .12s, border-color .12s;
}
.dpc-metric-toggle:has(input:checked) {
  background: rgba(45,27,142,.08);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.dpc-metric-toggle input { display: none; }

/* ─── SEUILS PILOTAGE — Toggle rows ──────────────────────── */
.seuil-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  margin-bottom: 8px;
}
.seuil-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.seuil-row-header label:first-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.seuil-row input[type="number"]:disabled {
  cursor: not-allowed;
  background: var(--bg3);
}


/* ─── RÈGLES CUSTOM PILOTAGE ──────────────────────────────── */
.regles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 4px;
}
.regle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: opacity .15s;
}
.regle-row--off { opacity: .5; }
.regle-row-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.regle-row-priorite {
  font-size: 11px;
  font-weight: 700;
}
.regle-row-nom {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.regle-row-meta {
  font-size: 11px;
  color: var(--text3);
}
.regle-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
/* Condition rows dans le formulaire */
.cond-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.cond-row select,
.cond-row input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 12px;
  background: var(--bg2);
  color: var(--text);
}
#condRows code {
  background: var(--bg3);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: var(--primary);
}

/* ─── VUE TOGGLE LISTE/PIPELINE ──────────────────────────── */
.vue-toggle {
  display: flex;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.vue-toggle-btn {
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.vue-toggle-btn.active {
  background: var(--bg2);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ─── PIPELINE KANBAN ─────────────────────────────────────── */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}
.pipeline-col {
  background: var(--bg3);
  border-radius: var(--radius-lg);
  min-height: 200px;
  transition: background .15s;
}
.pipeline-col--over { background: rgba(45,27,142,.06); }

/* Pipeline — groupes par recrue */
.pipeline-group { margin-bottom: 10px; }
.pipeline-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  background: var(--bg2);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text2);
  font-weight: 600;
}
.pipeline-group-header.pipeline-group-me {
  background: var(--primary-light);
  color: var(--primary);
  border-left: 3px solid var(--primary);
}
.pipeline-group-count {
  background: var(--bg3, #E5E7EB);
  color: var(--text3);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.pipeline-card-mine {
  border-left: 3px solid var(--primary);
}
.pipeline-col-header {
  padding: 14px 16px 10px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.pipeline-col-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.pipeline-col-count {
  font-size: 11px;
  color: var(--text3);
}
.pipeline-cards-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pipeline-empty {
  font-size: 12px;
  color: var(--text3);
  text-align: center;
  padding: 20px 0;
}
.pipeline-card {
  background: var(--bg2);
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  cursor: grab;
  transition: box-shadow .15s, opacity .15s;
}
.pipeline-card:hover { box-shadow: var(--shadow-sm); }
.pipeline-card--dragging { opacity: .4; cursor: grabbing; }
.pipeline-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.pipeline-card-montant {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.pipeline-card-adresse {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 3px;
}
.pipeline-card-label {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 6px;
}
.pipeline-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.pipeline-card-date { font-size: 11px; color: var(--text3); }
.pipeline-card-actions { display: flex; align-items: center; gap: 4px; }
.pipeline-statut-select {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 6px;
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
}

/* ─── BADGES STATUT ───────────────────────────────────────── */
.statut-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 99px;
  padding: 2px 8px;
  white-space: nowrap;
}
.statut-mandat    { background: rgba(99,102,241,.1);  color: #6366F1; }
.statut-offre     { background: rgba(245,158,11,.1);  color: #D97706; }
.statut-compromis { background: rgba(236,72,153,.1);  color: #EC4899; }
.statut-acte      { background: rgba(16,185,129,.1);  color: #059669; }

@media (max-width: 900px) {
  .pipeline-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .pipeline-board {
    grid-template-columns: 1fr;
  }
  .pipeline-col-header { padding: 10px 12px; }
  .pipeline-card { padding: 10px 12px; }
  /* Filter-bar pipeline : wrap les boutons de tri */
  .filter-bar .filter-presets { flex-wrap: wrap; }
}
/* Tablettes : 3 colonnes pipeline (pas de colonne écrasée) */
@media (min-width: 601px) and (max-width: 900px) {
  .pipeline-board { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
/* Page-header responsive */
@media (max-width: 600px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .page-header > div:last-child {
    width: 100%;
    justify-content: flex-start;
  }
  /* Historique table — scroll horizontal */
  .tbl-wrap { -webkit-overflow-scrolling: touch; }
  /* Réduire taille filter-bar sur mobile */
  .filter-bar { padding: 10px 12px; gap: 6px; }
  .filter-preset { padding: 4px 10px; font-size: 11px; }
  /* Drawer recherche full width sur mobile */
  .search-drawer { width: 100vw; border-left: none; }
}

/* ─── WIDGETS PIPELINE DASHBOARD ─────────────────────────── */
.pipeline-dashboard-kpi {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pipeline-kpi-item {
  flex: 1;
  min-width: 120px;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: center;
}
.pipeline-kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.pipeline-kpi-label {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}
.pipeline-delais-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pipeline-delai-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg3);
  border-radius: var(--radius);
}
.pipeline-delai-label {
  font-size: 13px;
  color: var(--text2);
}
.pipeline-delai-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

/* Bouton orange pastel — archivage */
.btn-warning { 
    background: #FDBA74; /* Orange pastel doux et diffus */
    color: #1F2937; /* Gris anthracite pour assurer la lisibilité (WCAG) */
    border: none; 
    border-radius: var(--radius); 
    padding: 6px 14px; 
    cursor: pointer; 
    font-size: 13px; 
    transition: background-color 0.2s ease-in-out; /* Rend le survol plus fluide/diffus */
}

.btn-warning:hover { 
    background: #FB923C; /* Teinte légèrement plus soutenue au survol */
}
/* ── SEARCH DRAWER ─────────────────────────────────────── */
.search-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 1100;
  transition: background 0.28s ease;
  pointer-events: none;
}
.search-drawer-overlay.visible {
  background: rgba(0,0,0,0.35);
  pointer-events: all;
}

.search-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 1101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
.search-drawer.visible {
  transform: translateX(0);
}

.search-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-drawer-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.search-drawer-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text3);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: var(--radius);
  transition: color 0.15s;
}
.search-drawer-close:hover { color: var(--text); }

.search-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Sections internes du drawer */
.sf-section {
  margin-bottom: 18px;
}
.sf-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.sf-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}
.sf-field label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 500;
}
.sf-field input,
.sf-field select {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.sf-field input:focus,
.sf-field select:focus {
  outline: none;
  border-color: var(--primary);
}
.sf-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Checkboxes statuts */
.sf-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sf-checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg2);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.sf-checkbox-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.sf-checkbox-label input {
  display: none;
}

/* Bouton recherche dans les headers */
.btn-search {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius);
  padding: 5px 12px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: relative;
  transition: border-color 0.15s, color 0.15s;
}
.btn-search:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-search--active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* Badge filtres actifs */
.search-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* Statut archive badge (si absent) */
.statut-badge.statut-archive { background: var(--bg3); color: var(--text3); }

/* form-section (si absent) */
.form-section { margin-bottom: 16px; }
.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) {
  .search-drawer { width: 100vw; }
}

/* ══════════════════════════════════════════════════════════
   ARBORESCENCE v3 — CSS Tree classique (ul/li récursif)
   Aucun JS de positionnement, connecteurs CSS purs
══════════════════════════════════════════════════════════ */

/* Scroll horizontal global */
.tree-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding: 20px 20px 36px;
  -webkit-overflow-scrolling: touch;
}

/* ── Structure ul/li ── */
.tree-root,
.tree-children {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
  position: relative;
}

/* Racines : space entre elles */
.tree-root {
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
  justify-content: flex-start;
}

/* Chaque item = colonne flex (carte + enfants sous) */
.tree-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding: 0 8px;
}

/* ── Connecteurs verticaux et horizontaux ── */

/* Ligne verticale descendant de la carte vers les enfants */
.tree-item > .tree-children::before {
  content: '';
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 24px;
  background: var(--border2);
  z-index: 0;
}

/* Ligne horizontale reliant les enfants entre eux */
.tree-item > .tree-children {
  position: relative;
  margin-top: 24px;
}

/* Ligne horizontale au-dessus des enfants (barre) */
.tree-item > .tree-children > .tree-item:not(:only-child)::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border2);
  z-index: 0;
}

/* Segment vertical reliant la barre horizontale à chaque enfant */
.tree-item > .tree-children > .tree-item::after {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 12px;
  background: var(--border2);
  z-index: 0;
}

/* Cas enfant unique : juste une ligne droite */
.tree-item > .tree-children > .tree-item:only-child::before {
  display: none;
}

/* Couper la barre horizontale aux extrémités */
.tree-item > .tree-children > .tree-item:first-child:not(:only-child)::before {
  left: 50%;
}
.tree-item > .tree-children > .tree-item:last-child:not(:only-child)::before {
  right: 50%;
}

/* ── Carte recrue ── */
.tree-card {
  width: 162px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 11px 11px 9px;
  cursor: pointer;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
  position: relative;
  z-index: 1;
  user-select: none;
}
.tree-card:hover {
  box-shadow: 0 6px 20px rgba(45,27,142,0.14);
  border-color: var(--node-color, var(--primary));
  transform: translateY(-2px);
}
.tree-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 7px;
}
.tree-card-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 10px; flex-shrink: 0;
}
.tree-card-info { flex:1; min-width:0; }
.tree-card-name {
  font-size: 12px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.tree-card-meta {
  display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-top: 3px;
}
.tree-card-taux  { font-size: 10px; color: var(--text2); font-weight: 600; }
.tree-card-parrain { font-size: 10px; color: var(--text3); }
.tree-card-stat {
  font-size: 11px; font-weight: 700;
  border-top: 1px solid var(--border); padding-top: 6px;
}

/* ── Badges réseau ── */
.tree-badge {
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .04em;
}
.tree-badge-mdb { background: rgba(245,158,11,.15); color: #92400E; }
.tree-badge-da  { background: rgba(45,27,142,.12);  color: #2D1B8E; }
.tree-badge-ml  { background: rgba(5,150,105,.12);  color: #065F46; }

/* ── Dot activité ── */
.tree-activity-dot {
  width: 9px; height: 9px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}

/* ── Légende ── */
.tree-legend {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 11px; color: var(--text2);
}
.tree-legend-item { display: flex; align-items: center; gap: 5px; }

/* ── Groupement par owner (admin) ── */
.tree-owner-group { margin-bottom: 32px; }
.tree-owner-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}

/* ── FICHE DÉTAIL RECRUE ── */
.recrue-detail-section {
  background: var(--bg3); border-radius: var(--radius-lg);
  padding: 12px 14px; margin-bottom: 10px;
}
.recrue-detail-section-title {
  font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .07em; margin-bottom: 10px;
}
.recrue-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 7px;
}
.recrue-detail-kpi {
  background: var(--bg2); border-radius: var(--radius);
  padding: 8px 8px 6px; text-align: center;
}
.recrue-detail-kpi-val {
  font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2;
}
.recrue-detail-kpi-label {
  font-size: 10px; color: var(--text3); margin-top: 2px; line-height: 1.2;
}

/* Pipeline funnel */
.recrue-detail-pipeline {
  display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: wrap; margin-bottom: 4px;
}
.rdp-col {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg2); border-radius: var(--radius);
  padding: 8px 10px; min-width: 56px; border-top: 3px solid;
}
.rdp-mandat    { border-color: #6366F1; }
.rdp-offre     { border-color: #F59E0B; }
.rdp-compromis { border-color: #EC4899; }
.rdp-acte      { border-color: #10B981; }
.rdp-val   { font-size: 22px; font-weight: 800; line-height: 1; color: var(--text); }
.rdp-label { font-size: 10px; color: var(--text3); margin-top: 3px; text-align: center; white-space: nowrap; }
.rdp-arrow { font-size: 14px; color: var(--text3); padding: 0 2px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .tree-card { width: 144px; }
  .tree-item { padding: 0 5px; }
  .recrue-detail-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
}
@media (max-width: 480px) {
  .tree-card { width: 128px; }
  .tree-legend { gap: 8px; }
  .recrue-detail-pipeline { gap: 2px; }
  .rdp-col { min-width: 48px; padding: 6px 8px; }
  .rdp-val { font-size: 18px; }
}


/* ══════════════════════════════════════════════════════════
   SEARCH DRAWER
══════════════════════════════════════════════════════════ */
.search-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0);
  z-index: 1100; transition: background 0.28s ease; pointer-events: none;
}
.search-drawer-overlay.visible { background: rgba(0,0,0,0.35); pointer-events: all; }
.search-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; max-width: 100vw;
  background: var(--bg); border-left: 1px solid var(--border); z-index: 1101;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
.search-drawer.visible { transform: translateX(0); }
.search-drawer-header { display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border);flex-shrink:0; }
.search-drawer-title { font-size:15px;font-weight:700;color:var(--text); }
.search-drawer-close { background:none;border:none;font-size:22px;color:var(--text3);cursor:pointer;padding:0 4px;line-height:1;border-radius:var(--radius);transition:color .15s; }
.search-drawer-close:hover { color:var(--text); }
.search-drawer-body { flex:1;overflow-y:auto;padding:16px 20px;display:flex;flex-direction:column;gap:0; }
.search-drawer-footer { padding:14px 20px;border-top:1px solid var(--border);display:flex;gap:10px;justify-content:flex-end;flex-shrink:0; }
.sf-section { margin-bottom:18px; }
.sf-section-title { font-size:11px;font-weight:700;color:var(--text3);text-transform:uppercase;letter-spacing:.06em;margin-bottom:10px;padding-bottom:6px;border-bottom:1px solid var(--border); }
.sf-field { display:flex;flex-direction:column;gap:5px;margin-bottom:8px; }
.sf-field label { font-size:12px;color:var(--text2);font-weight:500; }
.sf-field input,.sf-field select { width:100%;padding:7px 10px;border:1.5px solid var(--border);border-radius:var(--radius);background:var(--bg2);color:var(--text);font-size:13px;box-sizing:border-box; }
.sf-field-row { display:grid;grid-template-columns:1fr 1fr;gap:10px; }
.sf-checkboxes { display:flex;flex-wrap:wrap;gap:8px; }
.sf-checkbox-label { display:flex;align-items:center;gap:5px;font-size:12px;color:var(--text2);cursor:pointer;padding:5px 10px;border:1.5px solid var(--border);border-radius:20px;background:var(--bg2);transition:border-color .15s,background .15s;user-select:none; }
.sf-checkbox-label:has(input:checked) { border-color:var(--primary);background:var(--primary-light);color:var(--primary);font-weight:600; }
.sf-checkbox-label input { display:none; }
.btn-search { background:var(--bg2);border:1.5px solid var(--border);color:var(--text2);border-radius:var(--radius);padding:5px 12px;cursor:pointer;font-size:13px;display:inline-flex;align-items:center;gap:5px;position:relative;transition:border-color .15s,color .15s; }
.btn-search:hover { border-color:var(--primary);color:var(--primary); }
.btn-search--active { border-color:var(--primary);background:var(--primary-light);color:var(--primary); }
.search-filter-badge { display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;background:var(--primary);color:#fff;border-radius:8px;font-size:10px;font-weight:700;line-height:1; }
@media (max-width:600px) { .search-drawer { width:100vw; } }

/* ══════════════════════════════════════════════════════════
   AIDE — Wiki & CGU
══════════════════════════════════════════════════════════ */

/* ── Sidebar bas ── */
.sidebar-nav-bottom {
  margin-top: auto;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.nav-item-aide {
  opacity: 0.75;
}
.nav-item-aide:hover, .nav-item-aide.active {
  opacity: 1;
}

/* ── Login CGU ── */
.login-cgu-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 14px;
  cursor: pointer;
  line-height: 1.4;
}
.login-cgu-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--primary);
}
.login-cgu-link {
  color: var(--primary);
  text-decoration: underline;
}
.login-cgu-link:hover { opacity: 0.8; }

/* ── Tabs aide ── */
.aide-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.aide-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color 0.15s, border-color 0.15s;
}
.aide-tab-btn:hover { color: var(--primary); }
.aide-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}

/* ── Contenu aide ── */
.aide-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aide-section {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.aide-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--primary-light);
  border-bottom: 1.5px solid var(--border);
  cursor: default;
}
.aide-section-icon { font-size: 20px; }
.aide-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}
.aide-section-body {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
}
.aide-section-body p { margin: 0 0 10px; }
.aide-section-body p:last-child { margin-bottom: 0; }
.aide-h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 6px;
}
.aide-list {
  padding-left: 18px;
  margin: 6px 0 10px;
}
.aide-list li { margin-bottom: 5px; }
.aide-tip {
  background: var(--gold-light);
  border: 1px solid #FDE68A;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--gold-text);
  margin-top: 10px;
}

/* Pipeline steps aide */
.aide-pipeline-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.aide-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius);
  border-top: 3px solid;
  background: var(--bg2);
  min-width: 80px;
  font-size: 12px;
  text-align: center;
  border: 1.5px solid var(--border);
}
.aide-step span { font-size: 10px; color: var(--text3); margin-top: 3px; }
.aide-step-mandat    { border-top: 3px solid #6366F1; }
.aide-step-offre     { border-top: 3px solid #F59E0B; }
.aide-step-compromis { border-top: 3px solid #EC4899; }
.aide-step-acte      { border-top: 3px solid #10B981; }
.aide-step-arrow { font-size: 18px; color: var(--text3); }

/* FAQ */
.aide-faq-item {
  border-bottom: 1px solid var(--border);
}
.aide-faq-item:last-child { border-bottom: none; }
.aide-faq-q {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 12px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.aide-faq-q:hover { color: var(--primary); }
.aide-faq-chevron { color: var(--primary); flex-shrink: 0; font-size: 14px; }
.aide-faq-a {
  padding: 0 0 12px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

.aide-version {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  padding: 12px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ── CGU ── */
.aide-cgu-content { gap: 0; }

.aide-cgu-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary), #4F3FBF);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-bottom: 0;
}
.aide-cgu-logo { font-size: 32px; }
.aide-cgu-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.aide-cgu-meta { font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 3px; }

.aide-cgu-warning {
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: #991B1B;
  margin: 16px 0;
  line-height: 1.5;
}

.aide-cgu-section {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
}
.aide-cgu-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
  padding: 12px 18px;
  background: var(--primary-light);
  border-bottom: 1px solid var(--border);
}
.aide-cgu-section-body {
  padding: 14px 18px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.65;
}
.aide-cgu-section-body p { margin: 0 0 10px; }
.aide-cgu-section-body p:last-child { margin-bottom: 0; }
.aide-cgu-section-body ul { padding-left: 18px; margin: 6px 0 10px; }
.aide-cgu-section-body li { margin-bottom: 5px; }

.aide-cgu-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 13px;
}
.aide-cgu-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
}
.aide-cgu-table td:first-child {
  color: var(--text3);
  width: 40%;
  font-size: 12px;
}
.aide-cgu-table tr:last-child td { border-bottom: none; }

.aide-cgu-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  padding: 16px;
  border-top: 1px solid var(--border);
  line-height: 1.6;
  margin-top: 8px;
}

@media (max-width: 600px) {
  .aide-pipeline-steps { flex-direction: column; align-items: flex-start; }
  .aide-step-arrow { transform: rotate(90deg); }
  .aide-cgu-table td:first-child { width: 45%; }
}
