/* ==========================================================================
   Naya Partner — feuille de style maison (aucun framework, aucun CDN)
   Fintech premium épuré : fond clair, cartes blanches, bleu marine, doré.
   ========================================================================== */

:root {
  --navy: #1e2a4a;
  --navy-700: #17203a;
  --navy-500: #2c3c66;
  --gold: #c9a227;
  --gold-soft: #f4e9c6;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e7e9ef;
  --text: #17203a;
  --text-muted: #6b7488;
  --text-soft: #98a0b3;

  --green: #1f9d5b;
  --green-soft: #e3f6ec;
  --green-light: #7cc9a0;
  --green-light-soft: #eef8f2;
  --blue: #2563c9;
  --blue-soft: #e6eefb;
  --amber: #b4820c;
  --amber-soft: #fdf3d8;
  --grey: #6b7488;
  --grey-soft: #eef0f4;
  --red: #c0392b;
  --red-soft: #fdeceb;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 32, 58, .04), 0 8px 24px rgba(23, 32, 58, .06);
  --shadow-hover: 0 2px 4px rgba(23, 32, 58, .06), 0 14px 34px rgba(23, 32, 58, .1);
  --sidebar-w: 264px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.layout { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 28px 20px 24px;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #dfe4ef;
  z-index: 20;
}

.sidebar__brand { margin-bottom: 34px; }

.sidebar__logo {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--gold);
}
.sidebar__logo span { color: #ffffff; font-weight: 600; }

.sidebar__tagline {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(223, 228, 239, .58);
  letter-spacing: .02em;
}

.sidebar__nav { display: flex; flex-direction: column; gap: 4px; }

.navlink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(223, 228, 239, .82);
  transition: background .15s ease, color .15s ease;
}
.navlink:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.navlink.is-active {
  background: rgba(201, 162, 39, .14);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}
.navlink.is-active .navlink__icon { color: var(--gold); }

.navlink__icon { display: flex; color: rgba(223, 228, 239, .6); }
.navlink__icon svg { width: 19px; height: 19px; }

