/* ==========================================================================
   TYPOGRAPHIE
   Police auto-hebergee (Plus Jakarta Sans, SIL Open Font License 1.1).
   Elle etait citee dans toute la feuille sans jamais etre declaree : le
   navigateur ignorait donc silencieusement le choix typographique.
   Auto-hebergee pour rester conforme a la CSP (font-src 'self', aucun CDN).
   ========================================================================== */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {

  /* --- Jetons sans inversion, ajoutes par tools/jetons-lot.json ------------
     Chacun porte EXACTEMENT la valeur qu'il remplacait, et AUCUN n'est
     redeclare dans le bloc sombre : le remplacement ne change donc rien,
     dans aucun des deux themes. C est la regle a tenir -- un jeton ajoute
     ici puis redeclare la nuit transformerait 300 occurrences en une
     refonte non voulue. Le verifier le controle a chaque passage. --- */
  /* Blanc de texte sur fond plein. Ne PAS le confondre avec --paper ni --cream, qui s inversent la nuit : ceux-la designent une surface, celui-ci une encre. */
  --white: #ffffff;
  /* Voiles blancs : transparences posees sur les surfaces sombres (barre laterale, en-tetes, defilement). */
  --veil-03: rgba(255,255,255,0.03);
  /* Voiles blancs : transparences posees sur les surfaces sombres (barre laterale, en-tetes, defilement). */
  --veil-06: rgba(255,255,255,0.06);
  /* Voiles blancs : transparences posees sur les surfaces sombres (barre laterale, en-tetes, defilement). */
  --veil-08: rgba(255,255,255,0.08);
  /* Voiles blancs : transparences posees sur les surfaces sombres (barre laterale, en-tetes, defilement). */
  --veil-10: rgba(255,255,255,0.1);
  /* Voiles blancs : transparences posees sur les surfaces sombres (barre laterale, en-tetes, defilement). */
  --veil-14: rgba(255,255,255,0.14);
  /* Voiles blancs : transparences posees sur les surfaces sombres (barre laterale, en-tetes, defilement). */
  --veil-15: rgba(255,255,255,0.15);
  /* Voiles blancs : transparences posees sur les surfaces sombres (barre laterale, en-tetes, defilement). */
  --veil-20: rgba(255,255,255,0.2);
  /* Noirs transparents : ombres portees, voiles de fenetre, etat survole. */
  --shade-03: rgba(0,0,0,0.03);
  /* Noirs transparents : ombres portees, voiles de fenetre, etat survole. */
  --shade-06: rgba(0,0,0,0.06);
  /* Noirs transparents : ombres portees, voiles de fenetre, etat survole. */
  --shade-25: rgba(0,0,0,0.25);
  /* Noirs transparents : ombres portees, voiles de fenetre, etat survole. */
  --shade-40: rgba(0,0,0,0.4);
  /* Noirs transparents : ombres portees, voiles de fenetre, etat survole. */
  --shade-45: rgba(0,0,0,0.45);
  /* Noirs transparents : ombres portees, voiles de fenetre, etat survole. */
  --shade-50: rgba(0,0,0,0.5);
  /* Vert de marque. --green reste le vert vif des bordures et pastilles ; celui-ci est le vert des boutons et des fonds teintes, inchange la nuit. */
  --green-deep: #25785c;
  /* Vert de marque. --green reste le vert vif des bordures et pastilles ; celui-ci est le vert des boutons et des fonds teintes, inchange la nuit. */
  --green-bright: #6fda8f;
  /* Vert de marque. --green reste le vert vif des bordures et pastilles ; celui-ci est le vert des boutons et des fonds teintes, inchange la nuit. */
  --teal-bg: rgba(47,111,135,0.12);
  /* Orange de la marque (le logo, les accents "priorite chaude"). Distinct de --accent-amber, qui est un orange de texte. */
  --orange-bg: rgba(232,85,46,0.12);
  /* Orange de la marque (le logo, les accents "priorite chaude"). Distinct de --accent-amber, qui est un orange de texte. */
  --orange-bg-15: rgba(232,85,46,0.15);

  --ink: #0f272a;
  --paper: #f4efe6;
  --accent: #b83e20;
  --accent-hover: #a73c20;
  --accent-text: #a83b22;
  --navy: #0b2226;
  --navy-2: #14373c;
  --cream: #fbf9f4;
  --muted: #556274;
  --line: #d8d3c5;
  --line-light: #eae5d9;
  --green: #25785c;
  --green-bg: rgba(37, 120, 92, 0.12);
  --amber: #be7f20;
  --amber-bg: rgba(190, 127, 32, 0.13);
  --red: #af362b;
  --red-bg: rgba(175, 54, 43, 0.12);
  --blue: #2f6f87;
  --green-text: #25785c;
  --amber-text: #85570d;
  --red-text: #af362b;
  --blue-text: #2f6f87;
  --green-solid: #1d674b;
  --amber-solid: #85570d;
  --red-solid: #983027;
  --blue-solid: #245b70;
  --medal-silver: #566579;
  --medal-bronze: #8a461e;
  --gray-bg: #eef1f0;
  --gray-border: #c9d1cf;
  --blue-bg: rgba(47, 111, 135, 0.12);
  --shadow-sm: 0 2px 8px rgba(11, 34, 38, 0.05);
  --shadow: 0 14px 38px rgba(11, 34, 38, 0.09);
  --shadow-lg: 0 24px 60px rgba(11, 34, 38, 0.16);
  --sidebar-w: 256px;
  --topbar-h: 74px;
  --transition: .18s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  /* Échelles d’interface utilisées dans toute l’application. */
  --fs-2xs: 0.6875rem;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.875rem;
  --fs-lg: 1rem;
  --fs-xl: 1.125rem;
  --fs-2xl: 1.375rem;
  --fs-3xl: 1.75rem;
  --fs-4xl: 2.25rem;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 48px;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;
  --tint: #eee;
  --tone: var(--ink);
  --org-team-color: #12666b;
  --orange: #0f7074;
  --accent-dark: #0a5d61;
}

body.dark-mode {
  --ink: #eaf1f0;
  --paper: #0e1c1e;
  --cream: #152528;
  --muted: #8caaaa;
  --accent-text: #62c7c1;
  --green-text: #8fe3bf;
  --amber-text: #f5c56b;
  --red-text: #ff9e94;
  --blue-text: #87cbe3;
  --line: #22373a;
  --line-light: #1b2d30;
  --navy: #081618;
  --navy-2: #0d2023;
  --green-bg: rgba(37, 120, 92, 0.22);
  --amber-bg: rgba(190, 127, 32, 0.22);
  --red-bg: rgba(175, 54, 43, 0.22);
  --blue-bg: rgba(47, 111, 135, 0.22);
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html {
  min-width: 0;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: radial-gradient(circle at 88% 0%, rgba(232,85,46,0.07), transparent 32%), var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* === LAYOUT GLOBAL === */
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) var(--sp-4) var(--sp-4);
  color: #edf3f2;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(232,85,46,0.10), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0) 240px),
    var(--navy);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 25;
  transition: transform .26s cubic-bezier(0.16, 1, 0.3, 1);
  border-right: 1px solid var(--veil-06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.16) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--veil-14);
  border-radius: 99px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.26); }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::before {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  border: 1px solid var(--veil-06);
  border-radius: 50%;
  right: -120px;
  top: 90px;
  box-shadow: 0 0 0 34px rgba(255,255,255,0.018), 0 0 0 72px rgba(255,255,255,0.012);
  pointer-events: none;
}
.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 2px var(--sp-1) var(--sp-5);
  margin: 0 2px var(--sp-1);
  border-bottom: 1px solid var(--veil-08);
}
.brand-mark {
  width: 44px;
  height: 44px;
  padding: var(--sp-1);
  object-fit: contain;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 var(--veil-08), 0 4px 10px rgba(0,0,0,0.28);
  flex-shrink: 0;
}
.brand-name {
  font: 700 var(--fs-lg) "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.2px;
  color: var(--white);
  white-space: nowrap;
}
.brand-sub {
  color: #7fa09e;
  font-size: var(--fs-2xs);
  letter-spacing: 1.7px;
  text-transform: uppercase;
  margin-top: 3px;
  font-weight: 600;
  white-space: nowrap;
}
.nav-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-1);
  color: #6d8d8b;
  font-size: var(--fs-2xs);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}
.nav-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.13), transparent);
}
.nav {
  position: relative;
  display: grid;
  gap: 2px;
}
.nav-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #9fb6b4;
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-3);
  border-radius: 10px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  transition: background var(--transition), color var(--transition);
  width: 100%;
  font-size: var(--fs-xs);
  font-weight: 500;
  position: relative;
}
.nav-btn:hover {
  color: var(--white);
  background: var(--veil-06);
}
.nav-btn:hover .nav-icon { color: #d9e6e4; }
.nav-btn.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(232,85,46,0.20), rgba(232,85,46,0.05) 78%, rgba(232,85,46,0));
  font-weight: 600;
}
.nav-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(15,112,116,0.6);
}
.nav-btn.active .nav-icon { color: #ff8a63; }
.nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: inherit;
  transition: color var(--transition);
}
.nav-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  padding: 1.5px var(--sp-1);
  border-radius: 99px;
  text-align: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--accent), #c2401d);
  box-shadow: 0 2px 7px rgba(15,112,116,0.4);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

/* Sidebar Footer & User Profile */
.sidebar-foot {
  position: relative;
  margin-top: auto;
  padding: var(--sp-4) 2px 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.sidebar-foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 6px;
  right: 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--veil-15), transparent);
}
.agent-mini {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--veil-08);
  border-radius: 10px;
}
.avatar {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--fs-xs);
  background: linear-gradient(140deg, #eef3ec, #cfd9cf);
  color: #0c2429;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(15,112,116,0.5);
}
.avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3ddc84;
  border: 2px solid var(--navy);
}
.agent-info {
  min-width: 0;
  flex: 1;
}
.agent-info b {
  display: block;
  font-size: var(--fs-xs);
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-info small {
  display: block;
  color: #86a5a3;
  font-size: var(--fs-2xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logout-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  color: #9fb6b4;
  border-radius: 10px;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-2xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  transition: var(--transition);
  width: 100%;
}
.logout-btn:hover {
  background: rgba(175, 54, 43, 0.25);
  border-color: rgba(175, 54, 43, 0.5);
  color: #ffb8b0;
}

/* === MAIN & TOPBAR === */
.main {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  padding: 0 var(--sp-7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 15;
  gap: var(--sp-4);
}
.top-left {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  flex: 1;
  max-width: 700px;
}
.crumb {
  color: var(--muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.crumb b {
  color: var(--ink);
  font-weight: 600;
}
.search {
  position: relative;
  width: 100%;
  max-width: 360px;
}
.search input {
  width: 100%;
  padding: 9.5px 36px 9.5px var(--sp-4);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--cream);
  color: var(--ink);
  outline: none;
  font-size: var(--fs-sm);
  transition: var(--transition);
}
.search input:focus {
  border-color: var(--blue);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--teal-bg);
}
.search span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: var(--fs-md);
  pointer-events: none;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}
.icon-btn, .dark-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 6px;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: var(--fs-lg);
  transition: var(--transition);
}
.dark-toggle:hover, .icon-btn:hover {
  border-color: var(--muted);
  background: var(--paper);
  transform: translateY(-1px);
}
.dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  top: 7px;
  right: 7px;
  border: 1.5px solid var(--cream);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
}
.user-chip:hover {
  border-color: var(--blue);
  background: var(--paper);
}
.user-chip .avatar {
  width: 28px;
  height: 28px;
  font-size: var(--fs-2xs);
}
.user-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.user-chip-text b {
  font-size: var(--fs-xs);
  color: var(--ink);
}
.user-chip-text small {
  font-size: var(--fs-2xs);
  color: var(--muted);
}

/* === CONTENT & PAGE HEADINGS === */
.content {
  padding: var(--sp-7) var(--sp-8) 50px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.eyebrow {
  color: var(--accent-text);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 5px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  font: 500 var(--fs-4xl)/1.15 "Plus Jakarta Sans", sans-serif;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  color: var(--ink);
}
.page-head p {
  color: var(--muted);
  margin: 0;
  font-size: var(--fs-sm);
}
.actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.btn {
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  padding: var(--sp-2) var(--sp-4);
  border-radius: 6px;
  font-weight: 600;
  font-size: var(--fs-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--muted);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn.dark {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}
.btn.dark:hover {
  background: var(--navy-2);
  border-color: var(--navy-2);
}
.btn.sm {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  border-radius: 6px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === KPI GRIDS === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-bottom: 20px;
}
.kpi {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
}
.kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--tint, #eee);
  color: var(--tone, var(--ink));
  font-size: var(--fs-md);
}
.kpi-value {
  font: 500 var(--fs-4xl)/1 "Plus Jakarta Sans", sans-serif;
  margin: var(--sp-3) 0 var(--sp-1);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.trend {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--green-text);
}
.trend.down {
  color: var(--red-text);
}

/* === PANELS & GRIDS === */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: var(--sp-5);
}
.panel {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 {
  font: 500 var(--fs-lg) "Plus Jakarta Sans", sans-serif;
  margin: 0;
  color: var(--ink);
}
.subtle {
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* === TABLES & BADGES === */
.table-wrap {
  overflow-x: auto;
  width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  padding: var(--sp-3) var(--sp-4);
  color: var(--muted);
  font-size: var(--fs-2xs);
  letter-spacing: 1.1px;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line-light);
  vertical-align: middle;
  color: var(--ink);
  font-size: var(--fs-xs);
}
tbody tr {
  transition: background 0.12s ease;
}
tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}
body.dark-mode tbody tr:hover {
  background: var(--veil-03);
}
.person {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.person .avatar {
  width: 30px;
  height: 30px;
  font-size: var(--fs-2xs);
}
.person b {
  display: block;
  font-size: var(--fs-xs);
  line-height: 1.2;
}
.person span {
  color: var(--muted);
  font-size: var(--fs-2xs);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3.5px 8.5px;
  border-radius: 20px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  white-space: nowrap;
}
.tag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.tag.green { color: var(--green-text); background: var(--green-bg); }
.tag.amber { color: var(--amber-text); background: var(--amber-bg); }
.tag.red { color: var(--red-text); background: var(--red-bg); }
.tag.blue { color: var(--blue-text); background: var(--blue-bg); }
.tag.gray { color: var(--muted); background: var(--shade-06); }
body.dark-mode .tag.gray { background: var(--veil-08); }

.product-pill {
  display: inline-block;
  padding: var(--sp-1) var(--sp-2);
  border-radius: 6px;
  background: var(--blue-bg);
  color: var(--blue-text);
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blue-text);
  font-weight: 700;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: var(--transition);
}
.link:hover {
  text-decoration: underline;
  color: var(--accent-text);
}

/* === FILTERS & PAGINATION === */
.filters {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.filters input, .filters select {
  padding: 8.5px var(--sp-3);
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  border-radius: 6px;
  outline: none;
  font-size: var(--fs-xs);
  transition: var(--transition);
}
.filters input:focus, .filters select:focus {
  border-color: var(--blue);
}
.filters input {
  min-width: 240px;
}
.pagination {
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.pagination button {
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  border-radius: 6px;
  padding: var(--sp-1) var(--sp-2);
  font-weight: 600;
  transition: var(--transition);
}
.pagination button:hover:not(:disabled) {
  border-color: var(--muted);
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === PIPELINE KANBAN === */
.kanban {
  display: grid;
  grid-template-columns: repeat(7, minmax(220px, 1fr));
  gap: var(--sp-3);
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: rgba(0,0,0,0.025);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 480px;
  display: flex;
  flex-direction: column;
}
body.dark-mode .kanban-col {
  background: rgba(255,255,255,0.02);
}
.kanban-head {
  padding: var(--sp-3) var(--sp-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.kanban-head b {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--ink);
}
.count {
  min-width: 22px;
  height: 22px;
  padding: 0 var(--sp-1);
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--line);
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--ink);
}
.kanban-body {
  padding: var(--sp-3);
  display: grid;
  gap: var(--sp-3);
  flex: 1;
}
.deal-card {
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 6px;
  padding: var(--sp-3);
  box-shadow: 0 3px 10px var(--shade-03);
  transition: var(--transition);
  cursor: grab;
  user-select: none;
}
.deal-card:active {
  cursor: grabbing;
}
.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--muted);
}
.deal-card h3 {
  font-size: var(--fs-xs);
  margin: var(--sp-2) 0 var(--sp-1);
  color: var(--ink);
  font-weight: 600;
}
.deal-card p {
  color: var(--muted);
  font-size: var(--fs-2xs);
  margin-bottom: 10px;
}
.deal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-2xs);
}
.deal-price {
  font: 600 var(--fs-sm) "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.progress {
  height: 5px;
  background: var(--line);
  border-radius: 4px;
  margin: var(--sp-2) 0;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 4px;
}

/* === SCORING LEADS === */
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2.5px var(--sp-2);
  border-radius: 16px;
  font-size: var(--fs-2xs);
  font-weight: 700;
}
.score-pill.hot {
  background: var(--orange-bg-15);
  color: var(--accent-text);
}
.score-pill.warm {
  background: rgba(190, 127, 32, 0.15);
  color: var(--amber-text);
}
.score-pill.cold {
  background: var(--shade-06);
  color: var(--muted);
}
.score-bar {
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  width: 40px;
  display: inline-block;
  vertical-align: middle;
}
.score-fill {
  height: 100%;
  border-radius: 3px;
}

/* === AGENDA === */
.calendar {
  width: 100%;
  border-collapse: collapse;
}
.calendar th {
  padding: var(--sp-2) var(--sp-1);
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-2xs);
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.calendar td {
  padding: var(--sp-1);
  vertical-align: top;
  border: 1px solid var(--line);
  height: 84px;
  min-height: 84px;
  background: var(--cream);
  transition: background var(--transition);
}
.cal-day {
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}
.cal-day.today {
  color: var(--accent-text);
  font-weight: 800;
}
.cal-event {
  padding: 2.5px var(--sp-1);
  border-radius: 4px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  margin-bottom: 2px;
  background: var(--blue-bg);
  color: var(--blue-text);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}
.cal-event:hover {
  transform: translateX(1px);
  filter: brightness(0.95);
}
.cal-event.urgent {
  background: var(--red-bg);
  color: var(--red-text);
}
.cal-event.success {
  background: var(--green-bg);
  color: var(--green-text);
}
.agenda-mini {
  display: grid;
  gap: var(--sp-2);
}
.agenda-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}
.agenda-time {
  text-align: center;
  font-size: var(--fs-2xs);
  color: var(--ink);
  line-height: 1.15;
}
.agenda-time b {
  display: block;
  font-size: var(--fs-sm);
}

/* === DEVIS & COMPARATEUR === */
.devis-comparator {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.devis-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.devis-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--muted);
}
.devis-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.insurer-logo {
  width: 78px;
  height: 34px;
  border-radius: 6px;
  background: var(--cream);
  display: grid;
  place-items: center;
  font-size: var(--fs-2xs);
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
}
.devis-price {
  font: 700 var(--fs-2xl) "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  text-align: right;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.devis-price small {
  font: 400 var(--fs-2xs) sans-serif;
  color: var(--muted);
  display: block;
}
.devis-features {
  display: grid;
  gap: var(--sp-1);
  margin: var(--sp-3) 0 var(--sp-4);
  flex: 1;
}
.devis-feature {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-2xs);
  color: var(--ink);
}
.devis-feature::before {
  content: "✓";
  color: var(--green-text);
  font-weight: 800;
  font-size: var(--fs-xs);
}

/* === REPORTING & GAMIFICATION === */
.period-tabs {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: 18px;
}
.period-tab {
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: var(--fs-2xs);
  font-weight: 600;
  background: var(--cream);
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
}
.period-tab:hover {
  border-color: var(--muted);
}
.period-tab.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
}
.metric-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
}
.conversion-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-light);
  font-size: var(--fs-xs);
}
.conversion-row:last-child {
  border-bottom: 0;
}
.leaderboard {
  display: grid;
  gap: var(--sp-2);
}
.lb-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.lb-rank {
  font: 700 var(--fs-lg) "Plus Jakarta Sans", sans-serif;
  text-align: center;
  color: var(--muted);
}
.lb-rank.gold { color: var(--amber-text); }
.lb-rank.silver { color: var(--medal-silver); }
.lb-rank.bronze { color: var(--medal-bronze); }
.badge {
  padding: var(--sp-1) var(--sp-2);
  border-radius: 10px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  background: var(--blue-bg);
  color: var(--blue-text);
}
.badge.gold {
  background: var(--amber-bg);
  color: var(--amber-text);
}
.points-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin-top: 5px;
}
.points-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green), var(--blue));
}
.challenge-card {
  border: 1px solid var(--amber);
  background: var(--amber-bg);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
}
.challenge-list { display:grid; gap:14px; margin-bottom:20px; }
.challenge-card-heading, .challenge-card-foot { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.challenge-card-heading h3 { margin:0 0 4px; color:var(--amber-text); }
.challenge-card > p { margin:10px 0; font-size:var(--fs-2xs); }
.challenge-card .progress { height:8px; overflow:hidden; border-radius:99px; background:var(--line-light); }
.challenge-card .progress > i { display:block; height:100%; border-radius:inherit; transition:width .25s ease; }
.challenge-card-foot { margin-top:8px; color:var(--muted); font-size:var(--fs-2xs); }

/* === COMMUNICATIONS & WHATSAPP === */
.split-workspace {
  display: grid;
  grid-template-columns: 310px 1fr;
  min-height: 590px;
}
.inbox {
  border-right: 1px solid var(--line);
}
.inbox-head {
  padding: var(--sp-4) var(--sp-4);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink);
}
.inbox-item {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line-light);
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: var(--sp-3);
  cursor: pointer;
  transition: background 0.12s;
}
.inbox-item:hover {
  background: rgba(0,0,0,0.02);
}
.inbox-item.active {
  background: var(--green-bg);
  box-shadow: inset 3px 0 var(--green);
}
.inbox-item p {
  margin: 2px 0;
  font-size: var(--fs-2xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 175px;
}
.inbox-item time {
  font-size: var(--fs-2xs);
  color: var(--muted);
}
.conversation {
  display: flex;
  flex-direction: column;
  min-height: 590px;
}
.conversation-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.messages {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  flex: 1;
  background: var(--paper);
  overflow-y: auto;
}
.bubble {
  max-width: 68%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: 4px 10px 10px 10px;
  background: var(--cream);
  border: 1px solid var(--line);
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.bubble.mine {
  align-self: flex-end;
  border-radius: 10px 4px 10px 10px;
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.bubble small {
  display: block;
  opacity: 0.65;
  margin-top: 4px;
  font-size: var(--fs-2xs);
}
.composer {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line);
  display: flex;
  gap: var(--sp-2);
  background: var(--cream);
}
.composer input {
  flex: 1;
  padding: var(--sp-3) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
}
.wa-header {
  background: #128C7E;
  color: white;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.wa-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--veil-20);
  display: grid;
  place-items: center;
  font-size: var(--fs-xl);
}
.wa-bubble {
  max-width: 68%;
  padding: 9.5px var(--sp-3);
  border-radius: 4px 10px 10px 10px;
  background: var(--white);
  border: 1px solid #d4deda;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: #111;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.wa-bubble.mine {
  align-self: flex-end;
  border-radius: 10px 4px 10px 10px;
  background: #dcf8c6;
  border-color: #c3e6a8;
}

/* === SOFTPHONE & APPEL CTI === */
.softphone {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  color: white;
  background: var(--navy);
  border-radius: var(--radius);
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.softphone .avatar {
  background: var(--accent);
  color: white;
}
.softphone .actions {
  margin-left: auto;
}
.call-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--green-deep);
  color: white;
  font-size: var(--fs-md);
  display: grid;
  place-items: center;
  transition: var(--transition);
}
.call-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}
.call-btn.red {
  background: var(--red);
}
.call-strip {
  padding: var(--sp-3) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--navy);
  color: white;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-bright);
  box-shadow: 0 0 0 0 rgba(111,218,143,0.5);
  animation: pulse 1.8s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(111,218,143,0); }
}

