/* ===========================================================================
   ATLAS 2 — Liquid Glass Design System
   ---------------------------------------------------------------------------
   Re-skin of Atlas (client / prestation / jalon / lead tracking) onto the
   "Liquid Glass" visual language. The glass VISUAL grammar is preserved
   verbatim (tokens, .glass utility + ::after noise, 40px radius, dual bg
   video, blue/red/orange palette, hover transitions, two responsive
   breakpoints). Only the MEANING of the chrome changes: no people, no
   meetings, no mics. Every interactive surface is wired by app.js.

   PALETTE IS LOCKED:
     blue   #3b82f6   (primary accent — no teal/green/indigo/purple substitute)
     red    #ff4545   (--alert — overdue / destructive / blocked)
     orange #e05e36   (--orange — "à valider" / "en retard" status tag)
     neutral whites / blacks / greys only.

   Atlas status -> palette mapping (within the locked palette, no new hues):
     done    -> blue   (#3b82f6)          terminé / livré
     doing   -> orange (#e05e36)          en cours
     blocked -> red    (#ff4545)          bloqué
     todo    -> grey   (#9aa3af)          à faire
   =========================================================================== */

/* ───────────────────────── TOKENS ───────────────────────── */
:root {
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-blur: 8px;
  --text-main: #1a1a1a;
  --text-muted: #6b7280;
  --accent: #000000;
  --card-radius: 40px;
  --transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  --blue: #3b82f6;
  --alert: #ff4545;
  --orange: #e05e36;

  /* Atlas status colour aliases (within the locked palette) */
  --st-done: var(--blue);
  --st-doing: var(--orange);
  --st-blocked: var(--alert);
  --st-todo: #9aa3af;
  /* "fait récemment / validé" success accent reuses blue per palette lock */
  --ok: var(--blue);
}

body.dark-mode {
  --glass-bg: rgba(0, 0, 0, 0.45);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text-main: #fff;
  --text-muted: #b0b0b0;
  --accent: #fff;
  /* status / palette tokens are unchanged in dark mode (locked) */
}

/* ───────────────────────── RESET / BASE ───────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  min-height: 100vh;
  padding: 32px 40px 120px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background: #000;
  color: var(--text-main);
  transition: var(--transition);
}

#bg-video,
.bg-video {
  position: fixed; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: -1;
}
/* dual video: dark layer hidden in light mode, shown in dark mode */
#bg-video-dark { opacity: 0; transition: opacity 0.6s ease; }
body.dark-mode #bg-video-light { opacity: 0; transition: opacity 0.6s ease; }
body.dark-mode #bg-video-dark { opacity: 1; }

svg { display: block; }
img { display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* the hidden 0x0 noise-filter host */
.noise-host { position: absolute; width: 0; height: 0; }

/* ───────────────────────── GLASS UTILITY ───────────────────────── */
.glass {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  border-radius: var(--card-radius);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 1px 4px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  filter: url(#noise-filter);
  opacity: 0.06;
  mix-blend-mode: overlay;
}

/* ───────────────────────── APP SHELL LAYOUT ───────────────────────── */
/* #app is the single mount; app.js renders the active view inside it.
   Each view root carries .view + .view--<name>. */
#app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* per-view wrappers — explicit scoping hooks app.js emits (.view--<name>).
   They inherit the .view flex column; the variants only tune flow so each
   view's inner grid (today-cols / ov-cols / ws / leads-body) can breathe. */
.view--today,
.view--overview { gap: 4px; }
/* leads + detail carry their own scrolling grids: let content size them and
   allow the column to scroll past the viewport on tighter screens. */
.view--leads,
.view--detail { gap: 4px; min-height: 0; }

/* greeting block shared by all views (h1 + subtitle) */
.greeting { margin-bottom: 24px; }
.greeting h1 {
  font-size: 2rem; font-weight: 500; letter-spacing: -0.03em; line-height: 1.05;
  color: var(--text-main);
}
.greeting .sub {
  margin-top: 6px; font-size: 0.95rem; color: var(--text-muted); font-weight: 400;
}
.greeting .sub b { color: var(--text-main); font-weight: 600; }

/* generic section head (title + count badge + optional icon) */
.section-head {
  display: flex; align-items: center; gap: 12px; margin: 28px 0 16px;
}
.section-head .ic { width: 20px; height: 20px; opacity: .65; flex: none; }
.section-head h2 {
  font-size: 1.1rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text-main);
}
.section-head .count {
  margin-left: auto; min-width: 28px; height: 28px; padding: 0 9px;
  border-radius: 100px; display: inline-grid; place-items: center;
  background: rgba(0, 0, 0, 0.06); color: var(--text-main);
  font-size: 0.8rem; font-weight: 600;
}
body.dark-mode .section-head .count { background: rgba(255, 255, 255, 0.14); }

/* ───────────────────────── TOP NAV ───────────────────────── */
.topnav {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 40px;
}
.icon-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
  color: var(--text-main);
}
.icon-btn:hover { transform: scale(1.05); }
.icon-btn svg { width: 20px; height: 20px; }

/* brand / profile glyph holder (logo or initials) */
.brand-btn { padding: 0; overflow: hidden; }
.brand-btn img,
.brand-btn svg { width: 48px; height: 48px; }

.avatar { border-radius: 50%; object-fit: cover; }

