/* ============================================================
   Reloca CRM — Design System v2
   ============================================================ */

/* --- Tokens ---------------------------------------------- */
:root {
  --bg:          #F0F4F8;
  --surface:     #FFFFFF;
  --border:      #E2E8F0;
  --border-lt:   #EEF2F7;

  --primary:     #4A6FA5;
  --primary-dk:  #3A5A8C;
  --primary-lt:  #EEF3FB;

  --text:        #1A2332;
  --text-2:      #4A5568;
  --text-3:      #8A9AB0;

  --danger:      #E53E3E;
  --danger-lt:   #FFF5F5;
  --success-bg:  #F0FFF4;
  --success-bdr: #9AE6B4;
  --success-txt: #276749;

  --shadow-xs:   0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.07);
  --shadow:      0 4px 16px rgba(0,0,0,.09);
  --shadow-md:   0 8px 28px rgba(0,0,0,.11);

  --r-sm:   8px;
  --r:      12px;
  --r-lg:   18px;
  --r-xl:   24px;

  --sidebar-w:   240px;
  --topbar-h:    56px;
  --bnav-h:      64px;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- Reset ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }
svg { display: block; }

/* --- App layout ------------------------------------------ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: calc(var(--topbar-h) + 16px) 28px 20px;
  min-width: 0;
  max-width: 1440px;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border-lt);
  text-decoration: none;
  transition: opacity .15s;
}
.sidebar-brand:hover { opacity: .85; }
.brand-icon { width: 30px; height: 30px; flex-shrink: 0; }
.brand-name { font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -.3px; }

.sidebar-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; opacity: .65; display: flex; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { line-height: 1; }
.nav-item:hover { background: var(--primary-lt); color: var(--primary); }
.nav-item:hover .nav-icon { opacity: 1; }
.nav-item.active { background: var(--primary-lt); color: var(--primary); font-weight: 600; }
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--border-lt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .72rem; color: var(--text-3); }

.btn-logout {
  background: none; border: none;
  padding: 6px; border-radius: var(--r-sm);
  color: var(--text-3); cursor: pointer;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.btn-logout:hover { color: var(--danger); background: var(--danger-lt); }
.btn-logout svg { width: 17px; height: 17px; }

/* --- Topbar ---------------------------------------------- */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 36px;
  z-index: 90;
  gap: 12px;
  overflow: visible;
}
.topbar-brand {
  display: none; /* shown mobile only */
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.topbar-brand svg { width: 28px; height: 28px; }
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-user-wrap { position: relative; overflow: visible; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--r-sm);
  transition: background .15s;
}
.topbar-user:hover { background: var(--bg); }

.topbar-username { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .5px;
}

/* Dropdown */
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
}
.topbar-user-wrap.open .user-dropdown { display: block; }

.user-dropdown-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.user-dropdown-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.user-dropdown-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.user-dropdown-role { font-size: .75rem; color: var(--text-3); margin-top: 1px; }

.user-dropdown-sep { height: 1px; background: var(--border-lt); margin: 0; }

.user-dropdown-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--danger);
  transition: background .15s;
  text-align: left;
}
.user-dropdown-logout:hover { background: var(--danger-lt); }
.user-dropdown-logout svg { width: 16px; height: 16px; flex-shrink: 0; }

/* --- Bottom nav (mobile only, hidden on desktop) ---------- */
.bottom-nav { display: none; }

/* --- KPI scroll row -------------------------------------- */
.kpi-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 18px;
  min-width: 168px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  flex-shrink: 0;
}
.kpi-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kpi-total { cursor: default; }
.kpi-total:hover { box-shadow: var(--shadow-xs); transform: none; }

.kpi-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon-wrap svg { width: 18px; height: 18px; }

.kpi-icon-blue              { background: #DBEAFE; color: #2563EB; }
.kpi-icon-recherche_active  { background: #DBEAFE; color: #2563EB; }
.kpi-icon-visite_en_cours   { background: #FEF3C7; color: #D97706; }
.kpi-icon-offre_soumise     { background: #EDE9FE; color: #7C3AED; }
.kpi-icon-bail_signe        { background: #D1FAE5; color: #059669; }
.kpi-icon-suivi_apres_vente { background: #CFFAFE; color: #0891B2; }
.kpi-icon-complete          { background: #F1F5F9; color: #64748B; }

.kpi-body { display: flex; flex-direction: column; gap: 2px; }
.kpi-value { font-size: 1.55rem; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -.5px; }
.kpi-label { font-size: .72rem; font-weight: 500; color: var(--text-3); line-height: 1.2; max-width: 90px; }

/* --- Filters bar ----------------------------------------- */
.filters-bar { margin-bottom: 20px; }
.filters-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.filter-group {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 340px;
}
.filter-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-3); pointer-events: none;
  z-index: 1;
}
.filter-input {
  width: 100%;
  padding: 8px 12px 8px 2.5rem !important;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-size: .875rem;
}
.filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,111,165,.12); }
.filter-input::placeholder { color: var(--text-3); }
.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  outline: none;
  cursor: pointer;
  font-size: .875rem;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--primary); }

/* --- Cards meta ------------------------------------------ */
.cards-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.table-count { font-size: .82rem; color: var(--text-3); font-weight: 500; }

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

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  text-decoration: none;
  color: inherit;
}
.client-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
  border-color: #C9D8EC;
}

.client-card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.client-initial {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--primary-lt);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; font-weight: 700;
  flex-shrink: 0;
}
.client-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.client-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-sector {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  color: var(--text-3);
}
.client-sector svg { width: 11px; height: 11px; flex-shrink: 0; }

.client-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-lt);
}
.client-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.client-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .78rem;
  color: var(--text-3);
}
.client-meta-item svg { width: 12px; height: 12px; flex-shrink: 0; }
.client-date { font-size: .75rem; color: var(--text-3); white-space: nowrap; }

/* --- Status badges --------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-recherche_active  { background: #DBEAFE; color: #1D4ED8; }
.badge-visite_en_cours   { background: #FEF3C7; color: #92400E; }
.badge-offre_soumise     { background: #EDE9FE; color: #5B21B6; }
.badge-bail_signe        { background: #D1FAE5; color: #065F46; }
.badge-suivi_apres_vente { background: #CFFAFE; color: #155E75; }
.badge-complete          { background: #F1F5F9; color: #475569; }
.badge-admin             { background: #FEF3C7; color: #92400E; }
.badge-courtier          { background: var(--primary-lt); color: var(--primary); }

/* --- Buttons --------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(74,111,165,.3);
}
.btn-primary:hover { background: var(--primary-dk); box-shadow: 0 3px 8px rgba(74,111,165,.35); }

.btn-secondary {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); color: var(--text); }

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

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #C53030; }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1px solid transparent; }
.btn-danger-ghost:hover { background: var(--danger-lt); border-color: var(--danger); }

.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

/* --- Page header (client detail, admin) ------------------ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.page-header-left { display: flex; align-items: flex-start; gap: 14px; }
.page-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -.3px; color: var(--text); }
.page-sub { font-size: .82rem; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: background .15s, color .15s;
  margin-top: 3px;
  white-space: nowrap;
}
.btn-back:hover { background: var(--bg); color: var(--primary); }
.btn-back svg { width: 13px; height: 13px; }

/* --- Table card (admin users) ---------------------------- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.data-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-lt);
  color: var(--text-2);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.table-row { cursor: pointer; transition: background .1s; }
.table-row:hover { background: #FAFBFC; }
.td-action { white-space: nowrap; text-align: right; }
.td-name strong { color: var(--text); }

/* --- Empty state ----------------------------------------- */
.empty-state {
  padding: 72px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.empty-state svg { width: 64px; height: 64px; }
.empty-state p { color: var(--text-3); font-size: .95rem; }

/* --- Forms ---------------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--text-2); }
.required { color: var(--danger); }
.text-muted { font-weight: 400; color: var(--text-3); font-size: .78rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,111,165,.12);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { resize: vertical; }
select { cursor: pointer; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Client form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-lt);
  margin-bottom: 4px;
}
.notes-group textarea { min-height: 200px; }
.meta-info { background: var(--bg); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.meta-row { display: flex; justify-content: space-between; font-size: .78rem; color: var(--text-3); }
.meta-label { font-weight: 500; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* --- Alerts --------------------------------------------- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 20px;
}
.alert svg { width: 17px; height: 17px; flex-shrink: 0; }
.alert-error { background: var(--danger-lt); border: 1px solid #FEB2B2; color: var(--danger); }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-bdr); color: var(--success-txt); transition: opacity .5s; }

/* --- Auth page ------------------------------------------ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
}
.auth-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-logo svg { width: 48px; height: 48px; }
.auth-title { text-align: center; font-size: 1.5rem; font-weight: 800; letter-spacing: -.4px; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--text-3); font-size: .875rem; margin-bottom: 28px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

/* --- Modals --------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md); width: 100%; max-width: 440px; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--border-lt); }
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 1rem; color: var(--text-3); cursor: pointer; padding: 4px; border-radius: 4px; line-height: 1; }
.modal-close:hover { color: var(--text); background: var(--bg); }
.modal-form { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

/* --- Error page ----------------------------------------- */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; gap: 12px; }
.error-code { font-size: 3rem; font-weight: 800; color: var(--border); letter-spacing: -1px; }
.error-title { font-size: 1.25rem; font-weight: 700; }
.error-msg { color: var(--text-3); max-width: 400px; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 1024px) {
  .form-grid { grid-template-columns: 1fr; }
  .main-content { padding: calc(var(--topbar-h) + 24px) 24px 24px; }
}

@media (max-width: 768px) {
  /* Hide sidebar, show bottom nav */
  .sidebar { display: none; }

  .main-content {
    margin-left: 0;
    padding: calc(var(--topbar-h) + 20px) 16px calc(var(--bnav-h) + 16px);
  }

  /* Topbar: full width, show brand logo */
  .topbar {
    left: 0;
    padding: 0 16px;
  }
  .topbar-brand { display: flex; }

  /* Bottom nav */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bnav-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
    align-items: stretch;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: .68rem;
    font-weight: 500;
    color: var(--text-3);
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: var(--r-sm);
    transition: color .15s;
    text-decoration: none;
  }
  .bnav-item svg { width: 20px; height: 20px; }
  .bnav-item:hover, .bnav-item.active { color: var(--primary); }
  .bnav-item.active svg { stroke: var(--primary); }
  .bnav-item-form { flex: 1; display: flex; }
  .bnav-item-form .bnav-item { flex: 1; width: 100%; }

  /* KPI: tighter on mobile */
  .kpi-card { min-width: 140px; padding: 12px 14px; }
  .kpi-value { font-size: 1.3rem; }

  /* Cards: single column */
  .cards-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Filters */
  .filters-form { flex-direction: column; align-items: stretch; }
  .filter-group { max-width: 100%; }

  /* Form */
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .page-header { flex-direction: column; }
  .page-header-left { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  .kpi-scroll {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
  }
  .kpi-scroll::-webkit-scrollbar { display: none; }
  .kpi-card { min-width: 130px; flex-shrink: 0; }
}