/* === MODALS === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 22, 24, 0.72);
  backdrop-filter: blur(5px);
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--sp-6);
  animation: fade .18s ease;
}
.modal {
  width: min(690px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--cream);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}
.modal.wide {
  width: min(940px, 94vw);
}
.modal-head {
  padding: var(--sp-5) var(--sp-6);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--cream);
  z-index: 2;
}
.modal-head h2 {
  margin: 0 0 var(--sp-1);
  font: 500 var(--fs-2xl) "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
}
.close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 6px;
  color: var(--ink);
  font-size: var(--fs-xl);
  display: grid;
  place-items: center;
  transition: var(--transition);
}
.close:hover {
  background: var(--paper);
  border-color: var(--muted);
}
.modal-body {
  padding: var(--sp-6) var(--sp-6);
  flex: 1;
}
.modal-foot {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  background: var(--cream);
  position: sticky;
  bottom: 0;
  z-index: 2;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.field {
  display: grid;
  gap: var(--sp-1);
}
.field.full {
  grid-column: 1 / -1;
}
.field-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}
.field-group.full {
  grid-column: 1 / -1;
}
.field label {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  font-weight: 700;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-3);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 6px;
  outline: none;
  font-size: var(--fs-sm);
  transition: var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 135, 0.1);
}
.multi-select-dropdown { position: relative; min-width: 0; }
.multi-select-dropdown > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 40px; padding: var(--sp-2) var(--sp-3); overflow: hidden; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); font-size: var(--fs-xs); cursor: pointer; list-style: none; }
.multi-select-dropdown > summary::-webkit-details-marker { display: none; }
.multi-select-dropdown > summary span { overflow: hidden; text-overflow: ellipsis; }
.multi-select-dropdown > summary b { flex: 0 0 auto; color: var(--accent-hover); font-size: var(--fs-lg); }
.multi-select-dropdown[open] > summary { border-color: var(--blue); border-radius: 6px 6px 0 0; }
.multi-select-options { display: grid; gap: 2px; max-height: 210px; overflow-y: auto; padding: var(--sp-1); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; background: var(--paper); box-shadow: var(--shadow-sm); }
.multi-select-options label { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2); border-radius: 6px; color: var(--ink); font-size: var(--fs-2xs); font-weight: 500; letter-spacing: 0; text-align: left; text-transform: none; cursor: pointer; }
.multi-select-options label:hover { background: var(--cream); }
.multi-select-options input { width: 15px; height: 15px; flex: 0 0 auto; margin: 0; padding: 0; accent-color: var(--accent-hover); }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
.info-card {
  padding: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}
.info-card h3 {
  font: 500 var(--fs-md) "Plus Jakarta Sans", sans-serif;
  margin-bottom: 12px;
  color: var(--ink);
}
.info-row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  font-size: var(--fs-xs);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--line-light);
  color: var(--ink);
}
.info-row span { color: var(--muted); }
.checkline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  font-size: var(--fs-xs);
  color: var(--ink);
}
.notice {
  padding: var(--sp-3) var(--sp-4);
  border-left: 3px solid var(--amber);
  background: var(--amber-bg);
  color: var(--ink);
  font-size: var(--fs-xs);
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
  line-height: 1.45;
}
.notice.mini {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-2xs);
  padding: var(--sp-2) var(--sp-3);
}
.doc-requirements {
  display: grid;
  gap: var(--sp-1);
  margin-bottom: 10px;
}
.requirement-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-2) var(--sp-2);
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: var(--paper);
  font-size: var(--fs-xs);
}
.requirement-row span {
  color: var(--amber-text);
  font-weight: 800;
}
.requirement-row.done {
  border-color: rgba(37, 120, 92, 0.28);
  background: var(--green-bg);
}
.requirement-row.done span {
  color: var(--green-text);
}

/* === LOGIN SCREEN === */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-7) var(--sp-4);
  background: radial-gradient(circle at 50% 10%, var(--orange-bg), transparent 40%), var(--navy);
  position: relative;
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 85%, rgba(47,111,135,0.15), transparent 45%);
  pointer-events: none;
}
.login-box {
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  background: var(--cream);
  border-radius: 20px;
  box-shadow: 0 28px 80px var(--shade-45);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
  z-index: 2;
}
.login-left {
  padding: var(--sp-8) 38px;
  display: flex;
  flex-direction: column;
}
.login-right {
  padding: 38px var(--sp-7);
  background: var(--paper);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: 24px;
}
.login-brand-logo {
  width: 58px;
  height: 48px;
  object-fit: contain;
}
.login-brand h2 {
  margin: 0;
  font: 700 var(--fs-2xl) "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  letter-spacing: -0.4px;
}
.login-brand span {
  display: block;
  font-size: var(--fs-2xs);
  color: var(--accent-text);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
}
.login-form {
  display: grid;
  gap: var(--sp-4);
  margin-top: 10px;
}
.login-field {
  display: grid;
  gap: var(--sp-1);
}
.login-field label {
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.login-input-wrap {
  position: relative;
}
.login-input-wrap input {
  width: 100%;
  padding: var(--sp-3) var(--sp-8) var(--sp-3) var(--sp-4);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  color: var(--ink);
  font-size: var(--fs-md);
  outline: none;
  transition: var(--transition);
}
.login-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 112, 116, 0.12);
}
.login-pwd-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: var(--fs-md);
  padding: var(--sp-1);
}
.login-submit-btn {
  width: 100%;
  padding: var(--sp-3);
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: var(--fs-md);
  margin-top: 6px;
  transition: var(--transition);
  box-shadow: 0 6px 16px rgba(15, 112, 116, 0.25);
}
.login-submit-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.login-error {
  padding: var(--sp-3) var(--sp-3);
  background: var(--red-bg);
  border: 1px solid var(--red);
  color: var(--red-text);
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Demo accounts panel on login */
.demo-badge {
  display: inline-block;
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue-text);
  background: var(--blue-bg);
  padding: var(--sp-1) var(--sp-2);
  border-radius: 4px;
  margin-bottom: 8px;
}
.demo-accounts-list {
  display: grid;
  gap: var(--sp-2);
  overflow-y: auto;
  max-height: 430px;
  padding-right: 4px;
}
.demo-account-card {
  padding: 9.5px var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.demo-account-card:hover {
  border-color: var(--accent);
  transform: translateX(2px);
  background: var(--paper);
}
.demo-account-card .avatar {
  width: 32px;
  height: 32px;
  font-size: var(--fs-2xs);
}
.demo-acc-text {
  flex: 1;
  min-width: 0;
}
.demo-acc-text b {
  display: block;
  font-size: var(--fs-xs);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-acc-text span {
  display: block;
  font-size: var(--fs-2xs);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-acc-key {
  font-size: var(--fs-2xs);
  font-family: monospace;
  background: rgba(0,0,0,0.05);
  padding: 2px var(--sp-1);
  border-radius: 4px;
  color: var(--ink);
}

/* === TOAST === */
.toast {
  position: fixed;
  z-index: 999;
  right: 24px;
  bottom: 24px;
  padding: var(--sp-3) var(--sp-5);
  color: white;
  background: var(--navy);
  border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .22s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid var(--veil-10);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--navy);
  background: #a9e0be;
  font-weight: 700;
  font-size: var(--fs-2xs);
}

/* === MOBILE & RESPONSIVE === */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 40;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
  font-size: var(--fs-xl);
  place-items: center;
  box-shadow: var(--shadow-sm);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--shade-50);
  backdrop-filter: blur(2px);
  z-index: 20;
}

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .devis-comparator { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-box { grid-template-columns: 1fr; }
  .login-right { border-left: none; border-top: 1px solid var(--line); }
}

@media (max-width: 768px) {
  .sidebar-toggle { display: grid; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); z-index: 30; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { grid-column: 1; }
  .topbar { padding: 0 var(--sp-4) 0 68px; height: 64px; }
  .content { padding: var(--sp-5) var(--sp-4) var(--sp-8); }
  .modal { width: 100vw; max-height: 100vh; border-radius: 16px 16px 0 0; position: fixed; bottom: 0; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .form-grid, .detail-grid, .report-grid { grid-template-columns: 1fr; }
  .split-workspace { grid-template-columns: 1fr; }
  .inbox { border-right: none; border-bottom: 1px solid var(--line); }
  .search input { width: 180px; }
}

@media print {
  .sidebar, .topbar, .actions, .btn, .modal-backdrop { display: none !important; }
  .main { grid-column: 1; }
  .content { padding: 0; }
}

/* === SCOPE INDICATOR PILL (Top & Header) === */
.scope-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 20px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.scope-pill.advisor {
  background: var(--blue-bg);
  color: var(--blue-text);
  border-color: rgba(47, 111, 135, 0.25);
}
.scope-pill.teamlead {
  background: var(--green-bg);
  color: var(--green-text);
  border-color: rgba(37, 120, 92, 0.25);
}
.scope-pill.manager {
  background: var(--amber-bg);
  color: var(--amber-text);
  border-color: rgba(190, 127, 32, 0.25);
}
.scope-pill.admin {
  background: var(--orange-bg);
  color: var(--accent-text);
  border-color: rgba(232, 85, 46, 0.25);
}

/* === COLLABORATION & INTERNAL NOTES === */
.collab-banner {
  padding: var(--sp-3) var(--sp-4);
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.collab-banner-text {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--ink);
}
.collab-banner-actions {
  display: flex;
  gap: var(--sp-1);
}
.internal-note-box {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-height: 250px;
  overflow-y: auto;
  padding: var(--sp-1);
  margin-bottom: 12px;
}
.internal-note-item {
  padding: var(--sp-2) var(--sp-3);
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--line-light);
  font-size: var(--fs-xs);
}
.internal-note-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-2xs);
  color: var(--muted);
  margin-bottom: 4px;
}
.internal-note-head b {
  color: var(--ink);
}
.team-revenue-single {
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--radius);
  background: var(--cream);
  border: 1px solid var(--line);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  gap: var(--sp-5);
  flex-wrap: wrap;
}

/* === WHATSAPP BUTTONS === */
.btn-wa { background: #25d366; color: var(--white) !important; border-color: #25d366; }
.btn-wa:hover { background: #128c7e; border-color: #128c7e; }

/* === STATUS BADGES NEW === */
.tag.nrp { background: rgba(200,139,43,.12); color: var(--amber-text); border-color: rgba(200,139,43,.3); }
.tag.rappel { background: rgba(57,122,148,.12); color: var(--blue-text); border-color: rgba(57,122,148,.3); }
.tag.souscrit { background: rgba(46,125,98,.12); color: var(--green-text); border-color: rgba(46,125,98,.3); }
.tag.horscible { background: rgba(179,61,50,.12); color: var(--red-text); border-color: rgba(179,61,50,.3); }
.tag.gray { background: rgba(113,128,128,.10); color: var(--muted); border-color: rgba(113,128,128,.25); }

/* === REQUIREMENT CHECKLIST === */
.doc-requirements { display: grid; gap: var(--sp-1); margin-bottom: 12px; }
.requirement-row { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); border-radius: 6px; font-size: var(--fs-xs); background: var(--paper); border: 1px solid var(--line); }
.requirement-row span { font-size: var(--fs-md); width: 18px; text-align: center; color: var(--muted); }
.requirement-row b { flex: 1; color: var(--ink); }
.requirement-row.done { background: rgba(46,125,98,.08); border-color: rgba(46,125,98,.25); }
.requirement-row.done span { color: var(--green-text); }
.requirement-row.done b { color: var(--green-text); }

/* === NOTICE MINI === */
.notice.mini { font-size: var(--fs-2xs); padding: var(--sp-1) var(--sp-3); background: rgba(57,122,148,.08); border-left: 3px solid var(--blue); border-radius: 4px; color: var(--muted); margin-top: 6px; }

/* === COLLAB BANNER === */
.collab-banner { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-3) var(--sp-4); background: var(--paper); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 16px; gap: var(--sp-3); flex-wrap: wrap; }
.collab-banner-text { font-size: var(--fs-xs); color: var(--ink); }
.collab-banner-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* === INTERNAL NOTES === */
.internal-note-box { max-height: 180px; overflow-y: auto; display: grid; gap: var(--sp-2); margin-bottom: 10px; padding-right: 4px; }
.internal-note-item { padding: var(--sp-3) var(--sp-3); border-radius: 6px; background: var(--paper); border: 1px solid var(--line); font-size: var(--fs-xs); }
.internal-note-head { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: var(--fs-2xs); color: var(--muted); }
.internal-note-head b { color: var(--ink); }

/* === DARK MODE NEW ELEMENTS === */
.dark-mode .collab-banner { background: var(--cream); }
.dark-mode .internal-note-item { background: var(--cream); }
.dark-mode .requirement-row { background: var(--cream); }

