/* ============================================================
   HQH — Design system
   Fluent UI 2 (Microsoft) skin — primary #0078d4, Segoe UI.
   ============================================================ */

:root {
  /* Fluent neutrals */
  --bg:            #faf9f8;   /* app background (NeutralBackground) */
  --surface:       #ffffff;   /* cards */
  --surface-2:     #f3f2f1;   /* subtle fills, table headers */
  --surface-3:     #edebe9;   /* deeper fill / hover */
  --sidebar:       #ffffff;

  --border:        #edebe9;   /* NeutralStroke2 */
  --border-strong: #d2d0ce;   /* NeutralStroke1 */

  --text:          #242424;   /* NeutralForeground1 */
  --text-2:        #605e5c;   /* NeutralForeground2 */
  --text-3:        #8a8886;   /* NeutralForeground3 / placeholder */

  /* Brand — Fluent Communication blue */
  --primary:       #0078d4;
  --primary-strong:#005a9e;   /* pressed */
  --primary-hover: #106ebe;
  --primary-tint:  #eff6fc;   /* BrandBackground2 */
  --primary-tint-2:#deecf9;

  /* Secondary accent (Fluent "marigold"/orange for highlights) */
  --accent:        #ca5010;
  --accent-tint:   #fdf3ec;

  /* Semantic colors — Fluent */
  --positif:       #107c10;   /* success */
  --positif-tint:  #e8f5e9;
  --argumente:     #d18f00;   /* warning (darkened for contrast) */
  --argumente-tint:#fdf6e3;
  --repondeur:     #d13438;   /* danger */
  --repondeur-tint:#fdeced;
  --indispo:       #605e5c;
  --indispo-tint:  #f3f2f1;
  --autres:        #8a8886;
  --autres-tint:   #f3f2f1;

  --purple:        #8764b8;   /* Fluent purple */
  --purple-tint:   #f3effa;

  /* Radii — Fluent (crisp) */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 4px;
  --r-lg: 6px;
  --r-xl: 8px;

  /* Shadows — Fluent depth */
  --sh-1: 0 .3px .9px rgba(0,0,0,.10), 0 1.6px 3.6px rgba(0,0,0,.13);
  --sh-2: 0 .6px 1.8px rgba(0,0,0,.10), 0 3.2px 7.2px rgba(0,0,0,.13);
  --sh-3: 0 1.2px 3.6px rgba(0,0,0,.11), 0 6.4px 14.4px rgba(0,0,0,.13);

  --font: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "Consolas", "Spline Sans Mono", monospace;

  /* density (overridable by tweaks) */
  --row-pad: 13px;
  --gap: 20px;

  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.45;
}
::selection { background: var(--primary-tint-2); }

h1,h2,h3,h4 { margin: 0; font-weight: 600; letter-spacing: -0.005em; color: var(--text); }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
/* Fluent focus ring */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-radius: var(--r-xs); }
.btn:focus-visible, .icon-btn:focus-visible { outline-offset: 2px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ---------- Layout shell ---------- */
.app { display: flex; min-height: 100vh; }

/* When the UI scale tweak applies body { zoom }, vh units keep referencing the
   un-zoomed viewport — divide by --zoom so full-height regions still fill the screen. */
.app { min-height: calc(100vh / var(--zoom, 1)); }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: calc(100vh / var(--zoom, 1));
  overflow-y: auto;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 14px;
}
.sb-logo {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--primary);
  color: #fff; display: grid; place-items: center;
  box-shadow: var(--sh-1);
}
.sb-brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.sb-brand-sub  { font-size: 11px; color: var(--text-3); font-weight: 600; }

.sb-site {
  margin: 0 14px 6px; padding: 9px 11px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); display: flex; align-items: center; gap: 9px;
  cursor: pointer; transition: background .15s;
}
.sb-site:hover { background: var(--surface-3); }
.sb-site-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--positif); }

.sb-nav { padding: 8px 12px 20px; flex: 1; }
.sb-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); padding: 14px 12px 6px;
}
.sb-group-toggle {
  display: flex; align-items: center; gap: 7px; width: 100%; background: none; border: 0;
  font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); cursor: pointer; border-radius: var(--r-sm); transition: color .12s, background .12s;
}
.sb-group-toggle:hover { color: var(--text-2); background: var(--surface-2); }
.sb-group-count { font-size: 10px; font-weight: 800; color: var(--accent); background: var(--accent-tint); border-radius: 99px; padding: 1px 7px; letter-spacing: 0; }
.sb-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 12px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 550; font-size: 13.5px;
  cursor: pointer; transition: background .14s, color .14s;
  position: relative; user-select: none; white-space: nowrap;
}
.sb-item > span:not(.ico):not(.sb-badge) { overflow: hidden; text-overflow: ellipsis; }
.sb-item:hover { background: var(--surface-2); color: var(--text); }
.sb-item.active { background: var(--primary-tint); color: var(--primary-strong); font-weight: 650; }
.sb-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3.5px; height: 20px; border-radius: 0 4px 4px 0; background: var(--primary);
}
.sb-item .ico { flex: 0 0 18px; color: currentColor; opacity: .85; }
.sb-item .sb-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--accent-tint); color: var(--accent);
  padding: 1px 7px; border-radius: 99px;
}
.sb-foot { padding: 12px 16px; border-top: 1px solid var(--border); }