/* ============================================================
   Champs en lecture seule (rôle courtier)
   ============================================================ */
.field-readonly {
  background: var(--bg) !important;
  color: var(--text-2);
  border-color: transparent !important;
  box-shadow: none !important;
  cursor: default;
  user-select: text;
}

/* ============================================================
   Indicateur auto-save
   ============================================================ */
.autosave-indicator {
  font-size: .72rem;
  color: var(--text-3);
  margin-left: 6px;
  opacity: 0;
  transition: opacity .4s ease;
}
.autosave-indicator.visible { opacity: 1; }

/* ============================================================
   Fil de conversation (messages SMS-style)
   ============================================================ */
.messages-thread {
  min-height: 220px;
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  scroll-behavior: smooth;
}

.messages-empty {
  text-align: center;
  color: var(--text-3);
  font-size: .85rem;
  margin: auto;
  padding: 1.5rem 0;
}
.messages-empty-new {
  padding: 2rem 0;
}

/* Bulle wrapper */
.msg-bubble-wrap {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}
.msg-bubble-wrap.msg-own   { align-self: flex-end;   align-items: flex-end; }
.msg-bubble-wrap.msg-other { align-self: flex-start; align-items: flex-start; }

/* Bulle */
.msg-bubble {
  padding: 8px 13px;
  border-radius: 18px;
  font-size: .875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-own   .msg-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-other .msg-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Méta (nom · heure) */
.msg-meta {
  font-size: .68rem;
  color: var(--text-3);
  margin-top: 3px;
  padding: 0 4px;
}

/* Zone de saisie */
.msg-input-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.msg-input {
  flex: 1;
  resize: none;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .875rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.msg-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74,111,165,.12);
}
.msg-send-btn {
  flex-shrink: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   KPI cards — lien + état actif
   ============================================================ */
a.kpi-card {
  text-decoration: none;
  cursor: pointer;
}
.kpi-card.kpi-active {
  box-shadow: 0 0 0 2px var(--primary), var(--shadow);
  transform: translateY(-1px);
}

/* ============================================================
   Topbar — bouton icône (cloche)
   ============================================================ */
.topbar-icon-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.topbar-icon-btn:hover { background: var(--bg); }

/* Badge rouge */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #E53E3E;
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  line-height: 1;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Notifications — wrapper + dropdown
   ============================================================ */
.topbar-notif-wrap {
  position: relative;
  margin-right: 4px;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-lt);
}

.notif-mark-all {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  color: var(--primary);
  padding: 0;
  font-family: inherit;
}
.notif-mark-all:hover { text-decoration: underline; }

.notif-list {
  max-height: 340px;
  overflow-y: auto;
}

.notif-item {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-lt);
  transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg); }

.notif-item.notif-unread { background: var(--primary-lt); }
.notif-item.notif-unread:hover { background: #e0eaf7; }

.notif-msg {
  font-size: .82rem;
  color: var(--text);
  line-height: 1.4;
}
.notif-item.notif-unread .notif-msg { font-weight: 500; }

.notif-time {
  font-size: .7rem;
  color: var(--text-3);
  margin-top: 3px;
}

.notif-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: .85rem;
  color: var(--text-3);
  margin: 0;
}

/* ============================================================
   Admin stats strip
   ============================================================ */
.admin-stats-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-stat-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem;
  color: var(--text-2);
}

.admin-stat-item svg { color: var(--text-3); }

.admin-stat-warn {
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  padding: 4px 10px;
}
.admin-stat-warn svg { color: #D97706; }

/* ============================================================
   Dashboard — filter selects
   ============================================================ */
.filter-select {
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.filter-select:focus { border-color: var(--primary); }

/* ============================================================
   Dashboard — cards-meta (count + actions)
   ============================================================ */
.cards-meta-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================
   Dashboard — client card wrap + admin action bar
   ============================================================ */
.client-card-wrap {
  display: flex;
  flex-direction: column;
  border-radius: var(--r);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow .18s, transform .18s;
}
.client-card-wrap:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

/* Override card's own border-radius/shadow since wrap handles it */
.client-card-wrap .client-card {
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  margin: 0;
}
.client-card-wrap .client-card:hover {
  transform: none;
  box-shadow: none;
}

.card-admin-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-top: 1px solid var(--border-lt);
  background: #F8FAFC;
}

.btn-card-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, color .12s;
  font-family: inherit;
}
.btn-card-action:hover { background: var(--border-lt); color: var(--text); }
.btn-card-danger       { color: var(--danger); }
.btn-card-danger:hover { background: var(--danger-lt); color: var(--danger); }

/* ============================================================
   Badge — inactive 30j
   ============================================================ */
.badge-inactive {
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FED7AA;
  font-size: .65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.client-card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* ============================================================
   Admin/users — badges role & status
   ============================================================ */
.badge-admin {
  background: #EEF3FB;
  color: var(--primary);
  border: 1px solid #C3D4EE;
}
.badge-courtier {
  background: #F0FFF4;
  color: #276749;
  border: 1px solid #9AE6B4;
}

.user-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.user-status-active   { background: #F0FFF4; color: #276749; border: 1px solid #9AE6B4; }
.user-status-inactive { background: #FFF5F5; color: #C53030; border: 1px solid #FEB2B2; }

.user-row-inactive td { opacity: .55; }
.user-row-inactive td:last-child { opacity: 1; }

.text-muted { color: var(--text-3); font-size: .82rem; }

/* ============================================================
   Admin/users — modal body + temp password
   ============================================================ */
.modal-body {
  padding: 0 0 16px;
}

.temp-pwd-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.temp-pwd-code {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--text);
  word-break: break-all;
}
.temp-pwd-warn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: .78rem;
  color: #92400E;
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.4;
}

/* ============================================================
   Map page
   ============================================================ */
.map-page {
  padding: 0 !important;
  max-width: 100% !important;
  overflow: hidden;
  position: relative;
}
.map-page #map {
  width: 100%;
  height: calc(100vh - var(--topbar-h));
  margin-top: var(--topbar-h);
  filter: brightness(1.1) saturate(0.9);
}
@media (max-width: 768px) {
  .map-page #map {
    height: calc(100vh - var(--topbar-h) - var(--bnav-h, 60px));
  }
}

/* Custom map markers */
@keyframes map-bounce {
  0%   { transform: translateY(-20px); opacity: 0; }
  60%  { transform: translateY(4px);   opacity: 1; }
  100% { transform: translateY(0);     opacity: 1; }
}
@keyframes map-pulse {
  0%   { box-shadow: 0 0 0 0   var(--dot-color, rgba(74,111,165,.6)), 0 1px 5px rgba(0,0,0,.32); }
  70%  { box-shadow: 0 0 0 16px transparent,                          0 1px 5px rgba(0,0,0,.32); }
  100% { box-shadow: 0 0 0 0   transparent,                           0 1px 5px rgba(0,0,0,.32); }
}
.map-dot {
  border-radius: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  cursor: pointer;
  --dot-color: rgba(74,111,165,.6);
  /* bounce in, then pulse forever */
  animation: map-bounce 0.45s ease-out backwards,
             map-pulse  2s    0.45s ease-out infinite;
}
.map-dot-cluster {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,.28);
}

/* Map popup — modern card style */
.mpopup {
  min-width: 190px;
  font-family: 'Inter', sans-serif;
  padding: 2px 0;
}
.mpopup-name {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  margin-bottom: 6px;
  line-height: 1.3;
}
.mpopup-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: .02em;
}
.mpopup-row {
  font-size: 12px;
  color: #64748B;
  margin-bottom: 3px;
  line-height: 1.4;
}
.mpopup-label { color: #94A3B8; }
.mpopup-row strong { color: #334155; font-weight: 600; }
.mpopup-link {
  display: inline-block;
  margin-top: 9px;
  font-size: 12px;
  font-weight: 600;
  color: #4A6FA5;
  text-decoration: none;
  background: #EEF3FB;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background .15s;
}
.mpopup-link:hover { background: #D9E5F5; text-decoration: none; }
.mpopup-hint { font-size: 11px; color: #94A3B8; font-style: italic; margin-top: 5px; }

/* Spotlight (focus) popup */
.mpopup-sector {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #4A6FA5;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #E2E8F0;
}
.mpopup-focus-item { padding: 9px 0; border-bottom: 1px solid #F1F5F9; }
.mpopup-focus-item:last-child { border-bottom: none; padding-bottom: 2px; }

/* Leaflet popup wrapper */
.mpopup-wrap .leaflet-popup-content-wrapper,
.spot-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(15,23,42,.15), 0 1px 4px rgba(15,23,42,.08);
  padding: 12px 14px;
}
.mpopup-wrap .leaflet-popup-content,
.spot-popup .leaflet-popup-content { margin: 0; }
.mpopup-wrap .leaflet-popup-tip-container,
.spot-popup .leaflet-popup-tip-container { display: block; }

/* Mapbox GL popup */
.mapboxgl-popup-content {
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(15,23,42,.15), 0 1px 4px rgba(15,23,42,.08) !important;
  padding: 12px 14px !important;
}
.mapboxgl-popup-tip { border-top-color: #fff !important; }

/* Leaflet MarkerCluster overrides */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { background: rgba(74,111,165,.15) !important; }
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: rgba(74,111,165,.6) !important;
  color: #fff !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
}

/* Map legend (Leaflet control) */
.map-legend {
  background: #fff;
  border-radius: 10px;
  padding: 10px 13px;
  box-shadow: 0 4px 16px rgba(15,23,42,.12), 0 1px 4px rgba(15,23,42,.06);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  min-width: 148px;
}
.map-legend-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #94A3B8;
  margin-bottom: 7px;
}
.map-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  margin-bottom: 4px;
}
.map-legend-item:last-child { margin-bottom: 0; }
.map-legend-hint {
  font-size: 10px;
  color: #94A3B8;
  font-style: italic;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid #F1F5F9;
  line-height: 1.5;
}
.map-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.12);
}