.navlink--button {
  width: 100%;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.sidebar__footer { margin-top: auto; padding-top: 22px; }
.sidebar__logout { margin-bottom: 16px; }

.sidebar__signature {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: 12px;
  color: rgba(223, 228, 239, .5);
}
.sidebar__signature strong { display: block; color: var(--gold); font-size: 13px; letter-spacing: .04em; }

.main {
  margin-left: var(--sidebar-w);
  padding: 34px 38px 56px;
  max-width: 1180px;
}

.bottomnav { display: none; }

/* --------------------------------------------------------------------------
   En-tête de page + sélecteur de période
   -------------------------------------------------------------------------- */

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.pagehead__title { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.pagehead__subtitle { margin-top: 5px; color: var(--text-muted); font-size: 14.5px; }

.periodform { display: flex; align-items: center; gap: 10px; }
.periodform__label { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.periodform__select {
  appearance: none;
  padding: 10px 38px 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7488' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 15px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.periodform__select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.periodform__submit {
  padding: 10px 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff; font: inherit; cursor: pointer;
}

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { padding: 22px 24px; margin-bottom: 20px; }

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.panel__title { font-size: 16.5px; font-weight: 700; }
.panel__subtitle { font-size: 13px; color: var(--text-muted); }

.panel__link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13.5px; font-weight: 600; color: var(--navy-500);
}
.panel__link:hover { color: var(--gold); }
.panel__link svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   KPI
   -------------------------------------------------------------------------- */

.kpigrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi { padding: 18px; }
.kpigrid--five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi__label { font-size: 13px; font-weight: 600; color: var(--text-muted); letter-spacing: .01em; }
.kpi__value { margin-top: 8px; font-size: 32px; font-weight: 750; letter-spacing: -.02em; color: var(--navy); line-height: 1.1; }

/* Le rapport borde chaque carte de la couleur de son indicateur. */
.kpi { border-top: 3px solid var(--border); }
.kpi--neutral { border-top-color: var(--navy); }
.kpi--green   { border-top-color: var(--green); }
.kpi--amber   { border-top-color: var(--amber); }
.kpi--red     { border-top-color: var(--red); }
.kpi--soft    { border-top-color: var(--grey); }
.kpi--green .kpi__value { color: var(--green); }
.kpi--red   .kpi__value { color: var(--red); }
.kpi--amber .kpi__value { color: var(--amber); }

.kpi__hint { margin-top: 10px; font-size: 12.5px; color: var(--text-soft); line-height: 1.4; }

/* --------------------------------------------------------------------------
   Encadré « L'essentiel — » (synthèse en français du rapport)
   -------------------------------------------------------------------------- */

.essential {
  padding: 20px 22px;
  margin-bottom: 20px;
  border-left: 4px solid var(--gold);
  background: linear-gradient(90deg, #fffdf6, var(--surface) 60%);
}
.essential__title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gold);
}
.essential__text {
  margin-top: 8px; font-size: 15.5px; line-height: 1.6; color: var(--navy);
}
/* Ce qui a été retiré des compteurs est DIT, jamais masqué en silence. */
.essential__note { margin-top: 10px; font-size: 13px; color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Tableau de leads
   -------------------------------------------------------------------------- */

.leadtable { width: 100%; border-collapse: collapse; }

.leadtable thead th {
  padding: 0 12px 10px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-soft);
  border-bottom: 1px solid var(--border);
}

.leadtable__row { cursor: pointer; transition: background .15s ease; }
.leadtable__row:hover { background: #f4f6fa; }
.leadtable tbody td { padding: 13px 12px; border-bottom: 1px solid #f1f3f7; vertical-align: middle; }
.leadtable tbody tr:last-child td { border-bottom: 0; }

.leadtable__link { display: flex; align-items: center; gap: 11px; }
.leadtable__name { font-size: 14.5px; font-weight: 600; color: var(--navy); }
.leadtable__origin { display: block; font-size: 14px; font-weight: 500; color: var(--text); }
.leadtable__city, .leadtable__date { display: block; font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.leadtable__ident { display: flex; flex-direction: column; min-width: 0; }
.leadtable__phone { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }
.leadtable__demande { font-size: 13.5px; color: var(--text); }
.statnum { font-size: 15px; font-weight: 700; color: var(--text-muted); }
.statnum--green { color: var(--green); }
.statnum--red { color: var(--red); }
.panel__count { font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.panel__city { font-size: 13px; font-weight: 500; color: var(--text-soft); }
.leadtable__chevron { width: 30px; text-align: right; color: var(--text-soft); }
.leadtable__chevron svg { width: 16px; height: 16px; }
.leadtable__empty { padding: 26px 12px; text-align: center; color: var(--text-muted); }

.bignum { font-size: 16px; font-weight: 700; color: var(--navy); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 34px;
  border-radius: 50%;
  background: var(--navy); color: var(--gold);
  font-size: 14px; font-weight: 700;
}
.avatar--lg { width: 54px; height: 54px; flex-basis: 54px; font-size: 20px; }
.avatar--square { border-radius: 14px; }
.avatar--square svg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   Badges de statut
   -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
/* « OÙ ÇA EN EST » — les 5 états dérivés du rapport. */
.badge--green { background: var(--green-soft); color: var(--green); }
.badge--amber { background: var(--amber-soft); color: var(--amber); }
.badge--red   { background: var(--red-soft); color: var(--red); }
.badge--grey  { background: var(--grey-soft); color: var(--grey); }
.badge--soft  { background: #f4f6fa; color: var(--text-muted); }

/* « CONSENTEMENT » : oui + date, ou non. */
.consent { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.consent--yes { color: var(--green); }
.consent--no  { color: var(--text-muted); }

/* « WHATSAPP » : état du dernier message au prospect. */
.wa { font-size: 13px; font-weight: 600; }
.wa--red   { color: var(--red); }
.wa--green { color: var(--green); }
.wa--amber { color: var(--amber); }
.wa--soft  { color: var(--text-soft); }

/* Fiche « La demande » du détail d'un prospect. */
.factlist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.factlist__item dt {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-soft);
}
.factlist__item dd { margin-top: 6px; font-size: 14.5px; color: var(--navy); }
.leadhead__phone { margin-top: 2px; font-size: 14.5px; font-weight: 600; color: var(--text); }

/* --------------------------------------------------------------------------
   Détail d'un lead
   -------------------------------------------------------------------------- */

.backlink {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 18px;
  font-size: 13.5px; font-weight: 600; color: var(--text-muted);
}
.backlink:hover { color: var(--navy); }
.backlink svg { width: 16px; height: 16px; }

.leadhead {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 22px 24px; margin-bottom: 20px;
}
.leadhead__body { flex: 1 1 240px; }
.leadhead__name { font-size: 22px; font-weight: 700; }
.leadhead__origin { margin-top: 3px; font-size: 14px; color: var(--text-muted); }
.leadhead__meta { margin-top: 3px; font-size: 13px; color: var(--text-soft); }

.timeline { position: relative; display: flex; flex-direction: column; gap: 22px; padding-left: 6px; }
.timeline::before {
  content: ""; position: absolute; left: 24px; top: 12px; bottom: 12px;
  width: 2px; background: #eaedf3;
}

.timeline__item { position: relative; display: flex; gap: 16px; align-items: flex-start; }

.timeline__icon {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%;
  background: var(--grey-soft); color: var(--text-muted);
  border: 3px solid var(--surface);
}
.timeline__icon svg { width: 18px; height: 18px; }
.timeline__icon--qr       { background: #eef0f6; color: var(--navy); }
.timeline__icon--email    { background: var(--blue-soft); color: var(--blue); }
.timeline__icon--whatsapp { background: var(--green-light-soft); color: #2f8a60; }
.timeline__icon--shield   { background: var(--green-soft); color: var(--green); }
.timeline__icon--person   { background: var(--gold-soft); color: #97781a; }

.timeline__label { font-size: 14.5px; font-weight: 600; color: var(--navy); }
.timeline__detail { margin-top: 2px; font-size: 13.5px; color: var(--text-muted); }
.timeline__date { margin-top: 4px; font-size: 12.5px; color: var(--text-soft); }

.updated { margin: 6px 0 0; font-size: 12.5px; color: var(--text-soft); }

/* --------------------------------------------------------------------------
   Connexion
   -------------------------------------------------------------------------- */

.loginbody {
  background: linear-gradient(155deg, var(--navy) 0%, var(--navy-700) 55%, #101731 100%);
  min-height: 100vh;
}
.loginwrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.logincard { width: 100%; max-width: 400px; padding: 34px 30px; }

.login__logo { font-size: 16px; font-weight: 800; letter-spacing: .14em; color: var(--gold); }
.login__logo span { color: var(--navy); font-weight: 600; }
.login__title { margin-top: 16px; font-size: 21px; font-weight: 700; }
.login__subtitle { margin-top: 6px; font-size: 14px; color: var(--text-muted); }

.login__error {
  margin-top: 18px; padding: 10px 13px;
  border-radius: var(--radius-sm);
  background: #fdeceb; color: var(--red);
  font-size: 13.5px; font-weight: 500;
}

.login__form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }

.field { display: block; }
.field__label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.field__input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fbfcfe; font: inherit; font-size: 15px; color: var(--text);
}
.field__input:focus { outline: 2px solid var(--gold); outline-offset: 1px; background: #fff; }

.btn {
  padding: 13px 18px; border: 0; border-radius: var(--radius-sm);
  font: inherit; font-size: 15px; font-weight: 650; cursor: pointer;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-500); }

/* Mention discrète : l'entrée normale de l'apporteur est son lien privé. */
.login__hint { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--text-soft); }

.login__footer { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--text-soft); }
.login__footer strong { color: var(--navy); }

/* --------------------------------------------------------------------------
   « POURQUOI ÇA EN EST LÀ » — motif de blocage
   Trois surfaces : le bloc agrégé du tableau de bord (.whyblock), la ligne
   sous chaque prospect (.whyrow / .why) et l'encadré de la fiche (.whybox).
   Une seule échelle de couleurs pour les trois, sinon le lecteur ne fait pas
   le lien entre le total et le cas particulier.
   -------------------------------------------------------------------------- */

/* Qui attend quoi. Jamais rouge : c'est un constat, pas une accusation. */
.sidetag {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  background: #eef0f6;
  color: var(--text-muted);
}
.sidetag--prospect { background: #eef0f6; color: var(--text-muted); }
.sidetag--cabinet  { background: var(--navy); color: #fff; }

/* -- Bloc agrégé du tableau de bord -- */
.whyblock { margin-bottom: 20px; }
.whylist { display: flex; flex-direction: column; gap: 14px; }
.whylist__item { display: flex; align-items: flex-start; gap: 14px; }
.whylist__count {
  flex: 0 0 44px;
  height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  font-size: 16px; font-weight: 700;
  background: var(--grey-soft); color: var(--grey);
}
.whylist__count--green { background: var(--green-soft); color: var(--green); }
.whylist__count--amber { background: var(--amber-soft); color: var(--amber); }
.whylist__count--blue  { background: var(--blue-soft);  color: var(--blue); }
.whylist__count--grey  { background: var(--grey-soft);  color: var(--grey); }
.whylist__count--red   { background: var(--red-soft);   color: var(--red); }
.whylist__body { flex: 1 1 auto; min-width: 0; padding-top: 3px; }
.whylist__line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.whylist__text { font-size: 14.5px; color: var(--navy); }
.whylist__bar {
  display: block; height: 5px; margin-top: 8px;
  border-radius: 999px; background: #f1f3f7; overflow: hidden;
}
.whylist__fill { display: block; height: 100%; border-radius: 999px; background: var(--grey); }
.whylist__fill--green { background: var(--green); }
.whylist__fill--amber { background: var(--amber); }
.whylist__fill--blue  { background: var(--blue); }
.whylist__fill--grey  { background: var(--grey-soft); }
.whylist__fill--red   { background: var(--red); }
.whylist__empty { font-size: 14.5px; color: var(--text-muted); }
.whyblock__foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 14px; color: var(--green);
}
.whyblock__foot svg { width: 16px; height: 16px; flex: 0 0 16px; }

/* -- Ligne « Pourquoi » sous chaque prospect -- */
.leadtable--report tbody tr.leadrow td { border-bottom: 0; padding-bottom: 8px; }
.leadtable--report tbody tr.whyrow { cursor: pointer; }
.leadtable--report tbody tr.whyrow:hover { background: #f4f6fa; }
.leadtable--report tbody tr.whyrow td {
  padding: 0 12px 13px;
  border-bottom: 1px solid #f1f3f7;
}
.leadtable--report tbody tr.whyrow:last-child td { border-bottom: 0; }
.why { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.why__dot {
  width: 8px; height: 8px; flex: 0 0 8px;
  border-radius: 50%; background: var(--grey);
}
.why--green .why__dot { background: var(--green); }
.why--amber .why__dot { background: var(--amber); }
.why--blue  .why__dot { background: var(--blue); }
.why--grey  .why__dot { background: var(--text-soft); }
.why--red   .why__dot { background: var(--red); }
.why__label {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-soft);
}
/* Le texte partage la ligne de la pastille et se replie DANS sa colonne :
   sinon un motif long renvoie la pastille seule sur une ligne orpheline. */
.why__text { flex: 0 1 auto; min-width: 0; color: var(--text-muted); }

/* -- Encadré « Où en est ce dossier » de la fiche prospect -- */
.whybox {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 22px; margin-bottom: 20px;
  border-left: 4px solid var(--grey);
}
.whybox--green { border-left-color: var(--green); }
.whybox--amber { border-left-color: var(--amber); }
.whybox--blue  { border-left-color: var(--blue); }
.whybox--grey  { border-left-color: var(--text-soft); }
.whybox--red   { border-left-color: var(--red); }
.whybox__icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 12px;
  background: var(--grey-soft); color: var(--grey);
}
.whybox__icon svg { width: 20px; height: 20px; }
.whybox__icon--green { background: var(--green-soft); color: var(--green); }
.whybox__icon--amber { background: var(--amber-soft); color: var(--amber); }
.whybox__icon--blue  { background: var(--blue-soft);  color: var(--blue); }
.whybox__icon--grey  { background: var(--grey-soft);  color: var(--grey); }
.whybox__icon--red   { background: var(--red-soft);   color: var(--red); }
.whybox__body { flex: 1 1 auto; min-width: 0; }
.whybox__title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-soft);
}
.whybox__label { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--navy); }
.whybox__text { margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--text); }

/* --------------------------------------------------------------------------
   « PIÈCES ET ÉCHANGES » — état venu de la messagerie du cabinet (Cockpit)
   -------------------------------------------------------------------------- */

/* Puce compacte, dans la ligne « Pourquoi » de la liste. */
.doctag {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
  background: var(--grey-soft);
  color: var(--text-muted);
}
.doctag--green { background: var(--green-soft); color: var(--green); }
.doctag--amber { background: var(--amber-soft); color: var(--amber); }
.doctag--grey  { background: var(--grey-soft);  color: var(--grey); }
.doctag--soft  { background: #f4f6fa; color: var(--text-soft); }

/* Bandeau agrégé, en pied du bloc « pourquoi » du tableau de bord. */
.docstrip { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.docstrip__title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-soft); margin-bottom: 10px;
}
.docstrip__list { display: flex; flex-wrap: wrap; gap: 10px; }
.docstrip__item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  background: #fcfdff;
}
.docstrip__count {
  display: flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
  background: var(--grey-soft); color: var(--grey);
}
.docstrip__item--green .docstrip__count { background: var(--green-soft); color: var(--green); }
.docstrip__item--amber .docstrip__count { background: var(--amber-soft); color: var(--amber); }
.docstrip__item--grey  .docstrip__count { background: var(--grey-soft);  color: var(--grey); }
.docstrip__item--soft  .docstrip__count { background: #f4f6fa; color: var(--text-soft); }

/* Fiche prospect : encadré « Pièces et échanges ». */
.docstate { display: flex; align-items: flex-start; gap: 14px; }
.docstate__icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 12px; background: var(--grey-soft); color: var(--grey);
}
.docstate__icon svg { width: 19px; height: 19px; }
.docstate--green .docstate__icon { background: var(--green-soft); color: var(--green); }
.docstate--amber .docstate__icon { background: var(--amber-soft); color: var(--amber); }
.docstate--grey  .docstate__icon { background: var(--grey-soft);  color: var(--grey); }
.docstate--soft  .docstate__icon { background: #f4f6fa; color: var(--text-soft); }
.docstate__body { flex: 1 1 auto; min-width: 0; }
.docstate__label { font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: .02em; }
.docstate__text { margin-top: 5px; font-size: 14.5px; color: var(--text); line-height: 1.55; }

.doclist { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.doclist__item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fcfdff;
  font-size: 13.5px;
  color: var(--navy);
  word-break: break-word;
}
.doclist__item svg { width: 16px; height: 16px; flex: 0 0 16px; color: var(--text-soft); }

/* --------------------------------------------------------------------------
   Mobile (< 900px) : sidebar remplacée par une bottom-nav à 4 onglets
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .sidebar { display: none; }

  .main { margin-left: 0; padding: 22px 16px calc(78px + env(safe-area-inset-bottom)); }

  .pagehead { align-items: stretch; flex-direction: column; gap: 14px; }
  .pagehead__title { font-size: 22px; }
  .periodform { justify-content: space-between; }
  .periodform__select { flex: 1; }

  .kpigrid, .kpigrid--five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .factlist { grid-template-columns: 1fr; gap: 14px; }
  .kpi { padding: 16px; }
  .kpi__value { font-size: 26px; }
  .kpi__hint { display: none; }

  .panel { padding: 18px 16px; }


  /* Tableau → cartes empilées */
  .leadtable, .leadtable tbody, .leadtable tr, .leadtable td { display: block; width: 100%; }
  .leadtable thead { display: none; }
  .leadtable tbody tr {
    position: relative;
    margin-bottom: 10px;
    padding: 14px 40px 14px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fcfdff;
  }
  .leadtable tbody tr:last-child { margin-bottom: 0; }
  .leadtable tbody td { padding: 0; border: 0; }
  /* Première colonne (PROSPECT / EMPLACEMENT) : en-tête de la carte. */
  .leadtable tbody td:first-child { margin-bottom: 10px; }

  /* Les autres colonnes reprennent leur intitulé du rapport en préfixe. */
  .leadtable tbody td:not(:first-child):not(.leadtable__chevron) {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 7px;
    font-size: 14px;
  }
  .leadtable tbody td:not(:first-child):not(.leadtable__chevron)::before {
    content: attr(data-label) " :";
    flex: 0 0 auto;
    min-width: 108px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-soft);
  }
  .leadtable--report tbody td[data-label="Où ça en est"] { margin-top: 10px; }

  /* La ligne « Pourquoi » se recolle sous la carte du prospect : c'est le
     même dossier, il ne doit pas ressembler à une seconde fiche. */
  .leadtable--report tbody tr.leadrow {
    margin-bottom: 0;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    padding-bottom: 12px;
  }
  .leadtable--report tbody tr.whyrow {
    margin-bottom: 10px;
    padding: 0 14px 13px;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 14px 14px;
    background: #fcfdff;
  }
  .leadtable--report tbody tr.whyrow:last-child { margin-bottom: 0; }
  .leadtable--report tbody tr.whyrow td { padding: 12px 0 0; border-top: 1px dashed #e7e9ef; }
  .why { font-size: 12.5px; }
  .why__label { display: none; }

  .whylist__item { gap: 12px; }
  .whylist__count { flex-basis: 40px; height: 30px; font-size: 15px; }
  .whylist__text { font-size: 13.5px; }
  .whybox { padding: 18px 16px; gap: 12px; flex-wrap: wrap; }
  .whybox__text { font-size: 14.5px; }

  .leadtable__chevron {
    position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
    width: auto; padding: 0;
  }
  .leadtable__empty { padding: 22px 0; }

  .timeline::before { left: 18px; }
  .timeline__icon { width: 36px; height: 36px; flex-basis: 36px; }

  .leadhead { padding: 18px 16px; }

  .bottomnav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--navy);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -6px 20px rgba(23, 32, 58, .18);
  }

  .bottomnav__form { display: block; }

  .bottomnav__tab {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px 12px;
    background: none;
    border: 0;
    font: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .01em;
    color: rgba(223, 228, 239, .62);
    cursor: pointer;
  }
  .bottomnav__tab svg { width: 21px; height: 21px; }
  .bottomnav__tab.is-active { color: var(--gold); }
}

/* Très petits écrans uniquement : les 4 KPI restent sur 2 colonnes sur un
   téléphone standard (375–430 px), plus lisible qu'une colonne unique. */
@media (max-width: 340px) {
  .kpigrid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