/* ---------- Topbar ---------- */
.topbar-brand { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; flex: 0 0 60px;
  background: color-mix(in oklab, var(--surface) 86%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 0 26px; position: sticky; top: 0; z-index: 30;
}
.topbar-search {
  flex: 1; max-width: 420px; display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 12px; color: var(--text-3);
}
.topbar-search input { border: 0; background: transparent; outline: none; font-family: inherit; font-size: 13.5px; width: 100%; color: var(--text); }
.role-switch { display: flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.role-switch button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: all .14s;
}
.role-switch button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); display: grid; place-items: center; transition: all .14s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: var(--r-sm); cursor: pointer; }
.user-chip:hover { background: var(--surface-2); }
.user-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; width: 232px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--sh-3); padding: 6px; animation: um-in .14s ease; }
@keyframes um-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.user-menu-head { display: flex; align-items: center; gap: 10px; padding: 9px 10px 11px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.user-menu-item:hover { background: var(--surface-2); }
.user-menu-item > svg { color: var(--text-3); }
.user-menu-item.danger { color: var(--repondeur); }
.user-menu-item.danger > svg { color: var(--repondeur); }
.user-menu-item.danger:hover { background: var(--repondeur-tint); }
.user-menu-sep { height: 1px; background: var(--border); margin: 6px 0; }

/* Calendrier de plage (Enregistrements — style SNCF) */
.rcal { width: 560px; max-width: 92vw; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 14px; }
.rcal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rcal-range { font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.rcal-range > svg { color: var(--text-3); }
.rcal-months { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rcal-mname { text-align: center; font-weight: 700; font-size: 13px; margin-bottom: 8px; text-transform: capitalize; }
.rcal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.rcal-dow span { text-align: center; font-size: 10.5px; font-weight: 700; color: var(--text-3); }
.rcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.rcal-day { aspect-ratio: 1; border: none; background: none; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer; font-family: inherit; }
.rcal-day:hover:not(:disabled) { background: var(--surface-2); }
.rcal-day:disabled { color: var(--text-3); opacity: .4; cursor: not-allowed; }
.rcal-day.today { box-shadow: inset 0 0 0 1px var(--border-strong); }
.rcal-day.inr { background: var(--primary-tint); border-radius: 0; color: var(--primary-strong); }
.rcal-day.edge { background: var(--primary); color: #fff; }
.rcal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  /* Mobile : un seul mois (navigation par les chevrons ‹ ›), largeur contrainte au viewport */
  .rcal { width: min(92vw, 360px); padding: 12px; }
  .rcal-months { grid-template-columns: 1fr; }
  .rcal-months > .rcal-month + .rcal-month { display: none; }
}
.avatar { width: 34px; height: 34px; border-radius: var(--r-sm); background: var(--primary-strong); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }

/* ---------- Page ---------- */
.page { padding: 22px 30px 64px; max-width: 1480px; width: 100%; margin: 0 auto; }
.breadcrumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 12px; display: flex; gap: 7px; align-items: center; }
.breadcrumb b { color: var(--text-2); font-weight: 600; }
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.page-title-ico { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--primary-tint); color: var(--primary-strong); display: grid; place-items: center; flex: 0 0 auto; }
.page-title { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.page-sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.page-head-actions { margin-left: auto; display: flex; gap: 9px; align-items: center; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: 18px; }
.breadcrumb b, .breadcrumb span:not(:last-of-type) { cursor: pointer; transition: color .12s; }
.clsmt-top { display: grid; grid-template-columns: minmax(260px, 0.85fr) 1.15fr; gap: var(--gap); margin-bottom: var(--gap); align-items: start; }
.clsmt-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.clsmt-aside { position: sticky; top: 8px; }
@media (max-width: 1080px) { .clsmt-main { grid-template-columns: 1fr; } .clsmt-aside { position: static; } }
@media (max-width: 980px) { .clsmt-top { grid-template-columns: 1fr; } }
.breadcrumb b:hover, .breadcrumb span:not(:last-of-type):hover { color: var(--primary); text-decoration: underline; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14.5px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 8px 13px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600;
  transition: all .14s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: none; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:active { background: var(--primary-strong); border-color: var(--primary-strong); }
.btn-sm { padding: 5.5px 10px; font-size: 12px; border-radius: var(--r-xs); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }

/* ---------- Liens d'action (tables) ---------- */
.lnk-edit, .lnk-del { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 600; transition: opacity .14s; }
.lnk-edit { color: var(--primary); }
.lnk-del  { color: var(--repondeur); }
.lnk-edit:hover, .lnk-del:hover { opacity: .7; text-decoration: underline; }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 650; padding: 2.5px 9px; border-radius: 99px;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge-positif   { background: var(--positif-tint);   color: oklch(0.45 0.12 152); }
.badge-argumente { background: var(--argumente-tint); color: oklch(0.52 0.13 62); }
.badge-repondeur { background: var(--repondeur-tint); color: oklch(0.50 0.16 27); }
.badge-indispo   { background: var(--indispo-tint);   color: var(--indispo); }
.badge-autres    { background: var(--autres-tint);    color: var(--text-2); }
.badge-primary   { background: var(--primary-tint);   color: var(--primary-strong); }
.badge-accent    { background: var(--accent-tint);    color: oklch(0.5 0.12 58); }
.badge-purple    { background: var(--purple-tint);    color: var(--purple); }

/* ---------- Pills / segmented tabs ---------- */
.tabs { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 4px; }
.tabs button { border: 0; background: transparent; padding: 7px 15px; border-radius: var(--r-xs); font-size: 13px; font-weight: 600; color: var(--text-2); transition: all .14s; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--primary-strong); box-shadow: var(--sh-1); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--text-2); border-right: 1px solid var(--border); transition: all .14s; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button.active { background: var(--primary-tint); color: var(--primary-strong); }
.seg.seg-sm button { padding: 4px 9px; font-size: 11px; }

/* ---------- Statistiques équipe (Ventes) ---------- */
.vs-pills { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.vs-pills button { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 13.5px; font-weight: 600; padding: 8px 17px; border-radius: 99px; cursor: pointer; transition: all .14s; }
.vs-pills button:hover { border-color: var(--primary); }
.vs-pills button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.vs-kpi-click { transition: border-color .14s, box-shadow .14s; }
.vs-kpi-click:hover { border-color: var(--primary); box-shadow: var(--sh-2); }
.avatar-sm { width: 30px; height: 30px; border-radius: 99px; background: var(--primary-tint); color: var(--primary-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; }

/* ---------- Inputs ---------- */
.field-label { font-size: 11.5px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; display: block; }
.input, .select {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm);
  padding: 8px 11px; font-family: inherit; font-size: 13px; color: var(--text); outline: none; transition: border .14s, box-shadow .14s;
}
.input:focus, .select:focus { border-color: var(--primary); border-bottom-width: 2px; box-shadow: inset 0 -1px 0 0 var(--primary); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
/* Tables larges : la carte qui contient un tableau scrolle horizontalement
   au lieu de laisser le tableau déborder (à toutes les largeurs, pas seulement en mobile). */
.page .card:has(> .tbl) { overflow-x: auto; }
.tbl thead th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--text-2);
  padding: 11px var(--row-pad); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0;
}
.tbl thead th.sortable { cursor: pointer; color: var(--primary-strong); }
.tbl thead th.num, .tbl tbody td.num { text-align: right; }
.tbl tbody td { padding: var(--row-pad); border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .rowlink { color: var(--primary-strong); font-weight: 600; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; gap: var(--gap); }
.kpi, .kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--sh-1); position: relative; overflow: hidden;
}
.kpi-ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; margin-bottom: 12px; }
.kpi-val { font-size: 27px; font-weight: 600; letter-spacing: -0.01em; line-height: 1; }
.kpi-suffix { font-size: 16px; font-weight: 700; color: var(--text-3); margin-left: 1px; }
.kpi-label { font-size: 12.5px; color: var(--text-2); margin-top: 6px; font-weight: 550; }
.kpi-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; font-weight: 500; text-wrap: pretty; }
/* cliquable */
.kpi-card.is-click { cursor: pointer; transition: box-shadow .15s, border-color .15s, transform .15s; }
.kpi-card.is-click:hover { box-shadow: var(--sh-2, var(--sh-1)); border-color: var(--border-strong, var(--border)); transform: translateY(-1px); }
.kpi-card.is-click:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.kpi-open { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11.5px; color: var(--primary-strong); font-weight: 600; }
/* état critique */
.kpi-card.is-hot { background: var(--repondeur-tint); border-color: var(--repondeur); }
/* centré (ex. Architecture des données) */
.kpi-card.is-center { text-align: center; }
.kpi-card.is-center .kpi-ico { margin-left: auto; margin-right: auto; }
.kpi-card.is-center .kpi-open { justify-content: center; }
.kpi-delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; margin-top: 8px; }
.delta-up { color: var(--positif); }
.delta-down { color: var(--repondeur); }
/* Barre d'outils Reporting */
.rpt-actions { display: flex; gap: 10px; }
.rpt-act-short { display: none; }
/* KPI compacts — récap Dispatch (pas besoin d'être aussi gros que le dashboard) */
.disp-kpi .kpi, .disp-kpi .kpi-card { padding: 12px 14px; }
.disp-kpi .kpi-ico { width: 28px; height: 28px; margin-bottom: 8px; }
.disp-kpi .kpi-ico svg { width: 16px; height: 16px; }
.disp-kpi .kpi-val { font-size: 21px; }
.disp-kpi .kpi-val span { font-size: 13px !important; }
.disp-kpi .kpi-label { font-size: 12px; margin-top: 4px; }
.delta-flat { color: var(--text-3); }

/* utility */
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.grow { flex: 1; }
.divider { height: 1px; background: var(--border); border: 0; margin: 0; }
.tag-trend-up::after { content: "↑"; color: var(--positif); }
.tag-trend-down::after { content: "↓"; color: var(--repondeur); }

/* fade-in for page transitions */
@media (prefers-reduced-motion: no-preference) {
  .page-fade { animation: pf .26s ease both; }
  @keyframes pf { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Tweaks-driven helpers */
body[data-density="compact"] { --row-pad: 9px; --gap: 14px; }
body[data-density="spacious"] { --row-pad: 16px; --gap: 26px; }

/* ============================================================
   Ringover / async states, webhook, launcher
   ============================================================ */

/* pulsing live dot */
.live-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--positif); position: relative; flex: 0 0 auto; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 99px; border: 2px solid var(--positif); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .live-dot::after { animation: ping 1.8s ease-out infinite; }
  @keyframes ping { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
}

/* integration banner */
.intg-banner {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--sh-1);
}
.intg-logo { width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center; flex: 0 0 auto; background: var(--purple-tint); color: var(--purple); font-weight: 700; }

/* skeleton shimmer */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; border-radius: 6px; }
@media (prefers-reduced-motion: no-preference) { .skel { animation: shimmer 1.4s ease infinite; } @keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } } }

/* fresh row highlight (webhook arrival) */
@media (prefers-reduced-motion: no-preference) {
  tr.fresh-row > td { animation: freshpulse 2.4s ease; }
  @keyframes freshpulse { 0%,12% { background: var(--positif-tint); } 100% { background: transparent; } }
}
.fresh-tag { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--positif); background: var(--positif-tint); padding: 1px 6px; border-radius: var(--r-xs); }

/* toasts */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--primary);
  border-radius: var(--r-md); box-shadow: var(--sh-3);
}
@media (prefers-reduced-motion: no-preference) { .toast { animation: toastin .3s ease both; } @keyframes toastin { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } } }
.toast.ok { border-left-color: var(--positif); }
.toast.err { border-left-color: var(--repondeur); }
.toast.info { border-left-color: var(--primary); }

/* spinner */
.spin { width: 15px; height: 15px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 99px; display: inline-block; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: rot .7s linear infinite; } @keyframes rot { to { transform: rotate(360deg); } } }