/* Legend positioned inside .map-page for Mapbox GL mode */
.map-legend-mgl {
  position: absolute;
  bottom: 28px;
  right: 10px;
  z-index: 100;
  pointer-events: auto;
}

/* Tile filter — dark mode */
.leaflet-tile-pane { filter: brightness(0.9) saturate(1.1); }

/* Quartier labels */
.map-quartier-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none !important;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Zoom controls */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: 0 2px 10px rgba(15,23,42,.12) !important;
  border-radius: 10px !important;
  overflow: hidden;
}
.leaflet-control-zoom a {
  border-radius: 0 !important;
  font-size: 16px !important;
  color: #334155 !important;
  border-bottom-color: #E2E8F0 !important;
}
.leaflet-control-zoom a:hover { background: #F8FAFC !important; color: #4A6FA5 !important; }

/* Attribution — tiny, discreet */
.leaflet-control-attribution {
  background: rgba(255,255,255,0.72) !important;
  font-size: 10px !important;
  padding: 2px 6px !important;
  border-radius: 4px 0 0 0 !important;
  color: #94A3B8 !important;
}
.leaflet-control-attribution a { color: #94A3B8 !important; }

/* Geocoding toast */
.map-geocode-toast {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(15,23,42,.82);
  color: #fff;
  font-size: .78rem;
  font-family: 'Inter', sans-serif;
  padding: 6px 14px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
}

/* ============================================================
   Reassign modal — client name (legacy)
   ============================================================ */
.modal .modal-body p { font-size: .9rem; color: var(--text-2); }

/* ============================================================
   Reassign modal — redesigned
   ============================================================ */
.modal.modal-reassign {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(15,23,42,.18), 0 2px 8px rgba(15,23,42,.10);
  overflow: hidden;
  max-width: 420px;
}

.modal-reassign-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #4A6FA5;
  padding: 18px 22px;
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.modal-reassign-close {
  background: none;
  border: none;
  color: rgba(255,255,255,.85);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background .12s, color .12s;
}
.modal-reassign-close:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
}

.modal-reassign-body {
  padding: 26px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-reassign-client-name {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
  margin: 0;
}

.modal-reassign-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal-reassign-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.modal-reassign-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  cursor: pointer;
  appearance: auto;
}
.modal-reassign-select:focus {
  border-color: #4A6FA5;
  box-shadow: 0 0 0 3px rgba(74,111,165,.15);
}

.modal-reassign-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 22px;
}

.modal-reassign-btn-cancel {
  padding: 9px 20px;
  border: 1.5px solid #CBD5E1;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font-size: .875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.modal-reassign-btn-cancel:hover {
  border-color: #94A3B8;
  background: #F8FAFC;
  color: var(--text);
}

.modal-reassign-btn-confirm {
  padding: 9px 22px;
  border: none;
  border-radius: 8px;
  background: #4A6FA5;
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
}
.modal-reassign-btn-confirm:hover {
  background: #3B5F94;
  box-shadow: 0 2px 8px rgba(74,111,165,.30);
}
.modal-reassign-btn-confirm:disabled {
  background: #94A3B8;
  cursor: not-allowed;
  box-shadow: none;
}

/* ============================================================
   Performance page
   ============================================================ */
.perf-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.perf-section-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}

.perf-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) { .perf-charts { grid-template-columns: 1fr; } }

.perf-chart-card { margin-bottom: 0; }
.chart-wrap { height: 260px; position: relative; }

/* Period tabs */
.period-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px;
}
.period-tab {
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-size: .8rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.period-tab:hover { background: rgba(74,111,165,.08); color: var(--primary); }
.period-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); }

/* Table tweaks */
.ta-r { text-align: right; }
.td-num { font-variant-numeric: tabular-nums; }
.td-name { font-weight: 500; }
.td-date { color: var(--text-3); font-size: .8rem; }
.td-empty { text-align: center; color: var(--text-3); padding: 28px; }