/* === COMMAND PALETTE (CTRL+K) === */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 22, 24, 0.78);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 80px;
  animation: fade .15s ease;
}
.cmd-palette-modal {
  width: min(640px, 92vw);
  background: var(--cream);
  border-radius: 16px;
  box-shadow: 0 24px 60px var(--shade-50);
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.cmd-search-bar {
  display: flex;
  align-items: center;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  gap: var(--sp-3);
  background: var(--paper);
}
.cmd-search-bar span {
  font-size: var(--fs-xl);
  color: var(--muted);
}
.cmd-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: var(--fs-lg);
  color: var(--ink);
  outline: none;
}
.cmd-badge {
  font-size: var(--fs-2xs);
  font-weight: 700;
  padding: var(--sp-1) var(--sp-2);
  border-radius: 4px;
  background: var(--shade-06);
  color: var(--muted);
  font-family: monospace;
}
.cmd-results {
  max-height: 380px;
  overflow-y: auto;
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
  color: var(--ink);
}
.cmd-item:hover, .cmd-item.selected {
  background: var(--accent);
  color: var(--white) !important;
}
.cmd-item:hover .cmd-sub, .cmd-item.selected .cmd-sub,
.cmd-item:hover .cmd-meta, .cmd-item.selected .cmd-meta {
  color: var(--white) !important;
}
.cmd-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: rgba(0,0,0,0.05);
  display: grid;
  place-items: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
}
.cmd-item.selected .cmd-icon {
  background: var(--veil-20);
}
.cmd-text {
  flex: 1;
  min-width: 0;
}
.cmd-title {
  font-size: var(--fs-md);
  font-weight: 600;
  display: block;
}
.cmd-sub {
  font-size: var(--fs-2xs);
  color: var(--muted);
  display: block;
}
.cmd-meta {
  font-size: var(--fs-2xs);
  color: var(--muted);
  font-weight: 500;
}
.cmd-footer {
  padding: var(--sp-3) var(--sp-5);
  background: var(--paper);
  border-top: 1px solid var(--line);
  font-size: var(--fs-2xs);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* === DVC & E-SIGNATURE MODAL === */
.dvc-container {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.dvc-preview-card {
  --ink: #0d1d3d;
  --paper: #ffffff;
  --cream: #ffffff;
  --muted: #52606f;
  --line: #d7dde4;
  --line-light: #e8edf2;
  --accent: #0f7074;
  --accent-hover: #0a5d61;
  --accent-text: #0b6266;
  --green-text: #25785c;
  --amber-text: #85570d;
  --red-text: #af362b;
  --blue-text: #2f6f87;
  background: var(--white);
  color: #0d1d3d;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: var(--sp-5);
  font-size: var(--fs-xs);
  line-height: 1.6;
}
body.dark-mode .dvc-preview-card { background: var(--white); color: #0d1d3d; }
.dvc-header-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.dvc-title {
  font: 700 var(--fs-lg) "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
}
.dvc-section {
  margin-bottom: 14px;
}
.dvc-section-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--fs-2xs);
  letter-spacing: 0.8px;
  color: var(--accent-text);
  margin-bottom: 6px;
}
.dvc-sig-status-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

/* === RINGOVER CTI SOFTPHONE WIDGET === */
.ringover-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: var(--navy);
  color: white;
  border-radius: 16px;
  box-shadow: 0 16px 40px var(--shade-40);
  border: 1px solid var(--veil-15);
  z-index: 9900;
  overflow: hidden;
  animation: slideUp .22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.ringover-head {
  padding: var(--sp-3) var(--sp-4);
  background: var(--veil-06);
  border-bottom: 1px solid var(--veil-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ringover-head-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.ringover-body {
  padding: var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
}
.ringover-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: grid;
  place-items: center;
  font-size: var(--fs-2xl);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(15,112,116,0.4);
}
.ringover-call-name {
  font-size: var(--fs-lg);
  font-weight: 700;
}
.ringover-call-phone {
  font-size: var(--fs-xs);
  opacity: 0.75;
}
.ringover-timer {
  font-family: monospace;
  font-size: var(--fs-md);
  color: var(--green-bright);
  background: rgba(111,218,143,0.1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 10px;
  font-weight: 700;
}
.ringover-controls {
  display: flex;
  gap: var(--sp-3);
  margin-top: 6px;
}
.ringover-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: var(--fs-lg);
  transition: transform .15s;
}
.ringover-btn:hover {
  transform: scale(1.1);
}
.ringover-btn.red {
  background: var(--red);
  color: white;
}
.ringover-btn.gray {
  background: var(--veil-15);
  color: white;
}
.ringover-btn.gray.active {
  background: var(--amber);
  color: white;
}
.ringover-note-area {
  width: 100%;
  margin-top: 10px;
  text-align: left;
}
.ringover-note-area textarea {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border-radius: 6px;
  border: 1px solid var(--veil-20);
  background: var(--shade-25);
  color: white;
  font-size: var(--fs-xs);
  outline: none;
  resize: none;
}

/* =====================================================================
   Refonte RW Assurance — palette et composants inspirés des références
   ===================================================================== */
:root {
  --ink: #0d1d3d;
  --paper: #f8f6f2;
  --cream: #ffffff;
  --accent: #d69a35;
  --accent-hover: #bd8126;
  --accent-text: #805216;
  --navy: #081735;
  --navy-2: #142951;
  --muted: #7c879b;
  --line: #e4e1da;
  --line-light: #efede8;
  --gold: #e6b44e;
  --grad-accent: linear-gradient(135deg, #bd7d2b 0%, #e7b34d 54%, #ca8834 100%);
  --grad-navy: radial-gradient(130% 120% at 100% 0%, #1c315a 0%, #11244b 46%, #07142f 100%);
  --shadow-sm: 0 2px 8px rgba(8, 23, 53, .05), 0 5px 15px -8px rgba(8, 23, 53, .14);
  --shadow: 0 3px 8px rgba(8, 23, 53, .035), 0 18px 42px -20px rgba(8, 23, 53, .22);
  --shadow-lg: 0 26px 64px -24px rgba(8, 23, 53, .36);
  --shadow-glow: 0 10px 24px -10px rgba(193, 132, 42, .56);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
}

body {
  color: var(--ink);
  background:
    radial-gradient(850px 420px at 100% -12%, rgba(214,154,53,.07), transparent 62%),
    var(--paper);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: var(--fs-md);
}
h1, h2, h3, .page-head h1, .panel-head h2, .panel-head h3,
.login-welcome-copy h1, .login-auth-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  letter-spacing: -.025em;
}

/* Navigation latérale */
.sidebar {
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  color: #f5f6fa;
  background: linear-gradient(180deg, #0b1c40 0%, #071632 100%);
  border-right: 0;
  box-shadow: 8px 0 30px -22px rgba(4, 14, 34, .7);
}
.sidebar::before { opacity: .24; }
.brand {
  min-height: 88px;
  justify-content: center;
  padding: var(--sp-2) var(--sp-3);
  margin: 0 2px var(--sp-6);
  border: 0;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
}
.brand-mark {
  width: 100%;
  height: 70px;
  padding: var(--sp-1);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.brand-name, .brand-sub { display: none; }
.nav-label { color: #8292b1; letter-spacing: .14em; opacity: .8; }
.nav-btn {
  min-height: 42px;
  border-radius: 10px;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-btn:hover { transform: translateX(2px); background: rgba(255,255,255,.055); }
.nav-btn.active, .nav-btn[aria-current="page"] {
  color: var(--white);
  background: linear-gradient(90deg, rgba(30,55,103,.88), rgba(20,41,81,.72));
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-btn.active::before { display: none; }
.nav-btn.active .nav-icon { color: var(--gold); }
.nav-badge { background: var(--grad-accent); color: var(--navy); box-shadow: var(--shadow-glow); }
.agent-mini { border-radius: 16px; }

/* Barre supérieure et contenu */
.main { background: var(--paper); }
.topbar {
  background: rgba(248,246,242,.88);
  border-bottom: 1px solid var(--line-light);
  backdrop-filter: saturate(1.35) blur(14px);
  -webkit-backdrop-filter: saturate(1.35) blur(14px);
}
.search, .cmd-search-bar {
  border-radius: 999px;
  background: var(--white);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.page-head h1 { font-size: clamp(1.625rem, 3vw, 2.125rem); font-weight: 700; }
.eyebrow { color: var(--accent-text); letter-spacing: .15em; font-weight: 750; }
.page-head.dashboard-hero {
  min-height: 190px;
  align-items: center;
  padding: var(--sp-7) var(--sp-8);
  margin-bottom: 24px;
  border: 0;
  border-radius: 22px;
  color: var(--white);
  background: var(--grad-navy);
  box-shadow: 0 16px 36px rgba(8,23,53,.12);
  overflow: hidden;
  position: relative;
}
.page-head.dashboard-hero::after {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  right: 5%;
  top: -210px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(255,255,255,.018), 0 0 0 68px rgba(255,255,255,.012);
  pointer-events: none;
}
.page-head.dashboard-hero .eyebrow { color: var(--gold); }
.page-head.dashboard-hero h1 { color: var(--white); font-size: clamp(2rem, 4vw, 2.875rem); }
.page-head.dashboard-hero p { color: #aab5ca; }
.page-head.dashboard-hero .actions { position: relative; z-index: 1; }

/* Cartes, indicateurs et tableaux */
.panel, .kpi, .metric-card, .info-card, .devis-card, .deal-card,
.kanban-col, .inbox, .calendar, .leaderboard, .dvc-preview-card, .table-wrap {
  background: var(--cream);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel { padding: var(--sp-5) var(--sp-6); }
.panel-head h2, .panel-head h3 { color: var(--ink); font-size: var(--fs-2xl); }
.kpi {
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.kpi::before, .kpi::after { content: none !important; display: none !important; }
.kpi.kpi-clickable { width: 100%; appearance: none; -webkit-appearance: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.kpi.kpi-clickable:focus-visible { outline: 3px solid rgba(214,154,53,.55); outline-offset: 3px; }
.kpi:hover, .metric-card:hover, .deal-card:hover, .devis-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.kpi-value { color: var(--navy); font-size: var(--fs-4xl); font-weight: 800; }
.kpi-icon { color: var(--accent-text); background: rgba(214,154,53,.12); border-radius: 10px; }
.kanban-col { background: #f1efe9; box-shadow: none; }
.btn {
  border-radius: 10px;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}
.btn:hover { transform: translateY(-1px); }
.btn.primary, .btn-primary, .login-submit-btn, .login-welcome-cta {
  color: #111b31;
  background: var(--grad-accent);
  border: 0;
  box-shadow: var(--shadow-glow);
}
table { border-collapse: separate; border-spacing: 0; }
th { color: var(--muted); font-size: var(--fs-2xs); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: rgba(214,154,53,.055); }
.tag, .badge, .score-pill, .scope-pill, .product-pill { border-radius: 999px; font-weight: 700; }
.avatar { box-shadow: 0 0 0 3px var(--cream), 0 4px 12px -4px rgba(8,23,53,.25); }
.progress, .score-bar, .points-bar { border-radius: 999px; overflow: hidden; }
.score-fill, .points-fill { background: var(--grad-accent); border-radius: 999px; }
.field input, .field select, .field textarea, .login-input-wrap input {
  border-radius: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus, .login-input-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(214,154,53,.16);
}
.modal { border-radius: 20px; box-shadow: var(--shadow-lg); animation: rw-pop .28s cubic-bezier(.2,.8,.2,1); }
.modal-backdrop { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.softphone, .ringover-widget { border-radius: 20px; background: var(--grad-navy); box-shadow: var(--shadow-lg); }
.toast { border-radius: 16px; box-shadow: var(--shadow-lg); }

/* Écran d'accueil en deux volets */
.login-welcome {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--white);
}
.login-welcome-brand {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: var(--sp-9);
  background: var(--white);
}
.login-welcome-brand img { display: block; width: min(390px, 82%); height: auto; object-fit: contain; }
.login-welcome-panel {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: clamp(38px, 6vw, 92px);
  color: var(--white);
  background: var(--grad-navy);
  overflow: hidden;
  position: relative;
}
.login-welcome-panel::after {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  right: -280px;
  top: -315px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 40px rgba(255,255,255,.02), 0 0 0 84px rgba(255,255,255,.012);
  pointer-events: none;
}
.login-welcome-copy { position: relative; z-index: 1; width: min(100%, 490px); margin: auto; animation: rw-rise .55s cubic-bezier(.2,.8,.2,1) both; }
.login-welcome-copy .eyebrow { display: block; margin-bottom: 16px; color: var(--gold); }
.login-welcome-copy h1 { margin: 0 0 var(--sp-7); color: #f8f6f2; font-size: clamp(2.375rem, 4vw, 3.5rem); line-height: 1.18; font-weight: 600; }
.login-welcome-copy h1 span { white-space: nowrap; }
.login-welcome-features { display: grid; gap: var(--sp-3); margin: 0 0 36px; padding: 0; list-style: none; color: #aeb8cc; font-size: var(--fs-lg); }
.login-welcome-features li { display: flex; align-items: center; gap: var(--sp-3); }
.login-welcome-features li > span { width: 20px; height: 20px; display: grid; place-items: center; color: var(--gold); }
.login-welcome-features svg { width: 19px; height: 19px; }
.login-welcome-cta {
  min-width: 232px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-6);
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.login-welcome-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(214,154,53,.65); }

/* Écran d'authentification: carte claire centrée sur fond bleu nuit */
.login-screen.login-auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-7) var(--sp-5);
  background: var(--grad-navy);
}
.login-auth-box {
  display: block !important;
  width: min(448px, calc(100vw - 36px));
  max-width: 448px !important;
  overflow: hidden;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
  animation: rw-pop .32s cubic-bezier(.2,.8,.2,1) both;
}
.login-auth-box .login-left {
  min-width: 0;
  padding: var(--sp-8) var(--sp-7) var(--sp-7);
  color: var(--ink);
  background: var(--cream);
}
.login-auth-brand {
  justify-content: center;
  margin: 0 0 var(--sp-3);
  padding: 0;
  border: 0;
}
.login-auth-brand .login-brand-logo { width: 142px; height: 88px; object-fit: contain; }
.login-auth-title { margin: var(--sp-1) 0; color: var(--navy); font-size: var(--fs-3xl); font-weight: 600; text-align: center; }
.login-auth-subtitle { margin: 0 0 var(--sp-6); color: var(--muted); font-size: var(--fs-md); text-align: center; }
.login-auth-box .login-field label { color: var(--ink); }
.login-auth-box .login-input-wrap input { min-height: 40px; background: var(--white); border-color: var(--line); }
.login-auth-box .login-submit-btn { min-height: 44px; margin-top: 6px; border-radius: 10px; font-weight: 750; }
.login-auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-2); margin-top: 16px; }
.login-auth-links button { padding: var(--sp-1) 0; border: 0; color: var(--navy-2); background: transparent; font-size: var(--fs-xs); font-weight: 650; cursor: pointer; }
.login-auth-links button:hover { color: var(--accent-hover); text-decoration: underline; }
.login-auth-box .login-right { display: none; }
.login-auth-box.directory-open {
  display: grid !important;
  grid-template-columns: minmax(330px, .9fr) minmax(340px, 1.1fr);
  width: min(940px, calc(100vw - 36px));
  max-width: 940px !important;
}
.login-auth-box.directory-open .login-right { display: block; max-height: 80vh; overflow: auto; }
.login-auth-box .demo-accounts-list { max-height: 58vh !important; }

@keyframes rw-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rw-pop { from { opacity: 0; transform: scale(.975) translateY(7px); } to { opacity: 1; transform: none; } }
.main > * { animation: rw-rise .45s cubic-bezier(.2,.8,.2,1) both; }
.kpi-grid > *:nth-child(2) { animation-delay: .05s; }
.kpi-grid > *:nth-child(3) { animation-delay: .1s; }
.kpi-grid > *:nth-child(4) { animation-delay: .15s; }

/* Mode sombre compatible avec le bouton déjà présent dans le CRM */
body.dark-mode {
  --ink: #eaf0fa;
  --paper: #0b1428;
  --cream: #111f3a;
  --muted: #9aa7bd;
  --line: #293754;
  --line-light: #1d2a43;
  --navy: #06132d;
  --navy-2: #102246;
  --shadow: 0 16px 42px rgba(0,0,0,.42);
  --shadow-lg: 0 28px 70px rgba(0,0,0,.58);
  background: var(--paper);
}
body.dark-mode .topbar { background: rgba(11,20,40,.85); }
body.dark-mode .page-head.dashboard-hero { background: var(--grad-navy); }
body.dark-mode .login-auth-box, body.dark-mode .login-auth-box .login-left { background: var(--white); color: #0d1d3d; }

@media (max-width: 760px) {
  .login-welcome { grid-template-columns: 1fr; grid-template-rows: minmax(210px, 36vh) 1fr; }
  .login-welcome-brand { padding: var(--sp-5); }
  .login-welcome-brand img { width: min(260px, 64%); max-height: 30vh; }
  .login-welcome-panel { padding: var(--sp-7) var(--sp-6); }
  .login-welcome-copy h1 { font-size: clamp(2.125rem, 9vw, 2.875rem); }
  .login-auth-box.directory-open { display: block !important; width: min(448px, calc(100vw - 28px)); }
  .login-auth-box.directory-open .login-right { max-height: 42vh; border-top: 1px solid var(--line-light); }
  .page-head.dashboard-hero { min-height: 160px; padding: var(--sp-6) var(--sp-6); border-radius: 20px; }
  .page-head.dashboard-hero .actions { width: 100%; }
  .panel { padding: var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) {
  .login-welcome-copy, .login-auth-box, .main > *, .kpi-grid > * { animation: none !important; }
  .nav-btn, .btn, .kpi, .login-welcome-cta { transition: none !important; }
}

/* Ecrans métier : tableaux de bord, suivi des leads, agenda et GED */
.dashboard-columns, .dashboard-chart-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr); gap: var(--sp-4); }
.team-revenue-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.team-revenue-card { min-width: 0; padding: var(--sp-4); border-right: 1px solid var(--line); position: relative; }
.team-revenue-card:last-child { border-right: 0; }
.activity-list { padding: var(--sp-1) var(--sp-5) var(--sp-5); }
.activity-item { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: var(--sp-3); align-items: start; padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-light); }
.activity-item:last-child { border-bottom: 0; }
.activity-item p { margin: 0 0 var(--sp-1); color: var(--ink); font-size: var(--fs-xs); line-height: 1.45; }
.activity-item small, .activity-item time { color: var(--muted); font-size: var(--fs-2xs); }
.activity-item time { white-space: nowrap; }
.activity-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; color: var(--accent-hover); background: rgba(214,154,53,.12); font-weight: 800; }
.activity-empty { padding: var(--sp-7) var(--sp-5); text-align: center; color: var(--muted); font-size: var(--fs-xs); }

.lead-register-summary, .agenda-summary-grid, .document-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-4); }
.lead-register-summary > div, .agenda-summary-grid > div, .document-summary-card { min-width: 0; display: grid; gap: var(--sp-1); padding: var(--sp-4) var(--sp-4); border: 1px solid var(--line-light); border-radius: 16px; background: var(--cream); box-shadow: var(--shadow-sm); }
.lead-register-summary b, .agenda-summary-grid b, .document-summary-card b { color: var(--navy); font-size: var(--fs-2xl); line-height: 1.1; }
.lead-register-summary span, .agenda-summary-grid span, .document-summary-card span { color: var(--muted); font-size: var(--fs-2xs); }
.lead-register-summary > div:first-child { border-top: 3px solid var(--accent); }
.lead-filters { align-items: stretch; padding: var(--sp-3); margin-bottom: 14px; border: 1px solid var(--line-light); border-radius: 16px; background: rgba(255,255,255,.68); }
.lead-filters input { min-width: 240px; flex: 1.3; }
.lead-filters select { min-width: 145px; flex: 1; }
.leads-table-panel { padding: var(--sp-3); }
.leads-table-panel .table-wrap { border-radius: 16px; box-shadow: none; }
.leads-table-panel th { position: sticky; top: 0; z-index: 1; background: #f8f6f2; }
.leads-table-panel td { padding-top: 12px; padding-bottom: 12px; }
.leads-table-panel .person b { color: var(--navy); }
.pagination { gap: var(--sp-3); flex-wrap: wrap; }
.pagination button { padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--cream); }

.agenda-summary-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.agenda-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(300px,.85fr); gap: var(--sp-4); align-items: start; }
.agenda-calendar-panel, .agenda-list-panel { min-width: 0; }
.agenda-side-column { display: grid; gap: var(--sp-4); }
.agenda-calendar-panel .panel-head { align-items: center; }
.agenda-month-label, .agenda-count { color: var(--navy); font-size: var(--fs-xs); font-weight: 750; }
.agenda-count { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(214,154,53,.14); }
.calendar-scroll { overflow-x: auto; padding: var(--sp-3) 2px 2px; }
.calendar { min-width: 640px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.calendar th { padding: var(--sp-3) var(--sp-1); background: #f7f5f0; }
.calendar td { height: 94px; padding: var(--sp-2); }
.calendar-day-cell.is-today { background: rgba(214,154,53,.08); }
.cal-day { display: flex; align-items: center; gap: var(--sp-1); }
.cal-day.today > span { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: var(--white); background: var(--accent-hover); }
.cal-day small { color: var(--accent-hover); font-size: var(--fs-2xs); font-weight: 750; }
.cal-day i { margin-left: auto; display: grid; place-items: center; min-width: 17px; height: 17px; border-radius: 50%; color: var(--navy); background: rgba(214,154,53,.15); font-size: var(--fs-2xs); font-style: normal; }
.cal-event { display: block; width: 100%; border: 0; text-align: left; cursor: pointer; }
.cal-event time { opacity: .75; font-weight: 800; }
.agenda-empty { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-3); text-align: center; }
.agenda-empty > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #23745b; background: rgba(35,116,91,.11); font-weight: 800; }
.agenda-empty b { color: var(--ink); font-size: var(--fs-xs); }
.agenda-empty small { color: var(--muted); font-size: var(--fs-2xs); }
.agenda-empty.compact { padding: var(--sp-5) var(--sp-2); }
.agenda-item { border-color: var(--line-light); background: var(--white); }
.agenda-time { color: var(--accent-hover); }

.document-summary-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
.document-summary-card { position: relative; overflow: hidden; }
.document-summary-card b { font-size: var(--fs-3xl); }
.document-summary-card small { color: var(--muted); font-size: var(--fs-2xs); }
.document-summary-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--navy-2); }
.document-summary-card.pending::before { background: var(--accent); }
.document-summary-card.correction::before { background: #b94a40; }
.document-summary-card.accepted::before { background: #28775e; }
.document-toolbar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: 14px; }
.document-search { display: flex; align-items: center; gap: var(--sp-2); min-width: 240px; flex: 1; padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--muted); }
.document-search input { width: 100%; min-height: 40px; padding: var(--sp-2) 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.document-toolbar select { min-height: 40px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--white); }
.document-results { color: var(--muted); font-size: var(--fs-2xs); white-space: nowrap; }
.documents-panel { padding: var(--sp-4); }
.documents-panel .table-wrap { border-radius: 16px; box-shadow: none; }
.documents-panel th { background: #f8f6f2; }
.document-file-cell { display: flex; align-items: center; gap: var(--sp-3); min-width: 190px; }
.document-file-cell > div, .upload-index-context > div { display: grid; gap: var(--sp-1); min-width: 0; }
.document-file-cell b { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); }
.document-file-cell small, .documents-panel td small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--fs-2xs); }
.document-file-icon { display: grid; place-items: center; width: 36px; height: 40px; flex: 0 0 auto; border: 1px solid rgba(214,154,53,.25); border-radius: 10px; color: var(--accent-hover); background: rgba(214,154,53,.09); font-size: var(--fs-2xs); font-weight: 800; }
.document-index-tag { display: inline-flex; max-width: 220px; padding: var(--sp-1) var(--sp-2); border-radius: 10px; color: var(--navy-2); background: #f1f3f7; font-size: var(--fs-2xs); font-weight: 700; }
.document-date { color: var(--ink); font-size: var(--fs-2xs); }
.document-client-folders { display: grid; gap: var(--sp-3); }
.document-client-folder { overflow: hidden; border: 1px solid var(--line-light); border-radius: 16px; background: var(--white); box-shadow: 0 2px 8px rgba(17,35,59,.035); }
.document-client-folder[hidden] { display: none !important; }
.document-client-folder > summary { list-style: none; }
.document-client-folder > summary::-webkit-details-marker { display: none; }
.document-client-folder-heading { display: grid; grid-template-columns: 40px minmax(0,1fr) auto 18px; align-items: center; gap: var(--sp-3); min-height: 72px; padding: var(--sp-3) var(--sp-4); cursor: pointer; background: linear-gradient(90deg,#fbfaf7,var(--white)); }
.document-client-folder-heading:hover { background: #f8f7f3; }
.document-folder-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(214,154,53,.24); border-radius: 10px; color: var(--accent-hover); background: rgba(214,154,53,.1); }
.document-folder-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.document-folder-title { display: grid; gap: var(--sp-1); min-width: 0; }
.document-folder-title b { overflow: hidden; color: var(--navy); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.document-folder-title small { overflow: hidden; color: var(--muted); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.document-folder-count { padding: var(--sp-1) var(--sp-2); border: 1px solid var(--line-light); border-radius: 99px; color: var(--navy-2); background: var(--white); font-size: var(--fs-2xs); font-weight: 700; white-space: nowrap; }
.document-folder-chevron { color: var(--muted); font-size: var(--fs-lg); transition: transform .18s ease; }
.document-client-folder[open] .document-folder-chevron { transform: rotate(180deg); }
.document-client-folder[open] .document-client-folder-heading { border-bottom: 1px solid var(--line-light); }
.document-folder-files { display: grid; padding: var(--sp-1) var(--sp-4) var(--sp-3); }
.document-folder-file { display: grid; grid-template-columns: 38px minmax(0,1.6fr) minmax(120px,.8fr) auto auto; align-items: center; gap: var(--sp-3); min-height: 66px; padding: var(--sp-2) var(--sp-1); border-bottom: 1px solid var(--line-light); }
.document-folder-file:last-child { border-bottom: 0; }
.document-folder-file-meta { display: grid; gap: var(--sp-1); min-width: 0; }
.document-folder-file-meta b { overflow: hidden; color: var(--navy); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.document-folder-file-meta small, .document-folder-file-date small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--fs-2xs); }
.document-folder-file-date { color: var(--ink); font-size: var(--fs-2xs); }
.document-folder-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); flex-wrap: wrap; }
.document-folder-actions .btn { white-space: nowrap; }
.document-filter-empty { padding: 38px var(--sp-5); border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
.document-filter-empty[hidden] { display: none; }
[data-doc-row][hidden] { display: none !important; }
.calendar-day-cell.is-empty { background: #f8f6f2; }
.agenda-list-panel .agenda-mini:not(:has(.agenda-item))::after { content: "Aucune prochaine action programmée."; display: block; padding: var(--sp-5) var(--sp-2); color: var(--muted); font-size: var(--fs-2xs); text-align: center; }

.lead-progress-card { margin-bottom: 16px; padding: 17px var(--sp-5) var(--sp-4); border: 1px solid var(--line-light); border-radius: 16px; background: linear-gradient(135deg,var(--white) 0%,#f8f6f2 100%); }
.lead-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.lead-progress-heading > div { display: grid; gap: 2px; }
.lead-progress-heading .eyebrow { margin: 0; font-size: var(--fs-2xs); }
.lead-progress-heading b { color: var(--navy); font-size: var(--fs-md); }
.lead-progress-count { padding: var(--sp-1) var(--sp-2); border-radius: 6px; color: var(--navy-2); background: rgba(214,154,53,.12); font-size: var(--fs-2xs); font-weight: 750; }
.lead-progress-track { height: 5px; margin: var(--sp-4) 0 var(--sp-3); border-radius: 99px; background: #e9e6df; overflow: hidden; }
.lead-progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--grad-accent); }
.lead-stage-steps { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: var(--sp-1); margin: 0; padding: 0; list-style: none; }
.lead-stage-steps li { display: grid; justify-items: center; gap: var(--sp-1); text-align: center; color: var(--muted); }
.lead-stage-steps li > span { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); font-size: var(--fs-2xs); }
.lead-stage-steps li.complete > span, .lead-stage-steps li.current > span { border-color: #188d72; color: var(--white); background: #188d72; }
.lead-stage-steps li.current > span { box-shadow: 0 0 0 4px rgba(24,141,114,.12); }
.lead-stage-steps small { max-width: 90px; font-size: var(--fs-2xs); line-height: 1.25; }
.doc-checklist-progress { display: grid; gap: 2px; margin-bottom: 10px; color: var(--navy); font-size: var(--fs-2xs); }
.doc-checklist-progress span { color: var(--muted); font-size: var(--fs-2xs); }
.requirement-row { grid-template-columns: 20px minmax(0,1fr) auto auto; gap: var(--sp-2); }
.requirement-row b small { display: inline-block; margin-left: 6px; color: var(--muted); font-size: var(--fs-2xs); font-weight: 500; }
.requirement-row em { color: var(--muted); font-size: var(--fs-2xs); font-style: normal; white-space: nowrap; }
.requirement-row.in-review { border-color: rgba(214,154,53,.24); background: rgba(214,154,53,.07); }
.requirement-row.needs-correction { border-color: rgba(185,74,64,.24); background: rgba(185,74,64,.07); }
.requirement-upload { padding: var(--sp-1) var(--sp-2); border: 0; border-radius: 6px; color: var(--navy-2); background: var(--white); font-size: var(--fs-2xs); font-weight: 750; cursor: pointer; }
.doc-list { display: grid; gap: var(--sp-1); }
.doc-row small { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.qualification-context { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: 15px; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line-light); border-radius: 13px; background: #f8f6f2; }
.qualification-context > div:nth-child(2) { display: grid; gap: 2px; min-width: 0; flex: 1; }
.qualification-context b { color: var(--navy); font-size: var(--fs-xs); }
.qualification-context span:not(.product-pill) { overflow: hidden; color: var(--muted); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.qualification-sections { display: grid; gap: var(--sp-3); }
.qualification-section { padding: var(--sp-4); border: 1px solid var(--line-light); border-radius: 16px; background: var(--cream); }
.qualification-section-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: 13px; }
.qualification-section-head > span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 10px; color: var(--navy); background: rgba(214,154,53,.16); font-size: var(--fs-2xs); font-weight: 800; }
.qualification-section-head > div { display: grid; gap: 2px; }
.qualification-section-head b { color: var(--navy); font-size: var(--fs-xs); }
.qualification-section-head small { color: var(--muted); font-size: var(--fs-2xs); }
.qualification-confirmation { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: #f8f6f2; }
.qualification-confirmation input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: #188d72; }
.qualification-confirmation span { display: grid; gap: var(--sp-1); }
.qualification-confirmation b { color: var(--ink); font-size: var(--fs-2xs); }
.qualification-confirmation small { color: var(--muted); font-size: var(--fs-2xs); }
.reminder-field.is-inactive { opacity: .45; }
.reminder-field input:disabled { cursor: not-allowed; }

.upload-index-context { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: #f8f6f2; }
.upload-index-context > div { flex: 1; }
.upload-index-context b { color: var(--navy); font-size: var(--fs-2xs); }
.upload-index-context small { color: var(--muted); font-size: var(--fs-2xs); }
.upload-dropzone { display: grid; justify-items: center; gap: var(--sp-1); padding: var(--sp-5) var(--sp-4); border: 1px dashed #c5b894; border-radius: 16px; background: rgba(214,154,53,.045); text-align: center; cursor: pointer; transition: background var(--transition), border-color var(--transition); }
.upload-dropzone.is-dragging, .upload-dropzone:hover { border-color: var(--accent); background: rgba(214,154,53,.11); }
.upload-drop-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; color: var(--accent-hover); background: rgba(214,154,53,.16); font-size: var(--fs-2xl); }
.upload-dropzone b { color: var(--navy); font-size: var(--fs-xs); }
.upload-dropzone small, .upload-note { color: var(--muted); font-size: var(--fs-2xs); }
.upload-dropzone input[type=file] { width: 100%; max-width: 320px; padding: var(--sp-1); font-size: var(--fs-2xs); }
.upload-file-preview { max-width: 100%; color: var(--muted); font-size: var(--fs-2xs); overflow-wrap: anywhere; }
.upload-file-preview.has-file { color: #23745b; font-weight: 750; }
.upload-file-preview.file-error { color: #b94a40; font-weight: 750; }
.document-review-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(280px,.8fr); gap: var(--sp-4); align-items: start; }
.document-preview { display: grid; min-height: 380px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #eceae5; }
.document-preview-frame { width: 100%; height: 540px; border: 0; background: var(--white); }
.document-preview-image { display: block; max-width: 100%; max-height: 540px; object-fit: contain; }
.document-preview-empty { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-7); text-align: center; }
.document-preview-empty > span { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 var(--sp-2); border-radius: 10px; color: var(--accent-hover); background: rgba(214,154,53,.14); font-size: var(--fs-xs); font-weight: 800; }
.document-preview-empty b { color: var(--navy); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.document-preview-empty small { color: var(--muted); font-size: var(--fs-2xs); }
.document-review-checklist .checkline { padding: var(--sp-2) 0; }
.document-readonly-notice { margin-top: 12px; }
.btn.danger { border-color: rgba(185,74,64,.25); color: #a83b33; background: rgba(185,74,64,.06); }

@media (max-width: 1100px) {
  .team-revenue-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .team-revenue-card:nth-child(2) { border-right: 0; }
  .team-revenue-card:nth-child(n+3) { border-top: 1px solid var(--line); }
  .document-review-layout { grid-template-columns: 1fr; }
  .document-preview { min-height: 260px; }
  .document-preview-frame { height: 360px; }
}
@media (max-width: 900px) {
  .dashboard-columns, .dashboard-chart-grid, .agenda-layout { grid-template-columns: 1fr; }
  .agenda-side-column { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-hero .actions { justify-content: flex-start; }
  .lead-stage-steps small { font-size: var(--fs-2xs); }
}
@media (max-width: 680px) {
  .lead-register-summary { grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--sp-2); }
  .lead-register-summary > div, .agenda-summary-grid > div, .document-summary-card { padding: var(--sp-3); }
  .lead-register-summary b, .agenda-summary-grid b { font-size: var(--fs-xl); }
  .lead-register-summary span { font-size: var(--fs-2xs); }
  .lead-filters { display: grid; grid-template-columns: 1fr 1fr; }
  .lead-filters input { min-width: 0; grid-column: 1 / -1; }
  .lead-filters select { min-width: 0; width: 100%; }
  .lead-filters .btn { grid-column: 1 / -1; }
  .agenda-summary-grid, .document-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .agenda-side-column { grid-template-columns: 1fr; }
  .document-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .document-search { min-width: 0; grid-column: 1 / -1; }
  .document-results { padding: var(--sp-1) 0; }
  .documents-panel { padding: var(--sp-3); }
  .document-client-folder-heading { grid-template-columns: 36px minmax(0,1fr) auto 14px; gap: var(--sp-2); min-height: 64px; padding: var(--sp-3); }
  .document-folder-icon { width: 34px; height: 34px; }
  .document-folder-title b { font-size: var(--fs-2xs); }
  .document-folder-title small { font-size: var(--fs-2xs); }
  .document-folder-count { padding: var(--sp-1) var(--sp-2); font-size: var(--fs-2xs); }
  .document-folder-files { padding: var(--sp-1) var(--sp-2) var(--sp-2); }
  .document-folder-file { grid-template-columns: 34px minmax(0,1fr) auto; grid-template-rows: auto auto; gap: var(--sp-1) var(--sp-2); padding: var(--sp-3) 0; }
  .document-folder-file .document-file-icon { grid-column: 1; grid-row: 1 / span 2; width: 32px; height: 36px; }
  .document-folder-file-meta { grid-column: 2; grid-row: 1; }
  .document-folder-file-date { grid-column: 2; grid-row: 2; font-size: var(--fs-2xs); }
  .document-folder-file > .tag { grid-column: 3; grid-row: 1; }
  .document-folder-actions { grid-column: 2 / -1; grid-row: 3; justify-content: flex-end; gap: var(--sp-1); }
  .document-folder-actions .btn { padding: var(--sp-1) var(--sp-2); font-size: var(--fs-2xs); }
  .qualification-context { align-items: flex-start; flex-wrap: wrap; }
  .qualification-context > div:nth-child(2) { min-width: calc(100% - 55px); }
  .qualification-context .product-pill { margin-left: 44px; }
  .qualification-section { padding: var(--sp-3); }
  .qualification-section .form-grid { grid-template-columns: 1fr; }
  .lead-stage-steps { gap: 1px; }
  .lead-stage-steps li > span { width: 20px; height: 20px; }
  .lead-stage-steps small { font-size: var(--fs-2xs); overflow-wrap: anywhere; }
  .requirement-row { grid-template-columns: 18px minmax(0,1fr) auto; }
  .requirement-row em { grid-column: 2; white-space: normal; }
  .requirement-upload { grid-column: 3; grid-row: 1 / span 2; }
}

.communications-contact-bar { display: flex; align-items: center; gap: var(--sp-3); min-height: 62px; margin-bottom: 13px; padding: var(--sp-3) var(--sp-4); border-radius: 16px; color: var(--white); background: var(--grad-navy); box-shadow: var(--shadow); }
.communications-contact-copy { display: grid; gap: var(--sp-1); min-width: 0; flex: 1; }
.communications-contact-copy b { font-size: var(--fs-sm); }
.communications-contact-copy span { color: #b1bdd1; font-size: var(--fs-2xs); }
.communications-contact-bar .actions { margin-left: auto; }
.communications-no-contact { display: grid; gap: var(--sp-1); }
.communications-no-contact span { color: #b1bdd1; font-size: var(--fs-2xs); }
.inbox-head { display: flex; align-items: center; justify-content: space-between; }
.inbox-head > span { display: grid; place-items: center; min-width: 23px; height: 23px; padding: 0 var(--sp-1); border-radius: 99px; color: var(--navy); background: rgba(214,154,53,.18); font-size: var(--fs-2xs); font-weight: 800; }
.inbox-item { width: 100%; display: grid; grid-template-columns: 38px minmax(0,1fr) 8px; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-3); border: 0; border-bottom: 1px solid var(--line-light); text-align: left; color: var(--ink); background: transparent; cursor: pointer; }
.inbox-item:hover { background: rgba(214,154,53,.06); }
.inbox-item.active { background: rgba(24,141,114,.09); box-shadow: inset 3px 0 0 #188d72; }
.inbox-person { min-width: 0; display: grid; gap: var(--sp-1); }
.inbox-person b, .inbox-person small, .inbox-person p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-person b { color: var(--navy); font-size: var(--fs-2xs); }
.inbox-person small { color: var(--muted); font-size: var(--fs-2xs); }
.inbox-person p { margin: 0; color: var(--muted); font-size: var(--fs-2xs); }
.inbox-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #23a67d; }
.communications-empty-list { padding: 25px var(--sp-3); color: var(--muted); font-size: var(--fs-2xs); text-align: center; }
.conversation { min-width: 0; }
.conversation-head { min-height: 65px; }
.thread-log { display: grid; align-content: start; gap: var(--sp-2); padding: var(--sp-4); background: linear-gradient(180deg,#fbfaf7 0%,#f4f1ea 100%); }
.thread-note { max-width: 88%; padding: var(--sp-3) var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px 10px 10px 4px; background: var(--white); box-shadow: var(--shadow-sm); }
.thread-note.mine { justify-self: end; border-color: rgba(214,154,53,.24); border-radius: 10px 10px 4px 10px; background: #fffaf1; }
.thread-note > div { display: flex; align-items: center; gap: var(--sp-2); }
.thread-note b { color: var(--navy); font-size: var(--fs-2xs); }
.thread-note small { color: var(--muted); font-size: var(--fs-2xs); }
.thread-note p { margin: var(--sp-1) 0 0; color: var(--ink); font-size: var(--fs-2xs); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.communication-history-empty { display: grid; justify-items: center; align-content: center; gap: var(--sp-2); min-height: 230px; text-align: center; }
.communication-history-empty > span { color: var(--accent-hover); font-size: var(--fs-3xl); }
.communication-history-empty b { color: var(--navy); font-size: var(--fs-xs); }
.communication-history-empty small { max-width: 240px; color: var(--muted); font-size: var(--fs-2xs); }
.communication-composer { display: flex; align-items: center; }
.communication-composer input { min-width: 0; flex: 1; }
.communication-composer .btn:disabled { opacity: .45; }
.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; }

@media (max-width: 680px) {
  .communications-contact-bar { align-items: flex-start; flex-wrap: wrap; }
  .communications-contact-bar > .tag { order: 3; margin-left: 50px; }
  .communications-contact-bar .actions { width: 100%; margin-left: 50px; }
  .inbox-item { padding: var(--sp-3) var(--sp-2); }
  .thread-note { max-width: 96%; }
  .communication-composer { flex-wrap: wrap; }
  .communication-composer input { width: 100%; flex-basis: 100%; }
}

/* Espace appels : historique et enregistrements rattachés aux prospects */
.call-console { display: grid; grid-template-columns: minmax(235px, 290px) minmax(0,1fr); min-height: 510px; overflow: hidden; }
.call-prospect-list { min-width: 0; border-right: 1px solid var(--line); }
.call-detail { display: flex; flex-direction: column; min-width: 0; min-height: 510px; }
.call-detail .conversation-head { gap: var(--sp-3); }
.call-detail .conversation-head > div { min-width: 0; }
.call-history-list { display: flex; flex: 1; flex-direction: column; align-items: stretch; gap: var(--sp-3); min-height: 300px; max-height: 540px; overflow: auto; padding: var(--sp-4); background: linear-gradient(180deg,#fbfaf7 0%,#f4f1ea 100%); }
.call-entry { padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line-light); border-radius: 10px; background: var(--white); box-shadow: var(--shadow-sm); }
.call-entry-top { display: flex; align-items: center; gap: var(--sp-3); }
.call-entry-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; color: #0b7475; background: #e7f2f0; }
.call-entry-meta { display: grid; flex: 1; min-width: 0; gap: var(--sp-1); }
.call-entry-meta b { color: var(--navy); font-size: var(--fs-2xs); }
.call-entry-meta small { color: var(--muted); font-size: var(--fs-2xs); }
.call-entry > p { margin: var(--sp-3) 0 0 var(--sp-8); color: var(--ink); font-size: var(--fs-2xs); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.call-flow-panel { margin-top: 14px; }
.call-flow-steps, .call-script-steps { display: grid; gap: 0; margin: 0; padding: 2px var(--sp-5) var(--sp-4); list-style: none; }
.call-flow-steps li, .call-script-steps li { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-light); }
.call-flow-steps li:last-child, .call-script-steps li:last-child { border-bottom: 0; }
.call-flow-steps li > span, .call-script-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: #0b7475; background: #e5f1ef; font-size: var(--fs-2xs); font-weight: 800; }
.call-flow-steps li b, .call-script-steps li b { display: block; margin: 1px 0 var(--sp-1); color: var(--navy); font-size: var(--fs-2xs); }
.call-flow-steps li small, .call-script-steps li p, .call-script-steps li small { display: block; margin: 0; color: var(--muted); font-size: var(--fs-2xs); line-height: 1.55; }
.call-script-steps { padding: 0; }
.call-script-steps li { grid-template-columns: 30px minmax(0,1fr); gap: var(--sp-3); }
.call-script-steps li p { margin: var(--sp-1) 0; color: var(--ink); }
.call-script-steps li p strong { color: var(--navy); }
.org-team-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-4); margin-bottom: 14px; }
.org-team-card { overflow: hidden; }
.org-team-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4); color: var(--white); background: var(--org-team-color,#12666b); }
.org-team-card-head .eyebrow { margin: 0 0 var(--sp-1); color: var(--white); }
.org-team-card-head h3 { margin: 0 0 var(--sp-1); color: var(--white); font-size: var(--fs-lg); }
.org-team-card-head small { color: var(--white); font-size: var(--fs-2xs); }
.org-team-card-head .btn { color: var(--navy); background: var(--white); }
.org-team-card-body { display: grid; gap: var(--sp-3); padding: var(--sp-4); }
.org-team-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-2); }
.org-team-stats span { display: flex; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-light); border-radius: 6px; color: var(--muted); font-size: var(--fs-2xs); }
.org-team-stats b { color: var(--navy); }
.org-chip-list { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.org-advisor-list { display: grid; gap: var(--sp-2); padding-top: 10px; border-top: 1px solid var(--line-light); }
.org-advisor-row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.org-advisor-row > span:nth-child(2) { display: grid; flex: 1; min-width: 0; gap: 2px; }
.org-advisor-row b { overflow: hidden; color: var(--navy); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.org-advisor-row small { color: var(--muted); font-size: var(--fs-2xs); }
.org-management-panel { margin-top: 14px; }
.org-checkbox-field { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3); border: 1px solid var(--line); border-radius: 6px; }
.org-checkbox-field span { color: var(--ink); font-size: var(--fs-2xs); }
.org-checkbox-field input { width: 17px; height: 17px; }

@media (max-width: 820px) {
  .call-console { grid-template-columns: 1fr; }
  .call-prospect-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 240px; overflow: auto; }
  .call-detail { min-height: 420px; }
  .org-team-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .call-detail .conversation-head { align-items: flex-start; }
  .call-entry-top { align-items: flex-start; flex-wrap: wrap; }
  .call-entry-top .btn { margin-left: 40px; }
  .call-entry > p { margin-left: 0; }
  .call-flow-steps, .call-script-steps { padding-right: 11px; padding-left: 11px; }
}

/* Référence de fiche prospect: structure compacte, palette RW navy et or */
.brand {
  min-height: 0;
  justify-content: flex-start;
  gap: var(--sp-3);
  padding: 0 var(--sp-1) var(--sp-3);
  margin: 0 2px var(--sp-1);
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.13);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brand-mark {
  width: 44px;
  height: 44px;
  padding: var(--sp-1);
  border: 1px solid rgba(230,180,78,.3);
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 5px 14px rgba(0,0,0,.16);
}
.brand-name, .brand-sub { display: block; }
.brand-name { color: var(--white); font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", sans-serif; font-size: var(--fs-md); font-weight: 800; letter-spacing: -.02em; }
.brand-sub { margin-top: 2px; color: var(--gold); font-size: var(--fs-2xs); letter-spacing: 1.25px; }
.nav-label { margin-top: 13px; margin-bottom: 4px; color: #aab5ca; font-size: var(--fs-2xs); }
.nav-label::after { background: linear-gradient(90deg, rgba(255,255,255,.15), transparent); }
.nav-btn { min-height: 38px; padding-top: 7px; padding-bottom: 7px; border-radius: 10px; }
.sidebar-foot { padding-top: 11px; }
.agent-mini { border-color: rgba(255,255,255,.13); border-radius: 13px; background: rgba(255,255,255,.07); }
.agent-info small { color: #b1bdd1; }
.logout-btn { justify-content: flex-start; min-height: 36px; padding-left: 12px; border-radius: 10px; }

.modal.wide:has(.lead-detail-body) { width: min(1180px, 96vw); max-height: 94vh; }
.lead-detail-body { display: grid; gap: var(--sp-4); padding: var(--sp-5) var(--sp-5); }
.lead-overview-grid { display: grid; grid-template-columns: minmax(0,1.02fr) minmax(0,.98fr); gap: var(--sp-3); align-items: stretch; }
.contact-direct-panel, .lead-required-documents-panel {
  min-width: 0;
  padding: var(--sp-4);
  border: 1px solid var(--line-light);
  border-radius: 16px;
  background: var(--cream);
  box-shadow: var(--shadow-sm);
}
.contact-direct-panel { position: relative; overflow: hidden; }
.contact-direct-panel::before { position: absolute; content: ""; inset: 0 0 auto; height: 3px; background: var(--grad-accent); }
.contact-direct-heading { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; margin-bottom: 12px; }
.contact-direct-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border: 1px solid rgba(214,154,53,.24); border-radius: 10px; color: var(--accent-hover); background: rgba(214,154,53,.12); font-size: var(--fs-2xl); font-weight: 750; }
.contact-direct-title { display: grid; gap: 1px; min-width: 0; flex: 1; }
.contact-direct-title .eyebrow { font-size: var(--fs-2xs); }
.contact-direct-title > b { overflow: hidden; color: var(--navy); font-size: var(--fs-md); text-overflow: ellipsis; white-space: nowrap; }
.contact-direct-title > small { color: var(--muted); font-size: var(--fs-2xs); }
.contact-lead-reference { align-self: flex-start; padding: var(--sp-1) var(--sp-2); border: 1px solid var(--line-light); border-radius: 6px; color: var(--muted); background: var(--paper); font: 700 var(--fs-2xs) ui-monospace, monospace; }
.contact-client-strip { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; margin-bottom: 11px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: var(--paper); }
.contact-client-strip .avatar { width: 31px; height: 31px; box-shadow: 0 0 0 2px rgba(214,154,53,.32); font-size: var(--fs-2xs); }
.contact-client-strip > div { display: grid; gap: 1px; min-width: 0; flex: 1; }
.contact-client-strip > div b, .contact-client-strip > div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-client-strip > div b { color: var(--navy); font-size: var(--fs-2xs); }
.contact-client-strip > div span { color: var(--muted); font-size: var(--fs-2xs); }
.contact-client-strip .tag { flex: 0 0 auto; }
.contact-channel-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-2); }
.lead-contact-sticky { position: sticky; top: 0; z-index: 6; margin: -18px -20px 0; padding: var(--sp-2) var(--sp-5) var(--sp-3); border-bottom: 1px solid var(--line-light); background: color-mix(in srgb, var(--paper) 96%, transparent); backdrop-filter: blur(12px); }
.lead-contact-sticky .contact-channel-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--sp-2); }
.lead-contact-sticky .contact-channel-card { min-height: 44px; }
.contact-channel-card:focus-visible { outline: 3px solid rgba(214,154,53,.55); outline-offset: 2px; }
.contact-channel-card {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  min-height: 50px;
  padding: var(--sp-2) var(--sp-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--cream);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.contact-channel-card:hover { transform: translateY(-1px); border-color: rgba(214,154,53,.56); background: rgba(214,154,53,.09); box-shadow: var(--shadow-sm); }
.contact-channel-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 6px; color: var(--accent-hover); background: rgba(214,154,53,.13); font-size: var(--fs-md); }
.contact-channel-card > span:nth-child(2) { display: grid; gap: 1px; min-width: 0; flex: 1; }
.contact-channel-card b, .contact-channel-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-channel-card b { color: var(--navy); font-size: var(--fs-2xs); }
.contact-channel-card small { color: var(--muted); font-size: var(--fs-2xs); }
.contact-channel-card > i { color: var(--accent-hover); font-size: var(--fs-sm); font-style: normal; }
.contact-owner-line { display: flex; align-items: center; gap: var(--sp-1); margin-top: 10px; color: var(--muted); font-size: var(--fs-2xs); }
.contact-owner-line b { color: var(--navy); }
.contact-owner-separator { color: var(--accent-text); }
.required-documents-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: 10px; }
.required-documents-heading > div { display: grid; gap: 1px; }
.required-documents-heading .eyebrow { font-size: var(--fs-2xs); }
.required-documents-heading h3 { margin: 0; color: var(--navy); font: 700 var(--fs-lg) "Avenir Next", "Segoe UI", sans-serif; }
.documents-count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 37px; height: 27px; padding: 0 var(--sp-2); border: 1px solid rgba(214,154,53,.24); border-radius: 10px; color: var(--navy); background: rgba(214,154,53,.12); font-size: var(--fs-2xs); font-weight: 800; }
.lead-required-documents-panel .doc-checklist-progress { grid-template-columns: 1fr auto; align-items: end; gap: var(--sp-1) var(--sp-3); margin: 0 0 var(--sp-2); }
.lead-required-documents-panel .doc-checklist-progress b { font-size: var(--fs-2xs); }
.lead-required-documents-panel .doc-checklist-progress span { font-size: var(--fs-2xs); text-align: right; }
.lead-required-documents-panel .doc-requirements { gap: var(--sp-1); margin-bottom: 6px; }
.lead-required-documents-panel .requirement-row { min-height: 27px; padding: var(--sp-1) var(--sp-2); border-radius: 6px; font-size: var(--fs-2xs); }
.lead-required-documents-panel .requirement-row b { font-size: var(--fs-2xs); }
.lead-required-documents-panel .requirement-row em { font-size: var(--fs-2xs); }
.lead-required-documents-panel .requirement-upload { padding: var(--sp-1) var(--sp-1); font-size: var(--fs-2xs); }
.lead-required-documents-panel .notice.mini { margin-top: 6px; padding: var(--sp-1) var(--sp-2); font-size: var(--fs-2xs); }
.indexed-documents-list { display: grid; gap: var(--sp-1); max-height: 112px; margin-top: 9px; overflow: auto; }
.indexed-documents-title { display: flex; justify-content: space-between; color: var(--navy); font-size: var(--fs-2xs); }
.indexed-documents-title span { color: var(--muted); font-weight: 500; }
.indexed-documents-list .doc-row { grid-template-columns: 25px minmax(0,1fr) auto auto; padding: var(--sp-1) var(--sp-2); border-radius: 6px; background: var(--paper); }
.indexed-documents-list .doc-icon { width: 23px; height: 25px; font-size: var(--fs-2xs); }
.indexed-documents-list .doc-row b { font-size: var(--fs-2xs); }
.indexed-documents-list .doc-row small { max-width: 200px; font-size: var(--fs-2xs); }
.indexed-documents-list .tag { padding: var(--sp-1) var(--sp-1); font-size: var(--fs-2xs); }
.doc-view-button { padding: var(--sp-1) var(--sp-1); border: 1px solid var(--line); border-radius: 6px; color: var(--navy); background: var(--cream); font-size: var(--fs-2xs); font-weight: 750; cursor: pointer; }
.doc-view-button:hover { border-color: var(--accent); color: var(--accent-hover); }
.indexed-documents-empty { padding: var(--sp-3) var(--sp-1); border: 1px dashed var(--line); border-radius: 6px; color: var(--muted); font-size: var(--fs-2xs); text-align: center; }
.lead-upload-button { width: 100%; margin-top: 8px; border-color: rgba(214,154,53,.35); color: var(--navy); background: rgba(214,154,53,.10); }
.lead-progress-card { position: relative; overflow: hidden; margin: 0; padding: var(--sp-4) 17px var(--sp-3); border-color: rgba(20,41,81,.11); border-radius: 16px; background: linear-gradient(120deg,var(--cream) 0%,var(--paper) 100%); box-shadow: var(--shadow-sm); }
.lead-progress-card::after { position: absolute; content: ""; width: 180px; height: 180px; top: -115px; right: -26px; border: 1px solid rgba(214,154,53,.13); border-radius: 50%; box-shadow: 0 0 0 20px rgba(214,154,53,.035), 0 0 0 42px rgba(214,154,53,.025); pointer-events: none; }
.lead-progress-heading { position: relative; z-index: 1; }
.lead-progress-title { display: grid; gap: 2px; }
.lead-progress-title .eyebrow { font-size: var(--fs-2xs); }
.lead-progress-title b { color: var(--navy); font: 700 var(--fs-lg) "Plus Jakarta Sans", sans-serif; }
.lead-progress-title small { color: var(--muted); font-size: var(--fs-2xs); }
.lead-progress-count { display: inline-flex; align-items: center; gap: var(--sp-1); position: relative; z-index: 1; padding: var(--sp-1) var(--sp-2); border: 1px solid rgba(8,23,53,.12); border-radius: 10px; color: var(--navy); background: rgba(8,23,53,.045); line-height: 1.15; }
.lead-progress-count > b { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 6px; color: var(--white); background: var(--accent); font-size: var(--fs-sm); }
.lead-progress-count > span { font-size: var(--fs-2xs); font-weight: 800; text-transform: uppercase; }
.lead-progress-track { position: relative; z-index: 1; height: 4px; margin: var(--sp-4) 0 var(--sp-3); }
.lead-progress-track i { transform: scaleX(0); transform-origin: left center; animation: lead-progress-fill .85s cubic-bezier(.2,.8,.2,1) .1s forwards; }
@keyframes lead-progress-fill { to { transform: scaleX(1); } }
.lead-stage-steps { position: relative; z-index: 1; }
.lead-stage-steps li { position: relative; }
.lead-stage-steps li:not(:last-child)::after { position: absolute; content: ""; top: 11px; left: calc(50% + 15px); width: calc(100% - 30px); height: 1px; background: var(--line); }
.lead-stage-steps li.complete::after { background: var(--accent); }
.lead-stage-steps li > span { z-index: 1; width: 24px; height: 24px; border-color: #d8dce4; color: var(--muted); background: var(--cream); font-size: var(--fs-2xs); }
.lead-stage-steps li.complete > span { border-color: var(--accent); color: var(--navy); background: var(--grad-accent); }
.lead-stage-steps li.current > span { border: 2px solid var(--accent); color: var(--navy); background: var(--cream); box-shadow: 0 0 0 4px rgba(214,154,53,.16); animation: lead-step-pulse 1.8s ease-in-out infinite; }
@keyframes lead-step-pulse { 50% { box-shadow: 0 0 0 7px rgba(214,154,53,.06); } }
.lead-stage-steps small { max-width: 115px; font-size: var(--fs-2xs); line-height: 1.25; }
.lead-progress-current { position: relative; z-index: 1; display: flex; align-items: center; gap: var(--sp-2); margin-top: 12px; padding: var(--sp-2) var(--sp-2); border: 1px solid rgba(214,154,53,.18); border-radius: 10px; background: rgba(214,154,53,.06); }
.lead-progress-current-mark { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; border: 1px solid rgba(214,154,53,.3); border-radius: 6px; color: var(--accent-hover); background: var(--cream); font-size: var(--fs-2xs); }
.lead-progress-current > div { display: grid; gap: 1px; min-width: 0; }
.lead-progress-current small { color: var(--muted); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: .07em; }
.lead-progress-current b { overflow: hidden; color: var(--navy); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.lead-progress-percent { margin-left: auto; color: var(--muted); font-size: var(--fs-2xs); white-space: nowrap; }
.lead-action-call, .lead-action-whatsapp { border-color: rgba(214,154,53,.32); color: var(--navy); background: rgba(214,154,53,.10); }
.lead-action-call:hover, .lead-action-whatsapp:hover { background: rgba(214,154,53,.2); }
.lead-detail-body > .collab-banner { margin: 0; border-radius: 10px; }
.lead-detail-body > .collab-banner .collab-banner-actions { flex-wrap: wrap; justify-content: flex-end; }

/* Fiche client en page dédiée dans l’espace principal du CRM. */
.lead-record-page { display: grid; gap: var(--sp-3); min-width: 0; }
.lead-record-back-row { display: flex; justify-content: flex-start; }
.lead-record-card { display: flex; flex-direction: column; width: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); background: var(--cream); box-shadow: var(--shadow); }
.lead-record-card .modal-head { position: relative; top: auto; }
.lead-record-card .modal-body { max-height: none; overflow: visible; }
.lead-record-card .modal-foot { position: relative; bottom: auto; flex-wrap: wrap; }
.lead-record-card .lead-detail-body { min-height: 58vh; }

/* Reporting : cartes et graphiques calés sur la capture de référence. */
.reporting-page { display: grid; gap: var(--sp-5); color: #172c31; }
.reporting-summary-grid { display: grid; grid-template-columns: minmax(190px,.88fr) minmax(190px,.88fr) minmax(390px,1.78fr); gap: var(--sp-3); }
.reporting-charts-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--sp-4); }
.reporting-card { min-width: 0; padding: var(--sp-4); border: 1px solid #d8e1df; border-radius: 10px; background: var(--white); box-shadow: 0 2px 6px rgba(13,51,54,.025); }
.reporting-summary-grid .reporting-card { min-height: 140px; }
.reporting-card-title { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: 10px; color: #54717a; font-size: var(--fs-2xs); letter-spacing: .055em; }
.reporting-card-title > span:last-child { color: #0f626b; font-size: var(--fs-lg); }
.reporting-main-value { display: block; color: #132a30; font-size: var(--fs-3xl); font-weight: 750; line-height: 1.2; letter-spacing: -.035em; }
.reporting-segment-bar { height: 7px; margin: var(--sp-3) 0 var(--sp-2); overflow: hidden; border-radius: 99px; }
.reporting-segment-labels { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); color: #66787d; font-size: var(--fs-2xs); }
.reporting-segment-labels span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.reporting-segment-labels i, .report-product-legend i, .report-chart-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.green-dot { background: #208054; }
.amber-dot { background: #df8b2c; }
.red-dot { background: #c93b34; }
.reporting-trend { margin-top: 7px; color: #c34237; font-size: var(--fs-2xs); }
.reporting-fees-card p { max-width: 300px; margin: var(--sp-2) 0 0; color: #75868a; font-size: var(--fs-2xs); line-height: 1.45; }
.reporting-revenue-layout { display: grid; grid-template-columns: minmax(130px,.65fr) minmax(0,1.35fr); align-items: center; gap: var(--sp-5); height: calc(100% - 25px); }
.reporting-revenue-layout > div:first-child { display: grid; gap: var(--sp-1); }
.reporting-revenue-layout .reporting-main-value { font-size: var(--fs-4xl); }
.reporting-positive { color: #198252; font-size: var(--fs-2xs); }
.reporting-revenue-progress { display: grid; gap: var(--sp-2); }
.reporting-revenue-topline, .reporting-revenue-bottomline { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); color: #61777d; font-size: var(--fs-2xs); }
.reporting-revenue-topline b { color: #142e33; white-space: nowrap; }
.reporting-revenue-bottomline { font-size: var(--fs-2xs); }
.reporting-revenue-bottomline b { color: #425d63; }
.reporting-revenue-track { height: 7px; overflow: hidden; border-radius: 20px; background: #e4eceb; }
.reporting-revenue-track i { display: block; height: 100%; border-radius: inherit; background: #0f626b; }
.reporting-chart-card { min-height: 300px; }
.reporting-chart-heading h2 { margin: 1px 0 var(--sp-1); color: #122d33; font-size: var(--fs-sm); font-weight: 700; }
.reporting-chart-heading p { margin: 0; color: #72858a; font-size: var(--fs-2xs); }
.report-funnel { display: grid; gap: var(--sp-2); margin-top: 18px; }
.report-funnel-row { display: grid; grid-template-columns: 94px minmax(0,1fr) 24px; align-items: center; gap: var(--sp-2); color: #4f666d; font-size: var(--fs-2xs); }
.report-funnel-row > span { text-align: right; }
.report-funnel-row > i { display: block; height: 17px; overflow: hidden; border-left: 1px dotted #dce5e4; background: repeating-linear-gradient(90deg,transparent 0,transparent calc(25% - 1px),#edf1f0 calc(25% - 1px),#edf1f0 25%); }
.report-funnel-row > i > b { display: block; height: 100%; border-radius: 0 6px 6px 0; background: #0f626b; }
.report-funnel-row > strong { color: #243c41; font-size: var(--fs-2xs); }
.report-week-chart { position: relative; display: flex; align-items: stretch; gap: var(--sp-4); height: 207px; margin: var(--sp-4) var(--sp-1) 0 var(--sp-7); padding: var(--sp-2) var(--sp-2) var(--sp-6); border-bottom: 1px solid #dce5e4; background: repeating-linear-gradient(to top,transparent 0,transparent calc(25% - 1px),#e7eeed calc(25% - 1px),#e7eeed 25%); }
.report-week-column { position: relative; z-index: 1; display: grid; flex: 1; grid-template-rows: minmax(0,1fr) 18px; min-width: 0; text-align: center; }
.report-week-bar-area { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.report-week-bar-area > strong { position: absolute; left: 50%; transform: translate(-50%,0); color: #637a7e; font-size: var(--fs-2xs); font-weight: 600; }
.report-week-bar-area > i { display: block; width: min(26px,65%); min-height: 2px; border-radius: 4px 4px 0 0; background: #0f626b; }
.report-week-column > span { padding-top: 5px; color: #536a70; font-size: var(--fs-2xs); }
.report-week-column strong { white-space: nowrap; }
.report-week-target { position: absolute; z-index: 2; right: 8px; left: 8px; border-top: 2px dashed #e4852d; pointer-events: none; }
.report-week-target span { position: absolute; top: -14px; right: 0; padding-left: 4px; color: #dc7925; background: var(--white); font-size: var(--fs-2xs); }
.report-chart-legend { display: flex; justify-content: center; gap: var(--sp-3); margin-top: 8px; color: #6c7f84; font-size: var(--fs-2xs); }
.report-chart-legend span, .report-product-legend span { display: inline-flex; align-items: center; gap: var(--sp-1); }
.report-legend-teal { background: #0f626b; }
.report-legend-orange { background: #e4852d; }
.report-product-chart { display: grid; grid-template-columns: minmax(125px,.9fr) minmax(0,1fr); align-items: center; gap: var(--sp-3); min-height: 225px; padding-top: 6px; }
.report-donut { display: grid; place-items: center; width: min(166px,100%); aspect-ratio: 1; margin: auto; border-radius: 50%; }
.report-donut > div { display: grid; place-content: center; width: 66%; aspect-ratio: 1; border-radius: 50%; background: var(--white); text-align: center; }
.report-donut b { color: #17343a; font-size: var(--fs-md); }
.report-donut small { margin-top: 2px; color: #73858a; font-size: var(--fs-2xs); }
.report-product-legend { display: grid; gap: var(--sp-2); color: #60767b; font-size: var(--fs-2xs); }
.report-product-legend > div { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-1); }
.report-product-legend > div > span { min-width: 0; }
.report-product-legend > div > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.report-product-legend > div b { flex: 0 0 auto; color: #1b3339; }
.report-product-legend > div i { flex: 0 0 auto; }
.report-period-select { min-height: 34px; padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--cream); }

@media (max-width: 1120px) {
  .reporting-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reporting-revenue-card { grid-column: 1 / -1; }
  .reporting-charts-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .reporting-charts-grid .reporting-chart-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .reporting-summary-grid, .reporting-charts-grid { grid-template-columns: 1fr; }
  .reporting-revenue-card, .reporting-charts-grid .reporting-chart-card:last-child { grid-column: auto; }
  .reporting-revenue-layout { grid-template-columns: 1fr; gap: var(--sp-3); }
  .report-product-chart { grid-template-columns: minmax(100px,.7fr) minmax(0,1fr); }
  .reporting-chart-card { min-height: 280px; }
  .lead-record-card .modal-head { padding: var(--sp-4); }
  .lead-record-card .modal-body { padding: var(--sp-3); }
}

/* Fiche client guidée : chaque partie du dossier dispose de son espace dédié. */
.lead-file-tabs { display: flex; gap: var(--sp-1); padding: var(--sp-1); overflow-x: auto; border: 1px solid var(--line-light); border-radius: 13px; background: var(--cream); scrollbar-width: thin; }
.lead-file-tab { min-height: 39px; flex: 1 0 auto; padding: var(--sp-2) var(--sp-3); border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; font: 700 var(--fs-2xs) "Avenir Next", "Segoe UI", sans-serif; cursor: pointer; transition: color var(--transition), background var(--transition), box-shadow var(--transition); }
.lead-file-tab:hover { color: var(--navy); background: rgba(214,154,53,.08); }
.lead-file-tab.is-active { border-color: rgba(214,154,53,.26); color: var(--navy); background: var(--paper); box-shadow: 0 3px 10px rgba(20,41,81,.07); }
.lead-file-panel[hidden] { display: none !important; }
.lead-file-panel { min-width: 0; padding: var(--sp-5); border: 1px solid var(--line-light); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow-sm); animation: lead-panel-enter .24s ease both; }
@keyframes lead-panel-enter { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.lead-file-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: 15px; }
.lead-file-panel-head > div:first-child { min-width: 0; }
.lead-file-panel-head .eyebrow { margin-bottom: 4px; font-size: var(--fs-2xs); }
.lead-file-panel-head h3 { margin: 0; color: var(--navy); font: 700 var(--fs-2xl) "Plus Jakarta Sans", sans-serif; }
.lead-file-panel-head p { margin: var(--sp-1) 0 0; color: var(--muted); font-size: var(--fs-2xs); line-height: 1.45; }
.lead-file-panel-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-1); }
.lead-file-content-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-3); align-items: start; }
.lead-file-stack { display: grid; gap: var(--sp-3); }
.lead-file-panel .info-card { margin: 0; }
.lead-file-panel .lead-required-documents-panel { padding: var(--sp-4); }
.lead-file-empty { display: flex; align-items: center; gap: var(--sp-3); min-height: 100px; padding: var(--sp-5); border: 1px dashed var(--line); border-radius: 13px; color: var(--navy); background: var(--cream); }
.lead-file-empty > span { display: grid; place-items: center; width: 37px; height: 37px; flex: 0 0 auto; border-radius: 10px; color: var(--accent-hover); background: rgba(214,154,53,.15); font-size: var(--fs-xs); font-weight: 800; }
.lead-file-empty > div { display: grid; gap: var(--sp-1); }
.lead-file-empty b { font-size: var(--fs-2xs); }
.lead-file-empty small { color: var(--muted); font-size: var(--fs-2xs); }
.lead-gate-status { display: flex; align-items: flex-start; gap: var(--sp-2); margin-bottom: 12px; padding: var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: var(--cream); }
.lead-gate-status > span { display: grid; place-items: center; width: 22px; height: 22px; flex: 0 0 auto; border-radius: 6px; color: var(--white); background: #b7791f; font-size: var(--fs-xs); font-weight: 800; }
.lead-gate-status.is-ready > span { background: #188d72; }
.lead-gate-status > div { display: grid; gap: var(--sp-1); }
.lead-gate-status b { color: var(--navy); font-size: var(--fs-2xs); }
.lead-gate-status small { color: var(--muted); font-size: var(--fs-2xs); line-height: 1.45; }
.lead-validation-checklist { display: grid; gap: var(--sp-2); }
.lead-validation-row { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: var(--sp-2); min-height: 42px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: var(--cream); }
.lead-validation-row > span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--white); background: #b7791f; font-size: var(--fs-2xs); font-weight: 800; }
.lead-validation-row.is-ready > span { background: #188d72; }
.lead-validation-row b { color: var(--navy); font-size: var(--fs-2xs); }
.lead-validation-row em { color: var(--muted); font-size: var(--fs-2xs); font-style: normal; }
.lead-validation-row.is-ready em { color: #188d72; font-weight: 750; }
.lead-validation-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: 12px; padding: var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: var(--cream); }
.lead-validation-summary > div { display: grid; gap: var(--sp-1); min-width: 0; }
.lead-validation-summary .eyebrow { font-size: var(--fs-2xs); }
.lead-validation-summary b { color: var(--navy); font-size: var(--fs-2xs); }
.lead-validation-summary small { color: var(--muted); font-size: var(--fs-2xs); }
.lead-validation-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.lead-return-notice { margin: 0 0 var(--sp-3); border-left-color: var(--red-text); background: var(--red-bg); }
.lead-file-panel .contact-direct-panel { background: var(--cream); }
.lead-file-panel .info-row b { overflow-wrap: anywhere; }
.lead-file-panel .info-row { align-items: flex-start; }
.lead-file-panel .info-row > span:first-child { flex: 0 0 42%; }
.lead-file-panel .info-row > b, .lead-file-panel .info-row > .tag { text-align: right; }
.lead-modal-head-tools { display: flex; align-items: center; gap: var(--sp-3); }
#lead-save-status { display: inline-flex; align-items: center; max-width: 240px; padding: var(--sp-1) var(--sp-2); border: 1px solid var(--line-light); border-radius: 999px; color: var(--muted); background: var(--cream); font-size: var(--fs-2xs); font-weight: 700; text-align: center; }
#lead-save-status[data-status="saved"] { border-color: rgba(24,141,114,.3); color: #13765f; background: rgba(24,141,114,.07); }
#lead-save-status[data-status="saving"] { border-color: rgba(214,154,53,.35); color: #8a5b05; background: rgba(214,154,53,.1); }
#lead-save-status[data-status="error"], #lead-save-status[data-status="conflict"] { border-color: rgba(190,62,62,.3); color: #a42e35; background: rgba(190,62,62,.08); }
#lead-save-status[data-status="local"] { color: var(--muted); }
.dvc-readiness-card { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line-light); border-radius: 10px; background: var(--cream); }
.dvc-readiness-card.is-incomplete { border-color: rgba(214,154,53,.38); background: rgba(214,154,53,.07); }
.dvc-readiness-card.is-ready { border-color: rgba(24,141,114,.3); background: rgba(24,141,114,.06); }
.dvc-readiness-heading { display: flex; align-items: center; gap: var(--sp-2); }
.dvc-readiness-heading > span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; color: var(--white); background: #b7791f; font-size: var(--fs-xs); font-weight: 800; }
.dvc-readiness-card.is-ready .dvc-readiness-heading > span { background: #188d72; }
.dvc-readiness-heading > div { display: grid; gap: 2px; }
.dvc-readiness-heading b { color: var(--navy); font-size: var(--fs-2xs); }
.dvc-readiness-heading small, .dvc-readiness-card summary { color: var(--muted); font-size: var(--fs-2xs); }
.dvc-readiness-card ul { display: grid; gap: var(--sp-1); margin: var(--sp-2) 0 0 33px; padding-left: 13px; color: var(--ink); font-size: var(--fs-2xs); }
.dvc-readiness-card details { margin: var(--sp-2) 0 0 33px; }
.dvc-readiness-card summary { cursor: pointer; }
.inline-lead-editor { margin: 0 0 var(--sp-4) !important; }
.inline-lead-editor h3 { margin-bottom: 12px; }
.inline-confirmation { grid-column: 1 / -1; }
.lead-dvc-status { margin: 0 0 var(--sp-4); overflow-wrap: anywhere; }
.portal-document-selection { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-2); }
.portal-document-selection label { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: var(--cream); color: var(--ink); font-size: var(--fs-2xs); line-height: 1.4; cursor: pointer; }
.portal-document-selection input { margin: 2px 0 0; accent-color: var(--orange); }
.contract-upload-card { margin: 0 0 var(--sp-4) !important; }
.contract-upload-controls { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-3) 0 var(--sp-1); }
.contract-upload-controls input { min-width: 0; flex: 1; }
.contract-upload-card > small { color: var(--muted); font-size: var(--fs-2xs); }
.lead-file-panel > .lead-file-panel-actions { margin-top: 12px; }
.dvc-workspace { display: grid; gap: var(--sp-3); }
.dvc-status-panel { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-4) var(--sp-4); border: 1px solid var(--line-light); border-radius: 13px; background: var(--cream); }
.dvc-status-panel > div { display: grid; gap: var(--sp-1); }
.dvc-status-panel .eyebrow { font-size: var(--fs-2xs); }
.dvc-status-panel b { color: var(--navy); font-size: var(--fs-xs); }
.dvc-status-panel small { color: var(--muted); font-size: var(--fs-2xs); }
.dvc-status-panel.is-verified { border-color: rgba(24,141,114,.3); background: rgba(24,141,114,.06); }
.dvc-status-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 10px; color: var(--white); background: #188d72; font-size: var(--fs-lg); font-weight: 800; }
.dvc-status-panel.is-pending .dvc-status-icon { background: #b7791f; }
.dvc-summary-card { padding: var(--sp-4); border: 1px solid var(--line-light); border-radius: 13px; background: var(--paper); }
.dvc-summary-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: 10px; }
.dvc-summary-heading > div { display: grid; gap: var(--sp-1); }
.dvc-summary-heading .eyebrow { font-size: var(--fs-2xs); }
.dvc-summary-heading h3 { margin: 0; color: var(--navy); font-size: var(--fs-sm); }
.dvc-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-2); }
.dvc-summary-row { display: grid; gap: var(--sp-1); min-width: 0; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: var(--cream); }
.dvc-summary-row span { color: var(--muted); font-size: var(--fs-2xs); }
.dvc-summary-row b { color: var(--navy); font-size: var(--fs-2xs); line-height: 1.4; overflow-wrap: anywhere; }
.dvc-honesty-note { margin: 0; font-size: var(--fs-2xs); line-height: 1.5; }
.dvc-next-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3); border: 1px solid rgba(214,154,53,.25); border-radius: 10px; background: rgba(214,154,53,.07); }
.dvc-next-actions > div { display: grid; gap: var(--sp-1); }
.dvc-next-actions .eyebrow { font-size: var(--fs-2xs); }
.dvc-next-actions b { color: var(--navy); font-size: var(--fs-2xs); }
.dvc-next-actions small { color: var(--muted); font-size: var(--fs-2xs); }
.dvc-contact-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

@media (max-width: 680px) {
  .lead-file-panel { padding: var(--sp-3); }
  .lead-modal-head-tools { align-items: flex-end; flex-direction: column-reverse; gap: var(--sp-1); }
  #lead-save-status { max-width: 165px; font-size: var(--fs-2xs); }
  .lead-file-panel-head { align-items: flex-start; flex-direction: column; }
  .lead-file-panel-actions { justify-content: flex-start; }
  .lead-contact-sticky { margin: -12px -12px 0; padding: var(--sp-2) var(--sp-3); }
  .lead-contact-sticky .contact-channel-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .portal-document-selection { grid-template-columns: 1fr; }
  .contract-upload-controls { align-items: stretch; flex-direction: column; }
  .lead-file-content-grid, .dvc-summary-grid { grid-template-columns: 1fr; }
  .lead-file-tab { min-height: 36px; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-2xs); }
  .lead-validation-summary, .dvc-next-actions { align-items: flex-start; flex-direction: column; }
  .lead-validation-row { grid-template-columns: 24px minmax(0,1fr); }
  .lead-validation-row em { grid-column: 2; }
}

@media (max-width: 920px) {
  .lead-overview-grid { grid-template-columns: 1fr; }
  .modal.wide:has(.lead-detail-body) { width: min(760px, 96vw); }
}
@media (max-width: 680px) {
  .lead-detail-body { gap: var(--sp-3); padding: var(--sp-3); }
  .contact-direct-panel, .lead-required-documents-panel { padding: var(--sp-3); }
  .contact-client-strip .tag { display: none; }
  .lead-progress-card { padding: var(--sp-3) var(--sp-3) var(--sp-3); }
  .lead-progress-title b { font-size: var(--fs-md); }
  .lead-progress-title small { max-width: 210px; font-size: var(--fs-2xs); }
  .lead-progress-track { margin: var(--sp-3) 0; }
  .lead-stage-steps { display: flex; gap: 0; overflow-x: auto; padding: 2px 1px var(--sp-1); scrollbar-width: thin; }
  .lead-stage-steps li { flex: 0 0 88px; }
  .lead-stage-steps li:not(:last-child)::after { width: 58px; }
  .lead-stage-steps small { max-width: 82px; font-size: var(--fs-2xs); }
  .lead-progress-percent { display: none; }
  .lead-detail-body > .collab-banner { align-items: flex-start; }
  .lead-detail-body > .collab-banner .collab-banner-actions { justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .lead-progress-track i, .lead-stage-steps li.current > span { animation: none; transform: none; }
}

/* Saisie guidée : repères discrets et progression visible sans interrompre le formulaire. */
.qualification-completion { display: grid; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-3); border: 1px solid rgba(214,154,53,.24); border-radius: 13px; background: linear-gradient(110deg,rgba(214,154,53,.09),rgba(255,255,255,.7)); transition: border-color .25s ease, background .25s ease; }
.qualification-completion > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); color: var(--navy); font-size: var(--fs-2xs); }
.qualification-completion > div:first-child span { color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.qualification-completion > small { color: var(--muted); font-size: var(--fs-2xs); }
.qualification-completion-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(8,23,53,.09); }
.qualification-completion-track i { display: block; height: 100%; border-radius: inherit; background: var(--grad-accent); transition: width .42s cubic-bezier(.2,.8,.2,1); }
.qualification-completion.is-complete { border-color: rgba(24,141,114,.35); background: rgba(24,141,114,.06); }
.qualification-completion.is-complete .qualification-completion-track i { background: linear-gradient(90deg,#188d72,#3bb99a); }
.qualification-form .field { transition: transform .18s ease, filter .18s ease; }
.qualification-form .field.is-editing { transform: translateY(-1px); }
.qualification-form .field.is-editing label { color: var(--accent-hover); }
.qualification-form .field.is-filled:not(.is-inactive) label { color: var(--navy-2); }
.qualification-confirmation { transition: border-color .22s ease, background .22s ease, box-shadow .22s ease; }
.qualification-confirmation.is-filled { border-color: rgba(24,141,114,.3); background: rgba(24,141,114,.06); }
.lead-stage-steps li.just-activated > span { animation: lead-stage-arrive .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes lead-stage-arrive { 0% { transform: scale(.72); box-shadow: 0 0 0 0 rgba(214,154,53,.42); } 65% { transform: scale(1.18); box-shadow: 0 0 0 9px rgba(214,154,53,0); } 100% { transform: scale(1); } }

.director-mobile-nav { display: none; }
@media (max-width: 768px) {
  body.director-mobile-mode .director-mobile-nav {
    position: fixed;
    z-index: 45;
    right: max(10px, env(safe-area-inset-right));
    bottom: max(9px, env(safe-area-inset-bottom));
    left: max(10px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: var(--sp-1);
    padding: var(--sp-2);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    background: rgba(8,23,53,.96);
    box-shadow: 0 16px 40px rgba(8,23,53,.28), inset 0 1px 0 rgba(255,255,255,.08);
    backdrop-filter: blur(18px);
  }
  body.director-mobile-mode .director-mobile-tab {
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: var(--sp-1);
    padding: var(--sp-1) 2px;
    border: 0;
    border-radius: 10px;
    color: #aeb8cc;
    background: transparent;
    font: 650 var(--fs-2xs)/1.1 "Avenir Next", "Segoe UI", sans-serif;
    cursor: pointer;
    transition: color .18s ease, background .18s ease, transform .18s ease;
  }
  body.director-mobile-mode .director-mobile-tab:active { transform: scale(.95); }
  body.director-mobile-mode .director-mobile-tab.active { color: #f5cc80; background: rgba(214,154,53,.16); }
  body.director-mobile-mode .director-mobile-tab-icon { display: grid; place-items: center; height: 20px; font-size: var(--fs-lg); line-height: 1; }
  body.director-mobile-mode .sidebar-toggle { display: none; }
  body.director-mobile-mode .content { padding-bottom: calc(98px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .qualification-completion-track i, .qualification-form .field, .qualification-confirmation, .lead-stage-steps li.just-activated > span, .director-mobile-tab { transition: none !important; animation: none !important; }
}

/* Fiche prospect : checklist lisible, actions hiérarchisées et progression nette. */
.lead-required-documents-panel .required-documents-heading { align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line-light); }
.lead-required-documents-panel .required-documents-heading h3 { font-size: var(--fs-lg); }
.lead-required-documents-panel .required-documents-heading .eyebrow { color: var(--accent-hover); font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .09em; }
.lead-required-documents-panel .documents-count-pill { min-width: 54px; height: 34px; border-radius: 10px; font-size: var(--fs-xs); }
.lead-required-documents-panel .doc-checklist-progress { grid-template-columns: minmax(0,1fr); gap: var(--sp-1); margin: var(--sp-3) 0; }
.doc-checklist-summary { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.lead-required-documents-panel .doc-checklist-summary b { color: var(--navy); font-size: var(--fs-2xs); }
.lead-required-documents-panel .doc-checklist-summary span,
.lead-required-documents-panel .doc-checklist-progress > small { color: var(--muted); font-size: var(--fs-2xs); }
.doc-checklist-track { height: 5px; overflow: hidden; border-radius: 99px; background: var(--line-light); }
.doc-checklist-track i { display: block; height: 100%; border-radius: inherit; background: var(--grad-accent); transition: width .4s cubic-bezier(.2,.8,.2,1); }
.lead-required-documents-panel .doc-requirements { gap: var(--sp-1); margin-bottom: 9px; }
.lead-required-documents-panel .requirement-row { min-height: 36px; grid-template-columns: 21px minmax(0,1fr) auto auto; gap: var(--sp-2); padding: var(--sp-2) var(--sp-2); border: 1px solid var(--line-light); border-radius: 10px; background: var(--paper); }
.lead-required-documents-panel .requirement-row b { overflow-wrap: anywhere; font-size: var(--fs-2xs); line-height: 1.35; }
.lead-required-documents-panel .requirement-row em { font-size: var(--fs-2xs); }
.lead-required-documents-panel .requirement-upload { min-width: 56px; padding: var(--sp-1) var(--sp-2); border: 1px solid var(--line-light); border-radius: 6px; color: var(--navy); background: var(--cream); font-size: var(--fs-2xs); transition: border-color .18s ease, background .18s ease; }
.lead-required-documents-panel .requirement-upload:hover { border-color: var(--accent); background: rgba(214,154,53,.1); }
.optional-documents { margin: var(--sp-1) 0 var(--sp-3); border: 1px solid var(--line-light); border-radius: 10px; background: var(--paper); }
.optional-documents > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3); color: var(--navy-2); font-size: var(--fs-2xs); font-weight: 750; cursor: pointer; list-style: none; }
.optional-documents > summary::-webkit-details-marker { display: none; }
.optional-documents > summary::after { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: var(--accent-hover); background: rgba(214,154,53,.13); font-size: var(--fs-md); }
.optional-documents[open] > summary::after { content: "−"; }
.optional-documents > summary span { margin-left: auto; color: var(--muted); font-size: var(--fs-2xs); }
.optional-documents > .doc-requirements { padding: 0 var(--sp-2) var(--sp-2); }
.optional-documents .requirement-row { background: var(--cream); }
.lead-required-documents-panel .indexed-documents-list { max-height: 190px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line-light); }
.lead-required-documents-panel .indexed-documents-title { align-items: baseline; font-size: var(--fs-2xs); }
.lead-upload-button { min-height: 36px; margin-top: 10px; font-size: var(--fs-2xs); }
.lead-detail-body > .lead-action-toolbar { display: grid; grid-template-columns: minmax(170px,.7fr) minmax(0,1.8fr); align-items: center; gap: var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px solid rgba(20,41,81,.1); border-radius: 16px; background: linear-gradient(110deg,var(--paper),var(--cream)); }
.lead-toolbar-copy { display: grid; gap: var(--sp-1); }
.lead-toolbar-copy .eyebrow { color: var(--accent-hover); font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.lead-toolbar-copy b { color: var(--navy); font-size: var(--fs-xs); }
.lead-toolbar-copy small { color: var(--muted); font-size: var(--fs-2xs); line-height: 1.4; }
.lead-detail-body .lead-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); }
.lead-toolbar-actions > .btn { min-height: 35px; white-space: nowrap; }
.lead-actions-overflow { position: relative; }
.lead-actions-overflow > summary { display: inline-flex; align-items: center; justify-content: center; min-height: 35px; padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: 6px; color: var(--navy-2); background: var(--paper); font-size: var(--fs-2xs); font-weight: 700; cursor: pointer; list-style: none; white-space: nowrap; }
.lead-actions-overflow > summary::-webkit-details-marker { display: none; }
.lead-actions-overflow[open] > summary { border-color: var(--accent); }
.lead-actions-overflow > div { position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; display: grid; gap: var(--sp-1); min-width: 174px; padding: var(--sp-2); border: 1px solid var(--line-light); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); }
.lead-actions-overflow > div .btn { justify-content: flex-start; width: 100%; min-height: 33px; }
.lead-stage-steps { list-style: none !important; counter-reset: none !important; }
.lead-stage-steps > li::marker { content: ""; font-size: 0; }
.lead-stage-steps small { max-width: 120px; color: var(--muted); font-size: var(--fs-2xs); font-weight: 650; line-height: 1.3; }
.lead-stage-steps li.current small { color: var(--navy); }
.lead-progress-current { min-height: 39px; margin-top: 14px; padding: var(--sp-2) var(--sp-3); }
.lead-progress-current-mark { width: 25px; height: 25px; border-radius: 6px; color: var(--navy); font-weight: 800; }
.lead-progress-current small { font-size: var(--fs-2xs); }
.lead-progress-current b { font-size: var(--fs-2xs); }
.lead-progress-percent { font-size: var(--fs-2xs); font-weight: 750; }
@media (max-width: 920px) {
  .lead-detail-body > .lead-action-toolbar { grid-template-columns: 1fr; }
  .lead-detail-body .lead-toolbar-actions { justify-content: flex-start; }
}
@media (max-width: 680px) {
  .lead-detail-body .lead-toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .lead-toolbar-actions > .btn, .lead-actions-overflow > summary { width: 100%; min-height: 40px; }
  .lead-actions-overflow > div { right: auto; left: 0; }
  .lead-required-documents-panel .requirement-row { grid-template-columns: 20px minmax(0,1fr) auto; gap: var(--sp-1); }
  .lead-required-documents-panel .requirement-row em { grid-column: 2; white-space: normal; }
  .lead-required-documents-panel .requirement-upload { grid-column: 3; grid-row: 1 / span 2; }
  .lead-progress-title small { max-width: 240px; }
  .lead-stage-steps li { flex-basis: 92px; }
  .lead-stage-steps small { font-size: var(--fs-2xs); }
}
@media (prefers-reduced-motion: reduce) {
  .doc-checklist-track i { transition: none; }
}

/* En-tête épuré : recherche centrée, notifications et avatar du compte. */
.topbar.topbar-minimal { position: sticky; display: flex; justify-content: center; gap: 0; padding: 0 var(--sp-7); }
.topbar-search-cell { width: min(540px, calc(100% - 200px)); min-width: 0; margin: 0 auto; }
.topbar-search-cell .search { display: block; width: 100%; max-width: none; margin: 0; }
.topbar-search-cell .search input { min-height: 42px; padding: var(--sp-3) var(--sp-4); border: 1px solid rgba(20,41,81,.1); border-radius: 999px; background: var(--paper); box-shadow: 0 5px 18px rgba(8,23,53,.055); }
.topbar-search-cell .search input:focus { border-color: rgba(214,154,53,.65); box-shadow: 0 0 0 4px rgba(214,154,53,.12),0 7px 20px rgba(8,23,53,.07); }
.topbar-minimal .top-actions { position: absolute; top: 50%; right: 28px; width: auto; display: flex; align-items: center; gap: var(--sp-2); margin: 0; transform: translateY(-50%); }
.topbar-minimal .top-actions .icon-btn { width: 39px; height: 39px; border: 1px solid var(--line-light); border-radius: 50%; background: var(--paper); }
.topbar-minimal .user-chip-avatar { width: 42px; height: 42px; justify-content: center; padding: 2px; border: 1px solid var(--line-light); border-radius: 50%; background: var(--paper); }
.topbar-minimal .user-chip-avatar { appearance: none; display: grid; place-items: center; color: var(--ink); font: inherit; cursor: pointer; }
.topbar-minimal .user-chip-avatar:hover { border-color: var(--accent); background: var(--cream); }
.topbar-minimal .user-chip-avatar .avatar { width: 34px; height: 34px; font-size: var(--fs-2xs); }
.topbar-minimal .top-actions button:focus-visible { outline: 3px solid rgba(214,154,53,.38); outline-offset: 2px; }
@media (max-width: 768px) {
  .topbar.topbar-minimal { height: 62px; padding: 0 var(--sp-2); }
  .topbar-search-cell { width: min(540px, calc(100% - 180px)); }
  .topbar-search-cell .search input { min-height: 39px; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); }
  .topbar-minimal .top-actions { right: 8px; gap: var(--sp-1); }
  .topbar-minimal .top-actions .icon-btn { width: 35px; height: 35px; }
  .topbar-minimal .user-chip-avatar { width: 37px; height: 37px; }
  .topbar-minimal .user-chip-avatar .avatar { width: 30px; height: 30px; font-size: var(--fs-2xs); }
}
@media (max-width: 360px) {
  .topbar-search-cell { width: min(540px, calc(100% - 180px)); }
  .topbar-search-cell .search input { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-2xs); }
  .topbar-minimal .top-actions { gap: var(--sp-1); }
}
.profile-backup-tools { margin-top: 14px; }
.profile-backup-tools > p { margin: 0 0 var(--sp-3); }
.profile-backup-tools > div { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.profile-detail-grid { grid-template-columns: minmax(0,1fr); }

/* Le parcours de souscription permet de choisir directement une étape. */
.lead-stage-button { position: relative; z-index: 2; width: 100%; min-width: 0; display: grid; justify-items: center; gap: var(--sp-1); padding: 0 2px; border: 0; border-radius: 6px; color: inherit; background: transparent; font: inherit; text-align: center; cursor: pointer; }
.lead-stage-button > span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #d8dce4; border-radius: 50%; color: var(--muted); background: var(--cream); font-size: var(--fs-2xs); transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.lead-stage-steps li.complete .lead-stage-button > span { border-color: var(--accent); color: var(--navy); background: var(--grad-accent); }
.lead-stage-steps li.current .lead-stage-button > span { border: 2px solid var(--accent); color: var(--navy); background: var(--cream); box-shadow: 0 0 0 4px rgba(214,154,53,.16); animation: lead-step-pulse 1.8s ease-in-out infinite; }
.lead-stage-button:not([aria-current="step"]):hover > span { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 3px 10px rgba(8,23,53,.12); }
.lead-stage-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.lead-step-navigation { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--sp-2); }
.lead-step-navigation > .subtle { max-width: 320px; font-size: var(--fs-2xs); }
@media (prefers-reduced-motion: reduce) {
  .lead-stage-button > span { transition: none; }
  .lead-stage-steps li.current .lead-stage-button > span { animation: none; }
}

/* Product-specific intake and advice fields */
.product-form-section { grid-column: 1 / -1; padding: var(--sp-4); border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, var(--white), #faf8f3); }
.product-form-section-head { display: grid; gap: var(--sp-1); margin-bottom: 12px; }
.product-form-section-head .eyebrow { color: var(--accent-dark, #9a6a16); }
.product-form-section-head b { color: var(--navy); font-size: var(--fs-md); }
.product-form-section-head small { color: var(--muted); font-size: var(--fs-2xs); }
.product-form-section .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--sp-3); }
.product-form-section .field.full { grid-column: 1 / -1; }
.product-dvc-source-missing { grid-column: 1 / -1; }
.qualification-section > .product-form-section { margin-top: 10px; }
@media (max-width: 640px) {
  .product-form-section { padding: var(--sp-3); }
  .product-form-section .form-grid { grid-template-columns: 1fr; }
  .product-form-section .field.full { grid-column: auto; }
}

/* Direction visuelle des captures : navigation claire, tableaux compacts et accent teal. */
:root {
  --ink: #17383b;
  --paper: #f5f7f7;
  --cream: #ffffff;
  --accent: #0f7074;
  --accent-hover: #0a5d61;
  --accent-text: #0b6266;
  --navy: #124d51;
  --navy-2: #0d666a;
  --muted: #556f72;
  --line: #dce5e4;
  --line-light: #edf1f0;
  --gold: #0f8584;
  --grad-accent: linear-gradient(135deg, #0f777a 0%, #0b6569 100%);
  --grad-navy: linear-gradient(135deg, #0d676b 0%, #104d51 100%);
  --shadow-sm: 0 1px 3px rgba(18, 55, 58, .045);
  --shadow: 0 3px 10px rgba(18, 55, 58, .06);
  --shadow-lg: 0 14px 34px rgba(18, 55, 58, .14);
  --shadow-glow: 0 5px 14px rgba(15, 112, 116, .16);
  --radius-sm: 5px;
  --radius: 8px;
  --radius-lg: 10px;
  --sidebar-w: 164px;
  --topbar-h: 44px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-size: var(--fs-sm);
}

h1, h2, h3, .page-head h1, .panel-head h2, .panel-head h3 {
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.02em;
}

.sidebar {
  padding: var(--sp-3) var(--sp-3) var(--sp-3);
  color: var(--ink);
  background: var(--white);
  border-right: 1px solid var(--line);
  box-shadow: none;
  scrollbar-color: #cbd8d7 transparent;
}
.sidebar::before { display: none; }
.sidebar::-webkit-scrollbar-thumb { background: #d4dfde; }
.brand {
  min-height: 48px;
  gap: var(--sp-2);
  padding: 2px var(--sp-1) var(--sp-3);
  margin: 0 1px var(--sp-1);
  border-bottom: 1px solid var(--line-light);
}
.brand-mark {
  width: 28px;
  height: 28px;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: var(--white);
  box-shadow: none;
}
.brand-name { color: #16494c; font-size: var(--fs-xs); letter-spacing: -.02em; }
.brand-sub { color: #71898a; font-size: var(--fs-2xs); letter-spacing: .9px; }
.nav-label {
  margin: var(--sp-3) 0 var(--sp-1);
  padding: 0 var(--sp-2);
  color: #809394;
  font-size: var(--fs-2xs);
  letter-spacing: .11em;
}
.nav-label::after { display: none; }
.nav { gap: 1px; }
.nav-btn {
  min-height: 27px;
  padding: var(--sp-1) var(--sp-1);
  gap: var(--sp-1);
  border-radius: 6px;
  color: #52696b;
  font-size: var(--fs-2xs);
}
.nav-btn:hover {
  transform: none;
  color: #155b5f;
  background: #f1f7f6;
}
.nav-btn:hover .nav-icon { color: #0f7074; }
.nav-btn.active, .nav-btn[aria-current="page"] {
  color: #0d6468;
  background: #eaf4f3;
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}
.nav-btn.active::before { display: none; }
.nav-btn.active .nav-icon { color: var(--accent-text); }
.nav-icon { width: 15px; height: 15px; }
.nav-icon svg { width: 13px; height: 13px; stroke-width: 1.8; }
.nav-badge {
  color: var(--white);
  background: var(--accent);
  box-shadow: none;
}
.sidebar-foot { padding-top: 9px; }
.sidebar-foot::before { background: var(--line); }
.agent-mini {
  padding: var(--sp-2);
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: #f8fafa;
}
.agent-mini .avatar { box-shadow: 0 0 0 2px var(--white); }
.agent-mini .avatar::after { border-color: #f8fafa; }
.agent-info b { color: var(--ink); font-size: var(--fs-2xs); }
.agent-info small { color: var(--muted); font-size: var(--fs-2xs); }
.logout-btn {
  min-height: 30px;
  border-color: var(--line);
  color: #5f7476;
  border-radius: 6px;
}
.logout-btn:hover {
  color: #9b3e35;
  background: #fff5f3;
  border-color: #efd5d1;
}

.main { background: var(--paper); }
.topbar {
  height: var(--topbar-h);
  padding: 0 var(--sp-5);
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.topbar.topbar-minimal {
  justify-content: flex-start;
  padding: 0 var(--sp-4);
}
.topbar-search-cell {
  width: min(370px, calc(100% - 145px));
  margin: 0;
}
.topbar-minimal .top-actions { right: 14px; gap: var(--sp-1); }
.topbar-minimal .top-actions .icon-btn,
.topbar-minimal .user-chip-avatar {
  width: auto;
  min-width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.topbar-minimal .user-chip-avatar { display: flex; gap: var(--sp-1); padding: 2px var(--sp-1) 2px 2px; }
.topbar-minimal .user-chip-avatar .avatar { width: 22px; height: 22px; font-size: var(--fs-2xs); }
.topbar-minimal .user-chip-text { display: grid; gap: 1px; text-align: left; }
.topbar-minimal .user-chip-text b { max-width: 112px; overflow: hidden; color: var(--ink); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.topbar-minimal .user-chip-text small { color: var(--muted); font-size: var(--fs-2xs); }
.topbar-search-cell .search input {
  min-height: 28px;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafcfc;
  box-shadow: none;
  font-size: var(--fs-2xs);
}
.topbar-search-cell .search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,112,116,.1);
}
.topbar-minimal .top-actions button:focus-visible { outline-color: rgba(15,112,116,.35); }
.content {
  width: 100%;
  max-width: 1000px;
  padding: var(--sp-4) var(--sp-4) var(--sp-7);
}
.eyebrow { color: var(--accent-text); letter-spacing: .1em; }
.page-head { margin-bottom: 10px; gap: var(--sp-2); }
.page-head h1 { font-size: clamp(1.125rem, 1.7vw, 1.375rem); font-weight: 700; }
.page-head p { font-size: var(--fs-2xs); }
.page-head.dashboard-hero {
  min-height: 0;
  align-items: flex-end;
  padding: 0;
  margin-bottom: 9px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.page-head.dashboard-hero::after { display: none; }
.page-head.dashboard-hero .eyebrow { color: var(--accent-text); }
.page-head.dashboard-hero h1 { color: var(--ink); font-size: clamp(1.125rem, 1.7vw, 1.375rem); }
.page-head.dashboard-hero p { color: var(--muted); }

.btn {
  min-height: 31px;
  padding: var(--sp-1) var(--sp-3);
  border-color: var(--line);
  border-radius: 6px;
  font-size: var(--fs-2xs);
  box-shadow: none;
}
.btn:hover { transform: none; box-shadow: var(--shadow-sm); border-color: #b8ccca; }
.btn.primary, .btn-primary, .login-submit-btn, .login-welcome-cta {
  color: var(--white);
  background: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}
.btn.primary:hover, .btn-primary:hover, .login-submit-btn:hover, .login-welcome-cta:hover {
  color: var(--white);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: none;
}
.btn.dark { background: var(--navy); border-color: var(--navy); }
.btn.sm { min-height: 26px; padding: var(--sp-1) var(--sp-2); font-size: var(--fs-2xs); }

.kpi-grid { gap: var(--sp-2); margin-bottom: 9px; }
.kpi {
  min-height: 78px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: none;
}
.kpi:hover, .metric-card:hover, .deal-card:hover, .devis-card:hover { transform: none; box-shadow: var(--shadow); }
.kpi-top { font-size: var(--fs-2xs); letter-spacing: .07em; }
.kpi-value { margin: var(--sp-2) 0 var(--sp-1); color: var(--navy); font: 700 var(--fs-2xl)/1.05 "Avenir Next", "Segoe UI", sans-serif; }
.kpi-icon { width: 23px; height: 23px; border-radius: 6px; color: var(--accent-text); background: #eaf4f3; }
.panel, .metric-card, .info-card, .devis-card, .deal-card, .kanban-col,
.inbox, .calendar, .leaderboard, .dvc-preview-card, .table-wrap {
  border-color: var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: none;
}
.panel { padding: var(--sp-3); }
.panel-head { padding: var(--sp-2) var(--sp-3); border-bottom-color: var(--line-light); }
.panel-head h2, .panel-head h3 { color: var(--ink); font-size: var(--fs-2xs); font-weight: 700; }
.table-wrap { box-shadow: none; }
th {
  padding: var(--sp-1) var(--sp-2);
  color: #738789;
  background: #f7f9f9;
  border-bottom-color: var(--line);
  font-size: var(--fs-2xs);
  letter-spacing: .07em;
}
td { padding: var(--sp-1) var(--sp-2); border-top-color: var(--line-light); font-size: var(--fs-2xs); }
tbody tr:hover { background: #f5f9f8; }
.tag, .badge, .score-pill, .scope-pill, .product-pill { font-size: var(--fs-2xs); }
.product-pill { border-radius: 4px; }
.filters { gap: var(--sp-1); margin-bottom: 11px; }
.filters input, .filters select {
  min-height: 31px;
  padding: var(--sp-1) var(--sp-2);
  border-radius: 6px;
  font-size: var(--fs-2xs);
}
.lead-register-summary, .agenda-summary-grid, .document-summary-grid { gap: var(--sp-2); margin-bottom: 10px; }
.lead-register-summary > div, .agenda-summary-grid > div, .document-summary-card {
  padding: var(--sp-2) var(--sp-2);
  border-color: var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: none;
}
.lead-register-summary b, .agenda-summary-grid b, .document-summary-card b { color: var(--navy); font-size: var(--fs-lg); }
.lead-register-summary span, .agenda-summary-grid span, .document-summary-card span { font-size: var(--fs-2xs); }
.lead-register-summary > div:first-child { border-top: 2px solid var(--accent); }
.lead-filters { padding: var(--sp-2); border-radius: 6px; background: var(--white); }
.leads-table-panel { padding: var(--sp-2); }
.leads-table-panel .table-wrap { border-radius: 6px; }
.leads-table-panel th { background: #f7f9f9; }
.leads-table-panel td { padding-top: 8px; padding-bottom: 8px; }
.pagination { font-size: var(--fs-2xs); }
.pagination button { padding: var(--sp-1) var(--sp-2); border-radius: 6px; }

.kanban { grid-template-columns: repeat(7, minmax(176px, 1fr)); gap: var(--sp-1); }
.kanban-col { min-height: 390px; background: #f4f7f7; }
.kanban-head { padding: var(--sp-2) var(--sp-3); border-bottom-color: var(--line); }
.kanban-head b { color: #536c6e; font-size: var(--fs-2xs); }
.count { min-width: 19px; height: 19px; color: var(--accent-text); background: #e5f0ef; font-size: var(--fs-2xs); }
.kanban-body { gap: var(--sp-2); padding: var(--sp-2); }
.deal-card { padding: var(--sp-2); border-radius: 6px; cursor: grab; }
.deal-card:hover { border-color: #b7cfcd; }
.progress, .score-bar, .points-bar { border-radius: 99px; }
.score-fill, .points-fill { background: var(--accent); }
.field input, .field select, .field textarea, .login-input-wrap input { border-radius: 6px; }
.field input:focus, .field select:focus, .field textarea:focus, .login-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,112,116,.11);
}
.lead-progress-track i, .qualification-completion-track i, .doc-checklist-track i { background: var(--accent); }
.lead-progress-count, .documents-count-pill { color: var(--navy); background: #eaf4f3; border-color: #cfe2e0; }
.lead-stage-steps li.complete .lead-stage-button > span { color: var(--white); background: var(--accent); border-color: var(--accent); }
.lead-stage-steps li.current .lead-stage-button > span { color: var(--accent-text); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,112,116,.12); }
.lead-stage-steps li.current .lead-stage-button > span,
.lead-stage-steps li.current > span { animation: none; }
.lead-required-documents-panel .requirement-upload:hover { border-color: var(--accent); background: #eaf4f3; }
.lead-file-tab.is-active { border-color: #cfe2e0; color: var(--accent-text); background: #eaf4f3; box-shadow: none; }
.contact-direct-panel::before { background: var(--accent); }
.activity-icon, .contact-direct-mark, .contact-channel-icon, .upload-drop-icon {
  color: var(--accent-text);
  background: #eaf4f3;
}
.document-summary-card::before { background: var(--accent); }
.lead-contact-sticky { background: rgba(255,255,255,.97); }
.sidebar-toggle { border-color: var(--line); color: var(--ink); background: var(--white); box-shadow: var(--shadow-sm); }

body.dark-mode {
  --ink: #e5eeee;
  --paper: #111c1d;
  --cream: #192728;
  --muted: #9aafaf;
  --line: #2a3b3c;
  --line-light: #243334;
  --navy: #b4d8d6;
  --navy-2: #86c2bf;
  --accent: #4bb4b0;
  --accent-hover: #65c5c0;
  --gold: #4bb4b0;
  --grad-accent: linear-gradient(135deg, #318f8c 0%, #4bb4b0 100%);
  --grad-navy: linear-gradient(135deg, #173d3e 0%, #102d2f 100%);
  background: var(--paper);
}
body.dark-mode .sidebar { color: var(--ink); background: #172526; border-right-color: var(--line); }
body.dark-mode .brand-name, body.dark-mode .agent-info b { color: var(--ink); }
body.dark-mode .brand-sub, body.dark-mode .nav-label, body.dark-mode .agent-info small,
body.dark-mode .nav-btn { color: var(--muted); }
body.dark-mode .nav-btn.active { color: var(--ink); background: rgba(75,180,176,.14); }
body.dark-mode .agent-mini, body.dark-mode .topbar, body.dark-mode .panel,
body.dark-mode .kpi, body.dark-mode .table-wrap, body.dark-mode .lead-register-summary > div,
body.dark-mode .document-summary-card { background: var(--cream); border-color: var(--line); }
body.dark-mode .page-head.dashboard-hero { color: var(--ink); background: transparent; }
body.dark-mode .page-head.dashboard-hero h1 { color: var(--ink); }
body.dark-mode .page-head.dashboard-hero p { color: var(--muted); }
body.dark-mode .topbar-search-cell .search input, body.dark-mode th { color: var(--ink); background: #152323; }
body.dark-mode .kanban-col { background: #162323; }
body.dark-mode .deal-card { background: var(--cream); }

@media (max-width: 768px) {
  .sidebar { width: min(280px, 84vw); }
  .topbar.topbar-minimal { justify-content: flex-start; padding: 0 var(--sp-2) 0 68px; }
  .topbar-search-cell { width: min(370px, calc(100% - 100px)); }
  .topbar-minimal .top-actions { right: 8px; }
  .content { padding: var(--sp-4) var(--sp-3) var(--sp-7); }
  .page-head.dashboard-hero { min-height: 0; padding: 0; }
}

/* Compositions des trois vues de référence : tableau de bord, prospects et pipeline. */
.dashboard-view { display: grid; gap: var(--sp-2); }
.dashboard-view > .page-head { margin-bottom: 1px; }
.dashboard-period { display: inline-flex; align-items: center; min-height: 26px; padding: 0 var(--sp-2); border: 1px solid var(--line); border-radius: 6px; color: #617778; background: var(--white); font-size: var(--fs-2xs); font-weight: 700; text-transform: capitalize; }
.dashboard-overview-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--sp-2); }
.dashboard-primary-card, .dashboard-compact-card, .dashboard-metric-card,
.dashboard-chart-card, .dashboard-work-card, .dashboard-team-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}
.dashboard-primary-card {
  min-height: 154px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--sp-3) var(--sp-4);
  color: var(--white);
  background: #0d6569;
  border-color: #0d6569;
}
.dashboard-primary-label { color: #c9e5e4; font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.dashboard-primary-value { margin: var(--sp-1) 0 1px; font-size: var(--fs-3xl); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.dashboard-primary-sub { overflow: hidden; color: #d1e7e6; font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.dashboard-primary-track { height: 4px; margin: var(--sp-3) 0 var(--sp-2); overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.24); }
.dashboard-primary-track i { display: block; height: 100%; border-radius: inherit; background: #e59a42; }
.dashboard-primary-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-1) var(--sp-3); color: #e2f0ef; font-size: var(--fs-2xs); }
.dashboard-primary-footer b { color: var(--white); }
.dashboard-compact-card { min-height: 154px; padding: var(--sp-3); }
.dashboard-card-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-1); color: #687e80; font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.dashboard-card-icon { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; color: var(--accent-text); background: #eaf4f3; font-size: var(--fs-2xs); }
.dashboard-card-icon.is-alert { color: #b34b3c; background: #fff0ed; }
.dashboard-blocked-card > strong { display: block; margin: var(--sp-2) 0 2px; color: var(--ink); font-size: var(--fs-3xl); line-height: 1; }
.dashboard-blocked-card p { min-height: 28px; margin: 0 0 var(--sp-1); color: var(--muted); font-size: var(--fs-2xs); line-height: 1.35; }
.dashboard-view .link { color: var(--accent-text); font-size: var(--fs-2xs); }
.dashboard-reminders-card { display: flex; flex-direction: column; }
.dashboard-reminder-row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; padding: var(--sp-1) 0; border-bottom: 1px solid var(--line-light); }
.dashboard-reminder-row:last-of-type { border-bottom: 0; }
.dashboard-reminder-time { display: grid; justify-items: center; min-width: 33px; color: #177579; font-size: var(--fs-2xs); font-weight: 800; line-height: 1.15; }
.dashboard-reminder-time small { color: var(--muted); font-size: var(--fs-2xs); font-weight: 500; }
.dashboard-reminder-copy { display: grid; min-width: 0; gap: 1px; }
.dashboard-reminder-copy b, .dashboard-reminder-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-reminder-copy b { color: #304d4f; font-size: var(--fs-2xs); }
.dashboard-reminder-copy small { color: var(--muted); font-size: var(--fs-2xs); }
.dashboard-overdue-note { margin-top: auto; padding-top: 4px; color: #b34b3c; font-size: var(--fs-2xs); font-weight: 700; }
.dashboard-empty-line, .dashboard-chart-empty { padding: var(--sp-4) var(--sp-1); color: var(--muted); font-size: var(--fs-2xs); text-align: center; }

.dashboard-metric-grid { display: grid; grid-template-columns: 1.15fr .9fr 1.45fr; gap: var(--sp-2); }
.dashboard-metric-card { min-height: 66px; display: grid; align-content: center; gap: 2px; padding: var(--sp-2) var(--sp-3); }
.dashboard-metric-card > span { color: #74898a; font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.dashboard-metric-card > strong { color: var(--ink); font-size: var(--fs-2xl); line-height: 1.1; }
.dashboard-metric-card > small { color: var(--muted); font-size: var(--fs-2xs); }
.dashboard-metric-progress { height: 3px; margin: 2px 0; overflow: hidden; border-radius: 99px; background: #e8efee; }
.dashboard-metric-progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.dashboard-chart-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: var(--sp-2); }
.dashboard-chart-card { min-height: 190px; padding: var(--sp-3); }
.dashboard-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); padding-bottom: 7px; border-bottom: 1px solid var(--line-light); }
.dashboard-section-heading > div { display: grid; gap: 2px; min-width: 0; }
.dashboard-section-heading b { color: var(--ink); font-size: var(--fs-2xs); }
.dashboard-section-heading small { color: var(--muted); font-size: var(--fs-2xs); }
.dashboard-section-heading .link { flex-shrink: 0; }
.dashboard-bars, .dashboard-product-bars { display: grid; gap: var(--sp-3); padding: var(--sp-3) 0 1px; }
.dashboard-bar-row { display: grid; grid-template-columns: 72px minmax(0,1fr) 14px; align-items: center; gap: var(--sp-1); color: #627879; font-size: var(--fs-2xs); }
.dashboard-bar-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-bar-row > b, .dashboard-product-row > b { color: var(--ink); font-size: var(--fs-2xs); text-align: right; }
.dashboard-bar-track { height: 5px; overflow: hidden; border-radius: 99px; background: #edf2f1; }
.dashboard-bar-track i { display: block; height: 100%; border-radius: inherit; background: #176c70; }
.dashboard-product-row { display: grid; grid-template-columns: 7px minmax(58px, .9fr) minmax(30px,1fr) 14px; align-items: center; gap: var(--sp-1); color: #617778; font-size: var(--fs-2xs); }
.dashboard-product-row > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-product-color { width: 6px; height: 6px; border-radius: 50%; }
.dashboard-donut-layout { display: grid; grid-template-columns: 82px minmax(0,1fr); align-items: center; gap: var(--sp-2); padding-top: 10px; }
.dashboard-donut { display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%; }
.dashboard-donut > div { display: grid; place-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--white); text-align: center; }
.dashboard-donut b { color: var(--ink); font-size: var(--fs-2xs); }
.dashboard-donut small { color: var(--muted); font-size: var(--fs-2xs); }
.dashboard-legend { display: grid; gap: var(--sp-1); min-width: 0; }
.dashboard-legend-row { display: flex; justify-content: space-between; gap: var(--sp-1); color: #5d7475; font-size: var(--fs-2xs); }
.dashboard-legend-row > span { display: flex; align-items: center; gap: var(--sp-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-legend-row i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; }
.dashboard-legend-row b { flex: 0 0 auto; color: var(--ink); font-size: var(--fs-2xs); }

.dashboard-work-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: var(--sp-2); }
.dashboard-work-card { min-height: 180px; padding: var(--sp-3); }
.dashboard-action-list { display: grid; }
.dashboard-action-row { display: grid; grid-template-columns: 19px minmax(0,1fr) auto; align-items: center; gap: var(--sp-1); min-height: 31px; padding: var(--sp-1) 0; border-bottom: 1px solid var(--line-light); }
.dashboard-action-row:last-child { border-bottom: 0; }
.dashboard-action-mark { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; color: var(--accent-text); background: #eaf4f3; font-size: var(--fs-2xs); }
.dashboard-action-mark.is-alert { color: #b34b3c; background: #fff0ed; }
.dashboard-action-copy { display: grid; min-width: 0; gap: 1px; }
.dashboard-action-copy b, .dashboard-action-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-action-copy b { color: #304d4f; font-size: var(--fs-2xs); }
.dashboard-action-copy small { color: var(--muted); font-size: var(--fs-2xs); }
.dashboard-work-card .activity-list { padding: 2px 0; }
.dashboard-work-card .activity-item { grid-template-columns: 18px minmax(0,1fr) auto; gap: var(--sp-1); padding: var(--sp-1) 0; }
.dashboard-work-card .activity-icon { width: 16px; height: 16px; border-radius: 4px; font-size: var(--fs-2xs); }
.dashboard-work-card .activity-item p { font-size: var(--fs-2xs); line-height: 1.25; }
.dashboard-work-card .activity-item small, .dashboard-work-card .activity-item time { font-size: var(--fs-2xs); }
.dashboard-work-card .activity-empty { padding: var(--sp-4) var(--sp-1); font-size: var(--fs-2xs); }
.dashboard-team-card { overflow: hidden; padding: var(--sp-3); }
.dashboard-team-card .table-wrap { margin-top: 6px; border: 0; }
.dashboard-team-table { min-width: 620px; }
.dashboard-team-table th { padding: var(--sp-1) var(--sp-2); }
.dashboard-team-table td { padding: var(--sp-2); }
.dashboard-team-progress { display: flex; align-items: center; gap: var(--sp-1); min-width: 72px; }
.dashboard-team-progress > i { width: 48px; height: 4px; overflow: hidden; border-radius: 99px; background: #e8efee; }
.dashboard-team-progress > i span { display: block; height: 100%; border-radius: inherit; background: #23865a; }
.dashboard-team-progress > b { color: #426466; font-size: var(--fs-2xs); }
.dashboard-team-table .is-late { color: #b34b3c; font-weight: 800; }
.dashboard-portfolio-card .table-wrap { margin-top: 5px; border: 0; }

.lead-team-hint { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-2xs); }
.lead-table-docs { color: var(--accent-text); font-size: var(--fs-2xs); font-weight: 800; }
.leads-detail-table { min-width: 920px; }
.leads-detail-table th { white-space: nowrap; }
.leads-detail-table td { max-width: 180px; }
.leads-detail-table td small { display: block; max-width: 160px; overflow: hidden; color: var(--muted); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.leads-detail-table .person { gap: var(--sp-2); }
.leads-detail-table .person .avatar { width: 24px; height: 24px; font-size: var(--fs-2xs); }
.leads-detail-table .person b { display: block; font-size: var(--fs-2xs); }
.leads-detail-table .person span { display: block; max-width: 155px; overflow: hidden; color: var(--muted); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.lead-register-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.lead-filters { gap: var(--sp-1); }
.lead-filters input { min-width: 150px; flex: 1.6; }
.lead-filters select { min-width: 92px; flex: 1; padding-right: 20px; }
.lead-filters > .btn { min-height: 29px; padding: var(--sp-1) var(--sp-2); white-space: nowrap; }
.pipeline-summary { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: var(--sp-1); margin: 0 0 var(--sp-2); }
.pipeline-summary > div { display: grid; gap: 2px; min-width: 0; padding: var(--sp-2) var(--sp-2); border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.pipeline-summary strong { color: var(--ink); font-size: var(--fs-lg); line-height: 1.05; }
.pipeline-summary span { overflow: hidden; color: var(--muted); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.pipeline-summary .is-alert strong { color: #b34b3c; }
.pipeline-summary .is-success strong { color: #23865a; }
.pipeline-view .filters { margin-bottom: 8px; }

/* L’écran d’accès reprend la même palette claire du CRM. */
.login-welcome { background: var(--paper); }
.login-welcome-brand { background: var(--white); }
.login-welcome-brand img { width: min(340px, 78%); }
.login-welcome-panel { color: var(--ink); background: var(--paper); }
.login-welcome-panel::after { display: none; }
.login-welcome-copy .eyebrow { color: var(--accent-text); }
.login-welcome-copy h1 { color: var(--ink); font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.14; }
.login-welcome-features { color: var(--muted); font-size: var(--fs-md); line-height: 1.45; }
.login-welcome-features li > span { color: var(--accent-text); }
.login-welcome-cta { color: var(--white); background: var(--accent); box-shadow: none; }
.login-welcome-cta:hover { transform: none; color: var(--white); background: var(--accent-hover); box-shadow: none; }
.login-auth-box { border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.login-auth-box .login-left { background: var(--white); }
.login-auth-box.directory-open .login-right { background: #f8fafa; }

@media (max-width: 900px) {
  .content { max-width: 100%; }
  .dashboard-overview-grid { grid-template-columns: minmax(0,1.5fr) minmax(150px,1fr); }
  .dashboard-primary-card { grid-row: span 2; }
  .dashboard-reminders-card { grid-column: 2; }
  .dashboard-chart-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-chart-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .dashboard-overview-grid, .dashboard-metric-grid, .dashboard-chart-grid, .dashboard-work-grid { grid-template-columns: 1fr; }
  .dashboard-primary-card { grid-row: auto; min-height: 136px; }
  .dashboard-reminders-card, .dashboard-chart-card:last-child { grid-column: auto; }
  .dashboard-chart-card { min-height: 160px; }
  .dashboard-metric-grid { gap: var(--sp-1); }
  .lead-register-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lead-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lead-filters input { min-width: 0; grid-column: 1 / -1; }
  .lead-filters select { min-width: 0; width: 100%; }
  .lead-filters > .btn { grid-column: 1 / -1; }
  .pipeline-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pipeline-summary > div:last-child { grid-column: 1 / -1; }
}

/* Navigation principale en tiroir accessible depuis le bouton burger. */
.crm-authenticated .sidebar-toggle { display: grid; top: 12px; left: 16px; width: 38px; height: 38px; border-radius: 10px; color: var(--accent-text); background: var(--white); box-shadow: 0 5px 18px rgba(19,51,53,.12); font-size: var(--fs-2xl); }
.crm-authenticated .sidebar-toggle:hover { color: var(--white); background: var(--accent); }
.crm-sidebar-open .sidebar-toggle { left: calc(var(--sidebar-w) - 54px); }
.shell.sidebar-closed { grid-template-columns: 0 minmax(0,1fr); }
.shell.sidebar-closed .sidebar { transform: translateX(-100%); }
.shell:not(.sidebar-closed) { grid-template-columns: var(--sidebar-w) minmax(0,1fr); }
.shell:not(.sidebar-closed) .sidebar { transform: translateX(0); }
.shell.sidebar-closed .main, .shell:not(.sidebar-closed) .main { grid-column: 2; }

/* Même langage visuel pour les filtres Contrats et Services. */
.section-tabs { display: flex; align-items: center; gap: var(--sp-1); width: fit-content; max-width: 100%; margin: 0 0 var(--sp-4); padding: var(--sp-1); overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 3px 12px rgba(18,55,58,.045); scrollbar-width: thin; }
.section-tab { min-height: 36px; flex: 0 0 auto; padding: var(--sp-2) var(--sp-3); border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
.section-tab:hover { border-color: var(--line); color: var(--ink); background: var(--paper); }
.section-tab:active { transform: scale(.98); }
.section-tab.active { border-color: var(--accent); color: var(--white); background: var(--accent); box-shadow: 0 4px 10px rgba(15,112,116,.18); }
.section-tab:focus-visible, .lead-row-clickable:focus-visible { outline: 3px solid rgba(15,112,116,.28); outline-offset: 2px; }
.lead-row-clickable:hover td { background: #f1f8f7; }
.lead-row-open { display: inline; padding: 0; border: 0; color: var(--ink); background: transparent; font: inherit; font-weight: 700; text-align: left; }
.lead-row-open:hover { text-decoration: underline; }
.lead-row-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Centre d’appels : priorités, recherche rapide et journal sans audio. */
.communication-overview { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-4); }
.communication-stat { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; min-height: 86px; padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: 13px; background: var(--white); box-shadow: 0 4px 14px rgba(18,55,58,.045); }
.communication-stat-primary { border-color: rgba(15,112,116,.3); background: linear-gradient(135deg,#eaf5f3,var(--white) 75%); }
.communication-stat-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 10px; color: var(--accent-text); background: #e8f3f1; font-size: var(--fs-xl); font-weight: 800; }
.communication-stat > div { display: grid; min-width: 0; gap: 2px; }
.communication-stat small { overflow: hidden; color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.communication-stat b { color: var(--ink); font-size: var(--fs-2xl); line-height: 1.1; }
.communication-stat > div > span { overflow: hidden; color: var(--muted); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.communications-contact-bar { background: linear-gradient(115deg,#0e6468,#164d50); }
.communications-contact-copy > small { color: #9dd0c9; font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .1em; }
.communications-contact-bar .btn:disabled { cursor: not-allowed; opacity: .5; }
.call-console { border-radius: 16px; box-shadow: 0 8px 24px rgba(18,55,58,.07); }
.call-prospect-list { display: flex; flex-direction: column; max-height: 510px; overflow: auto; background: var(--white); }
.call-list-heading { padding: var(--sp-4) var(--sp-3) var(--sp-2); }
.call-list-heading > small { display: block; margin-top: 5px; color: var(--muted); font-size: var(--fs-2xs); line-height: 1.45; }
.communication-search { display: flex; align-items: center; gap: var(--sp-2); margin: var(--sp-1) var(--sp-3) var(--sp-2); padding: 0 var(--sp-3); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--paper); }
.communication-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,112,116,.1); }
.communication-search > span { font-size: var(--fs-xl); }
.communication-search input { width: 100%; min-width: 0; min-height: 36px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: var(--fs-2xs); }
.call-prospect-list .inbox-item { grid-template-columns: 36px minmax(0,1fr) 8px; padding: var(--sp-3) var(--sp-3); }
.call-prospect-list .inbox-person p { color: var(--accent-text); font-weight: 650; }
.inbox-status-dot.is-overdue { background: #d54b43; box-shadow: 0 0 0 3px rgba(213,75,67,.12); }
.communication-list-empty { padding: var(--sp-5) var(--sp-3); color: var(--muted); font-size: var(--fs-2xs); text-align: center; }
.communication-composer { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: var(--sp-3); padding: var(--sp-3); border-top: 1px solid var(--line); background: var(--white); }
.communication-composer-fields { display: grid; grid-template-columns: 150px minmax(0,1fr); align-items: center; gap: var(--sp-1) var(--sp-3); }
.communication-composer-fields label { color: var(--muted); font-size: var(--fs-2xs); font-weight: 750; }
.communication-composer-fields select, .communication-composer-fields textarea { width: 100%; min-width: 0; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); font-size: var(--fs-2xs); }
.communication-composer-fields textarea { min-height: 48px; resize: vertical; line-height: 1.45; }
.communication-attachment-control { grid-column:1 / -1; display:flex; align-items:center; gap:10px; min-width:0; }
.communication-attachment-control .subtle { overflow-wrap:anywhere; }
.communication-attachments { display:grid; gap:6px; margin:8px 0 0; font-size:var(--fs-2xs); }
.communication-attachments > b { color:var(--muted); }
.communication-attachments a { display:flex; align-items:center; gap:6px; width:max-content; max-width:100%; color:var(--accent-text); text-decoration:underline; overflow-wrap:anywhere; }
.communication-attachments a svg { width:14px; height:14px; flex:none; }
.custom-integration-row { display:flex; align-items:center; gap:12px; padding:14px 20px; border-bottom:1px solid var(--line-light); }
.custom-integration-copy { flex:1; min-width:0; display:grid; gap:3px; }
.custom-integration-copy > b, .custom-integration-copy > span, .custom-integration-copy > small { overflow-wrap:anywhere; }
.custom-integration-copy > span, .custom-integration-copy > small { color:var(--muted); font-size:var(--fs-2xs); }
.communication-composer > .btn { min-height: 38px; white-space: nowrap; }
.call-entry { border-radius: 10px; }
.call-duration-pill { padding: var(--sp-1) var(--sp-2); border-radius: 99px; color: var(--accent-text); background: #e8f3f1; font-size: var(--fs-2xs); font-weight: 800; }
.call-entry > p { margin-top: 8px; }
.call-flow-panel { overflow: hidden; border-radius: 16px; }
.call-flow-panel .panel-head h2 { margin: 2px 0 var(--sp-1); }
.call-flow-panel .eyebrow { margin-bottom: 2px; color: var(--accent-text); font-size: var(--fs-2xs); font-weight: 800; letter-spacing: .1em; }
.ringover-note-area { display: grid; gap: var(--sp-2); }
.ringover-note-area label { color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; }
.ringover-note-area select { width: 100%; min-height: 36px; padding: var(--sp-2) var(--sp-2); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--white); }

body.dark-mode .communication-stat, body.dark-mode .section-tabs, body.dark-mode .communication-composer { border-color: var(--line); background: var(--cream); }
body.dark-mode .communication-stat-primary { background: linear-gradient(135deg,#173b3c,#192728); }
body.dark-mode .call-prospect-list { background: var(--cream); }
body.dark-mode .communication-search, body.dark-mode .communication-composer-fields select, body.dark-mode .communication-composer-fields textarea { border-color: var(--line); color: var(--ink); background: #152323; }

/* Barre de recherche globale centrée dans l’en-tête. */
.topbar.topbar-minimal { justify-content: center; }
.topbar-minimal .topbar-search-cell { margin: 0 auto; }

@media (max-width: 768px) {
  .shell:not(.sidebar-closed) { grid-template-columns: 1fr; }
  .crm-authenticated .sidebar-toggle { top: 12px; left: 14px; }
  .crm-sidebar-open .sidebar-toggle { left: min(calc(84vw - 52px),228px); }
}
@media (max-width: 820px) {
  .communication-overview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .call-prospect-list { max-height: 240px; }
}
@media (max-width: 560px) {
  .section-tabs { width: 100%; gap: var(--sp-1); border-radius: 10px; }
  .section-tab { min-height: 34px; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-2xs); }
  .communication-overview { gap: var(--sp-2); }
  .communication-stat { min-height: 74px; gap: var(--sp-2); padding: var(--sp-3); }
  .communication-stat-icon { width: 31px; height: 31px; border-radius: 10px; font-size: var(--fs-lg); }
  .communication-stat b { font-size: var(--fs-xl); }
  .communication-stat small { font-size: var(--fs-2xs); }
  .communication-stat > div > span { font-size: var(--fs-2xs); }
  .communication-composer { grid-template-columns: 1fr; }
  .communication-composer-fields { grid-template-columns: 1fr; gap: var(--sp-1); }
  .communication-composer-fields select { margin-bottom: 3px; }
  .communication-composer > .btn { width: 100%; }
  .communication-attachment-control { flex-wrap:wrap; }
  .custom-integration-row { align-items:flex-start; flex-wrap:wrap; padding-inline:12px; }
  .communications-contact-bar .actions { width: 100%; margin-left: 48px; }
}

/* Ajustement fidèle à l’interface de référence ouverte dans Rocket. */
:root { --sidebar-w: 240px; --topbar-h: 62px; }
body { font-size: var(--fs-md); line-height: 1.45; }
.sidebar { padding: var(--sp-3) var(--sp-4) var(--sp-3); }
.brand { min-height: 54px; gap: var(--sp-3); padding: var(--sp-1) var(--sp-1) var(--sp-3); margin: 0 0 var(--sp-2); }
.brand-mark { width: 38px; height: 38px; }
.brand-name { font-size: var(--fs-lg); }
.brand-sub { font-size: var(--fs-2xs); letter-spacing: .15px; }
.nav-label { margin: var(--sp-3) 0 var(--sp-1); padding: 0 var(--sp-2); font-size: var(--fs-2xs); letter-spacing: .1em; }
.nav { gap: 2px; }
.nav-btn { min-height: 36px; padding: var(--sp-2) var(--sp-2); gap: var(--sp-2); border-radius: 6px; font-size: var(--fs-sm); }
.nav-icon { width: 17px; height: 17px; }
.nav-icon svg { width: 16px; height: 16px; }
.nav-badge { min-width: 19px; height: 19px; font-size: var(--fs-2xs); }
.sidebar-foot { padding-top: 10px; }
.agent-mini { padding: var(--sp-2); }
.agent-info b { font-size: var(--fs-xs); }
.agent-info small { font-size: var(--fs-2xs); }
.main { min-width: 0; }
.topbar { padding: 0 25px; }
.topbar.topbar-minimal { padding: 0 var(--sp-6); }
.topbar-search-cell { width: min(450px, calc(100% - 320px)); }
.topbar-search-cell .search input { min-height: 40px; padding: var(--sp-2) var(--sp-4); border-radius: 10px; font-size: var(--fs-sm); }
.topbar-minimal .top-actions { right: 24px; gap: var(--sp-3); }
.topbar-minimal .top-actions .icon-btn, .topbar-minimal .user-chip-avatar { min-width: 36px; height: 36px; border-radius: 6px; }
.topbar-minimal .user-chip-avatar .avatar { width: 30px; height: 30px; font-size: var(--fs-2xs); }
.topbar-minimal .user-chip-text b { max-width: 150px; font-size: var(--fs-xs); }
.topbar-minimal .user-chip-text small { font-size: var(--fs-2xs); }
.content { max-width: 1500px; padding: 25px var(--sp-8) 42px; }
.eyebrow { font-size: var(--fs-2xs); }
.page-head { align-items: center; gap: var(--sp-4); margin-bottom: 17px; }
.page-head h1 { font-size: clamp(1.4375rem, 2vw, 1.75rem); line-height: 1.15; }
.page-head p { max-width: 700px; margin-top: 6px; font-size: var(--fs-sm); line-height: 1.45; }
.page-head .actions { gap: var(--sp-2); }
.btn { min-height: 36px; padding: var(--sp-2) var(--sp-3); border-radius: 6px; font-size: var(--fs-xs); }
.btn.sm { min-height: 30px; padding: var(--sp-1) var(--sp-2); font-size: var(--fs-2xs); }
.filters input, .filters select { min-height: 38px; padding: var(--sp-2) var(--sp-3); border-radius: 6px; font-size: var(--fs-xs); }
th { padding: var(--sp-3) var(--sp-3); font-size: var(--fs-2xs); letter-spacing: .045em; }
td { padding: var(--sp-3); font-size: var(--fs-xs); }
.table-wrap { border-radius: 10px; }

.dashboard-view { gap: var(--sp-3); }
.dashboard-view > .page-head { margin-bottom: 0; }
.page-head.dashboard-hero { align-items: center; padding: 0; }
.page-head.dashboard-hero h1 { font-size: var(--fs-3xl); }
.page-head.dashboard-hero p { max-width: 580px; font-size: var(--fs-sm); }
.dashboard-head-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: var(--sp-2); }
.dashboard-period-switch { display: inline-flex; padding: var(--sp-1); border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.dashboard-period-switch button { min-height: 31px; padding: var(--sp-1) var(--sp-3); border: 0; border-radius: 6px; color: #617778; background: transparent; font-size: var(--fs-2xs); }
.dashboard-period-switch button.active { color: var(--white); background: var(--accent); font-weight: 700; }
.dashboard-refresh { width: 36px; padding: 0; font-size: var(--fs-xl); }
.dashboard-notice, .lead-register-note, .pipeline-validation-note { display: flex; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: 6px; color: #586e70; background: #f7f9f9; font-size: var(--fs-2xs); line-height: 1.45; }
.dashboard-notice > span, .lead-register-note > span, .pipeline-validation-note > span { flex: 0 0 auto; color: var(--accent-text); font-size: var(--fs-lg); }
.dashboard-notice p, .lead-register-note p { margin: 0; }
.dashboard-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-3); }
.dashboard-primary-card { grid-column: 1 / -1; min-height: 226px; padding: 25px var(--sp-7); border-radius: 10px; }
.dashboard-primary-label { color: #c9e5e4; font-size: var(--fs-2xs); letter-spacing: .09em; }
.dashboard-primary-value { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-4xl); }
.dashboard-primary-sub { font-size: var(--fs-xs); }
.dashboard-primary-track { height: 7px; margin: var(--sp-5) 0 var(--sp-3); }
.dashboard-primary-footer { justify-content: flex-start; gap: var(--sp-2) var(--sp-7); font-size: var(--fs-2xs); }
.dashboard-compact-card { min-height: 154px; padding: var(--sp-5) var(--sp-5); border-radius: 10px; }
.dashboard-card-heading { font-size: var(--fs-2xs); letter-spacing: .05em; }
.dashboard-card-icon { width: 30px; height: 30px; border-radius: 6px; font-size: var(--fs-lg); }
.dashboard-blocked-card > strong { margin: var(--sp-2) 0 var(--sp-1); font-size: var(--fs-4xl); }
.dashboard-blocked-card p { min-height: 0; margin-bottom: 9px; font-size: var(--fs-xs); }
.dashboard-view .link { font-size: var(--fs-2xs); }
.dashboard-reminder-count { display: block; margin: var(--sp-2) 0 0; color: var(--ink); font-size: var(--fs-3xl); line-height: 1; }
.dashboard-reminder-row { gap: var(--sp-3); padding: var(--sp-2) 0; }
.dashboard-reminder-time { min-width: 44px; font-size: var(--fs-2xs); }
.dashboard-reminder-time small { font-size: var(--fs-2xs); }
.dashboard-reminder-copy b { font-size: var(--fs-2xs); }
.dashboard-reminder-copy small { font-size: var(--fs-2xs); }
.dashboard-overdue-note { font-size: var(--fs-2xs); }
.dashboard-empty-line, .dashboard-chart-empty { padding: var(--sp-5) var(--sp-1); font-size: var(--fs-2xs); }
.dashboard-metric-grid { gap: var(--sp-3); }
.dashboard-metric-card { min-height: 90px; gap: var(--sp-1); padding: var(--sp-4) var(--sp-4); border-radius: 10px; }
.dashboard-metric-card > span { font-size: var(--fs-2xs); }
.dashboard-metric-card > strong { font-size: var(--fs-3xl); }
.dashboard-metric-card > small { font-size: var(--fs-2xs); }
.dashboard-metric-progress { height: 4px; }
.dashboard-chart-grid { gap: var(--sp-3); }
.dashboard-chart-card { min-height: 230px; padding: var(--sp-4); border-radius: 10px; }
.dashboard-section-heading { gap: var(--sp-3); padding-bottom: 10px; }
.dashboard-section-heading b { font-size: var(--fs-sm); }
.dashboard-section-heading small { font-size: var(--fs-2xs); }
.dashboard-section-heading .link { font-size: var(--fs-2xs); }
.dashboard-bars, .dashboard-product-bars { gap: var(--sp-3); padding: 17px 0 var(--sp-1); }
.dashboard-bar-row { grid-template-columns: 98px minmax(0,1fr) 22px; gap: var(--sp-2); font-size: var(--fs-2xs); }
.dashboard-bar-row > b, .dashboard-product-row > b { font-size: var(--fs-2xs); }
.dashboard-bar-track { height: 7px; }
.dashboard-product-row { grid-template-columns: 8px minmax(64px,.9fr) minmax(40px,1fr) 22px; gap: var(--sp-2); font-size: var(--fs-2xs); }
.dashboard-product-color { width: 8px; height: 8px; }
.dashboard-week-bars { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: end; gap: var(--sp-3); height: 155px; padding: var(--sp-4) var(--sp-1) 0; }
.dashboard-week-bar { display: grid; grid-template-rows: 18px 1fr 18px; justify-items: center; align-items: end; height: 100%; gap: var(--sp-1); color: var(--muted); font-size: var(--fs-2xs); }
.dashboard-week-bar b { align-self: start; color: var(--ink); font-size: var(--fs-2xs); }
.dashboard-week-bar i { display: block; width: min(35px,70%); min-height: 3px; align-self: end; border-radius: 4px 4px 0 0; background: #116d70; }
.dashboard-week-bar span { align-self: end; }
.dashboard-donut-layout { grid-template-columns: 130px minmax(0,1fr); gap: var(--sp-4); padding-top: 15px; }
.dashboard-donut { width: 124px; height: 124px; }
.dashboard-donut > div { width: 76px; height: 76px; }
.dashboard-donut b { font-size: var(--fs-xs); }
.dashboard-donut small { font-size: var(--fs-2xs); }
.dashboard-legend { gap: var(--sp-2); }
.dashboard-legend-row { gap: var(--sp-2); font-size: var(--fs-2xs); }
.dashboard-legend-row i { width: 8px; height: 8px; }
.dashboard-legend-row b { font-size: var(--fs-2xs); }
.dashboard-work-grid { gap: var(--sp-3); }
.dashboard-work-card { min-height: 220px; padding: var(--sp-4); border-radius: 10px; }
.dashboard-action-row { grid-template-columns: 27px minmax(0,1fr) auto; gap: var(--sp-2); min-height: 43px; padding: var(--sp-2) 0; }
.dashboard-action-mark { width: 24px; height: 24px; border-radius: 6px; font-size: var(--fs-xs); }
.dashboard-action-copy b { font-size: var(--fs-2xs); }
.dashboard-action-copy small { font-size: var(--fs-2xs); }
.dashboard-work-card .activity-item { grid-template-columns: 26px minmax(0,1fr) auto; gap: var(--sp-2); padding: var(--sp-2) 0; }
.dashboard-work-card .activity-icon { width: 23px; height: 23px; font-size: var(--fs-2xs); }
.dashboard-work-card .activity-item p { font-size: var(--fs-2xs); line-height: 1.35; }
.dashboard-work-card .activity-item small, .dashboard-work-card .activity-item time { font-size: var(--fs-2xs); }
.dashboard-team-card { padding: var(--sp-4); border-radius: 10px; }
.dashboard-team-card .table-wrap { margin-top: 9px; }
.dashboard-team-table { min-width: 760px; }
.dashboard-team-table th { padding: var(--sp-2) var(--sp-3); }
.dashboard-team-table td { padding: var(--sp-3); }
.dashboard-team-progress { min-width: 95px; }
.dashboard-team-progress > i { width: 62px; height: 5px; }
.dashboard-team-progress > b { font-size: var(--fs-2xs); }

.lead-register-summary { gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.lead-register-summary > div { position: relative; min-height: 78px; display: grid; grid-template-columns: 42px 1fr; grid-template-rows: 1fr 1fr; align-items: center; column-gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: none; }
.lead-register-summary > div:first-child { border-top: 1px solid var(--line); }
.lead-summary-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--accent-text); background: #e8f2f1; font-size: var(--fs-xl); }
.lead-summary-icon.is-red { color: #bb514a; background: #fff0ee; }
.lead-summary-icon.is-amber { color: #b78535; background: #fbf3e7; }
.lead-summary-icon.is-slate { color: #617f80; background: #eef3f3; }
.lead-summary-icon svg, .pipeline-stat-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lead-register-summary b { align-self: end; color: var(--ink); font-size: var(--fs-2xl); line-height: 1; }
.lead-register-summary > div > span:last-child { align-self: start; font-size: var(--fs-2xs); }
.lead-register-note { margin: 0 0 var(--sp-3); }
.leads-table-panel { overflow: visible; padding: 0; border-radius: 10px; }
.lead-table-toolbar { padding: var(--sp-4) var(--sp-4) var(--sp-3); border-bottom: 1px solid var(--line); }
.lead-filters { display: grid; grid-template-columns: minmax(180px,1.45fr) repeat(4,minmax(105px,1fr)) minmax(92px,.8fr) auto auto; gap: var(--sp-2); margin: 0; }
.lead-filters input { min-width: 0; width: 100%; }
.lead-filters select { min-width: 0; width: 100%; }
.lead-filters input, .lead-filters select { min-height: 38px; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-2xs); }
.lead-column-picker { position: relative; min-width: 90px; }
.lead-column-picker > summary { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: var(--sp-1) var(--sp-3); list-style: none; white-space: nowrap; }
.lead-column-picker > summary::-webkit-details-marker { display: none; }
.lead-column-options { position: absolute; top: calc(100% + 5px); right: 0; z-index: 20; display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-3); min-width: 250px; padding: var(--sp-3); border: 1px solid var(--line); border-radius: 6px; background: var(--white); box-shadow: 0 12px 30px rgba(18,55,58,.14); }
.lead-column-options label { display: flex; align-items: center; gap: var(--sp-2); color: #52696b; font-size: var(--fs-2xs); white-space: nowrap; }
.lead-reset-filters { white-space: nowrap; }
.lead-table-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) 2px 0; color: #607678; font-size: var(--fs-2xs); }
.lead-switch-label { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; color: #52696b; font-size: var(--fs-xs); }
.lead-switch-label input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lead-switch-track { position: relative; width: 36px; height: 20px; flex: 0 0 auto; border-radius: 99px; background: #d7e0df; transition: background .16s ease; }
.lead-switch-track::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ''; transition: transform .16s ease; }
.lead-switch-label input:checked + .lead-switch-track { background: var(--accent); }
.lead-switch-label input:checked + .lead-switch-track::after { transform: translateX(16px); }
.lead-switch-label input:focus-visible + .lead-switch-track { outline: 3px solid rgba(15,112,116,.2); outline-offset: 2px; }
.lead-result-count { display: inline-flex; align-items: center; gap: var(--sp-1); white-space: nowrap; }
.lead-result-count b { color: var(--ink); }
.leads-detail-table { min-width: 1120px; }
.leads-detail-table th { padding: var(--sp-3) var(--sp-3); font-size: var(--fs-2xs); }
.leads-detail-table td { padding: var(--sp-3) var(--sp-3); font-size: var(--fs-2xs); }
.leads-detail-table td[hidden], .leads-detail-table th[hidden] { display: none !important; }
.leads-detail-table td:nth-child(1) { min-width: 205px; }
.leads-detail-table .person { gap: var(--sp-2); }
.leads-detail-table .person .avatar { width: 34px; height: 34px; font-size: var(--fs-2xs); }
.leads-detail-table .person b { display: block; font-size: var(--fs-xs); }
.leads-detail-table .person span, .leads-detail-table .person small { display: block; max-width: 180px; overflow: hidden; color: var(--muted); font-size: var(--fs-2xs); text-overflow: ellipsis; white-space: nowrap; }
.leads-detail-table .person small { font-size: var(--fs-2xs); }
.leads-detail-table td small { max-width: 180px; font-size: var(--fs-2xs); }
.lead-team-hint { margin-top: 3px; font-size: var(--fs-2xs); }
.lead-table-docs { font-size: var(--fs-xs); }
.lead-fee-cell { color: #405d5f; white-space: nowrap; }
.lead-reminder-cell { display: grid; gap: var(--sp-1); white-space: nowrap; }
.lead-reminder-cell b { font-size: var(--fs-2xs); }
.lead-reminder-cell small { color: #688082; }
.lead-reminder-cell small.is-late { color: #b34b3c; font-weight: 700; }
.lead-created-cell { color: #617778; white-space: nowrap; }
.lead-pagination-actions { display: flex; align-items: center; gap: var(--sp-2); }
.lead-pagination-actions label { display: inline-flex; align-items: center; gap: var(--sp-1); }
.lead-pagination-actions select { min-height: 29px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--white); }

.pipeline-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.pipeline-header-actions select { min-height: 36px; min-width: 150px; padding: var(--sp-1) var(--sp-3); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--white); font-size: var(--fs-2xs); }
.pipeline-filter-label { color: #667d7e; font-size: var(--fs-2xs); }
.pipeline-summary { gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.pipeline-summary > div { position: relative; min-height: 70px; grid-template-columns: 34px 1fr; grid-template-rows: 1fr 1fr; align-items: center; column-gap: var(--sp-2); padding: var(--sp-3) var(--sp-3); border-radius: 10px; }
.pipeline-stat-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--accent-text); background: #e8f2f1; font-size: var(--fs-lg); font-style: normal; font-weight: 800; }
.pipeline-summary .is-alert .pipeline-stat-icon { color: #bb514a; background: #fff0ee; }
.pipeline-summary .is-success .pipeline-stat-icon { color: #26805b; background: #eaf5ef; }
.pipeline-stat-icon svg { width: 19px; height: 19px; }
.pipeline-summary strong { align-self: end; font-size: var(--fs-2xl); }
.pipeline-summary span { align-self: start; white-space: nowrap; font-size: var(--fs-2xs); }
.pipeline-view-controls { display: grid; gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.pipeline-toggle-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-6); }
.pipeline-validation-note { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-2xs); }
.kanban { grid-template-columns: unset; grid-auto-flow: column; grid-auto-columns: minmax(255px,1fr); gap: var(--sp-3); padding-bottom: 11px; }
.kanban-col { min-height: 500px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafa; box-shadow: none; }
.kanban-head { align-items: flex-start; min-height: 62px; padding: var(--sp-3) var(--sp-3) var(--sp-3); background: #f9fbfb; border-radius: 10px 10px 0 0; }
.kanban-head b { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); letter-spacing: 0; text-transform: none; }
.pipeline-stage-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #267b7d; }
.pipeline-stage-dot.stage-0 { background: #bcc8c8; }
.pipeline-stage-dot.stage-1, .pipeline-stage-dot.stage-2 { background: #3975bd; }
.pipeline-stage-dot.stage-3 { background: #d78a27; }
.pipeline-stage-dot.stage-4 { background: #8c57ae; }
.pipeline-stage-dot.stage-5 { background: #27845b; }
.pipeline-stage-meta { margin-top: 4px; font-size: var(--fs-2xs) !important; }
.kanban-head .count { min-width: 24px; height: 24px; border-radius: 99px; background: var(--white); font-size: var(--fs-2xs); }
.kanban-body { gap: var(--sp-2); padding: var(--sp-2); }
.deal-card.pipeline-deal-card { padding: var(--sp-3); border-radius: 10px; background: var(--white); box-shadow: 0 1px 2px rgba(18,55,58,.04); }
.pipeline-deal-card:hover { transform: translateY(-1px); border-color: #b8cfcd; box-shadow: 0 5px 15px rgba(18,55,58,.08); }
.pipeline-deal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.pipeline-deal-head h3 { overflow: hidden; margin: 0; font-size: var(--fs-sm); line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-deal-menu { width: 24px; height: 23px; flex: 0 0 auto; border: 0; border-radius: 6px; color: #708384; background: transparent; font-size: var(--fs-lg); line-height: 1; }
.pipeline-deal-menu:hover { color: var(--accent-text); background: #edf5f4; }
.pipeline-deal-tags { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1); margin: var(--sp-1) 0 var(--sp-2); }
.pipeline-deal-tags .product-pill { padding: var(--sp-1) var(--sp-2); border-radius: 99px; font-size: var(--fs-2xs); }
.pipeline-blocked-flag { color: #b24f45; font-size: var(--fs-2xs); font-weight: 700; }
.pipeline-deal-facts { display: grid; gap: 0; }
.pipeline-deal-facts > div { display: flex; justify-content: space-between; gap: var(--sp-2); min-height: 29px; align-items: center; border-top: 1px solid #edf1f0; color: #657b7c; font-size: var(--fs-2xs); }
.pipeline-deal-facts > div b { max-width: 58%; overflow: hidden; color: #657b7c; font-size: var(--fs-2xs); font-weight: 500; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-deal-facts > div b.is-complete { color: #23865a; font-weight: 700; }
.pipeline-deal-reminder { display: flex; justify-content: space-between; gap: var(--sp-1); margin-top: 7px; color: #596f70; font-size: var(--fs-2xs); }
.pipeline-deal-reminder small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.pipeline-deal-reminder.is-late, .pipeline-deal-reminder.is-late small { color: #b34b3c; font-weight: 700; }
.pipeline-deal-foot { gap: var(--sp-2); margin-top: 9px; padding-top: 8px; border-top: 1px solid #edf1f0; }
.pipeline-deal-owner { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.pipeline-deal-owner i { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 auto; border-radius: 50%; color: var(--accent-text); background: #e8f2f1; font-size: var(--fs-2xs); font-style: normal; font-weight: 800; }
.pipeline-deal-owner b { overflow: hidden; color: #557071; font-size: var(--fs-2xs); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-deal-value { color: #6a7e7f; font-size: var(--fs-2xs); white-space: nowrap; }
.pipeline-empty { padding: var(--sp-7) var(--sp-3); color: var(--muted); font-size: var(--fs-2xs); text-align: center; }

@media (max-width: 1200px) {
  .content { padding-right: 24px; padding-left: 24px; }
  .lead-filters { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .lead-filters input { grid-column: span 2; }
  .lead-column-picker, .lead-reset-filters { grid-column: span 1; }
  .pipeline-header-actions select { min-width: 125px; }
}
@media (max-width: 900px) {
  .dashboard-head-actions { justify-content: flex-start; }
  .dashboard-overview-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-primary-card { grid-column: 1 / -1; grid-row: auto; }
  .dashboard-reminders-card { grid-column: auto; }
  .dashboard-chart-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-chart-card:last-child { grid-column: 1 / -1; }
  .lead-filters { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .lead-filters input { grid-column: span 2; }
}
@media (max-width: 680px) {
  :root { --sidebar-w: 76px; }
  .sidebar { padding: var(--sp-3) var(--sp-2); }
  .brand { justify-content: center; padding-right: 0; padding-left: 0; }
  .brand-name, .brand-sub, .nav-label, .nav-btn span:not(.nav-icon), .agent-mini, .logout-btn { display: none; }
  .nav-btn { justify-content: center; padding: var(--sp-2); }
  .nav-icon, .nav-icon svg { width: 19px; height: 19px; }
  .content { padding: var(--sp-5) var(--sp-3) var(--sp-7); }
  .topbar, .topbar.topbar-minimal { padding: 0 var(--sp-3); }
  .topbar-search-cell { width: min(270px, calc(100% - 115px)); }
  .topbar-minimal .top-actions { right: 10px; }
  .topbar-minimal .user-chip-text { display: none; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; justify-content: flex-start; }
  .dashboard-overview-grid, .dashboard-metric-grid, .dashboard-chart-grid, .dashboard-work-grid { grid-template-columns: 1fr; }
  .dashboard-primary-card { grid-column: auto; min-height: 190px; padding: var(--sp-5); }
  .dashboard-primary-value { font-size: var(--fs-4xl); }
  .dashboard-chart-card:last-child { grid-column: auto; }
  .dashboard-period-switch { overflow-x: auto; max-width: 100%; }
  .dashboard-period-switch button { padding-right: 8px; padding-left: 8px; white-space: nowrap; }
  .lead-register-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--sp-2); }
  .lead-register-summary > div { min-height: 68px; grid-template-columns: 34px 1fr; column-gap: var(--sp-2); padding: var(--sp-3); }
  .lead-summary-icon { width: 31px; height: 31px; font-size: var(--fs-lg); }
  .lead-register-summary b { font-size: var(--fs-2xl); }
  .lead-register-summary > div > span:last-child { font-size: var(--fs-2xs); }
  .lead-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .lead-filters input { grid-column: 1 / -1; }
  .lead-filters select { grid-column: span 1; }
  .lead-column-picker, .lead-reset-filters { grid-column: span 1; }
  .lead-table-controls { align-items: flex-start; flex-direction: column; }
  .lead-pagination-actions { flex-wrap: wrap; justify-content: flex-end; }
  .pipeline-header-actions { width: 100%; justify-content: flex-start; }
  .pipeline-header-actions select { min-width: 130px; flex: 1; }
  .pipeline-toggle-row { gap: var(--sp-3); }
  .pipeline-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pipeline-summary > div:last-child { grid-column: 1 / -1; }

}

/* Cibles tactiles de 40 px pour les actions fréquentes, y compris les libellés de cases. */
.nav-btn, .btn, .btn.sm, .icon-btn, .dark-toggle, .logout-btn,
.section-tab, .period-tab, .pagination button, .close, .checkline,
.upload-dropzone { min-height: 40px; }
.link { display: inline-flex; align-items: center; min-height: 40px; }
.btn { white-space: nowrap; }
html.using-keyboard :focus { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.kpi[data-tone="green"] .kpi-icon { color: var(--green-text); background: var(--green-bg); }
.kpi[data-tone="amber"] .kpi-icon { color: var(--amber-text); background: var(--amber-bg); }
.kpi[data-tone="red"] .kpi-icon { color: var(--red-text); background: var(--red-bg); }
.kpi[data-tone="blue"] .kpi-icon { color: var(--blue-text); background: var(--blue-bg); }
.kpi[data-tone="accent"] .kpi-icon { color: var(--accent-text); background: var(--cream); }

/* Surfaces de cartes et composants récents en mode sombre */
body.dark-mode .dashboard-compact-card,
body.dark-mode .dashboard-metric-card,
body.dark-mode .dashboard-chart-card,
body.dark-mode .dashboard-work-card,
body.dark-mode .dashboard-team-card,
body.dark-mode .dashboard-period-switch,
body.dark-mode .dashboard-donut > div,
body.dark-mode .dashboard-notice,
body.dark-mode .lead-register-note,
body.dark-mode .pipeline-validation-note,
body.dark-mode .pipeline-summary > div,
body.dark-mode .lead-column-options,
body.dark-mode .lead-pagination-actions select,
body.dark-mode .pipeline-header-actions select,
body.dark-mode .ringover-note-area select,
body.dark-mode .kanban-head .count,
body.dark-mode .deal-card.pipeline-deal-card,
body.dark-mode .lead-filters,
body.dark-mode .topbar-search-cell .search,
body.dark-mode .topbar-minimal .top-actions .icon-btn,
body.dark-mode .topbar-minimal .top-actions .dark-toggle,
body.dark-mode .topbar-minimal .user-chip-avatar,
body.dark-mode .metric-card,
body.dark-mode .info-card,
body.dark-mode .devis-card,
body.dark-mode .inbox,
body.dark-mode .calendar,
body.dark-mode .leaderboard,
body.dark-mode .agenda-summary-grid > div {
  color: var(--ink);
  background: var(--cream);
  border-color: var(--line);
}
body.dark-mode .leads-table-panel th {
  color: var(--muted);
  background: var(--paper);
}
body.dark-mode .kanban-col,
body.dark-mode .kanban-head {
  background: var(--paper);
  border-color: var(--line);
}
body.dark-mode .dashboard-card-heading,
body.dark-mode .dashboard-metric-card > span,
body.dark-mode .dashboard-bar-row,
body.dark-mode .dashboard-product-row,
body.dark-mode .dashboard-legend-row,
body.dark-mode .dashboard-reminder-copy b,
body.dark-mode .dashboard-action-copy b,
body.dark-mode .dashboard-team-progress > b,
body.dark-mode .dashboard-period-switch button,
body.dark-mode .lead-fee-cell,
body.dark-mode .lead-reminder-cell small,
body.dark-mode .lead-created-cell,
body.dark-mode .lead-table-controls,
body.dark-mode .lead-switch-label,
body.dark-mode .lead-column-options label,
body.dark-mode .pipeline-filter-label,
body.dark-mode .pipeline-deal-facts > div,
body.dark-mode .pipeline-deal-facts > div b,
body.dark-mode .pipeline-deal-reminder,
body.dark-mode .pipeline-deal-owner b,
body.dark-mode .pipeline-deal-value {
  color: var(--muted);
}
body.dark-mode .dashboard-reminder-time,
body.dark-mode .dashboard-card-icon,
body.dark-mode .dashboard-action-mark,
body.dark-mode .lead-summary-icon,
body.dark-mode .pipeline-stat-icon,
body.dark-mode .pipeline-deal-owner i {
  color: var(--accent-text);
  background: var(--teal-bg);
}
body.dark-mode .dashboard-card-icon.is-alert,
body.dark-mode .dashboard-action-mark.is-alert,
body.dark-mode .lead-summary-icon.is-red,
body.dark-mode .pipeline-summary .is-alert .pipeline-stat-icon {
  color: var(--red-text);
  background: var(--red-bg);
}
body.dark-mode .lead-summary-icon.is-amber {
  color: var(--amber-text);
  background: var(--amber-bg);
}
body.dark-mode .pipeline-summary .is-success .pipeline-stat-icon {
  color: var(--green-text);
  background: var(--green-bg);
}
body.dark-mode .dashboard-bar-track,
body.dark-mode .dashboard-metric-progress,
body.dark-mode .dashboard-team-progress > i,
body.dark-mode .lead-switch-track {
  background: var(--line-light);
}
body.dark-mode .pipeline-deal-facts > div,
body.dark-mode .pipeline-deal-foot {
  border-top-color: var(--line-light);
}
body.dark-mode .lead-row-clickable:hover td {
  background: var(--line-light);
}
body.dark-mode .sidebar-toggle {
  color: var(--ink);
  background: var(--cream);
  border-color: var(--line);
}

/* En-tête mobile et tiroir latéral complet sur téléphone */
.topbar-minimal .top-actions .dark-toggle {
  min-width: 36px;
  height: 36px;
  border-radius: 6px;
}

/* Harmonisation des icônes vectorielles SVG dans l'ensemble du CRM */
svg[viewBox="0 0 24 24"] {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.nav-icon svg,
.director-mobile-tab-icon svg {
  width: 19px;
  height: 19px;
}
.kpi-icon svg,
.dashboard-card-icon svg,
.dashboard-action-mark svg,
.activity-icon svg,
.communication-stat-icon svg,
.call-entry-icon svg,
.contact-channel-icon svg,
.doc-icon svg,
.cmd-icon svg,
.dvc-status-icon svg,
.dvc-readiness-heading > span svg,
.lead-validation-row > span svg {
  width: 17px;
  height: 17px;
}
.upload-drop-icon svg {
  width: 22px;
  height: 22px;
}
.btn svg,
.logout-btn span svg,
.lead-result-count svg,
.pipeline-filter-label svg,
.pipeline-deal-facts span svg,
.pipeline-deal-reminder span svg,
.communication-search span svg,
.document-search span svg,
.document-folder-chevron svg,
.cmd-search-bar span svg,
.dashboard-notice span svg,
.lead-register-note span svg,
.pipeline-validation-note span svg {
  width: 15px;
  height: 15px;
}
.pipeline-deal-facts > div > span,
.pipeline-deal-reminder > span,
.lead-result-count,
.pipeline-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
@media (max-width: 680px) {
  .sidebar.open {
    width: min(280px, 84vw);
    padding: var(--sp-3) var(--sp-4);
  }
  .sidebar.open .brand {
    justify-content: flex-start;
    padding: var(--sp-1) var(--sp-1) var(--sp-3);
  }
  .sidebar.open .brand-name,
  .sidebar.open .brand-sub,
  .sidebar.open .nav-label,
  .sidebar.open .nav-btn span:not(.nav-icon),
  .sidebar.open .agent-mini,
  .sidebar.open .logout-btn {
    display: revert;
  }
  .sidebar.open .nav-btn {
    justify-content: flex-start;
    padding: var(--sp-2);
  }
  .topbar.topbar-minimal {
    justify-content: flex-start;
    padding: 0 var(--sp-3);
  }
  .topbar-minimal .topbar-search-cell {
    margin: 0;
    width: calc(100% - 134px);
  }
  .topbar-minimal .top-actions {
    right: 10px;
    gap: var(--sp-2);
  }
}

/* Les réglages mobiles restent prioritaires sur les styles d’accueil globaux. */
@media (max-width: 760px) {
  .login-welcome-brand img { width: min(260px, 64%); max-height: 30vh; }
  .login-welcome-copy h1 { font-size: clamp(2.125rem, 9vw, 2.875rem); }
  .login-welcome-features { font-size: var(--fs-sm); }
}