/* ---------- Workspace launcher ---------- */
.launcher {
  min-height: calc(100vh / var(--zoom, 1)); display: grid; place-items: center; padding: 40px 24px;
  background:
    radial-gradient(1100px 600px at 80% -10%, var(--primary-tint), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--accent-tint), transparent 55%),
    var(--bg);
}
.launcher-inner { width: 100%; max-width: 940px; }
.launcher-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 6px; }
.launcher-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.ws-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 22px; box-shadow: var(--sh-2); cursor: pointer; transition: transform .16s, box-shadow .16s, border-color .16s;
  display: flex; flex-direction: column; gap: 13px; text-align: left;
}
.ws-card:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--border-strong); }
.ws-ico { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; }
.ws-card h3 { font-size: 18px; }
.ws-feat { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.ws-feat .ck { color: var(--positif); flex: 0 0 auto; }
.ws-enter { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; color: var(--primary-strong); padding-top: 6px; }
@media (max-width: 800px) { .launcher-cards { grid-template-columns: 1fr; } }

/* ---------- Écran de connexion (login + sélecteur de comptes démo) ---------- */
.login-screen {
  min-height: calc(100vh / var(--zoom, 1)); display: grid; place-items: center; padding: 40px 20px;
  background:
    radial-gradient(1100px 520px at 50% -8%, color-mix(in oklab, var(--primary) 9%, transparent), transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 408px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-3); padding: 32px 30px 22px;
}
.login-brand { text-align: center; margin-bottom: 22px; }
.login-brand h1 { font-size: 23px; letter-spacing: -0.02em; font-weight: 800; }
.login-brand p { color: var(--text-2); font-size: 13.5px; margin-top: 5px; }
.login-submit { width: 100%; justify-content: center; margin-top: 18px; padding: 11px; font-size: 14px; }
.login-div { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; color: var(--text-3); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.login-div::before, .login-div::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-accounts { display: flex; flex-direction: column; gap: 7px; }
.login-acc {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer; transition: border-color .14s, background .14s, box-shadow .14s; font: inherit;
}
.login-acc:hover { background: var(--surface-2); border-color: var(--border-strong); }
.login-acc.sel { border-color: var(--primary); background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--primary); }
.login-acc-av { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; }
.login-acc-txt { flex: 1; min-width: 0; line-height: 1.25; }
.login-acc-name { display: block; font-size: 13px; font-weight: 700; }
.login-acc-role { display: block; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.login-acc-go { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--text-3); transition: background .14s, color .14s; }
.login-acc-go:hover { background: color-mix(in oklab, var(--primary) 16%, transparent); color: var(--primary-strong); }
.login-acc.sel .login-acc-go { color: var(--primary-strong); }
.login-foot { text-align: center; color: var(--text-3); font-size: 11.5px; margin-top: 20px; }
.login-pwrow { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.login-forgot { background: none; border: 0; padding: 0; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--primary-strong); cursor: pointer; margin-top: 14px; }
.login-forgot:hover { text-decoration: underline; }
.login-back { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; background: none; border: 0; padding: 10px; margin-top: 14px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.login-back:hover { color: var(--text); }
.login-sent { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border-radius: var(--r-md); background: var(--positif-tint); color: var(--positif); font-size: 13px; }

/* ---------- Wallboard « En direct » (superviseur) ---------- */
.wb-sec-label { display: flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 2px 0 11px; }
.wb-sec-label svg { color: var(--text-3); }
.wb-grid-full { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.wb-cols { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: var(--gap); align-items: start; }
.wb-feed-card { display: flex; flex-direction: column; max-height: 560px; }
.wb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; align-content: start; }
.wb-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 11px 13px; display: flex; align-items: center; gap: 11px;
  transition: border-color .3s, box-shadow .14s, transform .14s; cursor: pointer;
}
.wb-tile:hover { border-color: var(--primary); box-shadow: var(--sh-1); transform: translateY(-1px); }
.wb-av { position: relative; flex: 0 0 auto; }
.wb-dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 99px; border: 2px solid var(--surface); }
.wb-body { flex: 1; min-width: 0; }
.wb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-timer { font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.wb-sub { display: flex; align-items: center; gap: 7px; margin-top: 4px; min-width: 0; }
.wb-stat { flex: 0 0 auto; }
.wb-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; min-width: 0; font-size: 11.5px; color: var(--text-2); }
.wb-prospect { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 600; }
.wb-ia { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); font-size: 10px; font-weight: 600; }
.wb-feed { overflow-y: auto; padding: 4px 6px 6px; }
.wb-feed-row { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-bottom: 1px solid var(--border); animation: wb-slide .35s ease; }
.wb-feed-row:last-child { border-bottom: 0; }
.wb-feed-ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: 0 0 auto; }
@keyframes wb-slide { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .page .wb-cols { grid-template-columns: 1fr; }
  .page .wb-grid { grid-template-columns: 1fr; }
  .wb-feed-card { max-height: 360px; }
}

/* workspace identity pill in sidebar */
.ws-pill { margin: 0 14px 8px; padding: 7px 11px; border-radius: var(--r-sm); display: flex; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 700; }

/* perf bars — valeur au survol */
.perf-bar::after {
  content: attr(data-v);
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums;
  opacity: 0; transition: opacity .12s; pointer-events: none; white-space: nowrap;
}
.perf-bar:hover::after { opacity: 1; }
.perf-bar:hover { filter: brightness(1.08); }

/* rerank fade (changement de période) */
@media (prefers-reduced-motion: no-preference) {
  tbody.rerank { animation: rerank .35s ease both; }
  @keyframes rerank { from { opacity: .25; } to { opacity: 1; } }
}

/* back bar (after KPI / insight redirection) */
.backbar { padding: 10px 30px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 20; display: flex; justify-content: flex-end; }

/* dispatch split columns — compact list rows */
.disp-list { display: flex; flex-direction: column; max-height: 620px; overflow-y: auto; }
.disp-item { padding: 12px 15px; border-bottom: 1px solid var(--border); transition: background .12s; }
.disp-item:last-child { border-bottom: 0; }
.disp-item:hover { background: var(--surface-2); }
.disp-empty { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 44px 20px; color: var(--text-3); text-align: center; }
.disp-col-head { display: flex; align-items: center; gap: 9px; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.disp-col-head .dot-l { width: 9px; height: 9px; border-radius: 99px; flex: 0 0 auto; }

/* Dispatch sur mobile : cartes d'intention et boutons compacts */
@media (max-width: 600px) {
  .disp-item { padding: 9px 11px; }
  .disp-col-head { padding: 10px 12px; }
  .disp-list { max-height: none; }
  .disp-item .btn { min-height: 32px; }
  .disp-item .btn-sm { padding: 4px 9px; font-size: 12px; }
  .disp-item .btn-sm svg { width: 12px; height: 12px; }
}

/* Dashboard sur mobile : graphes (donuts) plus petits */
@media (max-width: 600px) {
  svg[width="180"] { width: 130px !important; height: 130px !important; }
  svg[width="150"] { width: 120px !important; height: 120px !important; }
  svg[width="88"] { width: 74px !important; height: 74px !important; }
}

/* ============================================================
   Responsive — mobile & tablette
   ============================================================ */
.menu-btn { display: none; }
.nav-overlay { display: none; }

/* Tablette : grilles allégées */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .page { padding: 20px 22px 56px; }
}

/* Mobile / petite tablette : sidebar en tiroir */
@media (max-width: 768px) {
  body { overflow-x: hidden; }                 /* le tiroir hors-écran ne crée pas de scroll horizontal */
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 60; width: min(290px, 86vw);
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--sh-3);
  }
  .sidebar.open { transform: translateX(0); }
  .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(40,34,28,.4); z-index: 55; }
  .main { width: 100%; min-width: 0; }
  .topbar { padding: 0 14px; gap: 10px; height: 56px; flex-basis: 56px; }
  .topbar-search { display: none; }
  .topbar .menu-btn { display: none; }
  .topbar-brand { display: flex; align-items: center; gap: 9px; cursor: pointer; }
  .topbar-brand-txt { line-height: 1.15; }
  .topbar-brand-txt b { display: block; font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
  .topbar-brand-txt span { display: block; font-size: 11px; color: var(--text-3); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hide-mobile { display: none !important; }
  .page { padding: 16px 14px 64px; }
  .page-head { flex-wrap: wrap; gap: 10px; }
  .page-title { font-size: 21px; }
  .page-title-ico { width: 38px; height: 38px; }
  .page-sub { font-size: 12.5px; }
  .page-head-actions { margin-left: 0; flex-wrap: wrap; width: 100%; }

  /* Toute grille multi-colonnes passe en 1 colonne — sauf .kpi-grid (géré à part)
     et les grilles auto-fit/auto-fill, qui se ré-agencent déjà toutes seules. */
  .page div[style*="grid-template-columns"]:not(.kpi-grid):not([style*="auto-fit"]):not([style*="auto-fill"]) {
    grid-template-columns: 1fr !important;
  }
  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Tables larges : la carte qui contient un tableau scrolle horizontalement
     au lieu de déborder de l'écran (en-tête et lignes restent alignés). */
  .page .card:has(> .tbl) { overflow-x: auto; }
  /* Panneaux « sticky » (filtres objections, asides) : statiques sur mobile —
     sinon ils restent par-dessus le contenu quand on scrolle. */
  .obj-tree-card { position: static !important; }
  .kpi-grid { gap: 10px; }
  .kpi, .kpi-card { padding: 11px 12px; border-radius: var(--r-md); }
  .kpi-ico { width: 26px; height: 26px; margin-bottom: 8px; }
  .kpi-ico svg { width: 15px; height: 15px; }
  .kpi-val { font-size: 19px; }
  .kpi-suffix { font-size: 12px; }
  .kpi-label { font-size: 11px; margin-top: 3px; }
  .kpi-sub { font-size: 10.5px; margin-top: 2px; }
  .kpi-delta { font-size: 10.5px; margin-top: 5px; }
  .row.between { flex-wrap: wrap; }
  .vs-pills { flex-wrap: wrap; }
  /* Barre d'outils Reporting (mobile) : on ne garde que le filtre durée.
     « Par agent » (inutile en mobile) + actions d'impression/export → masqués ici
     (les actions vivent dans la carte preview .rpt-mobile-cta, plus de doublon). */
  .rpt-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .rpt-tb-left, .rpt-tb-right { width: 100%; gap: 10px; }
  .rpt-tb-left > .seg, .rpt-tb-left > .select { display: none; } /* vue d'ensemble/par agent + sélecteur agent */
  .rpt-tb-right > .seg { width: 100%; }                          /* durée = plein largeur */
  .rpt-actions { display: none; }                                /* déplacé dans la carte preview */
  /* segmented controls : défilement horizontal, JAMAIS de wrap */
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: 0 0 auto; white-space: nowrap; }
  /* onglets pill : pleine largeur répartie (grille), pas de scroll */
  .page-head-actions { width: 100%; }
  .page-head-actions .tabs { display: flex; flex-wrap: wrap; width: 100%; gap: 4px; }
  .page-head-actions .tabs button { flex: 1 1 44%; white-space: nowrap; justify-content: center; }

  /* Tableaux larges : défilement horizontal contenu dans la carte */
  .card { overflow-x: auto; }
  .tbl { min-width: 560px; }

  /* Cibles tactiles plus généreuses */
  .btn, .icon-btn, .seg button { min-height: 38px; }

  /* Tiroirs latéraux : pleine largeur lisible */
  .c-drawer { width: min(440px, 100vw); }
}