/* Conversion rate badge */
.perf-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  background: #E2E8F0;
  color: var(--text-2);
}
.perf-badge[data-high] { background: #4A6FA5; color: #fff; }
.perf-badge[data-mid]  { background: #7FA3CC; color: #fff; }

/* ─── News ticker ─────────────────────────────────────────── */
.news-ticker {
  display: none; /* shown by JS once feed loaded */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: #fff;
  border-top: 1px solid #E2E8F0;
  color: #64748B;
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  align-items: center;
  z-index: 80;
  overflow: hidden;
}
.ticker-track-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #64748B;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.ticker-item:hover { color: #4A6FA5; }
.ticker-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4A6FA5;
  flex-shrink: 0;
}
.ticker-title { color: #334155; }
.ticker-source {
  color: #94A3B8;
  font-size: 10px;
}
.ticker-sep {
  display: inline-block;
  padding: 0 16px;
  color: #CBD5E1;
  font-size: 13px;
  line-height: 1;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
/* Add bottom padding to main-content so ticker doesn't overlap */
.main-content { padding-bottom: calc(36px + 28px); }
@media (max-width: 768px) {
  .news-ticker { display: none !important; }
  .main-content { padding-bottom: calc(var(--bnav-h) + 16px); }
}

/* ─── Actualités page ─────────────────────────────────────── */
.actu-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.actu-filters--secondary { margin-bottom: 24px; }
.actu-filter {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: none;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s, color .15s;
}
.actu-filter:hover  { border-color: #4A6FA5; color: #4A6FA5; }
.actu-filter.active { background: #4A6FA5; border-color: #4A6FA5; color: #fff; }
/* source filters (smaller, plainer) */
.actu-filter-src {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: none;
  font-size: .76rem;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s, background .15s, color .15s;
}
.actu-filter-src:hover  { border-color: #94A3B8; color: var(--text-2); }
.actu-filter-src.active { background: #F1F5F9; border-color: #94A3B8; color: var(--text-1); }
/* category pill on card */
.actu-cat-pill {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.actu-cat--logement    { background: #FEF9C3; color: #854D0E; }
.actu-cat--immigration { background: #DBEAFE; color: #1E40AF; }
.actu-cat--emploi      { background: #D1FAE5; color: #065F46; }
.actu-cat--viequebec   { background: #EDE9FE; color: #5B21B6; }
.actu-cat--economie    { background: #DCFCE7; color: #166534; }
.actu-cat--autre       { background: #F1F5F9; color: #64748B; }
.actu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.actu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.actu-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-color: #C7D9F0;
  transform: translateY(-2px);
}
.actu-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.actu-source {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.actu-source--rc-immigration { background: #FCE7F3; color: #9D174D; }
.actu-source--rc-societe     { background: #DBEAFE; color: #1D4ED8; }
.actu-source--rc-economie    { background: #E0E7FF; color: #3730A3; }
.actu-source--metro          { background: #FEF3C7; color: #92400E; }
.actu-source--immigrer       { background: #D1FAE5; color: #065F46; }
.actu-source--lactualite     { background: #F3F4F6; color: #374151; }
.actu-date {
  font-size: .75rem;
  color: var(--text-3);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.actu-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  margin: 0;
}
.actu-summary {
  font-size: .82rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.actu-read-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  font-weight: 600;
  color: #4A6FA5;
  text-decoration: none;
  margin-top: auto;
  transition: color .15s;
}
.actu-read-link:hover { color: #3a5a8f; }
.actu-refresh-info { font-size: .8rem; color: var(--text-3); }

/* ============================================================
   Badge client (admin/users)
   ============================================================ */
.badge-client { background: #EDE9FE; color: #6D28D9; }

/* ============================================================
   Admin parcours page
   ============================================================ */
.parcours-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 2px solid var(--border); padding-bottom: 0; }
.parcours-tab {
  background: none; border: none; cursor: pointer;
  padding: 10px 18px; font-size: .875rem; font-weight: 500;
  color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.parcours-tab:hover { color: var(--primary); }
.parcours-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.tab-panel { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.semaine-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); margin-bottom: 10px; overflow: hidden;
}
.semaine-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; cursor: pointer;
  transition: background .15s;
}
.semaine-card-header:hover { background: var(--bg); }
.semaine-card-left { display: flex; align-items: center; gap: 14px; }
.semaine-num-badge {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-lt); color: var(--primary);
  font-weight: 700; font-size: .8rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.semaine-card-titre { font-weight: 600; font-size: .925rem; }
.semaine-card-meta { font-size: .78rem; color: var(--text-3); margin-top: 2px; }
.chevron-icon { color: var(--text-3); flex-shrink: 0; }

.semaine-card-body { border-top: 1px solid var(--border-lt); padding: 18px; }
.semaine-content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .semaine-content-grid { grid-template-columns: 1fr; } }

.content-col { background: var(--bg); border-radius: var(--r-sm); padding: 12px; }
.content-col-header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: .82rem; margin-bottom: 10px; color: var(--text-2);
}
.content-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 6px 8px; background: var(--surface);
  border-radius: var(--r-sm); margin-bottom: 4px; font-size: .82rem;
}
.content-empty { font-size: .8rem; color: var(--text-3); text-align: center; padding: 8px 0; }

.btn-xs {
  padding: 3px 8px; font-size: .75rem; border-radius: 5px;
  font-weight: 500; cursor: pointer; border: 1px solid transparent;
  transition: background .15s, color .15s;
}
.btn-xs.btn-ghost { border-color: var(--border); background: none; color: var(--text-2); }
.btn-xs.btn-ghost:hover { background: var(--primary-lt); color: var(--primary); border-color: var(--primary); }
.btn-xs.btn-danger-ghost { border-color: var(--border); background: none; color: var(--danger); }
.btn-xs.btn-danger-ghost:hover { background: var(--danger-lt); border-color: var(--danger); }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px 18px;
}
.faq-inactive { opacity: .5; }
.faq-q { font-size: .875rem; font-weight: 500; margin-bottom: 6px; }
.faq-r { font-size: .82rem; color: var(--text-2); margin-bottom: 10px; line-height: 1.5; }
.faq-actions { display: flex; gap: 8px; }

/* ============================================================
   Portail client — layout 3 colonnes
   ============================================================ */

/* ─── Header (semaine page) ─── */
.portal-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  height: 56px;
  display: flex; align-items: center;
}
.portal-header-content {
  width: 100%; max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.portal-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1rem; color: var(--text);
}
.portal-logo svg { width: 28px; height: 28px; }
.portal-header-actions { display: flex; align-items: center; gap: 8px; }
.portal-back-link {
  display: flex; align-items: center; gap: 6px;
  font-size: .875rem; font-weight: 500; color: var(--text-2);
  transition: color .15s;
}
.portal-back-link:hover { color: var(--primary); }
.portal-msg-btn {
  position: relative; background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--r-sm); color: var(--text-2);
  display: flex; align-items: center;
  transition: background .15s, color .15s;
}
.portal-msg-btn:hover { background: var(--primary-lt); color: var(--primary); }
.portal-msg-badge {
  position: absolute; top: 0; right: 0;
  background: var(--danger); color: #fff;
  font-size: .65rem; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.portal-logout-btn {
  background: none; border: none; cursor: pointer;
  padding: 6px; border-radius: var(--r-sm); color: var(--text-3);
  display: flex; align-items: center;
  transition: background .15s, color .15s;
}
.portal-logout-btn:hover { background: var(--danger-lt); color: var(--danger); }

.portal-main-semaine { padding: 24px 20px 120px; max-width: 640px; margin: 0 auto; }

/* ─── 3-column layout ─── */
.p3-layout {
  display: flex;
  min-height: 100vh;
  background: linear-gradient(160deg, #F0F4FF 0%, #FAFBFF 60%);
  font-family: 'Inter', var(--font), sans-serif;
}

/* COLONNE 1 — Sidebar (240px) */
.p3-sidebar {
  display: none; /* mobile: caché */
}

/* COLONNE 2 — Liste étapes */
.p3-steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border-right: 1px solid #EEF2F7;
}

/* Topbar mobile */
.p3-mob-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: #fff;
  border-bottom: 1px solid #EEF2F7;
  position: sticky; top: 0; z-index: 100;
}
.p3-mob-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: .95rem; font-weight: 800; color: #0F172A;
}
.p3-mob-actions { display: flex; align-items: center; gap: 6px; }
.p3-mob-btn {
  position: relative;
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #475569; transition: background .15s, color .15s;
}
.p3-mob-btn:hover { background: #F1F5F9; color: #4A6FA5; }
.p3-mob-btn--logout:hover { background: #FEF2F2; color: #EF4444; }

.p3-steps-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid #F1F5F9;
}
.p3-steps-title { font-size: 1.2rem; font-weight: 800; color: #0F172A; margin: 0 0 2px; }
.p3-steps-sub   { font-size: .78rem; color: #94A3B8; margin: 0; }

.p3-step-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 40px;
  display: flex; flex-direction: column; gap: 6px;
}

/* Step cards */
.p3-step-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 12px;
  padding: 12px 13px;
  text-align: left; cursor: pointer; border: none;
  border-left: 3px solid transparent;
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
  transition: box-shadow .18s, transform .15s, border-color .15s, background .15s;
  width: 100%; position: relative;
}
.p3-step-card:not([disabled]):hover {
  box-shadow: 0 3px 12px rgba(15,23,42,.09);
  transform: translateY(-1px);
}
.p3-step-card--done   { border-left-color: #34D399; opacity: .8; }
.p3-step-card--done:hover { opacity: 1; }
.p3-step-card--active {
  background: #EFF6FF; border-left-color: #4A6FA5;
  box-shadow: 0 2px 10px rgba(74,111,165,.12);
}
.p3-step-card--active:hover { box-shadow: 0 4px 16px rgba(74,111,165,.2); }
.p3-step-card--locked { opacity: .45; cursor: default; }
.p3-step-card--selected { box-shadow: 0 0 0 2px #4A6FA5 !important; transform: none !important; }
.p3-step-just-done { animation: card-glow .9s ease-out; }
@keyframes card-glow {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.6); }
  60%  { box-shadow: 0 0 0 10px rgba(52,211,153,0); }
  100% { box-shadow: 0 1px 3px rgba(15,23,42,.05); }
}

/* Step number circle */
.p3-step-num {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800;
}
.p3-step-num--done   { background: #DCFCE7; color: #16A34A; }
.p3-step-num--active { background: #DBEAFE; color: #2563EB; }
.p3-step-num--locked { background: #F1F5F9; color: #CBD5E1; }

.p3-step-body { flex: 1; min-width: 0; }
.p3-step-label {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: #94A3B8; margin-bottom: 2px;
}
.p3-obligatoire { color: #4A6FA5; }
.p3-step-title { font-size: 13px; font-weight: 600; color: #0F172A; line-height: 1.35; }
.p3-step-desc  { font-size: 11px; color: #64748B; margin-top: 2px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Checklist progress */
.p3-step-prog { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.p3-step-prog-track { flex: 1; height: 3px; background: #E2E8F0; border-radius: 3px; }
.p3-step-prog-fill  { height: 3px; border-radius: 3px; transition: width .4s ease; }
.p3-step-prog-fill--done   { background: #34D399; }
.p3-step-prog-fill--active { background: #4A6FA5; }
.p3-step-prog-lbl { font-size: 10px; color: #94A3B8; white-space: nowrap; flex-shrink: 0; }

.p3-step-right {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.p3-chevron { color: #CBD5E1; transition: color .15s; }
.p3-step-card:not([disabled]):hover .p3-chevron { color: #4A6FA5; }
.p3-step-card--selected .p3-chevron { color: #4A6FA5; }

/* Badges */
.p3-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; white-space: nowrap;
}
.p3-badge--done   { background: #DCFCE7; color: #16A34A; }
.p3-badge--active { background: #DBEAFE; color: #2563EB; animation: badge-pulse 2.5s ease-in-out infinite; }
.p3-badge--locked { background: #F1F5F9; color: #94A3B8; }
@keyframes badge-pulse { 0%,100%{opacity:1;} 50%{opacity:.55;} }

/* Unread badge */
.p3-unread {
  min-width: 17px; height: 17px; border-radius: 9px;
  background: #EF4444; color: #fff;
  font-size: .6rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
  margin-left: auto;
}
.p3-unread--badge {
  position: absolute; top: 0; right: 0;
  min-width: 15px; height: 15px;
}

/* Soon badge */
.p3-soon-tag {
  margin-left: auto; font-size: .6rem; font-weight: 700; padding: 1px 6px;
  background: #F1F5F9; color: #94A3B8; border-radius: 20px;
}

/* COLONNE 3 — Panneau détail (caché mobile) */
.p3-detail { display: none; }

/* Mobile bottom sheet */
.p3-sheet-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 600;
  opacity: 0; transition: opacity .25s;
}
.p3-sheet-overlay.visible { display: block; opacity: 1; }

.p3-sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 20px 20px 0 0;
  z-index: 700; max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.p3-sheet.open { transform: translateY(0); }
.p3-sheet-handle {
  width: 36px; height: 4px; background: #E2E8F0;
  border-radius: 2px; margin: 10px auto 4px;
  flex-shrink: 0;
}
.p3-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px 14px;
  font-size: .85rem; font-weight: 700; color: #0F172A;
  border-bottom: 1px solid #F1F5F9;
  flex-shrink: 0;
}
.p3-sheet-body {
  flex: 1; overflow-y: auto;
  padding: 16px 18px 40px;
}

/* Spinner */
.p3-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid #E2E8F0;
  border-top-color: #4A6FA5;
  animation: p3-spin .7s linear infinite;
  display: block;
}
.p3-spinner--sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: middle; }
@keyframes p3-spin { to { transform: rotate(360deg); } }

.p3-detail-spinner { display: none; align-items: center; justify-content: center; padding: 60px; }

/* ─── Desktop ≥1024px ─── */
@media (min-width: 1024px) {
  /* 3 colonnes */
  .p3-layout { overflow: hidden; height: 100vh; }

  .p3-sidebar {
    display: flex; flex-direction: column; align-items: center;
    width: 240px; flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #EEF2F7;
    padding: 24px 16px 20px;
    overflow-y: auto;
    position: sticky; top: 0; height: 100vh;
  }

  .p3-logo {
    display: flex; align-items: center; gap: 8px;
    font-size: 1rem; font-weight: 800; color: #0F172A;
    margin-bottom: 24px; width: 100%;
  }
  .p3-avatar-wrap {
    position: relative; width: 72px; height: 72px;
    margin: 0 auto 10px; flex-shrink: 0;
  }
  .p3-ring { position: absolute; inset: -8px; width: 88px; height: 88px; }
  .p3-avatar {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A6FA5, #2D6A4F);
    color: #fff; font-size: 1.15rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .p3-user-name { font-size: .9rem; font-weight: 700; color: #0F172A; text-align: center; margin-bottom: 3px; }
  .p3-user-country { font-size: .72rem; color: #94A3B8; text-align: center; margin-bottom: 6px; }
  .p3-pct { font-size: .78rem; color: #64748B; margin-bottom: 18px; }
  .p3-pct-val { color: #4A6FA5; font-weight: 700; }

  .p3-nav {
    width: 100%; margin-bottom: 18px;
    display: flex; flex-direction: column; gap: 2px;
  }
  .p3-nav-item {
    display: flex; align-items: center; gap: 9px; width: 100%;
    padding: 8px 10px; border-radius: 9px;
    font-size: .82rem; font-weight: 500; color: #475569;
    background: none; border: none; cursor: pointer; text-decoration: none;
    transition: background .15s, color .15s;
  }
  .p3-nav-item:hover:not(:disabled):not(.p3-nav-item--active) { background: #F8FAFC; }
  .p3-nav-item--active { background: #EFF6FF; color: #2563EB; font-weight: 600; cursor: default; }
  .p3-nav-item--soon   { opacity: .5; cursor: default; }

  .p3-coord {
    display: flex; align-items: center; gap: 9px;
    background: linear-gradient(135deg,#F0F7FF,#E8F5F0);
    border: 1px solid #C7E2FF; border-radius: 11px;
    padding: 10px 12px; width: 100%; margin-top: auto; margin-bottom: 10px;
  }
  .p3-coord-av {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg,#4A6FA5,#2D6A4F);
    color: #fff; font-size: .75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
  }
  .p3-coord-info { flex: 1; min-width: 0; }
  .p3-coord-name { font-size: .8rem; font-weight: 700; color: #0F172A; }
  .p3-coord-role { font-size: .67rem; color: #64748B; }
  .p3-coord-btn  {
    width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
    background: #4A6FA5; color: #fff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
  }
  .p3-coord-btn:hover { background: #3A5A8C; transform: scale(1.08); }

  .p3-logout-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 7px; border-radius: 8px;
    background: none; border: none; cursor: pointer;
    font-size: .75rem; color: #94A3B8;
    transition: color .15s, background .15s;
  }
  .p3-logout-btn:hover { color: #EF4444; background: #FEF2F2; }

  /* Steps column */
  .p3-steps {
    width: 340px; flex-shrink: 0;
    height: 100vh; overflow-y: auto;
    border-right: 1px solid #EEF2F7;
    display: flex; flex-direction: column;
  }
  .p3-mob-topbar  { display: none; }
  .p3-step-list   { padding: 10px 12px 40px; }
  .p3-step-desc   { display: block; }

  /* Detail column */
  .p3-detail {
    display: flex; flex-direction: column;
    flex: 1; min-width: 0;
    height: 100vh; overflow-y: auto;
    background: #FAFCFF;
  }

  /* Empty state */
  .p3-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; padding: 40px; text-align: center;
    min-height: 100%;
  }
  .p3-empty-svg  { width: 180px; height: 145px; margin-bottom: 20px; }
  .p3-empty-title { font-size: 1.05rem; font-weight: 700; color: #0F172A; margin-bottom: 6px; }
  .p3-empty-sub   { font-size: .82rem; color: #94A3B8; }

  /* Detail inner */
  .p3-detail-inner {
    padding: 28px 32px 60px;
    opacity: 0; transform: translateX(16px);
  }
  .p3-detail-inner--in {
    animation: p3-slidein .28s ease forwards;
  }
  @keyframes p3-slidein {
    to { opacity: 1; transform: translateX(0); }
  }

  /* Detail header */
  .p3d-hdr {
    display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px;
    padding-bottom: 16px; border-bottom: 1px solid #F1F5F9;
  }
  .p3d-num {
    width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800;
  }
  .p3d-num--done   { background: #DCFCE7; color: #16A34A; }
  .p3d-num--active { background: #DBEAFE; color: #2563EB; }
  .p3d-num--locked { background: #F1F5F9; color: #CBD5E1; }
  .p3d-hdr-body { flex: 1; min-width: 0; }
  .p3d-hdr-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #94A3B8; margin-bottom: 4px; }
  .p3d-hdr-title { font-size: 1.25rem; font-weight: 800; color: #0F172A; line-height: 1.3; margin: 0; }
  .p3d-desc { font-size: .88rem; color: #64748B; line-height: 1.6; margin-bottom: 20px; }

  /* Sections */
  .p3d-section { margin-bottom: 22px; }
  .p3d-section-title {
    display: flex; align-items: center; gap: 7px;
    font-size: .8rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #475569;
    margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid #F1F5F9;
  }
  .p3d-prog-lbl {
    margin-left: auto; font-size: .72rem; font-weight: 500;
    background: #EFF6FF; color: #4A6FA5; padding: 1px 8px; border-radius: 12px;
    text-transform: none; letter-spacing: 0;
  }

  /* Video */
  .p3d-video-card { border-radius: 12px; overflow: hidden; border: 1px solid #E2E8F0; margin-bottom: 10px; }
  .p3d-video-title { padding: 10px 14px; font-size: .82rem; font-weight: 600; color: #0F172A; border-bottom: 1px solid #F1F5F9; }
  .p3d-video-wrap  { position: relative; padding-top: 56.25%; background: #000; }
  .p3d-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

  /* Checklist */
  .p3d-checklist { display: flex; flex-direction: column; gap: 7px; }
  .p3d-check-item {
    display: flex; align-items: flex-start; gap: 11px;
    background: #fff; border: 1px solid #E2E8F0; border-radius: 10px;
    padding: 11px 13px; cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
  }
  .p3d-check-item:hover { border-color: #4A6FA5; background: #FAFCFF; }
  .p3d-check-item--done { background: #F0FFF4; border-color: #9AE6B4; }
  .p3d-check-box {
    width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
    border: 2px solid #E2E8F0; background: #fff;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, border-color .15s;
  }
  .p3d-check-box--checked { background: #059669; border-color: #059669; }
  .p3d-check-label { font-size: .875rem; line-height: 1.5; flex: 1; }
  .p3d-check-item--done .p3d-check-label { text-decoration: line-through; color: #94A3B8; }

  /* Documents */
  .p3d-docs { display: flex; flex-direction: column; gap: 7px; }
  .p3d-doc-item {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border: 1px solid #E2E8F0; border-radius: 10px;
    padding: 11px 13px; color: #0F172A; font-size: .875rem; font-weight: 500;
    transition: border-color .15s, color .15s;
    text-decoration: none;
  }
  .p3d-doc-item:hover { border-color: #4A6FA5; color: #4A6FA5; }

  /* Actions */
  .p3d-actions { margin-top: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
  .p3d-done-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: #D1FAE5; color: #059669;
    font-weight: 700; padding: 10px 18px;
    border-radius: 12px; font-size: .9rem;
  }
  .p3d-complete-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, #4A6FA5, #3A5A8C);
    color: #fff; border: none; cursor: pointer;
    padding: 12px 24px; border-radius: 12px;
    font-size: .92rem; font-weight: 700;
    box-shadow: 0 4px 14px rgba(74,111,165,.3);
    transition: transform .15s, box-shadow .15s;
  }
  .p3d-complete-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(74,111,165,.38); }
  .p3d-complete-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
  .p3d-next-btn {
    display: inline-flex; align-items: center; gap: 8px;
    background: #EFF6FF; color: #2563EB; border: none; cursor: pointer;
    padding: 10px 20px; border-radius: 12px;
    font-size: .88rem; font-weight: 600;
    transition: background .15s;
  }
  .p3d-next-btn:hover { background: #DBEAFE; }

  /* Chatbot FAB hidden on desktop (accessible via sidebar) */
  .portal-chatbot-fab { display: none; }
}

/* ─── Confetti ─── */
.confetti-stage {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9999; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -12px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg) scale(.8); opacity: 0; }
}

/* (old tl-* / sb-* / desktop removed — replaced by p3-* above) */


/* ─── Semaine page ─── */
.semaine-progress-bar {
  height: 4px; background: var(--border);
  position: sticky; top: 56px; z-index: 90;
}
.semaine-progress-fill {
  height: 4px; background: var(--primary);
  transition: width .4s ease;
}
.semaine-header { margin-bottom: 24px; padding-top: 4px; }
.semaine-badge {
  display: inline-flex; align-items: center;
  background: var(--primary-lt); color: var(--primary);
  font-size: .75rem; font-weight: 700; letter-spacing: .5px;
  padding: 4px 10px; border-radius: 20px; margin-bottom: 10px;
}
.semaine-titre { font-size: 1.5rem; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
.semaine-desc  { color: var(--text-2); font-size: .9rem; line-height: 1.6; }

.semaine-section { margin-bottom: 28px; }
.semaine-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 1rem; font-weight: 700; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border-lt);
}

/* Vidéos */
.semaine-videos { display: flex; flex-direction: column; gap: 14px; }
.semaine-video-card { background: var(--surface); border-radius: var(--r); overflow: hidden; border: 1px solid var(--border); }
.semaine-video-titre { padding: 10px 14px; font-weight: 600; font-size: .875rem; border-bottom: 1px solid var(--border-lt); }
.semaine-video-wrap { position: relative; padding-top: 56.25%; background: #000; }
.semaine-video-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* Checklist */
.semaine-checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer;
  transition: border-color .15s;
}
.checklist-item:hover { border-color: var(--primary); }
.checklist-cb { display: none; }
.checklist-box {
  width: 20px; height: 20px; border-radius: 5px;
  border: 2px solid var(--border); background: var(--surface);
  flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.checklist-cb:checked + .checklist-box {
  background: #059669; border-color: #059669;
}
.checklist-cb:checked + .checklist-box::after {
  content: ''; display: block;
  width: 5px; height: 9px;
  border: 2px solid #fff; border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}
.checklist-label { font-size: .875rem; line-height: 1.5; flex: 1; }
.checklist-done  { text-decoration: line-through; color: var(--text-3); }

/* Documents */
.semaine-docs { display: flex; flex-direction: column; gap: 8px; }
.semaine-doc-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 14px;
  color: var(--text); font-size: .875rem; font-weight: 500;
  transition: border-color .15s, color .15s;
}
.semaine-doc-item:hover { border-color: var(--primary); color: var(--primary); }
.semaine-doc-item svg:first-child { color: var(--primary); flex-shrink: 0; }

/* Bouton complété */
.semaine-complete-wrap { margin-top: 28px; text-align: center; }
.semaine-complete-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #4A6FA5, #3A5A8C);
  color: #fff; border: none; cursor: pointer;
  padding: 14px 28px; border-radius: var(--r-lg);
  font-size: 1rem; font-weight: 700;
  box-shadow: 0 4px 14px rgba(74,111,165,.35);
  transition: transform .15s, box-shadow .15s;
}
.semaine-complete-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(74,111,165,.4); }
.semaine-complete-btn:disabled { opacity: .6; cursor: not-allowed; }
.semaine-complete-hint { font-size: .78rem; color: var(--text-3); margin-top: 10px; }
.semaine-done-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #D1FAE5; color: #059669;
  font-weight: 700; padding: 12px 20px;
  border-radius: var(--r-lg); margin-top: 28px; font-size: .95rem;
}

/* ─── Panneau messages client ─── */
.portal-msg-panel {
  position: fixed; top: 0; right: -360px; bottom: 0;
  width: 340px; max-width: 95vw;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 500;
  transition: right .3s ease;
  box-shadow: var(--shadow-md);
}
.portal-msg-panel.open { right: 0; }
.portal-msg-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: .95rem;
}
.portal-msg-thread {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.portal-msg-empty { font-size: .82rem; color: var(--text-3); text-align: center; margin: auto; }
.portal-msg-compose {
  display: flex; gap: 8px; padding: 12px 16px;
  border-top: 1px solid var(--border-lt); align-items: flex-end;
}
.portal-msg-textarea {
  flex: 1; resize: none; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 12px; font-size: .875rem;
  outline: none; line-height: 1.4;
}
.portal-msg-textarea:focus { border-color: var(--primary); }
.portal-send-btn {
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  padding: 9px 12px; border-radius: var(--r-sm);
  display: flex; align-items: center;
  transition: background .15s;
}
.portal-send-btn:hover { background: var(--primary-dk); }
.portal-close-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px; border-radius: var(--r-sm); color: var(--text-3);
  display: flex; align-items: center;
  transition: background .15s;
}
.portal-close-btn:hover { background: var(--bg); color: var(--text); }
.portal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.25);
  z-index: 499; opacity: 0; pointer-events: none; transition: opacity .3s;
}
.portal-overlay.visible { opacity: 1; pointer-events: auto; }

/* ─── Assistant Sourcinc — panel slide-in droite ─── */
.cb-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.25);
  z-index: 598; opacity: 0; transition: opacity .25s;
}
.cb-overlay.visible { display: block; opacity: 1; }

.cb-panel {
  position: fixed; top: 0; right: -420px; bottom: 0;
  width: 400px; max-width: 95vw;
  background: #fff; border-left: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 599;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 32px rgba(0,0,0,.12);
}
.cb-panel.open { right: 0; }

.cb-hdr {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 18px 14px;
  background: linear-gradient(135deg, #2D3A5E 0%, #2D6A4F 100%);
  flex-shrink: 0;
}
.cb-hdr-title {
  display: flex; align-items: center; gap: 7px;
  font-weight: 700; font-size: .95rem; color: #fff; margin-bottom: 3px;
}
.cb-hdr-sub { font-size: .75rem; color: rgba(255,255,255,.7); }
.cb-hdr .portal-close-btn { color: rgba(255,255,255,.8); }
.cb-hdr .portal-close-btn:hover { background: rgba(255,255,255,.15); color: #fff; }

/* Category shortcut buttons */
.cb-cats {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 14px; border-bottom: 1px solid #F1F5F9;
  background: #FAFCFF; flex-shrink: 0;
}
.cb-cat {
  font-size: .75rem; font-weight: 500; padding: 4px 10px;
  border-radius: 20px; border: 1px solid #E2E8F0;
  background: #fff; cursor: pointer; color: #475569;
  transition: background .14s, border-color .14s, color .14s;
}
.cb-cat:hover { background: #EFF6FF; border-color: #4A6FA5; color: #4A6FA5; }

/* Messages thread */
.cb-msgs {
  flex: 1; overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.cb-bubble {
  padding: 9px 13px; border-radius: 14px;
  font-size: .85rem; line-height: 1.55; max-width: 88%;
}
.cb-bubble-bot  {
  background: #F0F4FF; color: #0F172A;
  align-self: flex-start; border-bottom-left-radius: 4px;
}
.cb-bubble-user {
  background: linear-gradient(135deg,#4A6FA5,#3A5A8C); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 4px;
}
.cb-contact-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #4A6FA5; color: #fff; border: none; cursor: pointer;
  padding: 7px 14px; border-radius: 8px; font-size: .82rem; font-weight: 600;
  transition: background .15s;
}
.cb-contact-btn:hover { background: #3A5A8C; }

/* Suggestion pills (real-time + category) */
.cb-suggestions {
  padding: 0 14px 8px;
  display: flex; flex-direction: column; gap: 5px;
  flex-shrink: 0;
}
.cb-sugg-pill {
  text-align: left; background: #F8FAFC;
  border: 1px solid #E2E8F0; border-radius: 10px;
  padding: 7px 12px; font-size: .8rem; color: #0F172A;
  cursor: pointer; transition: background .14s, border-color .14s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cb-sugg-pill:hover { background: #EFF6FF; border-color: #4A6FA5; color: #2563EB; }

/* Input area */
.cb-compose {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1px solid #F1F5F9; align-items: center;
  flex-shrink: 0; background: #fff;
}
.cb-input {
  flex: 1; border: 1px solid #E2E8F0; border-radius: 22px;
  padding: 8px 16px; font-size: .85rem; outline: none;
  transition: border-color .15s;
}
.cb-input:focus { border-color: #4A6FA5; }

/* FAB */
.portal-chatbot-fab {
  position: fixed; bottom: 20px; right: 20px;
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; border: none; cursor: pointer; z-index: 399;
  box-shadow: 0 4px 18px rgba(74,111,165,.28), 0 1px 4px rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.portal-chatbot-fab:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(74,111,165,.38); }

/* ─── Admin FAQ categories ─── */
.faq-cat-section { margin-bottom: 20px; }
.faq-cat-header {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #64748B;
  padding: 6px 0 8px; margin-bottom: 8px;
  border-bottom: 1px solid #F1F5F9;
  display: flex; align-items: center;
}

/* ─── Mobile fine-tuning ─── */
@media (max-width: 480px) {
  .p3-steps-title      { font-size: 1.05rem; }
  .p3-step-card        { padding: 10px 11px; gap: 10px; }
  .p3-step-title       { font-size: 12px; }
  .semaine-titre       { font-size: 1.25rem; }
  .cb-panel            { width: 100vw; }
  .portal-main-semaine { padding: 16px 14px 100px; }
}

/* ─── Client tabs (dossier / parcours) ─── */
.client-tabs-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.client-tab-btn {
  padding: 8px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  transition: color .15s, border-color .15s;
}
.client-tab-btn:hover { color: var(--primary); }
.client-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-lt);
}
.client-tab-content { padding-top: 0.5rem; }

/* ─── Form portal fields ─── */
.form-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0 1.25rem;
}
.form-sub-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 1rem;
}

/* ─── Parcours progression table ─── */
.parcours-progression-table { margin-top: 1rem; }
.parcours-no-account {
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-2);
}

/* ─── Credentials card (client-created page) ─── */
.credentials-card {
  max-width: 580px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.credentials-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  background: var(--success-bg);
  border-bottom: 1px solid var(--success-bdr);
  color: var(--success-txt);
  font-weight: 600;
  font-size: 1rem;
}
.credentials-body { padding: 24px; }
.credentials-body p { margin: 0 0 1rem; color: var(--text); }
.credentials-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 1rem;
}
.cred-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
}
.cred-row + .cred-row { border-top: 1px solid var(--border-lt); }
.cred-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  min-width: 160px;
  flex-shrink: 0;
}
.cred-value {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 0;
  user-select: all;
}
.cred-password {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .08em;
}
.cred-note {
  font-size: 0.82rem;
  color: var(--text-3);
  margin: 0 !important;
}
.credentials-actions {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

/* ─── Performance: KPI row ─── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .kpi-grid { grid-template-columns: 1fr 1fr; } }
.kpi-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
  flex-shrink: 0;
}
.kpi-value {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-1);
}
.kpi-label {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ─── Performance: 2-column layout ─── */
.perf-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
  align-items: start;
}
@media (max-width: 1000px) { .perf-two-col { grid-template-columns: 1fr; } }

/* ─── Performance: 3 charts row ─── */
.perf-charts3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1000px) { .perf-charts3 { grid-template-columns: 1fr; } }

/* ─── Performance: count badge in section title ─── */
.perf-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  background: #F1F5F9;
  color: #475569;
  font-size: .68rem;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 4px;
}

/* ─── Performance: client cards (zone 2) ─── */
.perf-c2-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 1300px) { .perf-c2-grid { grid-template-columns: 1fr; } }
.perf-c2-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: box-shadow .15s;
}
.perf-c2-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.perf-c2-hdr {
  display: flex;
  align-items: center;
  gap: 9px;
}
.perf-c2-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
}
.perf-c2-name {
  font-weight: 600;
  font-size: .88rem;
  color: var(--text-1);
  line-height: 1.3;
}
.perf-c2-pays {
  font-size: .73rem;
  color: var(--text-3);
}
.perf-c2-step {
  font-size: .78rem;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 18px;
}
.perf-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.perf-c2-bar {
  height: 5px;
  background: var(--bg-2);
  border-radius: 2px;
  overflow: hidden;
}
.perf-c2-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.perf-c2-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

/* ─── Performance: client portal cards ─── */
.perf-client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.perf-client-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s;
}
.perf-client-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.perf-client-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.perf-client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.perf-client-name {
  font-weight: 600;
  font-size: .92rem;
  color: var(--text-1);
  line-height: 1.3;
}
.perf-client-pays {
  font-size: .78rem;
  color: var(--text-3);
}
.perf-client-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.perf-client-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-2);
  border-radius: 3px;
  overflow: hidden;
}
.perf-client-step-badge {
  font-size: .75rem;
  color: var(--text-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.perf-client-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.perf-badge-sm {
  font-size: .72rem;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--bg-2);
  color: var(--text-2);
  white-space: nowrap;
}

/* ============================================================
   Dashboard Admin — Vue 360 CRM
   ============================================================ */

/* Layout 2 colonnes 60/40 */
.dash-crm-main {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1.5fr;
  gap: 16px;
  align-items: start;
  margin-top: 14px;
}
@media (max-width: 1200px) {
  .dash-crm-main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .dash-crm-main { grid-template-columns: 1fr; }
}
.dash-crm-left { min-width: 0; }
.dash-crm-mid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.dash-crm-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* Section header gauche */
.dash-crm-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-crm-section-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.dash-crm-section-count {
  font-size: .75rem;
  color: var(--text-3);
}

/* Panels droite */
.dash-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
}
.dash-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-bottom: 12px;
}
.dash-panel-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
}
.dash-panel-link {
  font-size: .75rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}
.dash-panel-link:hover { text-decoration: underline; }

/* Panel alertes */
.dash-panel-alerts {
  border-color: #FCA5A5;
  background: #FFF5F5;
}
.dash-panel-alerts .dash-panel-hdr { color: #991B1B; }
.dash-alerts-list { display: flex; flex-direction: column; gap: 0; }
.dash-alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(252,165,165,.3);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.dash-alert-item:last-child { border-bottom: none; }
.dash-alert-item:hover { background: rgba(252,165,165,.1); border-radius: 6px; padding-left: 4px; }
.dash-alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-alert-body { flex: 1; min-width: 0; }
.dash-alert-name {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-alert-desc {
  display: block;
  font-size: .72rem;
  color: var(--text-2);
}
.dash-alert-arrow {
  font-size: .75rem;
  color: var(--text-3);
  flex-shrink: 0;
}

/* Partners compact list */
.dash-partners-list { display: flex; flex-direction: column; gap: 0; }
.dash-partner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-lt);
  text-decoration: none;
  color: inherit;
  transition: background .1s;
}
.dash-partner-row:last-child { border-bottom: none; }
.dash-partner-row:hover { background: var(--bg); border-radius: 6px; padding-left: 4px; }
.dash-partner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.dash-partner-info { flex: 1; min-width: 0; }
.dash-partner-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 5px;
}
.dash-partner-meta {
  font-size: .7rem;
  color: var(--text-3);
}

/* Pipeline pills */
.pipeline-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
}
.pipeline-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.pipeline-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.pipeline-pill:hover {
  background: var(--primary-lt);
  border-color: var(--primary);
  color: var(--primary);
}
.pipeline-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pipeline-pill.active .pill-count {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-2);
  line-height: 1;
}

/* Search row */
.dash-search-row {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: nowrap;
  max-width: 100%;
}
.dash-search-wrap {
  position: relative;
  width: 280px;
  flex-shrink: 0;
}
.dash-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-3);
  pointer-events: none;
}
.dash-search-input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: .82rem;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.dash-search-input:focus { border-color: var(--primary); }

/* Count bar */
.dash-count-bar {
  font-size: .78rem;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* Client grid */
.dash-client-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 860px) {
  .dash-client-grid { grid-template-columns: 1fr; }
}

/* Individual client card (reuses perf-c2-card) */
.dash-c-card {
  transition: box-shadow .15s, transform .15s;
}
.dash-c-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Section label in sidebar */
.dash-section-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 12px;
}

/* Activity feed */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-lt);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}
.activity-body { min-width: 0; }
.activity-text {
  font-size: .78rem;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.activity-time {
  font-size: .7rem;
  color: var(--text-3);
  margin-top: 2px;
}

/* ============================================================
   Partenaires
   ============================================================ */

.part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.part-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.part-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.part-card-hdr {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.part-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.part-info { flex: 1; min-width: 0; }
.part-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.part-email {
  font-size: .75rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.part-status-badge {
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.part-badge-active   { background: #DCFCE7; color: #166534; }
.part-badge-inactive { background: #F1F5F9; color: #64748B; }

.part-unread-badge {
  background: #DC2626;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.6;
}

.part-prog-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.part-prog-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.part-prog-label {
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.part-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  border-top: 1px solid var(--border-lt);
  padding-top: 12px;
}
.part-stat { text-align: center; }
.part-stat-val {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}
.part-stat-lbl {
  font-size: .65rem;
  color: var(--text-3);
  margin-top: 1px;
}

/* Detail page */
.part-detail-wrap { display: flex; flex-direction: column; gap: 0; }

.part-detail-hdr {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  border-radius: 14px;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.part-detail-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.part-detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.4rem;
}
.part-detail-info { flex: 1; min-width: 0; }
.part-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.part-detail-cols {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
@media (max-width: 1050px) {
  .part-detail-cols { grid-template-columns: 1fr; }
}

/* Client list in detail */
.part-clients-list { display: flex; flex-direction: column; }
.part-client-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-lt);
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.part-client-row:last-child { border-bottom: none; }
.part-client-row:hover { background: var(--bg); }
.part-client-initial {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-lt);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.part-badge-sm {
  font-size: .68rem;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Messaging */
.part-msg-card {
  display: flex;
  flex-direction: column;
  height: 580px;
  overflow: hidden;
  border-radius: 14px;
  padding: 0;
}
.part-msg-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.part-msg-row { display: flex; flex-direction: column; }
.part-msg-row-me  { align-items: flex-end; }
.part-msg-row-them { align-items: flex-start; }
.part-msg-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: .83rem;
  line-height: 1.45;
  word-break: break-word;
}
.part-msg-me {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.part-msg-them {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.part-msg-meta {
  font-size: .66rem;
  color: var(--text-3);
  margin-top: 3px;
  padding: 0 4px;
}
.part-msg-compose {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.part-msg-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: .83rem;
  font-family: var(--font);
  resize: none;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s;
}
.part-msg-input:focus { border-color: var(--primary); }

/* ============================================================
   Admin Talents — liste + panneau latéral
   ============================================================ */

/* Tuiles KPI statut */
.tal-kpi-row {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.tal-kpi-row::-webkit-scrollbar { display: none; }

.tal-kpi-tile {
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 14px 20px 12px;
  cursor: pointer;
  min-width: 110px;
  transition: box-shadow .15s, border-color .15s, background .15s;
}
.tal-kpi-tile:hover { box-shadow: var(--shadow); }

.tal-kpi-badge {
  position: absolute;
  top: 8px; right: 10px;
  background: var(--bg);
  color: var(--text-2);
  font-size: .68rem;
  font-weight: 800;
  border-radius: 20px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  line-height: 1.5;
}

.tal-kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
}

.tal-kpi-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  text-align: center;
}

/* Filtres */
.tal-filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; margin-bottom: 16px;
}
.tal-search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 280px; }
.tal-search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); color: var(--text-3); pointer-events: none;
}

/* En-tête colonnes */
.tal-list-head {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 16px;
  font-size: .72rem; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
}

/* Ligne talent */
.tal-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 16px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  margin-bottom: 6px;
}
.tal-row:hover { box-shadow: var(--shadow-sm); border-color: var(--primary); }

/* Colonnes layout */
.tal-col-avatar  { width: 40px; flex-shrink: 0; }
.tal-col-identity{ flex: 1; min-width: 0; }
.tal-col-pays    { width: 130px; flex-shrink: 0; display: flex; align-items: center; gap: 5px; }
.tal-col-prog    { width: 140px; flex-shrink: 0; }
.tal-col-statut  { width: 150px; flex-shrink: 0; }
.tal-col-login   { width: 84px; flex-shrink: 0; font-size: .78rem; text-align: right; }
.tal-col-msgs    { width: 36px; flex-shrink: 0; text-align: center; }
.tal-col-action  { width: 70px; flex-shrink: 0; }

.tal-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .78rem; font-weight: 700;
}
.tal-name  { font-size: .87rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tal-email { font-size: .74rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tal-flag  { font-size: 1.05rem; flex-shrink: 0; }
.tal-pays-txt { font-size: .78rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tal-prog-bar-wrap { display: flex; align-items: center; gap: 6px; }
.tal-prog-bar { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }

.tal-statut-badge {
  font-size: .71rem; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  white-space: nowrap; display: inline-block;
}
.tal-msg-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #EF4444; color: #fff;
  font-size: .68rem; font-weight: 700;
}

/* Overlay */
.tal-panel-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.28);
  z-index: 900;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.tal-panel-overlay.open { opacity: 1; pointer-events: auto; }

/* Panneau latéral */
.tal-panel {
  position: fixed; top: 0; right: 0;
  width: 500px; max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  box-shadow: -6px 0 32px rgba(0,0,0,.13);
  z-index: 901;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.tal-panel.open { transform: translateX(0); }

.tal-panel-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.tal-panel-close {
  background: none; border: none; cursor: pointer;
  font-size: 1.5rem; color: var(--text-3); padding: 0 2px;
  line-height: 1; flex-shrink: 0; transition: color .15s;
}
.tal-panel-close:hover { color: var(--text); }
.tal-panel-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
}
.tal-panel-name { font-size: .93rem; font-weight: 700; color: var(--text); }
.tal-panel-sub  { font-size: .76rem; color: var(--text-3); }

/* Onglets */
.tal-panel-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface);
}
.tal-tab-btn {
  flex: 1; background: none; border: none;
  padding: 10px 6px; cursor: pointer;
  font-size: .78rem; font-weight: 500; color: var(--text-2);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tal-tab-btn:hover { color: var(--text); }
.tal-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* Corps du panneau */
.tal-panel-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.tal-loading { text-align: center; color: var(--text-3); padding: 48px 0; font-size: .88rem; }

/* Timeline parcours */
.tal-timeline { display: flex; flex-direction: column; }
.tal-timeline-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0 8px 14px;
  border-left: 3px solid var(--border);
  margin-left: 10px;
}
.tal-timeline-icon { font-size: .95rem; flex-shrink: 0; margin-left: -10px; background: var(--surface); }
.tal-timeline-title { font-size: .83rem; font-weight: 600; color: var(--text); }
.tal-timeline-status { font-size: .74rem; margin-top: 1px; }

/* Dossier form */
.tal-dossier-form { display: flex; flex-direction: column; gap: 13px; }
.tal-field { display: flex; flex-direction: column; gap: 4px; }
.tal-field label { font-size: .77rem; font-weight: 600; color: var(--text-2); }

/* Messages */
.tal-msgs-thread {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 300px; overflow-y: auto;
  margin-bottom: 12px; padding: 4px 0;
}
.tal-msg-row { display: flex; flex-direction: column; }
.tal-msg-me   { align-items: flex-end; }
.tal-msg-them { align-items: flex-start; }
.tal-msg-bubble {
  max-width: 82%; padding: 8px 12px; border-radius: 12px;
  font-size: .84rem; line-height: 1.4;
  word-break: break-word;
}
.tal-msg-bubble-me   { background: var(--primary); color: #fff; border-radius: 12px 12px 4px 12px; }
.tal-msg-bubble-them { background: var(--bg); color: var(--text); border-radius: 12px 12px 12px 4px; }
.tal-msg-meta { font-size: .7rem; color: var(--text-3); margin-top: 3px; }
.tal-msg-compose {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--border); padding-top: 12px;
}
.tal-msg-input {
  border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 10px 12px; resize: vertical; width: 100%;
  min-height: 68px; background: var(--surface); color: var(--text);
  font-family: var(--font); font-size: .84rem;
}
.tal-msg-input:focus { outline: none; border-color: var(--primary); }

/* Activité */
.tal-act-list { display: flex; flex-direction: column; }
.tal-act-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 9px 0 9px 14px;
  border-left: 2px solid var(--border); margin-left: 10px;
}
.tal-act-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
  margin-top: 5px; margin-left: -13px;
}
.tal-act-label { font-size: .83rem; font-weight: 600; color: var(--text); }
.tal-act-meta  { font-size: .74rem; color: var(--text-3); margin-top: 2px; }

/* ============================================================
   Sidebar drag & drop
   ============================================================ */
.nav-drag-handle {
  display: none;
  font-size: .85rem;
  color: var(--text-3);
  cursor: grab;
  padding-right: 4px;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}
.nav-item { display: flex; align-items: center; }
.nav-item:hover .nav-drag-handle { display: block; }
.nav-item-dragging { opacity: .35; pointer-events: none; }
.nav-item-dragover { background: var(--primary-lt) !important; border-radius: var(--r-sm); }

.sidebar-reset-order {
  width: 100%; background: none; border: none;
  font-size: .71rem; color: var(--text-3);
  cursor: pointer; padding: 6px 20px; text-align: left;
  border-top: 1px solid var(--border); margin-top: 4px;
  transition: color .15s;
}
.sidebar-reset-order:hover { color: var(--text-2); }

@media (max-width: 768px) {
  .nav-drag-handle { display: none !important; }
  .sidebar-reset-order { display: none; }
  .tal-list-head { display: none; }
  .tal-row {
    flex-wrap: wrap; gap: 8px;
  }
  .tal-col-pays, .tal-col-prog, .tal-col-statut, .tal-col-login,
  .tal-col-msgs, .tal-col-action { display: none; }
  .tal-col-identity { flex: 1; }
  .tal-panel { width: 100vw; }
}

/* ============================================================
   Nouveau Talent — formulaire redesigné (ntf)
   ============================================================ */
.ntf-form { max-width: 860px; }

.ntf-sections { display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px; }

.ntf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  padding: 22px 28px;
}

.ntf-section-title {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
  margin-bottom: 18px;
}

.ntf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.ntf-field { display: flex; flex-direction: column; gap: 5px; }
.ntf-field-full { grid-column: 1 / -1; }

.ntf-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-2);
}

.ntf-hint {
  font-size: .74rem;
  color: var(--text-3);
  margin-top: 5px;
}

.ntf-pwd-field {
  flex: 1;
  min-width: 0;
}

.ntf-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 16px;
  gap: 12px;
}

.ntf-submit-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 36px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(74,111,165,.3);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.ntf-submit-btn:hover {
  background: var(--primary-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(74,111,165,.35);
}
.ntf-submit-btn:active { transform: translateY(0); }

@media (max-width: 600px) {
  .ntf-grid { grid-template-columns: 1fr; }
  .ntf-card { padding: 16px 18px; }
}

/* ── Ticker close / restore ── */
.ticker-close-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,.55);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 10px 0 6px;
  transition: color .15s;
  align-self: center;
}
.ticker-close-btn:hover { color: #fff; }

.ticker-restore-btn {
  position: fixed;
  bottom: 10px;
  right: 14px;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 11px;
  font-size: .82rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
  gap: 4px;
}
.ticker-restore-btn:hover { box-shadow: var(--shadow); }

@media (max-width: 768px) {
  .ticker-restore-btn { bottom: calc(var(--bnav-h) + 8px); }
}

/* ============================================================
   Dashboard Admin — Greeting banner
   ============================================================ */
.dash-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #EFF6FF 0%, #F0FDF4 100%);
  border: 1px solid #DBEAFE;
  border-radius: 12px;
  padding: 10px 18px;
  margin-bottom: 12px;
}
.dash-greeting-left { min-width: 0; }
.dash-greeting-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.2px;
  line-height: 1.2;
}
.dash-greeting-wave { display: inline-block; }
.dash-greeting-date {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 1px;
  text-transform: capitalize;
}
.dash-greeting-sub {
  font-size: .75rem;
  color: var(--text-2);
  margin-top: 1px;
}
.dash-greeting-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.dash-greeting-badge {
  display: inline-flex;
  align-items: center;
  background: #DC2626;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .dash-greeting { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .dash-greeting-right { flex-wrap: wrap; }
}

/* ── Weather widget ── */
.weather-widget {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.75);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 12px;
  font-size: .82rem;
  color: var(--text-2);
  backdrop-filter: blur(4px);
}
.ww-icon  { font-size: 1.1rem; line-height: 1; }
.ww-temp  { font-weight: 700; color: var(--text); }
.ww-city  { color: var(--text-3); font-size: .72rem; }

/* ── KPI sparklines ── */
.kpi-sparkline {
  margin-top: 6px;
  opacity: .85;
}

/* ── Compact talent table ── */
.dash-talent-table {
  width: 100%;
  border-collapse: collapse;
}
.dt-row {
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.dt-row:last-child { border-bottom: none; }
.dt-row:hover { background: var(--bg-2); }
.dt-row td { padding: 9px 6px; vertical-align: middle; }
/* Col 1 : avatar */
.dt-avatar-cell { width: 36px; padding-left: 0 !important; }
.dt-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #4A6FA5;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* Col 2 : nom + pays */
.dt-info-cell { min-width: 0; width: 32%; }
.dt-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dt-pays { font-size: .67rem; color: var(--text-3); margin-top: 1px; }
/* Col 3 : progression + étape */
.dt-prog-cell { width: 28%; }
.dt-prog-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 2px;
}
.dt-prog-fill { height: 100%; border-radius: 2px; transition: width .3s; }
.dt-prog-pct { font-size: .67rem; font-weight: 600; }
.dt-step-name {
  font-size: .67rem;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}
/* Col 4 : étape numéro */
.dt-step-cell { width: 60px; }
.dt-step-txt { font-size: .71rem; color: var(--text-2); white-space: nowrap; }
.dt-done { font-size: .71rem; color: #10B981; font-weight: 600; }
.dt-none { font-size: .71rem; color: var(--text-3); }
/* Col 5 : badges */
.dt-badges-cell { white-space: nowrap; text-align: right; }
.dt-badge-red,
.dt-badge-orange,
.dt-badge-gray {
  display: inline-flex;
  align-items: center;
  font-size: .63rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  margin-bottom: 2px;
  white-space: nowrap;
}
.dt-badge-red    { background: #FEE2E2; color: #991B1B; }
.dt-badge-orange { background: #FEF3C7; color: #92400E; }
.dt-badge-gray   { background: #F1F5F9; color: #64748B; font-weight: 500; }
/* Col 6 : lien */
.dt-action-cell { width: 24px; text-align: right; padding-right: 0 !important; }
.dt-link {
  color: var(--primary);
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  opacity: .6;
  transition: opacity .1s;
}
.dt-link:hover { opacity: 1; }
.dt-footer {
  margin-top: 10px;
  text-align: right;
}
.dt-more-link {
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.dt-more-link:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .dt-step-cell, .dt-pays { display: none; }
  .dt-prog-cell { width: 60px; }
}

/* ── Donut chart panel ── */
.dash-donut-panel { padding: 14px 16px; }
.dash-donut-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-donut-wrap canvas {
  width: 120px !important;
  height: 120px !important;
  flex-shrink: 0;
}
.dash-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.ddleg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .69rem;
  color: var(--text-2);
  line-height: 1.3;
}
.ddleg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ddleg-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
}
.ddleg-cnt {
  font-weight: 700;
  color: var(--text);
  font-size: .72rem;
  flex-shrink: 0;
}

/* ── Citation du jour ── */
.dash-quote {
  margin-top: 14px;
  padding: 10px 0 4px;
  text-align: center;
}
.dash-quote-sep {
  width: 48px;
  height: 1px;
  background: var(--border);
  margin: 0 auto 10px;
}
.dash-quote-text {
  font-size: .85rem;
  font-style: italic;
  color: var(--text-3);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}
.dash-quote-author {
  font-size: .72rem;
  color: var(--text-3);
  margin-top: 6px;
  opacity: .7;
}


/* ══════════════════════════════════════════════════════
   Messagerie /admin/messagerie
══════════════════════════════════════════════════════ */
.msg-main {
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}
.msg-layout {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--topbar-h) - 36px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.msg-left {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: #FAFBFC;
}
.msg-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.msg-search-form { padding: 10px 10px 8px; box-sizing: border-box; width: 100%; }
.msg-search-wrap { position: relative; width: 100%; }
.msg-search-icon {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none; flex-shrink: 0;
}
.msg-search-input {
  width: 100%; padding: 7px 10px 7px 30px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: .8rem; background: var(--surface); outline: none; color: var(--text);
}
.msg-search-input:focus { border-color: var(--primary); }
.msg-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 12px; flex-shrink: 0;
}
.msg-tab {
  flex: 1; padding: 7px 4px; text-align: center;
  font-size: .78rem; font-weight: 600; color: var(--text-3);
  border-bottom: 2px solid transparent; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: color .15s, border-color .15s;
}
.msg-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.msg-tab-badge {
  background: #DC2626; color: #fff;
  font-size: .62rem; font-weight: 700; padding: 1px 5px; border-radius: 8px;
}
.msg-conv-list { flex: 1; overflow-y: auto; }
.msg-empty-list { padding: 24px 16px; text-align: center; font-size: .8rem; color: var(--text-3); }
.msg-conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--border-lt);
  text-decoration: none; color: inherit; cursor: pointer; transition: background .1s;
}
.msg-conv-item:hover { background: #F4F7FB; }
.msg-conv-item.active { background: #EEF3FB; }
.msg-conv-item.unread .msg-conv-name { font-weight: 700; }
.msg-conv-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.msg-conv-avatar-partner { background: #7C3AED; }
.msg-conv-body { flex: 1; min-width: 0; }
.msg-conv-name { font-size: .83rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-conv-preview { font-size: .73rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.msg-conv-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.msg-conv-time { font-size: .66rem; color: var(--text-3); white-space: nowrap; }
.msg-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.msg-no-conv { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-3); }
.msg-no-conv-icon { font-size: 2.5rem; opacity: .35; }
.msg-no-conv p { font-size: .85rem; }
.msg-thread-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
}
.msg-thread-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
}
.msg-thread-avatar-partner { background: #7C3AED; }
.msg-thread-name { font-size: .92rem; font-weight: 700; color: var(--text); flex: 1; }
.msg-thread-link { font-size: .76rem; color: var(--primary); text-decoration: none; }
.msg-thread-link:hover { text-decoration: underline; }
.msg-messages { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.msg-empty-thread { text-align: center; font-size: .8rem; color: var(--text-3); margin: auto; }
.msg-bubble-wrap { display: flex; }
.msg-bubble-wrap.out { justify-content: flex-end; }
.msg-bubble-wrap.in  { justify-content: flex-start; }
.msg-bubble { max-width: 72%; background: #F0F4F8; border-radius: 14px; padding: 7px 13px; }
.msg-bubble-wrap.out .msg-bubble { background: var(--primary); color: #fff; }
.msg-bubble-text { font-size: .86rem; line-height: 1.5; }
.msg-bubble-meta { font-size: .64rem; opacity: .55; margin-top: 3px; text-align: right; }
.msg-send-form { padding: 10px 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.msg-send-wrap { display: flex; gap: 8px; }
.msg-readonly-banner { padding: 10px 14px; border-top: 1px solid var(--border); font-size: .78rem; color: #6b7280; background: #f9fafb; text-align: center; flex-shrink: 0; }
.msg-send-input {
  flex: 1; padding: 7px 14px; border: 1px solid var(--border);
  border-radius: 22px; font-size: .86rem; outline: none; background: #F8FAFC; color: var(--text);
}
.msg-send-input:focus { border-color: var(--primary); background: #fff; }
.msg-send-btn {
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: var(--primary); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.msg-send-btn:hover { background: var(--primary-dk); }
.msg-send-btn svg { width: 15px; height: 15px; }
.nav-msg-badge {
  position: absolute; top: -4px; right: -6px;
  background: #DC2626; color: #fff;
  font-size: .58rem; font-weight: 700; padding: 1px 4px; border-radius: 8px; line-height: 1.3;
}