/* dark/light toggle + a neutral nav button (e.g. "Réglages" / refresh) */
.toggle-container {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 6px; border-radius: 100px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.mode-switch {
  width: 88px; height: 48px; border-radius: 100px; position: relative;
  background: #fff; box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); overflow: hidden;
}
.mode-track {
  position: absolute; top: 4px; left: 8px; width: 76px; height: 40px;
  border-radius: 100px; background: var(--blue);
}
.mode-handle {
  position: absolute; top: 8px; right: 8px; width: 32px; height: 32px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 2;
}
.mode-icon {
  position: absolute; top: 14px; left: 12px; font-size: 16px; color: #fff;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1;
}
body.dark-mode .mode-handle { transform: translateX(-36px); }
body.dark-mode .mode-icon { transform: translateX(42px); }

.nav-btn {
  padding: 10px 24px; border-radius: 100px; color: #fff;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  transition: var(--transition);
}
.nav-btn:hover { background: rgba(0, 0, 0, 0.12); }

/* ── ÉCHÉANCE / JALON ALERT (repurposed meeting-alert) ──
   Centered white pill: client-initial chip + label + time-tag (J-N) +
   ring-close whose progress arc = % d'avancement du jalon. Hidden <=768. */
.deadline-alert {
  justify-self: center;
  display: flex; align-items: center; gap: 12px;
  background: #fff; color: #1a1a1a;
  padding: 6px 6px 6px 16px; border-radius: 100px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  font-size: 0.85rem; font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}
.deadline-alert.is-overdue { color: var(--alert); }
.deadline-alert .da-chip { width: 32px; height: 32px; flex: none; }
.time-tag {
  background: #f0f0f0; color: #6b7280;
  padding: 4px 10px; border-radius: 100px; font-size: 0.75rem; white-space: nowrap;
}
.time-tag.is-overdue { background: rgba(255, 69, 69, 0.12); color: var(--alert); }
.ring-close { width: 32px; height: 32px; position: relative; display: grid; place-items: center; }
.ring-close svg.ring { position: absolute; inset: 0; }

/* ── VIEW SWITCHER (repurposed: Atlas nav) ──
   Pill of buttons. app.js sets .active on the route-matching one.
   Buttons: Aujourd'hui / Clients / Leads. */
.view-switcher {
  display: flex;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 4px; border-radius: 100px;
}
.view-switcher button,
.view-switcher a {
  position: relative;
  padding: 8px 18px; border-radius: 100px; font-size: 0.85rem; font-weight: 500;
  color: #fff; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px;
}
.view-switcher button.active,
.view-switcher a.active {
  background: #fff; color: #000; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
/* nav badge on a switcher item (overdue count = red, new-leads = blue) */
.nav__badge,
.nav__badge--accent {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 100px;
  display: inline-grid; place-items: center;
  font-size: 0.68rem; font-weight: 700; line-height: 1; color: #fff;
}
.nav__badge { background: var(--alert); }
.nav__badge--accent { background: var(--blue); }

/* back link (client detail) */
.backlink {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
  margin-bottom: 16px; transition: var(--transition);
}
.backlink:hover { color: var(--text-main); }
.backlink svg { width: 16px; height: 16px; }

/* ───────────────────────── CARD GRID + CARD VARIANTS ───────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 24px;
  max-width: 1400px; width: 100%; margin: 0 auto;
  flex: 1; min-height: 0;
}

.card {
  padding: 28px 20px;
  display: flex; flex-direction: column;
  border-radius: var(--card-radius);
  transition: var(--transition);
  overflow: hidden;
}
.card:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12); }

/* solid = active project tier */
.card-solid {
  background: #fff; color: #1a1a1a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
}
body.dark-mode .card-solid { background: rgba(26, 26, 26, 0.98); color: #fff; }

/* glass-dark translucent = paused / "aucun jalon à venir" tier */
.card-glass-dark {
  position: relative; color: #fff;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
body.dark-mode .card-glass-dark { background: rgba(255, 255, 255, 0.08); }

/* gradient (screen-share tier / featured) */
.card-gradient {
  background: linear-gradient(to bottom, #f4f4f4 0%, #fff 50%, #fff 100%);
  color: #1a1a1a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}
body.dark-mode .card-gradient {
  background: linear-gradient(to bottom, rgba(40, 40, 40, 0.98) 0%, rgba(26, 26, 26, 0.98) 60%);
  color: #fff;
}

/* create / empty = "Nouveau projet/prestation" */
.card-create {
  align-items: center; justify-content: center; gap: 12px; color: #fff;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}
body.dark-mode .card-create { background: rgba(255, 255, 255, 0.08); }
.card-create svg { width: 32px; height: 32px; }
.card-create span { font-weight: 500; }

/* card internals */
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-title { font-size: 1.35rem; font-weight: 400; letter-spacing: -0.03em; line-height: 1.15; }
.card-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.card-solid .card-sub,
.card-gradient .card-sub { color: #6b7280; }
.card-head .kind-ic { width: 16px; height: 16px; opacity: .5; flex: none; }
.card-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 20px; }

/* avatar / chip stack (repurposed: client-initial chips, never faces) */
.stack { display: flex; }
.stack img,
.stack .ichip { border: 2px solid #fff; }
.stack img + img,
.stack .ichip + .ichip { margin-left: -12px; }

/* count badge: now counts jalons / tâches / livrables */
.badge {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.08); font-size: 0.85rem; font-weight: 600; margin-left: auto;
}
.card-glass-dark .badge { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* client-initial chip (inline data:svg circle expected from app.js; the
   geometry below also styles a text-only fallback chip) */
.ichip {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 700; color: #fff;
  background: var(--blue); object-fit: cover; flex: none;
}
.ichip--sm { width: 24px; height: 24px; font-size: 0.6rem; }
.ichip--lg { width: 44px; height: 44px; font-size: 0.95rem; }

/* ───────────────────────── STATUS PRIMITIVES ───────────────────────── */
/* status dot — colour via .is-done/.is-doing/.is-blocked/.is-todo */
.dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--st-todo);
}
.dot.is-done { background: var(--st-done); }
.dot.is-doing { background: var(--st-doing); }
.dot.is-blocked { background: var(--st-blocked); }
.dot.is-todo { background: var(--st-todo); }

/* status pill — text label inside coloured tint */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 600; line-height: 1; white-space: nowrap;
  background: rgba(154, 163, 175, 0.16); color: var(--st-todo);
}
.pill.is-done { background: rgba(59, 130, 246, 0.14); color: var(--blue); }
.pill.is-doing { background: rgba(224, 94, 54, 0.14); color: var(--orange); }
.pill.is-blocked { background: rgba(255, 69, 69, 0.14); color: var(--alert); }
.pill.is-todo { background: rgba(154, 163, 175, 0.16); color: var(--st-todo); }

/* progress bar (linear) */
.bar {
  position: relative; height: 6px; border-radius: 100px;
  background: rgba(0, 0, 0, 0.08); overflow: hidden; width: 100%;
}
body.dark-mode .bar { background: rgba(255, 255, 255, 0.12); }
.card-solid .bar { background: rgba(0, 0, 0, 0.07); }
.bar > i {
  position: absolute; inset: 0 auto 0 0; display: block; height: 100%;
  border-radius: 100px; background: var(--blue);
  width: 0; transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar.is-done > i { background: var(--st-done); }
.bar.is-doing > i { background: var(--st-doing); }
.bar.is-blocked > i { background: var(--st-blocked); }
.bar.is-todo > i { background: var(--st-todo); }

/* progress ring (donut) — app.js sizes via the SVG; this styles colour.
   Markup contract: <span class="donut is-doing"><svg ...><circle class="ring-track"/>
   <circle class="ring-fill"/></svg><span class="ring-pct">75<small>%</small></span></span> */
.donut { position: relative; display: inline-grid; place-items: center; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut .ring-track { fill: none; stroke: rgba(0, 0, 0, 0.08); }
body.dark-mode .donut .ring-track { stroke: rgba(255, 255, 255, 0.12); }
.donut .ring-fill {
  fill: none; stroke: var(--blue); stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.donut.is-done .ring-fill { stroke: var(--st-done); }
.donut.is-doing .ring-fill { stroke: var(--st-doing); }
.donut.is-blocked .ring-fill { stroke: var(--st-blocked); }
.donut.is-todo .ring-fill { stroke: var(--st-todo); }
.donut .ring-pct {
  position: absolute; font-size: 0.85rem; font-weight: 600; color: var(--text-main);
}
.donut .ring-pct small { font-size: 0.6em; font-weight: 500; }

/* ───────────────────────── STAT CARDS (Overview) ───────────────────────── */
/* Stat card grid: 4 KPIs. .stat is a .glass tile. */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 8px;
}
.stat {
  padding: 22px 24px; border-radius: var(--card-radius);
  display: flex; flex-direction: column; gap: 6px;
  transition: var(--transition);
}
.stat:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12); }
.stat__top { display: flex; align-items: center; gap: 10px; color: var(--text-muted); }
.stat__top svg { width: 18px; height: 18px; opacity: .8; }
.stat__top .lbl { font-size: 0.82rem; font-weight: 500; }
.stat__val { font-size: 2.1rem; font-weight: 500; letter-spacing: -0.03em; line-height: 1; color: var(--text-main); }
.stat__sub { font-size: 0.78rem; color: var(--text-muted); }
.stat.is-alert .stat__val { color: var(--alert); }
.stat.is-alert .stat__top svg { color: var(--alert); opacity: 1; }

/* ───────────────────────── CLIENT CARD GRID (Overview) ───────────────────────── */
.client-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px;
}
.cc {
  padding: 24px; border-radius: var(--card-radius);
  display: flex; flex-direction: column; gap: 16px;
  transition: var(--transition); cursor: pointer; outline: none;
}
.cc:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12); }
.cc:focus-visible { box-shadow: 0 0 0 2px var(--blue); }
.cc__head { display: flex; align-items: center; gap: 14px; }
.cc__avatar { position: relative; }
.cc__avatar .ichip { width: 46px; height: 46px; font-size: 0.95rem; border: none; }
.cc__overdue {
  position: absolute; top: -2px; right: -2px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--alert); border: 2px solid #fff;
}
body.dark-mode .card-solid .cc__overdue { border-color: rgba(26, 26, 26, 0.98); }
.cc__id { min-width: 0; }
.cc__name { font-size: 1.15rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; }
.cc__meta {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cc__ring { margin-left: auto; flex: none; }

/* prestation mini-list inside a client card */
.cc__prests { display: flex; flex-direction: column; gap: 10px; }
.prow { display: flex; align-items: center; gap: 10px; }
.prow .name {
  font-size: 0.85rem; font-weight: 500; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.prow .pct { font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.prow .bar { flex: 0 0 56px; }
.cc__empty { font-size: 0.82rem; color: var(--text-muted); font-style: italic; }

.cc__foot {
  display: flex; align-items: center; gap: 8px; padding-top: 4px;
  font-size: 0.78rem; color: var(--text-muted);
}
.cc__chip {
  margin-left: auto; padding: 4px 10px; border-radius: 100px;
  background: rgba(0, 0, 0, 0.06); font-size: 0.72rem; font-weight: 600; color: var(--text-main);
}
body.dark-mode .cc__chip { background: rgba(255, 255, 255, 0.14); }

/* ───────────────────────── DEADLINES ASIDE (Overview) ───────────────────────── */
.deadlines { padding: 24px; border-radius: var(--card-radius); }
.dl-list { display: flex; flex-direction: column; gap: 4px; }
.dl {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 6px; border-radius: 14px;
}
.dl__date {
  flex: none; width: 46px; text-align: center; line-height: 1.05;
}
.dl__date .d { font-size: 1.2rem; font-weight: 600; }
.dl__date .m { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: .05em; }
.dl__body { min-width: 0; flex: 1; }
.dl__client { font-size: 0.85rem; font-weight: 500; }
.dl__jalon {
  font-size: 0.78rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dl .dot { margin-left: auto; }
.dl-empty { font-size: 0.85rem; color: var(--text-muted); padding: 8px 6px; }

/* overview 2-pane layout: client grid (main) + deadlines (aside) */
.ov-cols { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
/* main column of .ov-cols (section head + client grid). min-width:0 keeps the
   client cards from overflowing the track on narrow viewports. */
.ov-main { min-width: 0; display: flex; flex-direction: column; }

/* ───────────────────────── TODAY / AGENDA ───────────────────────── */
.today-cols { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
/* the two columns of .today-cols: buckets (main) + recent activity (aside).
   min-width:0 lets the main column's labels/meta ellipsis correctly; the
   aside sticks alongside, mirroring .ws-aside in the detail view. */
.today-main { min-width: 0; display: flex; flex-direction: column; }
.today-aside { min-width: 0; position: sticky; top: 0; }

/* a "bucket" = one ordered agenda section (overdue/today/week/later/undated) */
.bucket { margin-bottom: 8px; }
.bucket + .bucket { margin-top: 8px; }
.bucket .section-head .ic.is-alert { color: var(--alert); opacity: 1; }
.bucket .section-head .ic.is-today { color: var(--blue); opacity: 1; }

.ag-list { display: flex; flex-direction: column; gap: 8px; }
.ag-row {
  width: 100%; text-align: left;
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: 22px;
  transition: var(--transition);
}
.ag-row:hover { transform: translateX(3px); }
.ag-row .dot { align-self: flex-start; margin-top: 6px; }
.ag-row__body { min-width: 0; flex: 1; }
.ag-row__label { font-size: 0.95rem; font-weight: 500; color: var(--text-main); }
.ag-row__meta {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ag-row__meta b { color: var(--text-main); font-weight: 600; }
.ag-row__due {
  flex: none; margin-left: auto;
  padding: 4px 12px; border-radius: 100px;
  font-size: 0.74rem; font-weight: 600; white-space: nowrap;
  background: rgba(0, 0, 0, 0.06); color: var(--text-muted);
}
body.dark-mode .ag-row__due { background: rgba(255, 255, 255, 0.12); }
.ag-row__due.is-overdue { background: rgba(255, 69, 69, 0.14); color: var(--alert); }
.ag-row__due.is-today { background: rgba(59, 130, 246, 0.14); color: var(--blue); }

/* today empty / "rien d'urgent" state */
.zen {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px; padding: 60px 20px; border-radius: var(--card-radius);
}
.zen svg { width: 48px; height: 48px; }
.zen.is-ok svg { color: var(--blue); }
.zen h2 { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; }
.zen p { font-size: 0.9rem; color: var(--text-muted); max-width: 420px; }

/* ── "Fait récemment" (activity feed) ── */
.activity { padding: 24px; border-radius: var(--card-radius); }
.act-list { display: flex; flex-direction: column; gap: 2px; }
.act-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 6px; border-radius: 14px;
}
.act-row .pulse-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--blue);
  flex: none; margin-top: 6px;
}
.act-row__body { min-width: 0; flex: 1; }
.act-row__ts { font-size: 0.72rem; color: var(--text-muted); }
.act-row__verb { font-size: 0.88rem; font-weight: 500; }
.act-row__verb b { font-weight: 600; }
.act-row__client { font-size: 0.76rem; color: var(--text-muted); }

/* ───────────────────────── CLIENT DETAIL (workspace) ───────────────────────── */
.ws { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.ws-aside { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; }
.ws-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* identity card */
.det-client { padding: 26px 24px; border-radius: var(--card-radius); text-align: center; }
.det-client .ichip { width: 64px; height: 64px; font-size: 1.4rem; margin: 0 auto 14px; border: none; }
.det-client h2 { font-size: 1.4rem; font-weight: 500; letter-spacing: -0.02em; }
.det-client .meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.det-client .domain {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  font-size: 0.8rem; color: var(--blue); font-weight: 500;
}
.det-client .domain svg { width: 14px; height: 14px; }
.det-client .ring-wrap { margin: 20px auto 8px; }
.det-client .prog-label { font-size: 0.8rem; color: var(--text-muted); }
.det-client .prog-detail { font-size: 0.82rem; color: var(--text-main); font-weight: 500; margin-top: 4px; }

/* segmented audience toggle (Interne / Attentes client) */
.seg {
  display: inline-flex; padding: 4px; border-radius: 100px;
  background: rgba(0, 0, 0, 0.06);
}
body.dark-mode .seg { background: rgba(255, 255, 255, 0.10); }
.seg--block { display: flex; width: 100%; }
.seg button {
  flex: 1; padding: 9px 14px; border-radius: 100px;
  font-size: 0.82rem; font-weight: 500; color: var(--text-muted);
  transition: var(--transition); white-space: nowrap;
}
.seg button[aria-selected="true"],
.seg button.active {
  background: #fff; color: #1a1a1a; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
body.dark-mode .seg button[aria-selected="true"],
body.dark-mode .seg button.active { background: rgba(255, 255, 255, 0.92); }

/* prestation selector (aside list of prestations) */
.psel { display: flex; flex-direction: column; gap: 8px; }
.pitem {
  width: 100%; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px; border-radius: 20px;
  transition: var(--transition);
  background: rgba(0, 0, 0, 0.03);
}
body.dark-mode .pitem { background: rgba(255, 255, 255, 0.05); }
.pitem:hover { background: rgba(0, 0, 0, 0.06); }
.pitem.active { background: rgba(59, 130, 246, 0.12); box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35); }
.pitem__top { display: flex; align-items: center; gap: 10px; }
.pitem__top .kind-ic { width: 16px; height: 16px; opacity: .6; flex: none; }
.pitem__top .name { font-size: 0.88rem; font-weight: 500; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* prestation detail (main) */
.pdetail { padding: 28px 28px; border-radius: var(--card-radius); }
.pdetail__head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.pdetail__head .kind-ic { width: 22px; height: 22px; opacity: .55; flex: none; }
.pdetail__title { flex: 1; min-width: 0; }
.pdetail__title h3 {
  font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.pdetail__price { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.pdetail__count { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.pdetail__ring { flex: none; }

/* monthly period chips */
.mnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.mchip {
  padding: 7px 14px; border-radius: 100px; font-size: 0.78rem; font-weight: 500;
  background: rgba(0, 0, 0, 0.05); color: var(--text-muted); transition: var(--transition);
}
body.dark-mode .mchip { background: rgba(255, 255, 255, 0.08); }
.mchip.active { background: var(--blue); color: #fff; }

/* edit bar (lock / unlock) — internal audience only */
.ebar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 18px; margin: 8px 0 16px;
  background: rgba(0, 0, 0, 0.04); font-size: 0.85rem; color: var(--text-muted);
}
body.dark-mode .ebar { background: rgba(255, 255, 255, 0.06); }
.ebar svg { width: 18px; height: 18px; flex: none; }
.ebar.is-on { background: rgba(59, 130, 246, 0.10); color: var(--text-main); }
.ebar.is-on svg { color: var(--blue); }
.ebar > span { flex: 1; }
.ebar button {
  padding: 8px 16px; border-radius: 100px; font-size: 0.8rem; font-weight: 600;
  background: #1a1a1a; color: #fff;
  transition: var(--transition);
}
body.dark-mode .ebar button { background: #fff; color: #1a1a1a; }
.ebar.is-on button { background: var(--blue); color: #fff; }

/* next-deadline banner / client-expectation banner */
.pbanner {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 18px; margin-bottom: 16px;
  font-size: 0.88rem;
  background: rgba(59, 130, 246, 0.08);
}
.pbanner svg { width: 18px; height: 18px; flex: none; color: var(--blue); }
.pbanner b { font-weight: 600; }
.pbanner--eye { background: rgba(0, 0, 0, 0.04); color: var(--text-muted); }
body.dark-mode .pbanner--eye { background: rgba(255, 255, 255, 0.06); }
.pbanner--eye svg { color: var(--text-muted); }

/* ── TIMELINE (jalon nodes) ── */
.rtl { position: relative; display: flex; flex-direction: column; }
.rtl__row {
  position: relative;
  display: grid; grid-template-columns: 54px 28px 1fr auto;
  align-items: center; gap: 14px;
  padding: 12px 0;
}
.rtl__row.is-editable { cursor: default; }
.rtl__row.is-busy { opacity: .5; pointer-events: none; }
.rtl__row.is-overdue .rtl__label { color: var(--alert); }

/* per-status row colouring (locked palette):
   done→blue · doing→orange · blocked→red · todo→grey.
   The row class drives the rail node accent so jalon status is visually
   differentiated in read mode, mirroring the .dot/.pill/.bar primitives.
   (is-overdue, when present, still wins on the label colour above.) */
.rtl__row.is-todo .rtl__node { box-shadow: 0 0 0 2px var(--st-todo); }
.rtl__row.is-doing .rtl__node { box-shadow: 0 0 0 2px var(--st-doing); }
.rtl__row.is-blocked .rtl__node { box-shadow: 0 0 0 2px var(--st-blocked); }
.rtl__row.is-done .rtl__node { background: var(--st-done); box-shadow: 0 0 0 2px var(--st-done); }
/* tint the date number to match status; done is fully struck-complete (muted). */
.rtl__row.is-doing .rtl__date .d { color: var(--st-doing); }
.rtl__row.is-blocked .rtl__date .d { color: var(--st-blocked); }
.rtl__row.is-done .rtl__label { color: var(--text-muted); }
.rtl__row.is-blocked .rtl__label { color: var(--st-blocked); }

/* date cell */
.rtl__date { text-align: right; line-height: 1.05; }
.rtl__date .d { font-size: 1.05rem; font-weight: 600; }
.rtl__date .m { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted); letter-spacing: .05em; }
.rtl__date .none { font-size: 1rem; color: var(--text-muted); }

/* rail + node: vertical connector through the timeline */
.rtl__rail { position: relative; display: grid; place-items: center; align-self: stretch; }
.rtl__rail::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; transform: translateX(-50%); background: rgba(0, 0, 0, 0.08);
}
body.dark-mode .rtl__rail::before { background: rgba(255, 255, 255, 0.12); }
.rtl__row:first-child .rtl__rail::before { top: 50%; }
.rtl__row:last-child .rtl__rail::before { bottom: 50%; }
.rtl__node {
  position: relative; z-index: 1;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 2px var(--st-todo);
}
body.dark-mode .rtl__node { background: #1a1a1a; }
.rtl__node.is-done { background: var(--st-done); box-shadow: 0 0 0 2px var(--st-done); }
.rtl__node.is-doing { box-shadow: 0 0 0 2px var(--st-doing); }
.rtl__node.is-blocked { box-shadow: 0 0 0 2px var(--st-blocked); }

/* edit-mode checkbox marker replaces the node */
.rtl__chk, .crow__chk {
  position: relative; z-index: 1;
  width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center;
  background: #fff; box-shadow: inset 0 0 0 2px var(--st-todo);
  transition: var(--transition); color: #fff;
}
body.dark-mode .rtl__chk, body.dark-mode .crow__chk { background: #1a1a1a; }
.rtl__chk:hover, .crow__chk:hover { transform: scale(1.08); }
.rtl__chk svg, .crow__chk svg { width: 14px; height: 14px; opacity: 0; }
.rtl__chk.is-on, .crow__chk.is-on { background: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.rtl__chk.is-on svg, .crow__chk.is-on svg { opacity: 1; }

/* label + sub-line */
.rtl__main { min-width: 0; }
.rtl__label { font-size: 0.95rem; font-weight: 500; }
.rtl__sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 2px; }

/* trailing time badge + pill */
.rtl__tail { display: flex; align-items: center; gap: 10px; }
.rtl__time {
  padding: 3px 10px; border-radius: 100px; font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  background: rgba(0, 0, 0, 0.06); color: var(--text-muted);
}
body.dark-mode .rtl__time { background: rgba(255, 255, 255, 0.12); }
.rtl__time.is-overdue { background: rgba(255, 69, 69, 0.14); color: var(--alert); }
.rtl__time.is-today { background: rgba(59, 130, 246, 0.14); color: var(--blue); }

/* client-expectation row (dated, cochable depuis V9) */
.crow {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
body.dark-mode .crow { border-color: rgba(255, 255, 255, 0.08); }
.crow:last-child { border-bottom: none; }
.crow .label { font-size: 0.95rem; font-weight: 500; }
.crow.is-past .label { color: var(--text-muted); }
.crow.is-done .label { color: var(--text-muted); text-decoration: line-through; }

/* libellé de jalon éditable au clic (interne + client) */
.rtl__label.is-editable, .crow .label.is-editable {
  cursor: text; border-radius: 9px; padding: 3px 7px; margin: -3px -7px;
  transition: background 0.2s ease;
}
.rtl__label.is-editable:hover, .crow .label.is-editable:hover { background: rgba(59, 130, 246, 0.12); }
.label-edit {
  width: 100%; font: inherit; font-weight: 500; color: var(--text-main);
  background: rgba(59, 130, 246, 0.08); border: 1px solid var(--blue);
  border-radius: 9px; padding: 3px 7px; margin: -4px -8px; outline: none;
}
.crow .when { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
/* client-row date is clickable (editable) */
.crow .when.is-editable {
  border-radius: 9px; padding: 5px 9px; margin: -5px -9px;
  transition: background 0.2s ease;
}
.crow .when.is-editable:hover { background: rgba(59, 130, 246, 0.12); color: var(--text-main); }

/* ── dates d'abonnement début/fin (prestation, éditables au clic) ── */
/* colonne avec 10px d'écart : l'espace demandé sous le bouton "début". */
.pdates {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 10px; margin-top: 8px; margin-bottom: 10px;
}
.pdates__chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 100px;
  font-size: 0.8rem; color: var(--text-main);
  background: rgba(59, 130, 246, 0.10);
  transition: var(--transition);
}
.pdates__chip svg { width: 14px; height: 14px; flex: none; color: var(--blue); }
.pdates__chip b { font-weight: 600; }
.pdates__chip:hover { background: rgba(59, 130, 246, 0.18); transform: translateY(-1px); }
.pdates__chip.is-empty { background: rgba(0, 0, 0, 0.05); color: var(--text-muted); }
body.dark-mode .pdates__chip.is-empty { background: rgba(255, 255, 255, 0.07); }
.pdates__chip.is-empty svg { color: var(--text-muted); }

/* ── duplication Attentes client → Interne ── */
.cnav-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.cnav-row .mnav { margin: 0; }
.cnav-row .clone-chip { margin-left: auto; }
.clone-chip {
  cursor: pointer; border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.10); white-space: nowrap;
}
.clone-chip:hover { background: rgba(59, 130, 246, 0.20); transform: translateY(-1px); }
.clone-menu {
  width: 280px; max-width: calc(100vw - 24px); padding: 14px;
  border-radius: 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  display: flex; flex-direction: column; gap: 8px;
}
.clone-menu.is-busy { opacity: .5; pointer-events: none; }
.clone-menu__title { font-weight: 600; font-size: 0.9rem; }
.clone-menu__hint { font-size: 0.76rem; color: var(--text-muted); margin-bottom: 4px; line-height: 1.4; }
.clone-menu__opt {
  cursor: pointer; text-align: left; padding: 9px 12px; border-radius: 10px;
  font-size: 0.82rem; font-weight: 500; color: var(--text-main);
  background: rgba(59, 130, 246, 0.12); transition: var(--transition);
}
.clone-menu__opt:hover { background: rgba(59, 130, 246, 0.22); }
.clone-menu__opt--danger { background: rgba(239, 68, 68, 0.12); }
.clone-menu__opt--danger:hover { background: rgba(239, 68, 68, 0.22); }
.clone-menu__cancel {
  cursor: pointer; padding: 7px; border-radius: 10px; font-size: 0.78rem;
  color: var(--text-muted); background: transparent;
}
.clone-menu__cancel:hover { color: var(--text-main); }

/* ── bouton + formulaire "Ajouter une ligne" ── */
.addline {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  padding: 9px 16px; border-radius: 100px; font-size: 0.82rem; font-weight: 500;
  color: var(--text-muted); background: rgba(0, 0, 0, 0.04);
  border: 1px dashed rgba(0, 0, 0, 0.18); transition: var(--transition);
}
body.dark-mode .addline { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.18); }
.addline:hover { color: var(--blue); border-color: var(--blue); background: rgba(59, 130, 246, 0.08); }
.addline__plus { font-size: 1.05rem; font-weight: 600; line-height: 1; }
.addline-form {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px;
}
.addline-form.is-busy { opacity: .5; pointer-events: none; }
.addline-form__label {
  flex: 1; min-width: 180px; padding: 10px 14px; border-radius: 12px;
  font-size: 0.88rem; color: var(--text-main);
  background: rgba(0, 0, 0, 0.05); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
body.dark-mode .addline-form__label { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.addline-form__label:focus { box-shadow: inset 0 0 0 1.5px var(--blue); }
.addline-form__date {
  padding: 9px 14px; border-radius: 100px; font-size: 0.8rem; font-weight: 500;
  color: var(--text-muted); background: rgba(0, 0, 0, 0.05); transition: var(--transition);
}
body.dark-mode .addline-form__date { background: rgba(255, 255, 255, 0.08); }
.addline-form__date.has-date { color: #fff; background: var(--blue); }
.addline-form__ok {
  padding: 9px 18px; border-radius: 100px; font-size: 0.82rem; font-weight: 600;
  color: #fff; background: var(--blue); transition: var(--transition);
}
.addline-form__ok:hover { filter: brightness(1.08); }
.addline-form__cancel {
  width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; line-height: 1;
  display: grid; place-items: center; color: var(--text-muted); background: rgba(0, 0, 0, 0.05);
}
body.dark-mode .addline-form__cancel { background: rgba(255, 255, 255, 0.08); }
.addline-form__cancel:hover { color: var(--alert); }

/* ── bouton suppression d'une ligne (jalon) — discret, rouge au survol ── */
.jdel {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center; color: var(--text-muted);
  opacity: .45; transition: var(--transition);
}
.jdel svg { width: 15px; height: 15px; }
.jdel:hover { opacity: 1; color: var(--alert); background: rgba(255, 69, 69, 0.12); }
.rtl__row:hover .jdel, .crow:hover .jdel { opacity: .7; }

/* timeline date cell becomes a clickable button (editable) */
.rtl__date.is-editable {
  text-align: right; border-radius: 10px; padding: 4px 7px; margin: -4px -7px;
  transition: background 0.2s ease;
}
.rtl__date.is-editable:hover { background: rgba(59, 130, 246, 0.12); }
.rtl__date.is-editable .none { transition: color 0.2s ease; }
.rtl__date.is-editable:hover .none { color: var(--blue); }

/* ── DATEPICKER (calendrier glass maison) ── */
.dpick {
  position: absolute; z-index: 1200;
  width: 280px; padding: 14px; border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  animation: dpick-in 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes dpick-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }
.dpick__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dpick__title { font-size: 0.92rem; font-weight: 600; text-transform: capitalize; }
.dpick__nav {
  width: 30px; height: 30px; border-radius: 50%; font-size: 1.1rem; line-height: 1;
  display: grid; place-items: center; color: var(--text-main);
  background: rgba(0, 0, 0, 0.05); transition: var(--transition);
}
body.dark-mode .dpick__nav { background: rgba(255, 255, 255, 0.08); }
.dpick__nav:hover { background: var(--blue); color: #fff; }
.dpick__wd {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px;
}
.dpick__wd span {
  text-align: center; font-size: 0.62rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); padding: 4px 0;
}
.dpick__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dpick__cell {
  aspect-ratio: 1; border-radius: 50%; font-size: 0.82rem; font-weight: 500;
  display: grid; place-items: center; color: var(--text-main);
  transition: background 0.15s ease, color 0.15s ease;
}
.dpick__cell.is-empty { pointer-events: none; }
.dpick__cell:hover:not(.is-empty) { background: rgba(59, 130, 246, 0.16); }
.dpick__cell.is-today { box-shadow: inset 0 0 0 1.5px var(--blue); }
.dpick__cell.is-sel { background: var(--blue); color: #fff; }
.dpick__foot {
  display: flex; gap: 8px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}
body.dark-mode .dpick__foot { border-color: rgba(255, 255, 255, 0.1); }
.dpick__act {
  flex: 1; padding: 8px 0; border-radius: 100px; font-size: 0.76rem; font-weight: 600;
  background: rgba(0, 0, 0, 0.05); color: var(--text-main); transition: var(--transition);
}
body.dark-mode .dpick__act { background: rgba(255, 255, 255, 0.08); }
.dpick__act:hover { background: var(--blue); color: #fff; }
.dpick__act--clear:hover { background: var(--alert); }

/* ───────────────────────── LEADS ───────────────────────── */
/* counters banner */
.lcounts {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 16px 18px; border-radius: var(--card-radius); margin-bottom: 8px;
}
.lcount {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 100px; font-size: 0.82rem; font-weight: 500;
  background: rgba(0, 0, 0, 0.05); color: var(--text-main);
}
body.dark-mode .lcount { background: rgba(255, 255, 255, 0.08); }
.lcount .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.lcount--total { background: #1a1a1a; color: #fff; }
body.dark-mode .lcount--total { background: #fff; color: #1a1a1a; }
.lcount--new .n { color: var(--blue); }
.lcount--won .n { color: var(--blue); }
.lcount--lost .n { color: var(--alert); }
.lcount--rdv .n { color: var(--orange); }
/* "contacté" is a deliberate neutral (mirrors .lpill--contacted): keep its
   number in the muted grey so the chip stays coloured rather than defaulting. */
.lcount--contacted .n { color: var(--text-muted); }

/* leads container: vertical stack of per-client groups (.lead-group) */
.leads-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* group head */
.lead-group { margin-bottom: 8px; }

/* lead card grid */
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.lead {
  padding: 22px; border-radius: var(--card-radius);
  display: flex; flex-direction: column; gap: 14px;
  transition: var(--transition);
}
.lead:hover { transform: translateY(-3px) scale(1.01); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12); }
.lead__head { display: flex; align-items: center; gap: 12px; }
.lead__head .ichip { width: 44px; height: 44px; font-size: 0.95rem; border: none; }
.lead__id { flex: 1; min-width: 0; }
.lead__name { font-size: 1.05rem; font-weight: 500; letter-spacing: -0.01em; }
.lead__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* source badge */
.lsrc {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px; font-size: 0.7rem; font-weight: 600;
  background: rgba(0, 0, 0, 0.06); color: var(--text-muted);
}
body.dark-mode .lsrc { background: rgba(255, 255, 255, 0.12); }
.lsrc--meta { background: rgba(59, 130, 246, 0.14); color: var(--blue); }
.lsrc--form { background: rgba(224, 94, 54, 0.12); color: var(--orange); }
.lsrc--manual { background: rgba(0, 0, 0, 0.06); color: var(--text-muted); }
body.dark-mode .lsrc--manual { background: rgba(255, 255, 255, 0.12); }

/* campaign badge */
.lead__campaign {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 100px; font-size: 0.7rem; font-weight: 500;
  background: rgba(0, 0, 0, 0.05); color: var(--text-muted);
}
.lead__campaign svg { width: 12px; height: 12px; }
body.dark-mode .lead__campaign { background: rgba(255, 255, 255, 0.08); }

/* status pill (lead) — reuses the locked palette */
.lpill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px; font-size: 0.74rem; font-weight: 600; white-space: nowrap;
  align-self: flex-start;
  background: rgba(154, 163, 175, 0.16); color: var(--st-todo);
}
.lpill--new { background: rgba(59, 130, 246, 0.14); color: var(--blue); }
.lpill--contacted { background: rgba(0, 0, 0, 0.06); color: var(--text-muted); }
body.dark-mode .lpill--contacted { background: rgba(255, 255, 255, 0.12); }
.lpill--rdv { background: rgba(224, 94, 54, 0.14); color: var(--orange); }
.lpill--won { background: rgba(59, 130, 246, 0.16); color: var(--blue); }
.lpill--lost { background: rgba(255, 69, 69, 0.14); color: var(--alert); }

/* contacts */
.lead__contacts { display: flex; flex-direction: column; gap: 8px; }
.lead__contact {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-main); transition: var(--transition);
}
.lead__contact:hover { color: var(--blue); }
.lead__contact svg { width: 15px; height: 15px; opacity: .7; flex: none; }
.lead__none { font-size: 0.82rem; color: var(--text-muted); font-style: italic; }
.lead__message {
  font-size: 0.85rem; color: var(--text-muted); line-height: 1.45;
  padding: 12px 14px; border-radius: 16px; background: rgba(0, 0, 0, 0.04);
}
body.dark-mode .lead__message { background: rgba(255, 255, 255, 0.06); }
.lead__foot {
  margin-top: auto; padding-top: 8px;
  font-size: 0.74rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}

/* ───────────────────────── BAR CHART (Weekly Insights metric) ───────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 60px; margin-top: 14px; }
.bars span { flex: 1; border-radius: 2px; background: #e5e7eb; }
.bars span.lead-bar { background: var(--blue); }

/* ───────────────────────── ACTIVITY STRIP (recent / livrables) ───────────────────────── */
.chips { display: flex; gap: 8px; }
.chip {
  background: #fff; padding: 6px 14px; border-radius: 100px; font-size: 0.75rem; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.chip.blue { color: var(--blue); }
.chip.black { color: #000; }
.shots {
  display: flex; gap: 12px; overflow-x: auto; margin: 20px -20px 0; padding: 0 20px 16px;
  cursor: grab; scrollbar-width: none;
}
.shots::-webkit-scrollbar { display: none; }
.shot {
  position: relative; flex: 0 0 160px; height: 100px; border-radius: 16px;
  background-size: cover; background-position: center; background-color: rgba(0, 0, 0, 0.06);
}
.shot-tag { position: absolute; right: 8px; bottom: 8px; display: flex; align-items: center; gap: 4px; }
.shot-tag .ichip { border: none; }
.shot-tag .name {
  background: var(--orange); color: #fff; font-size: 0.65rem; padding: 2px 8px; border-radius: 100px;
}

/* indicator dots */
.dots { display: flex; justify-content: center; gap: 16px; margin: 24px 0 0; }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: #fff; opacity: 0.3; }
.dots span.active { opacity: 1; }

/* ───────────────────────── BOTTOM BAR (active projects / leads rail) ───────────────────────── */
.bottom-bar {
  position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 100px; z-index: 20;
}
/* the project chip + its activity pulse badge */
.speaker-wrap { position: relative; }
.speaker-wrap .ichip { width: 44px; height: 44px; font-size: 0.95rem; border: 2px solid rgba(255, 255, 255, 0.6); }
.voice-ind {
  position: absolute; top: -2px; right: -2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex; align-items: center; justify-content: center; gap: 1.5px;
}
/* recoloured to --blue per mapping (activity pulse, not voice) */
.voice-ind i { width: 2px; background: var(--blue); border-radius: 2px; animation: voice-wave 1s ease-in-out infinite; }
.voice-ind i:nth-child(1) { animation-delay: 0s; }
.voice-ind i:nth-child(2) { animation-delay: 0.2s; }
.voice-ind i:nth-child(3) { animation-delay: 0.4s; }
@keyframes voice-wave { 0%, 100% { height: 4px; } 50% { height: 10px; } }

.plus-chip {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, 0.25);
  color: #fff; font-weight: 700; font-size: 0.8rem; display: grid; place-items: center;
}

/* ───────────────────────── PORTFOLIO LAUNCHER (components button) ───────────────────────── */
.components-btn {
  position: fixed; bottom: 32px; left: 32px; width: 44px; height: 44px; border-radius: 14px;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 7px; z-index: 20;
}
.components-btn img,
.components-btn span { width: 100%; height: 100%; border-radius: 4px; display: block; }

/* ───────────────────────── FLOATING CONTROLS (dashboard actions) ───────────────────────── */
.float-controls {
  position: fixed; bottom: 32px; right: 32px; display: flex; gap: 12px;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: 10px 14px; border-radius: 100px; z-index: 20;
}
.ctrl-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.9); color: #1a1a1a; transition: var(--transition);
}
.ctrl-btn:hover { transform: scale(1.08); }
.ctrl-btn svg { width: 20px; height: 20px; }
/* destructive / alert toggle (e.g. "uniquement les projets en retard") */
.ctrl-btn.off { background: var(--alert); color: #fff; }

/* ───────────────────────── SKELETONS ───────────────────────── */
.sk {
  position: relative; overflow: hidden; border-radius: 22px;
  background: rgba(0, 0, 0, 0.05);
}
body.dark-mode .sk { background: rgba(255, 255, 255, 0.06); }
.sk::before {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: sk-shimmer 1.4s infinite;
}
body.dark-mode .sk::before { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); }
@keyframes sk-shimmer { 100% { transform: translateX(100%); } }
.sk-row { height: 64px; margin-bottom: 8px; }
.sk-card { height: 220px; }

/* ───────────────────────── OPTIONAL ALERT PULSE (reserved) ───────────────────────── */
/* Reserved emergency/alert ring; not used by default. Uses --alert per spec. */
@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(255, 69, 69, 0.5); }
  70% { box-shadow: 0 0 0 12px rgba(255, 69, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 69, 69, 0); }
}
.is-pulsing { animation: pulse-red 1.8s ease-out infinite; }

/* ───────────────────────── RESPONSIVE (mobile-down) ───────────────────────── */
@media (max-width: 1200px) {
  body { overflow: auto; height: auto; min-height: 100vh; }
  .grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; grid-auto-rows: 280px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .ov-cols,
  .today-cols { grid-template-columns: 1fr; }
  .ws { grid-template-columns: 1fr; }
  .ws-aside { position: static; }
}

@media (max-width: 768px) {
  body { padding: 16px 16px 130px; }
  .grid { grid-template-columns: 1fr; }
  .deadline-alert { display: none; }
  .topnav { grid-template-columns: auto auto auto; }
  .view-switcher { grid-column: 1 / -1; }
  .float-controls,
  .components-btn { bottom: 80px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .client-grid,
  .lead-grid { grid-template-columns: 1fr; }
  .greeting h1 { font-size: 1.6rem; }
}