/* Téléphone étroit : grilles en 1 colonne (mais KPI gardent 2 colonnes pour rester compacts) */
@media (max-width: 460px) {
  .launcher-cards { grid-template-columns: 1fr !important; }
  .page-head-actions > .btn, .page-head-actions > .seg, .page-head-actions > .period-filter { width: 100%; }
  .page-head-actions > .btn { justify-content: center; }
}

/* ---------- Multi-sites : chips, stats, agenda, filtres ---------- */
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  border-radius: 99px; padding: 6px 13px; font-size: 12.5px; font-weight: 600; transition: all .14s; white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); }
.chip-on { background: var(--primary-tint); border-color: color-mix(in oklab, var(--primary) 40%, transparent); color: var(--primary-strong); }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap); }
.stat-cell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; box-shadow: var(--sh-1); }
.stat-k { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; }
.stat-v { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; margin-top: 6px; }
.stat-s { font-size: 11.5px; margin-top: 3px; }

.filter-select { display: inline-flex; flex-direction: column; gap: 4px; }
.filter-select-label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.filter-select select {
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-sm);
  padding: 7px 11px; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--text); outline: none; cursor: pointer; min-width: 160px;
}
.filter-select select:focus { border-color: var(--primary); }

.agenda-grid { display: grid; gap: 14px; }
.agenda-col { min-width: 0; }
.agenda-day { font-size: 13px; font-weight: 700; color: var(--text); padding: 0 2px 10px; border-bottom: 2px solid var(--border); margin-bottom: 10px; }
.agenda-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; }
.agenda-card:hover { background: var(--surface-3); }

/* ---------- Sélecteur de site (sidebar) ---------- */
.site-switch { position: relative; margin: 4px 12px 10px; }
.site-switch-btn {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md);
  cursor: pointer; transition: all .14s; text-align: left;
}
.site-switch-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.site-switch-ico { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.site-switch-name { font-size: 13px; font-weight: 700; line-height: 1.15; }
.site-switch-sub { font-size: 10.5px; color: var(--text-3); }
.site-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--sh-3, 0 12px 32px rgba(0,0,0,.16)); padding: 6px; max-height: 70vh; overflow: auto;
}
.site-menu-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); padding: 8px 10px 4px; }
.site-opt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: transparent; border-radius: var(--r-sm); cursor: pointer; text-align: left; transition: background .12s; }
.site-opt:hover { background: var(--surface-2); }
.site-opt.active { background: var(--primary-tint); }
.site-opt-name { font-size: 12.5px; font-weight: 600; }
.site-opt-sub { font-size: 10.5px; color: var(--text-3); }
.site-menu-div { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- Objections explorer ---------- */
.badge-int-forte { background: #efe7e1; color: #8a5a3c; }
.obj-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .obj-layout { grid-template-columns: 1fr; } }
.obj-back-mobile { display: none; }
@media (max-width: 768px) {
  /* drill-in : liste des groupes seule par défaut ; détail seul une fois un groupe ouvert */
  .obj-detail-mode .obj-tree-card { display: none; }
  .obj-layout:not(.obj-detail-mode) .obj-detail-wrap { display: none; }
  .obj-back-mobile {
    display: flex; align-items: center; gap: 5px; width: 100%;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 11px 14px; margin-bottom: 12px; font: inherit; font-size: 12.5px; font-weight: 700;
    color: var(--primary-strong); cursor: pointer;
  }
}

.obj-sort { border: 0; background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 99px; cursor: pointer; transition: all .12s; }
.obj-sort:hover { background: var(--surface-2); }
.obj-sort.active { background: var(--primary-tint); color: var(--primary-strong); font-weight: 700; }

.obj-row { padding: 12px 14px; cursor: pointer; transition: background .12s; }
.obj-row:hover { background: var(--surface-2); }
.obj-row.sel { background: var(--primary-tint); box-shadow: inset 3px 0 0 var(--primary); }
.obj-count { font-size: 13px; font-weight: 700; min-width: 26px; text-align: right; color: var(--text-2); }
.obj-exp { border: 0; background: transparent; cursor: pointer; padding: 2px; color: var(--text-3); display: grid; place-items: center; border-radius: 5px; flex: 0 0 auto; }
.obj-exp:hover { background: var(--surface-3); color: var(--text); }
.obj-sub { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 40px; cursor: pointer; transition: background .12s; }
.obj-sub:hover { background: var(--surface-3); }
.obj-sub.sel { background: var(--primary-tint); box-shadow: inset 3px 0 0 var(--primary); }

.obj-grouptab { font-size: 13px; font-weight: 800; letter-spacing: .03em; padding: 7px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); }
.obj-chart-title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; }
.obj-flabel { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 9px; }
.obj-chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 99px; cursor: pointer; transition: all .12s; }
.obj-chip:hover { border-color: var(--primary); }
.obj-chip.active { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-strong); font-weight: 700; }

.obj-inst { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 15px 17px; box-shadow: var(--sh-1); }
.obj-inst:hover { border-color: var(--border-strong); }
.obj-state { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; flex: 0 0 auto; }
.obj-gtag { font-size: 10px; font-weight: 800; letter-spacing: .04em; color: var(--text-3); background: var(--autres-tint); padding: 3px 9px; border-radius: 99px; }
.obj-quote { display: flex; gap: 11px; align-items: flex-start; background: var(--repondeur-tint); border-radius: var(--r-md); padding: 13px 15px; font-size: 13.5px; line-height: 1.5; }
.obj-detail-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px 20px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--border); }
.obj-detail-row > div { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.obj-dk { font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }

/* ---------- Explorateur de données ---------- */
.ex-tbl th { vertical-align: top; padding-top: 9px; padding-bottom: 9px; }
.ex-tbl td { font-size: 12.5px; }
.ex-tbl tbody tr:hover { background: var(--surface-2); }
.ex-tbl tr.ex-sel { background: var(--primary-tint); }

/* Profil qualité */
.ex-prof-row { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; transition: background .12s; text-align: left; }
.ex-prof-row:hover { background: var(--surface-2); }
.ex-prof-row.active { background: var(--primary-tint); }
.ex-chip-info { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 5px 11px; border-radius: 99px; }
.ex-topval { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: transparent; padding: 3px 4px; border-radius: var(--r-sm); cursor: pointer; transition: background .12s; }
.ex-topval:hover { background: var(--surface-2); }
.da-tbl-list thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }

/* ---------- Datamining ---------- */
.dm-layout { display: grid; grid-template-columns: 1fr 300px; gap: var(--gap); align-items: start; }
.dm-insights { position: sticky; top: 8px; }
@media (max-width: 1100px) { .dm-layout { grid-template-columns: 1fr; } .dm-insights { position: static; } }

/* ---------- Contacts CRM ---------- */
.c-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 800; letter-spacing: .03em; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.c-dot { width: 5px; height: 5px; border-radius: 99px; flex: 0 0 auto; display: inline-block; }
.c-row { padding: 13px 15px; cursor: pointer;
  display: flex; align-items: center; gap: 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-1); transition: border-color .14s, box-shadow .14s, transform .14s;
}
.c-row:hover { border-color: var(--border-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.c-ava { width: 38px; height: 38px; border-radius: 99px; display: grid; place-items: center; font-weight: 700; font-size: 13.5px; flex: 0 0 auto; }
.c-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.c-line1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.c-name { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.c-line2 { display: flex; align-items: center; gap: 7px; font-size: 12.5px; line-height: 1.4; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-line2 .mono { font-size: 13px; color: var(--text); flex: 0 0 auto; }
.c-sep { color: var(--border-strong); flex: 0 0 auto; }
.c-score { font-weight: 800; font-size: 19px; flex: 0 0 auto; min-width: 28px; text-align: right; line-height: 1; }
/* Mobile : on masque les tags secondaires de la ligne 1 (gardés dans la fiche) et on resserre */
@media (max-width: 560px) {
  .c-row { padding: 11px 13px; gap: 11px; }
  .c-line1 .c-tag:nth-of-type(n+2) { display: none; }
  .c-line2 { font-size: 12px; }
}
.c-sort { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: var(--r-sm); cursor: pointer; transition: all .12s; }
.c-sort:hover { border-color: var(--primary); }
.c-sort.active { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-strong); font-weight: 700; }
.c-drawer-ovl { position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 60; }
.c-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 92vw); background: var(--surface); box-shadow: -8px 0 30px rgba(0,0,0,.18); z-index: 61; display: flex; flex-direction: column; animation: c-slide .2s ease; }
@keyframes c-slide { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* ---------- Actions (Kanban suggestions / tâches) ---------- */
.act-axis-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); min-width: 74px; }
.act-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.act-col { flex: 0 0 308px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xl); display: flex; flex-direction: column; max-height: calc(100vh / var(--zoom,1) - 220px); }
.act-col-wide { flex-basis: 360px; }
.act-col-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; font-weight: 700; font-size: 13.5px; position: sticky; top: 0; background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; z-index: 1; }
.act-count { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--text-2); background: var(--surface-3); padding: 1px 9px; border-radius: 99px; }
.act-col-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.act-empty { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 22px 0; }
.act-group { display: flex; flex-direction: column; gap: 10px; }
.act-group + .act-group { margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--border); }
.act-group-head { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.act-group-n { margin-left: auto; font-weight: 700; color: var(--text-2); }
.act-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 14px 15px; transition: border-color .14s, box-shadow .14s; }
.act-card:hover { border-color: var(--border-strong); box-shadow: var(--sh-2); }
.act-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.act-dot { width: 5px; height: 5px; border-radius: 99px; }
.act-title { font-size: 13.5px; font-weight: 600; line-height: 1.4; text-wrap: pretty; }
.act-meta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.act-cta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--primary-strong); }
.act-link { border: 0; background: none; padding: 0; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; }
.act-link:hover { text-decoration: underline; }
.act-note { font-size: 12px; color: var(--text-2); line-height: 1.45; margin-top: 6px; white-space: pre-wrap; text-wrap: pretty; background: var(--surface-2); border-radius: var(--r-md); padding: 7px 10px; }
.act-card-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--border); }
.act-move { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text-2); font-size: 11.5px; font-weight: 700; cursor: pointer; }
.act-move select { border: 0; background: none; font: inherit; color: inherit; cursor: pointer; padding: 0; outline: none; }
.act-iconbtn { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; color: var(--text-3); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.act-iconbtn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.act-add { margin-left: 6px; width: 26px; height: 26px; color: var(--text-2); }
.act-card { cursor: pointer; }
.act-accent { display: block; width: 30px; height: 4px; border-radius: 99px; margin-bottom: 11px; }
.act-col-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 9px; margin-top: 2px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: none; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.act-col-add:hover { background: var(--surface); border-color: var(--primary); color: var(--primary-strong); }
.act-col-new { flex: 0 0 230px; align-self: flex-start; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 64px; padding: 16px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-xl); background: none; color: var(--text-3); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.act-col-new:hover { background: var(--surface-2); border-color: var(--primary); color: var(--primary-strong); }
.act-col-edit { width: 24px; height: 24px; opacity: 0; transition: opacity .12s; }
.act-col:hover .act-col-edit { opacity: 1; }
.act-icon-pick { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); cursor: pointer; transition: border-color .12s, color .12s; }

/* ---------- Barre d'onglets mobile (bottom nav, Android-style) ---------- */
/* Cartes mobiles (défauts AVANT le media query pour que l'override mobile l'emporte) */
.sc-jcards { display: none; flex-direction: column; gap: 9px; padding: 4px 0; }
.sc-jcard { display: flex; flex-direction: column; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 11px 13px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.sc-jcard:active { border-color: var(--primary); box-shadow: var(--sh-2); }
.rec-cards { display: none; flex-direction: column; gap: 9px; }
.rec-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 12px 14px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.rec-card:active { border-color: var(--primary); box-shadow: var(--sh-2); }

.mobile-tabbar { display: none; }
@media (max-width: 768px) {
  .mobile-tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: color-mix(in oklab, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  }
  .mtab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0;
    background: none; border: 0; cursor: pointer; padding: 5px 2px; border-radius: var(--r-md);
    color: var(--text-3); font: inherit; font-size: 10.5px; font-weight: 600; min-height: 48px;
    transition: color .12s, background .12s;
  }
  .mtab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mtab.active, .mtab.active svg { color: var(--primary-strong); }
  .mtab:active { background: var(--surface-2); }
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .topbar .menu-btn { display: none; }
  .hide-mobile-kpi { display: none !important; }
  /* Enregistrements : table → cartes sur mobile */
  .rec-table-card { display: none; }
  .rec-cards { display: flex; }
  /* Journal commerciaux : table → cartes sur mobile */
  .sc-jtable { display: none; }
  .sc-jcards { display: flex; }
}
.act-card.act-dragging { opacity: .45; }
.act-col-over { border-color: var(--primary); box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--primary) 35%, transparent); }
.act-hint { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); margin-bottom: 10px; }
.act-hint svg { color: var(--accent); flex: 0 0 auto; }
.act-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.act-cal-row:hover { border-color: var(--border-strong); background: var(--surface-2); }

@media (max-width: 768px) {
  .act-col { flex-basis: 86vw; max-height: none; }
  .act-col-wide { flex-basis: 90vw; }
  .act-axis-label { min-width: 0; width: 100%; }
  .act-form-grid { grid-template-columns: 1fr; }
  .act-move { padding: 7px 10px; font-size: 12.5px; }
  .act-iconbtn { width: 34px; height: 34px; }
}
.wip-notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--argumente-tint); border: 1px solid var(--argumente);
  color: oklch(0.45 0.09 70); border-radius: var(--r-md);
  padding: 11px 14px; font-size: 13px; line-height: 1.5; margin-bottom: var(--gap); text-wrap: pretty;
}
.wip-notice b { font-weight: 700; }
.wip-notice > svg { flex: 0 0 auto; margin-top: 1px; color: var(--argumente); }
/* En direct (assistant d'appel) */
@keyframes live-blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.live-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 380px; padding: 30px; background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 11px, var(--surface) 11px, var(--surface) 22px); }
.live-code { margin-top: 14px; font-family: var(--mono, ui-monospace, monospace); font-size: 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); padding: 6px 11px; border-radius: var(--r-sm); }

/* ---------- Fiche client 360° ---------- */
.cf-brief-h { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.cf-brief-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cf-brief-ul { margin: 0; padding-left: 16px; display: flex; flex-direction: column; gap: 4px; }
.cf-brief-ul li { font-size: 12px; color: var(--text-2); line-height: 1.4; text-wrap: pretty; }
.cf-timeline { display: flex; flex-direction: column; gap: 0; }
.cf-ev { display: grid; grid-template-columns: 28px 1fr; gap: 11px; position: relative; padding-bottom: 14px; }
.cf-ev::before { content: ''; position: absolute; left: 13.5px; top: 26px; bottom: -2px; width: 2px; background: var(--border); }
.cf-ev:last-child { padding-bottom: 0; }
.cf-ev:last-child::before { display: none; }
.cf-ev-dot { width: 28px; height: 28px; border-radius: 99px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; z-index: 1; }
.cf-ev-body { border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 12px; background: var(--surface-2); }
/* enregistrement dépliable (page 360) */
/* enregistrements — maître-détail (page 360) */
.cf-rec-ix { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 99px; background: var(--primary-tint); color: var(--primary-strong); font-weight: 800; font-size: 12px; display: grid; place-items: center; }
.cf-master { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.cf-master-list { display: flex; flex-direction: column; gap: 8px; max-height: 740px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); padding: 9px; }
.cf-rec-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 11px 12px; cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.cf-rec-row:hover { border-color: var(--border-strong); }
.cf-rec-row.active { border-color: var(--primary); background: var(--primary-tint); box-shadow: inset 2.5px 0 0 var(--primary); }
.cf-rec-row-main { flex: 1; min-width: 0; }
.cf-rec-row-title { font-weight: 700; font-size: 12.5px; }
.cf-rec-row-q { font-size: 11.5px; color: var(--text-2); margin-top: 5px; font-style: italic; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cf-master-detail { min-width: 0; }
.cf-detail, .cf-global { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.cf-detail-head { padding: 13px 14px; border-bottom: 1px solid var(--border); }
.cf-detail-player { padding: 13px 14px 0; }
.cf-detail-scroll { max-height: 580px; overflow-y: auto; }
.cf-hl-note { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-tint); border-radius: 99px; padding: 5px 11px; }
.cf-hl-tag { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.cf-tline-hl .cf-tline-txt { background: var(--accent-tint); border-radius: var(--r-sm); padding: 5px 9px; box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 24%, transparent); font-weight: 600; }
/* résumé global */
.cf-global { padding: 15px 16px; }
.cf-global-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13.5px; margin-bottom: 13px; }
.cf-global-kpis { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.cf-global-kpi { flex: 1 1 118px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.cf-global-kpi > span:first-child { font-size: 23px; font-weight: 800; color: var(--primary-strong); line-height: 1; font-variant-numeric: tabular-nums; }
.cf-global-kpi > span:first-child small { font-size: 12px; color: var(--text-3); font-weight: 700; }
.cf-global-kpi > span:last-child { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.cf-global-kpi-txt { font-size: 13px !important; color: var(--text) !important; font-weight: 700; line-height: 1.25 !important; }
.cf-global-sub { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 9px; }
.cf-global-moment { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 11px; cursor: pointer; transition: border-color .12s, background .12s; }
.cf-global-moment:hover { border-color: var(--primary); background: var(--primary-tint); }
.cf-global-q { font-size: 12.5px; font-weight: 600; font-style: italic; line-height: 1.45; color: var(--text); text-wrap: pretty; }
.cf-global-q::before { content: '\00ab\00a0'; color: var(--primary-strong); }
.cf-global-q::after { content: '\00a0\00bb'; color: var(--primary-strong); }
.cf-back-mobile { display: none; }
@media (max-width: 860px) {
  .cf-master { grid-template-columns: 1fr; gap: 0; }
  .cf-master-list { max-height: none; overflow: visible; border: 0; background: transparent; padding: 0; }
  /* drill-in : liste seule par défaut, détail seul une fois un appel ouvert */
  .cf-master-sel .cf-master-list { display: none; }
  .cf-master:not(.cf-master-sel) .cf-master-detail { display: none; }
  .cf-rec-row { padding: 13px 13px; min-height: 56px; }
  .cf-back-mobile {
    display: flex; align-items: center; gap: 5px; width: 100%;
    background: var(--surface-2); border: 0; border-bottom: 1px solid var(--border);
    padding: 12px 14px; font: inherit; font-size: 12.5px; font-weight: 700;
    color: var(--primary-strong); cursor: pointer;
  }
  .cf-head-btn, .cf-head-hint { display: none; }
  .cf-detail-scroll { max-height: none; }
}
/* TabList Fluent 2 : pas de séparateurs, indicateur brand arrondi sous l'onglet actif */
.cf-rec-tabs { display: flex; align-items: center; gap: 2px; border-top: 1px solid var(--border); background: var(--surface); padding: 3px 9px 0; }
.cf-tab { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 10px 10px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: none; border: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; cursor: pointer; transition: color .12s, background .12s; }
.cf-tab:hover { color: var(--text); background: var(--surface-2); }
.cf-tab::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: transparent; transition: background .12s; }
.cf-tab:hover::after { background: var(--border-strong); }
.cf-tab.active { color: var(--primary-strong); font-weight: 700; }
.cf-tab.active::after { background: var(--primary); }
.cf-tab-spacer { flex: 1 1 auto; }
.cf-tab-full { flex: 0 0 auto; margin: 4px 0; }
.cf-rec-panel { padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
@media (max-width: 600px) { .cf-rec-tabs { flex-wrap: wrap; padding-bottom: 4px; } .cf-tab-spacer { display: none; } .cf-tab-full { margin-left: auto; } }
@media (max-width: 600px) { .cf-brief-grid { grid-template-columns: 1fr; } }

/* ---------- Rapport agents (imprimable) ---------- */
.rpt-sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 30px 34px; box-shadow: var(--sh-1); max-width: 1100px; margin: 0 auto; }

/* Preview mobile : carte d'accès — cachée sur desktop (le document s'affiche directement) */
.rpt-mobile-cta { display: none; }
.rpt-mcta-head { display: flex; align-items: center; gap: 12px; }
.rpt-mcta-ico { width: 40px; height: 40px; flex: 0 0 auto; border-radius: var(--r-md); display: grid; place-items: center; background: var(--primary-tint); color: var(--primary-strong); }
.rpt-mcta-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.rpt-mcta-sub { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 1px; }
.rpt-mcta-note { font-size: 12.5px; color: var(--text-2); margin: 12px 0 14px; text-wrap: pretty; line-height: 1.45; }
.rpt-mcta-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rpt-mcta-actions .btn { width: 100%; justify-content: center; }
.rpt-mcta-actions .rpt-mcta-fs, .rpt-mcta-actions .rpt-mcta-csv { grid-column: 1 / -1; } /* plein largeur ; les 2 boutons d'impression restent côte à côte */
.rpt-mcta-select { width: 100%; margin: 12px 0; }
.rpt-mobile-cta + .rpt-mobile-cta { margin-top: 12px; } /* espace entre la carte vue d'ensemble et la carte fiche agent */
/* Plein écran mobile */
.rpt-fs { position: fixed; inset: 0; z-index: 200; background: var(--bg, var(--surface-2)); display: flex; flex-direction: column; }
.rpt-fs-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px calc(10px); padding-top: calc(10px + env(safe-area-inset-top, 0px)); background: var(--surface); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.rpt-fs-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Contrôle de zoom du plein écran (−/%/+) */
.rpt-fs-zoomctl { display: flex; align-items: center; flex: 1; justify-content: center; }
.rpt-fs-zoomctl button { border: 1px solid var(--border); background: var(--surface); height: 32px; min-width: 36px; display: grid; place-items: center; font-size: 17px; font-weight: 700; line-height: 1; color: var(--text-2); cursor: pointer; }
.rpt-fs-zoomctl button:disabled { opacity: .4; cursor: default; }
.rpt-fs-zoomctl button:first-child { border-radius: 8px 0 0 8px; }
.rpt-fs-zoomctl button:last-child { border-radius: 0 8px 8px 0; }
.rpt-fs-zoomctl button:not(:first-child) { border-left: 0; }
.rpt-fs-zoomctl .rpt-fs-zoomval { font-size: 12px; font-weight: 700; min-width: 56px; font-variant-numeric: tabular-nums; color: var(--text); }
.rpt-fs-zoom { width: 720px; margin: 0 auto; }
.rpt-fs-scroll { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; padding: 14px; }
.rpt-fs-scroll .rpt-sheet { min-width: 720px; }
.rpt-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 18px; border-bottom: 2px solid var(--text); margin-bottom: 22px; }
.rpt-title { font-size: 23px; font-weight: 800; letter-spacing: -.01em; }
.rpt-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.rpt-brand { font-size: 22px; font-weight: 800; color: var(--primary-strong); text-align: right; line-height: 1; }
.rpt-brand span { display: block; font-size: 10px; font-weight: 600; color: var(--text-3); letter-spacing: .04em; margin-top: 3px; }
.rpt-section-label { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 22px 0 11px; }
.rpt-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.rpt-kpi { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 13px; background: var(--surface-2); }
.rpt-kpi-v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rpt-kpi-l { font-size: 11px; color: var(--text-2); margin-top: 4px; font-weight: 600; }
.rpt-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 800; margin-top: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Records du centre */
.rpt-records { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rpt-record { border: 1px solid var(--border); border-radius: var(--r-md); padding: 11px 13px; background: var(--surface-2); }
.rpt-record-v { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--primary-strong); }
.rpt-record-l { font-size: 11px; font-weight: 700; margin-top: 4px; color: var(--text-2); }
.rpt-record-d { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
@media (max-width: 900px) { .rpt-records { grid-template-columns: repeat(2, 1fr); } }
/* Records en liste (vue d'ensemble) */
.rpt-rec-list { display: flex; flex-direction: column; gap: 8px; }
.rpt-rec-row { display: flex; align-items: baseline; gap: 12px; border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 12px; background: var(--surface-2); }
.rpt-rec-v { font-size: 17px; font-weight: 800; color: var(--primary-strong); flex: 0 0 auto; min-width: 64px; }
.rpt-rec-txt { display: flex; flex-direction: column; min-width: 0; }
.rpt-rec-txt b { font-size: 12px; font-weight: 700; color: var(--text-2); }
.rpt-rec-txt span { font-size: 10.5px; }
/* Mouvement au classement + rang héro de la fiche agent */
.rpt-rankmove { display: inline-flex; align-items: center; gap: 1px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.rpt-rank-hero { text-align: center; border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 20px; background: var(--surface-2); }
.rpt-rank-hero-v { font-size: 30px; font-weight: 800; line-height: 1.05; color: var(--primary-strong); font-variant-numeric: tabular-nums; }
.rpt-rank-hero-tot { font-size: 14px; font-weight: 700; color: var(--text-3); }
.rpt-rank-hero-l { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-top: 3px; }
.rpt-rank-hero-mv { font-size: 11px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rpt-table th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); padding: 9px 10px; border-bottom: 1.5px solid var(--border-strong); }
.rpt-table th.num, .rpt-table td.num { text-align: right; }
.rpt-table td { padding: 10px; border-bottom: 1px solid var(--border); }
.rpt-table tfoot td { border-top: 1.5px solid var(--border-strong); border-bottom: none; background: var(--surface-2); }
.rpt-badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 99px; border: 1px solid; background: transparent; font-variant-numeric: tabular-nums; }
.rpt-tag { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface-3); border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
.rpt-tag b { color: var(--repondeur); }
.rpt-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); line-height: 1.55; text-wrap: pretty; }
@media (max-width: 900px) { .rpt-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) {
  .rpt-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .rpt-kpi { padding: 10px 11px; }
  .rpt-kpi-v { font-size: 17px; }
  .rpt-sheet { padding: 16px 14px !important; }
  .rpt-section-label { margin: 18px 0 9px; }
  /* tableaux du reporting : scroll horizontal propre sur mobile */
  .rpt-sheet .rpt-table { min-width: 560px; }
  .rpt-agent-grid { gap: 16px; }
  /* Mobile : on remplace le document détaillé par une preview + accès plein écran/impression */
  .rpt-mobile-cta { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 16px; }
  .rpt-body { display: none; }
}

/* Impression : ne garder que la feuille de rapport */
/* Mise en page fiche agent (radar + tables) */
.rpt-agent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 760px) { .rpt-agent-grid { grid-template-columns: 1fr; } }
.print-only { display: none; }

/* Impression : ne garder que la/les feuille(s) de rapport */
@media print {
  /* marge 0 → le navigateur ne peut plus imprimer URL / titre / date dans les marges */
  @page { margin: 0; }
  .sidebar, .topbar, .nav-overlay, .breadcrumb, .page-head, .no-print, .toast-wrap { display: none !important; }
  /* neutralise les animations d'entrée (sinon opacity:0 → page blanche en PDF) */
  .app, .main, .content, .page, .page-fade, .report-page, .rpt-sheet {
    display: block !important; margin: 0 !important; padding: 0 !important;
    height: auto !important; overflow: visible !important;
    opacity: 1 !important; animation: none !important; transform: none !important;
  }
  body, .app, .main { background: #fff !important; }
  /* force l'impression des couleurs de fond (barres du graphique horaire, pastilles
     des points d'attention, swatches de légende) — sinon le navigateur les supprime en PDF */
  .rpt-sheet, .rpt-sheet * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  /* la marge visuelle est reportée ici (padding) puisque @page est à 0 */
  .rpt-sheet { border: none; box-shadow: none; border-radius: 0; padding: 12mm 14mm !important; max-width: none; }
  /* saut de page contrôlé : la section démarre une nouvelle page AVEC une marge haute
     (sinon, @page étant à 0, le contenu serait collé au bord du papier → crop à l'impression) */
  .rpt-break { break-before: page; padding-top: 12mm; }
  /* tableau long coupé par la page : le thead se répète sur chaque page imprimée →
     ce padding ajoute une marge haute à CHAQUE reprise du tableau (anti-crop) */
  .rpt-table thead th { padding-top: 9mm; }
  .rpt-kpi, .rpt-record, .rpt-rec-row, .rpt-rank-hero, .rpt-table tfoot td { background: #fff !important; }
  .rpt-table tr { break-inside: avoid; }
  .rpt-table thead { display: table-header-group; }
  .rpt-table tfoot { display: table-footer-group; }
  .rpt-section-label { break-after: avoid; }
  .rpt-kpis, .rpt-records, .rpt-agent-grid, .rpt-sheet .row, .rpt-foot { break-inside: avoid; }
  .rpt-head { break-after: avoid; }
  /* Vue d'ensemble : la grille 2-col s'écoule en colonne unique à l'impression
     (sinon, trop haute, elle est rognée ou poussée à la page suivante) */
  .rpt-ov { display: block !important; break-inside: auto !important; }
  .rpt-ov > div { break-inside: auto; margin-bottom: 6mm; }
  .rpt-alert, .rpt-rec-row { break-inside: avoid; }
  /* « Records du centre » insécable + padding-top interne : s'il bascule en haut
     d'une page (où @page=0 → bord du papier), le padding évite le rognage */
  .rpt-rec-block { break-inside: avoid; page-break-inside: avoid; padding-top: 12mm; }
  .rpt-rec-list { break-inside: avoid; }
  .rpt-ov .rpt-section-label { break-after: avoid; }

  /* Fiche agent : tout tenir sur UNE seule page (compactage à l'impression) */
  .rpt-sheet--agent { padding: 9mm 12mm !important; page-break-inside: avoid; break-inside: avoid; page-break-after: avoid; }
  .rpt-sheet--agent .rpt-head { padding-bottom: 11px !important; margin-bottom: 13px !important; }
  .rpt-sheet--agent .rpt-section-label { margin: 12px 0 6px !important; }
  .rpt-sheet--agent .rpt-kpis { gap: 6px !important; }
  .rpt-sheet--agent .rpt-kpi { padding: 8px 10px !important; }
  .rpt-sheet--agent .rpt-kpi-v { font-size: 16px !important; }
  .rpt-sheet--agent .rpt-kpi-l { font-size: 10px !important; margin-top: 2px !important; }
  .rpt-sheet--agent .rpt-trend { font-size: 9.5px !important; margin-top: 3px !important; }
  .rpt-sheet--agent .rpt-rank-hero { padding: 7px 16px !important; }
  .rpt-sheet--agent .rpt-rank-hero-v { font-size: 25px !important; }
  .rpt-sheet--agent .rpt-agent-grid { gap: 16px !important; }
  .rpt-sheet--agent .rpt-agent-grid svg { width: 196px !important; height: 196px !important; }
  .rpt-sheet--agent .rpt-table td { padding: 5px 9px !important; }
  .rpt-sheet--agent .rpt-table th { padding: 5px 9px !important; }

  /* impression normale : la feuille visible s'imprime, le bloc « tous agents » reste masqué */
  .print-only { display: none !important; }

  /* impression « tous les agents » : on masque la feuille courante et on déroule toutes les fiches */
  body.printing-all .report-page > .rpt-sheet { display: none !important; }
  body.printing-all .print-only { display: block !important; }
  body.printing-all .rpt-allagents > .rpt-sheet { break-after: page; }
  body.printing-all .rpt-allagents > .rpt-sheet:last-child { break-after: auto; }
}

/* ---------- Espace commercial : tableau de RDV façon Monday ---------- */
.cb-group { margin-bottom: 26px; }
.cb-group-title { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 15px; margin-bottom: 10px; width: 100%; background: none; border: 0; font-family: inherit; cursor: pointer; padding: 4px 0; text-align: left; border-radius: var(--r-sm); transition: opacity .12s; }
.cb-group-title:hover { opacity: .72; }
.cb-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.cb-table { width: 100%; min-width: 940px; border-collapse: collapse; font-size: 13px; }
.cb-table th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--text-3); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.cb-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cb-table tbody tr:last-child td { border-bottom: none; }
.cb-status { width: 100%; min-width: 126px; border: 0; cursor: pointer; color: #fff; font-weight: 700; font-size: 12.5px; padding: 8px 10px; border-radius: 5px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.cb-status:hover { filter: brightness(1.07); }
.cb-menu { position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; min-width: 176px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: 0 10px 28px rgba(0,0,0,.18); padding: 7px; display: flex; flex-direction: column; gap: 5px; }
.cb-menu button { border: 0; color: #fff; font-weight: 700; font-size: 12.5px; padding: 7px 10px; border-radius: 5px; cursor: pointer; }
.cb-menu button:hover { filter: brightness(1.08); }
.cb-note { border: 0; outline: 0; background: transparent; width: 100%; min-width: 140px; font-size: 12.5px; color: var(--text); padding: 6px 4px; border-radius: 4px; font-family: inherit; }
.cb-note:hover { background: var(--surface-2); }
.cb-note:focus { background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--primary); }
.cb-fill { border: 1.5px dashed var(--repondeur); color: var(--repondeur); background: var(--repondeur-tint); font-weight: 700; font-size: 12px; border-radius: 5px; padding: 7px 10px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.cb-fill:hover { filter: brightness(1.04); }
.cb-batt { display: flex; height: 9px; border-radius: 4px; overflow: hidden; flex: 1; max-width: 340px; background: var(--surface-3); }
.cb-listen { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 5px 11px 5px 6px; cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--text); white-space: nowrap; }
.cb-listen:hover { border-color: var(--primary); color: var(--primary-strong); }
.cb-wave { display: flex; align-items: center; gap: 2px; height: 52px; flex: 1; cursor: pointer; }
.cb-wave span { flex: 1; border-radius: 2px; min-width: 2px; }
.cb-kanban { display: grid; grid-template-columns: repeat(6, minmax(168px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.cb-kcol { min-width: 168px; border-radius: var(--r-md); padding: 4px; }
.cb-kcol.over { background: var(--primary-tint); outline: 2px dashed var(--primary); outline-offset: -2px; }
.cb-kcol-head { color: #fff; font-weight: 700; font-size: 12.5px; padding: 7px 11px; border-radius: 6px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.cb-kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 11px; cursor: grab; box-shadow: var(--sh-1); }
.cb-kcard:hover { border-color: var(--border-strong); box-shadow: var(--sh-2); }
.cb-kcard:active { cursor: grabbing; }
/* carte en direct (Suivi commerciaux) : halo des marqueurs en mouvement */
.sc-live-dot { animation: scPulse 2s ease-out infinite; }
@keyframes scPulse {
  0%   { box-shadow: var(--sh-2), 0 0 0 0 color-mix(in srgb, currentColor 0%, rgba(0,120,212,.45)); }
  70%  { box-shadow: var(--sh-2), 0 0 0 11px rgba(0,120,212,0); }
  100% { box-shadow: var(--sh-2), 0 0 0 0 rgba(0,120,212,0); }
}
@media (prefers-reduced-motion: reduce) { .sc-live-dot { animation: none; } }

/* grille du mois : 7 colonnes TOUJOURS (classe dédiée → échappe à la règle mobile « grilles 1 colonne ») */
.cb-cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
@media (max-width: 460px) { .cb-cal-month { gap: 4px; } .cb-cal-month > div { border-radius: 7px; } }

/* roulette mois / année (style iOS) */
.cb-wheel { height: 180px; overflow-y: auto; scroll-snap-type: y mandatory; padding: 72px 0; scrollbar-width: none; position: relative; z-index: 1; }
.cb-wheel::-webkit-scrollbar { display: none; }
.cb-wheel-item { height: 36px; display: flex; align-items: center; justify-content: center; scroll-snap-align: center; font-size: 14px; color: var(--text-3); font-weight: 600; cursor: pointer; transition: color .12s, font-size .12s; }
.cb-wheel-item.on { color: var(--text); font-weight: 800; font-size: 15.5px; }
.cb-wheel-band { position: absolute; top: 50%; left: 2px; right: 2px; height: 36px; transform: translateY(-50%); border-radius: 9px; background: var(--primary-tint); pointer-events: none; }
@media (max-width: 900px) {
  .cb-kanban { display: flex; }
  .cb-kanban .cb-kcol { flex: 0 0 200px; }
  .cb-cal-grid { grid-template-columns: 1fr !important; }
}
/* notification « êtes-vous sur place ? » — popup BLOQUANTE : réponse obligatoire (pas de clic hors zone, pas d'Échap) */
.cb-push-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(20, 22, 26, .52); display: grid; place-items: center; padding: 12px; }

/* ---- Carte & tournée : itinéraires + animation « Optimiser ma tournée » ---- */
@keyframes tourFlow { to { stroke-dashoffset: -140; } }
.tour-main { animation: tourFlow 7s linear infinite; }
.tour-alt { opacity: .16; }
@keyframes tourScan { 0%, 100% { opacity: .12; } 50% { opacity: .6; } }
.tour-calc .tour-alt { animation: tourScan 1.1s ease-in-out infinite; }
.tour-calc .tour-alt:nth-child(2) { animation-delay: .55s; }
.tour-calc .tour-main { opacity: .25; }
@keyframes pinPop { 0% { transform: rotate(-45deg) scale(.35); } 70% { transform: rotate(-45deg) scale(1.18); } 100% { transform: rotate(-45deg) scale(1); } }
.tour-pin { transform: rotate(-45deg); animation: pinPop .45s ease both; }
.tour-leg { position: absolute; transform: translate(-50%, -50%); font-size: 9.5px; font-weight: 700; color: var(--text-2); background: rgba(255, 255, 255, .92); border: 1px solid var(--border); border-radius: 99px; padding: 1px 7px; white-space: nowrap; animation: legFade .5s ease both .25s; opacity: 0; }
@keyframes legFade { to { opacity: 1; } }
.cb-push { width: min(430px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; padding: 13px 15px; box-shadow: 0 14px 40px rgba(0,0,0,.24); }
@media (prefers-reduced-motion: no-preference) {
  .cb-push { animation: cb-push-in .35s cubic-bezier(.2,.9,.3,1.1); }
  @keyframes cb-push-in { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: translateY(0); } }
}

/* ============================================================
   Mobile — Mon agenda en cartes + modales en bottom sheet
   ============================================================ */
.cb-mcards { display: none; }
@media (max-width: 768px) {
  /* la table Monday cède la place aux cartes RDV */
  .cb-table-wrap { display: none; }
  .cb-mcards { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
  .cb-mcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 13px 14px; box-shadow: var(--sh-1); cursor: pointer; }
  .cb-mcard .cb-status { min-height: 34px; }
  .cb-mcard-actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 8px; margin-top: 11px; }
  .cb-mcard-actions .btn { min-height: 44px; justify-content: center; font-weight: 650; }

  /* modales mobiles : centrées à l'écran, largeur quasi pleine, pas de débordement horizontal */
  .modal-overlay { padding: 14px !important; place-items: center !important; }
  .modal-pane {
    width: 100% !important; max-width: 430px !important;
    max-height: 86dvh !important;
    border-radius: var(--r-lg) !important;
    overflow-x: hidden !important;
  }
  .modal-pane .row { flex-wrap: wrap; }

  /* tables larges : défilement horizontal au doigt (au lieu d'être clippées par la carte) */
  .card > .tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* dashboard : la table du classement cède la place à la liste compacte */
  .dash-rank > .tbl { display: none; }
  .card.dash-rank .dash-rank-mobile { display: flex; }
}

/* classement compact mobile (dashboard) */
.dash-rank-mobile { display: none; flex-direction: column; }
.dash-rank-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.cb-mcard-motif { display: flex; align-items: center; gap: 7px; width: 100%; margin-top: 9px; border: 1px dashed var(--border-strong); background: var(--surface-2); border-radius: var(--r-md); padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--text-2); font-family: inherit; cursor: pointer; min-height: 40px; text-align: left; }

/* ============================================================
   Permissions & accès (Super Admin)
   ============================================================ */
.pm-online { width: 8px; height: 8px; border-radius: 99px; background: var(--positif); box-shadow: 0 0 0 2px color-mix(in oklab, var(--positif) 28%, transparent); flex: 0 0 auto; }
.pm-site-head { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 15px; background: var(--surface-2); border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background .12s; }
.pm-site-head:hover { background: color-mix(in oklab, var(--surface-2) 60%, var(--border)); }
.pm-site.open > .pm-site-head { border-bottom: 1px solid var(--border); }
.pm-site-chev { flex: 0 0 auto; display: grid; place-items: center; color: var(--text-3); transition: transform .15s; margin-left: 4px; }
.pm-site.open > .pm-site-head .pm-site-chev { transform: rotate(180deg); }
.pm-site-note { flex: 0 0 auto; }
.pm-changed { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); background: var(--accent-tint); padding: 2px 7px; border-radius: 99px; }
.pm-row.changed { background: color-mix(in oklab, var(--accent) 6%, transparent); box-shadow: inset 2.5px 0 0 var(--accent); }
.pm-savebar { position: sticky; bottom: 14px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 4px; padding: 11px 16px; background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-lg); box-shadow: var(--sh-2, 0 6px 20px rgba(0,0,0,.12)); }
.pm-site-ico { width: 32px; height: 32px; border-radius: var(--r-md); display: grid; place-items: center; flex: 0 0 auto; }
.pm-rank-label { display: flex; align-items: center; gap: 7px; padding: 9px 15px 7px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); background: var(--surface); border-bottom: 1px solid var(--border); }
.pm-rank-dot { width: 8px; height: 8px; border-radius: 99px; flex: 0 0 auto; }
.pm-rank-scope { margin-left: auto; font-size: 10.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--text-3); }
.pm-row { display: flex; align-items: center; gap: 11px; padding: 9px 15px; border-bottom: 1px solid var(--border); }
.pm-row:last-child { border-bottom: 0; }
.pm-row:hover { background: var(--surface-2); }
.pm-row-main { flex: 1 1 auto; min-width: 0; }
.pm-rank { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.pm-station { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; color: var(--text-2); background: var(--surface-3); }

/* ---------- Produits & tutoriels (commercial) ---------- */
.pr-brand-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.pr-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pr-card { display: flex; flex-direction: column; gap: 9px; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 15px; cursor: pointer; font: inherit; transition: border-color .14s, box-shadow .14s, transform .14s; }
.pr-card:hover { border-color: var(--primary); box-shadow: var(--sh-1); transform: translateY(-1px); }
.pr-card-name { font-weight: 750; font-size: 14.5px; }
.pr-card-pitch { font-size: 12.5px; color: var(--text-2); line-height: 1.45; text-wrap: pretty; flex: 1; }
.pr-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px solid var(--border); margin-top: 2px; }
.pr-sec { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin-bottom: 9px; }
.pr-obj { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.pr-tuto { display: flex; gap: 11px; align-items: center; border: 1px solid var(--border); border-radius: var(--r-md); padding: 8px; }
.pr-tuto-thumb { position: relative; width: 84px; height: 52px; border-radius: 6px; flex: 0 0 auto; background: repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 7px, var(--surface-3) 7px, var(--surface-3) 14px); display: grid; place-items: center; }
.pr-tuto-play { width: 28px; height: 28px; border-radius: 99px; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; }
.pr-tuto-dur { position: absolute; right: 4px; bottom: 4px; font-size: 9.5px; font-weight: 700; color: #fff; background: rgba(0,0,0,.6); border-radius: 3px; padding: 0 4px; }
.pr-tuto-body { min-width: 0; }

/* ---------- Reporting · points d'attention (problème + action) ---------- */
.rpt-alert { background: var(--surface-2); border-radius: var(--r-md); padding: 9px 12px; }
.rpt-alert-pb { font-size: 11.5px; color: var(--text-2); line-height: 1.45; margin: 4px 0 0 16px; text-wrap: pretty; }
.rpt-alert-fix { display: flex; gap: 6px; font-size: 11.5px; color: var(--text); line-height: 1.45; margin: 6px 0 0 16px; text-wrap: pretty; }
@media print { .rpt-alert { background: #f4f5f7; break-inside: avoid; } }

/* ---------- En direct (agent) · indicateur de qualité du lead ---------- */
.live-lead { border-width: 1.5px; padding: 15px 16px; }
.live-lead-ring { position: relative; width: 50px; height: 50px; border-radius: 99px; flex: 0 0 auto; display: grid; place-items: center; color: #fff; }
.live-lead-pulse { position: absolute; inset: -4px; border-radius: 99px; border: 2px solid; opacity: .55; animation: live-lead-pulse 1.8s ease-out infinite; }
@keyframes live-lead-pulse { 0% { transform: scale(1); opacity: .55; } 70% { transform: scale(1.18); opacity: 0; } 100% { opacity: 0; } }
.live-lead-bar { height: 7px; border-radius: 99px; background: color-mix(in oklab, var(--text) 8%, transparent); overflow: hidden; margin-top: 13px; }
.live-lead-bar span { display: block; height: 100%; border-radius: 99px; transition: width .5s; }
@media (prefers-reduced-motion: reduce) { .live-lead-pulse { animation: none; } }
.pm-last { flex: 0 0 auto; width: 96px; text-align: right; white-space: nowrap; }
.pm-kebab { width: 30px; height: 30px; flex: 0 0 auto; color: var(--text-3); }
.pm-kebab:hover { color: var(--primary-strong); }
.pm-switch { width: 40px; height: 23px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: background .15s, border-color .15s; flex: 0 0 auto; padding: 0; }
.pm-switch::after { content: ''; position: absolute; top: 1.5px; left: 1.5px; width: 18px; height: 18px; border-radius: 99px; background: #fff; box-shadow: var(--sh-1); transition: transform .15s; }
.pm-switch.on { background: var(--positif); border-color: var(--positif); }
.pm-switch.on::after { transform: translateX(17px); }
.pm-switch:disabled { opacity: .45; cursor: not-allowed; }
/* matrice */
.pm-mx { width: 100%; border-collapse: separate; border-spacing: 0; }
.pm-mx th { padding: 12px 10px; font-size: 11.5px; font-weight: 700; color: var(--text-3); border-bottom: 1px solid var(--border); text-align: center; }
.pm-mx td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pm-mx tbody tr:last-child td { border-bottom: 0; }
.pm-mx tbody tr:hover td { background: var(--surface-2); }
.pm-mx-rank { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; }
.pm-mx-cell { width: 32px; height: 32px; border-radius: var(--r-sm); display: inline-grid; place-items: center; }
.pm-mx-cell.sm { width: 20px; height: 20px; border-radius: var(--r-xs); }
.pm-legend { display: flex; flex-wrap: wrap; gap: 18px; padding: 13px 16px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.pm-legend span { display: inline-flex; align-items: center; gap: 7px; }
@media (max-width: 760px) {
  .pm-last { display: none; }
  .pm-station { display: none; }
  .pm-rank-scope { display: none; }
  .pm-rank span { display: none; }
}
