/* ============================================
   BatiCED v2 — Dashboard
   Layout, sidebar, header, hero, quick, pulse, presence,
   timeline, companies, activity.
   Les design tokens (variables CSS) sont définis dans baticed-tokens.css,
   chargé en premier par dashboard_v2_render.php.
   ============================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.v2-dashboard {
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  letter-spacing: -0.005em;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.v2-dashboard button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.v2-dashboard a { color: inherit; text-decoration: none; }
.v2-dashboard .mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }

/* Ambient orb */
.v2-dashboard .ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.v2-dashboard .ambient::before {
  content: ''; position: absolute;
  top: -300px; right: -200px;
  width: 800px; height: 800px;
  background: radial-gradient(circle, var(--lavender) 0%, transparent 60%);
  filter: blur(140px); opacity: 0.10;
  border-radius: 50%;
}

/* App shell */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}
.app[data-collapsed="true"] { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.main { min-width: 0; display: flex; flex-direction: column; }
.main-inner {
  width: 100%; max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--s-7) var(--s-9);
  display: flex; flex-direction: column; gap: var(--s-7);
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--line);
  padding: var(--s-5) var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-6);
}

.sidebar-brand {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-3);
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--lavender);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600;
  font-size: 14px; color: var(--canvas);
  letter-spacing: -.03em;
}
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.brand-org { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }

/* Bouton "réduire/agrandir" la sidebar : à droite du logo en mode ouvert, en dessous en mode fermé */
.sidebar-toggle-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text-3);
  margin-left: auto;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover {
  background: rgba(255,255,255,.08);
  border-color: var(--line-strong);
  color: var(--text);
}
.sidebar-toggle-btn .nav-icon,
.sidebar-toggle-btn .nav-icon svg { width: 14px; height: 14px; transition: transform .25s cubic-bezier(.16,1,.3,1); }
[data-theme="light"] .sidebar-toggle-btn { background: rgba(15,15,20,.04); }
[data-theme="light"] .sidebar-toggle-btn:hover { background: rgba(15,15,20,.08); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }

.app[data-collapsed="true"] .brand-text,
.app[data-collapsed="true"] .nav-label,
.app[data-collapsed="true"] .nav-item .nav-item-text,
.app[data-collapsed="true"] .user-meta,
.app[data-collapsed="true"] .nav-badge {
  display: none;
}
.app[data-collapsed="true"] .nav-item {
  justify-content: center;
  padding: 12px 0;
}
/* Icônes plus gros en collapsed */
.app[data-collapsed="true"] .nav-icon { width: 22px; height: 22px; }
.app[data-collapsed="true"] .nav-icon svg { width: 22px; height: 22px; }
.app[data-collapsed="true"] .sidebar {
  position: relative;
  z-index: 80;
}
.app[data-collapsed="true"] .sidebar-brand {
  flex-direction: column;
  gap: 10px;
  padding-left: 0;
  padding-right: 0;
  align-items: center;
}
.app[data-collapsed="true"] .sidebar-user { justify-content: center; }
/* En collapsed : le bouton toggle passe sous le logo (plus de margin-left:auto) */
.app[data-collapsed="true"] .sidebar-toggle-btn { margin-left: 0; }
/* Quand collapsed, l'icône du toggle est retournée (pour suggérer "expand") */
.app[data-collapsed="true"] .sidebar-toggle-btn .nav-icon { transform: rotate(180deg); }

/* Tooltip CSS custom — n'apparaît qu'en collapsed au hover */
.app[data-collapsed="true"] .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--elevated);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.app[data-collapsed="true"] .nav-item:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}
[data-theme="light"] .app[data-collapsed="true"] .nav-item::after {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15,15,20,.15);
}

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-4); padding: var(--s-3) var(--s-3) var(--s-2); font-weight: 500;
  font-family: var(--font-mono);
}
.nav-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 10px var(--s-3);
  border-radius: 10px;
  font-size: 14px; color: var(--text-2);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, padding-left .18s ease, transform .18s ease;
  position: relative;
}
.nav-item:hover {
  background: rgba(167,139,250,.14);
  color: var(--lavender-2);
  padding-left: calc(var(--s-3) + 4px);
}
.nav-item:hover .nav-icon { color: var(--lavender); transform: scale(1.1); }
.nav-icon { transition: transform .18s ease, color .18s ease; }
.nav-item[data-active="true"] {
  background: rgba(167,139,250,.10);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--lavender);
}
[data-theme="light"] .nav-item:hover { background: rgba(124,58,237,.10); color: var(--lavender); }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: grid; place-items: center; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-badge {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 11px;
  background: var(--elevated); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px; color: var(--text-2);
}
.nav-item[data-active="true"] .nav-badge {
  background: var(--lavender); color: var(--lavender-dark); border-color: transparent;
}

.sidebar-spacer { flex: 1; }
.sidebar-user {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3);
  border-top: 1px solid var(--line);
  margin-top: var(--s-2);
}
.sidebar-user-link {
  display: flex; align-items: center; gap: var(--s-3);
  flex: 1; min-width: 0;
  text-decoration: none;
  color: inherit;
  padding: 4px 6px;
  margin: -4px -6px;
  border-radius: 8px;
  transition: background .15s;
}
.sidebar-user-link:hover { background: rgba(255,255,255,0.04); }
.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--text);
  font-family: var(--font-mono); letter-spacing: -.02em;
  flex-shrink: 0;
}
.user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.user-name { font-size: 13px; font-weight: 500; }
.user-role {
  font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  font-family: var(--font-mono);
}

/* ============================================
   HEADER
   ============================================ */
.header {
  height: var(--header-h);
  padding: 0 var(--s-7);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s-4);
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.header-greet { display: flex; flex-direction: column; gap: 2px; }
.greet-line { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.greet-name { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.greet-name b { color: var(--text); font-weight: 700; }

.header-spacer { flex: 1; }
.header-divider { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.context-pill {
  display: inline-flex; align-items: center; gap: var(--s-3);
  padding: 6px 10px 6px 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.context-pill:hover { background: rgba(255,255,255,0.06); border-color: var(--line-strong); }
.context-pill-mark {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 700;
}
.context-pill-mark.mhc,
.context-pill-mark.flag { background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--text-2); }
.context-pill-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.context-pill-label {
  font-size: 9px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
  font-family: var(--font-mono);
}
.context-pill-value { font-size: 12px; font-weight: 500; color: var(--text); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
  position: relative;
}
.icon-btn:hover {
  background: rgba(255,255,255,.04);
  border-color: var(--line);
  color: var(--text);
}
.icon-btn .notif-dot {
  position: absolute; top: 7px; right: 7px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--coral);
  box-shadow: 0 0 0 2px var(--canvas);
}
/* Badge compteur sur la cloche notifications (substitut du dot quand on a un nombre) */
.icon-btn .notif-count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--coral);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center; justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--canvas);
  letter-spacing: 0;
}
.notif-btn.has-notifs { color: var(--text); }
.notif-btn.has-notifs:hover { color: var(--coral); }

/* ====== Project switcher dropdown ====== */
.project-switcher {
  position: relative;
}
.project-switcher-toggle { cursor: pointer; }
.project-switcher.is-open .project-switcher-toggle { background: rgba(255,255,255,.07); border-color: var(--line-strong); }

.project-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  max-width: 360px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 6px;
  z-index: 50;
  box-shadow: 0 18px 40px rgba(0,0,0,.35), 0 0 0 1px var(--line);
  animation: projectMenuIn .18s cubic-bezier(.16,1,.3,1);
}
[data-theme="light"] .project-menu {
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15,15,20,.12), 0 0 0 1px var(--line);
}
.project-menu[hidden] { display: none; }
@keyframes projectMenuIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.project-menu-head {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-3);
  padding: 6px 10px 10px;
}
.project-menu-form { margin: 0; }
.project-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background .12s;
}
.project-menu-item:hover { background: var(--inner-cell-bg-hover); }
.project-menu-item.is-current { background: rgba(167,139,250,.10); cursor: default; }
[data-theme="light"] .project-menu-item.is-current { background: rgba(124,58,237,.08); }
.project-menu-item[disabled] { opacity: .85; }
.project-menu-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 11px;
  color: var(--text-2);
  flex-shrink: 0;
}
.project-menu-item.is-current .project-menu-mark {
  background: var(--lavender);
  color: var(--canvas);
  border-color: transparent;
}
.project-menu-meta {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0; flex: 1;
}
.project-menu-name {
  font-size: 13px; font-weight: 500;
  letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.project-menu-loc {
  font-size: 11px; color: var(--text-3);
  font-family: var(--font-mono);
}
.project-menu-check {
  color: var(--lavender);
  display: grid; place-items: center;
  flex-shrink: 0;
}

@media (max-width: 500px) {
  .project-menu { right: -8px; min-width: 240px; }
}

.date-stamp {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3);
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}

/* ============================================
   PAGE INTRO
   ============================================ */
.page-intro {
  padding: var(--s-7) 0 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--s-6);
}
.page-intro-actions { display: flex; gap: 8px; }
.page-title {
  font-size: 36px; font-weight: 600; letter-spacing: -.03em;
  margin: 0; line-height: 1;
}
.page-subtitle {
  font-size: 13px; color: var(--text-3);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* Section heading shared */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: 16px;
}
.section-eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
.section-eyebrow .num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--lavender);
  padding: 2px 8px;
  background: rgba(167,139,250,.12);
  border-radius: 6px;
  font-weight: 500; letter-spacing: -.01em;
}
.section-eyebrow .line {
  width: 32px; height: 1px;
  background: linear-gradient(90deg, var(--lavender), transparent);
}
.section-title { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.section-sub { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); margin-top: 4px; }

/* ============================================
   BUTTONS
   ============================================ */
.v2-dashboard .btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  color: var(--text);
  transition: background .12s, border-color .12s, transform .1s;
  cursor: pointer;
}
.v2-dashboard .btn:hover { background: rgba(255,255,255,0.07); border-color: var(--line-strong); }
.v2-dashboard .btn:active { transform: scale(.98); }
.v2-dashboard .btn-primary {
  background: var(--lavender);
  border-color: transparent;
  color: var(--canvas); font-weight: 600;
}
.v2-dashboard .btn-primary:hover { background: var(--lavender-2); }

/* CTA avec icône en mini cercle contrasté (le "+" devient bien visible) */
.btn-cta { gap: 8px; padding: 8px 14px 8px 8px; }
.btn-cta-icon {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  flex-shrink: 0;
  color: inherit;
}
.btn-cta-icon svg { width: 14px; height: 14px; stroke-width: 2.5; }
[data-theme="light"] .btn-cta-icon { background: rgba(255,255,255,.30); }
.v2-dashboard .btn-sm { padding: 5px 10px; font-size: 11px; border-radius: 8px; }
.v2-dashboard .btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.v2-dashboard .btn-ghost:hover { background: rgba(255,255,255,.04); color: var(--text); }

/* ============================================
   TABS
   ============================================ */
.v2-dashboard .tabs {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.v2-dashboard .tab {
  font-size: 12px; padding: 5px 12px;
  border-radius: 7px; color: var(--text-3); font-weight: 500;
  transition: all .12s;
}
.v2-dashboard .tab:hover { color: var(--text-2); }
.v2-dashboard .tab[data-active="true"] {
  background: rgba(167,139,250,.15);
  color: var(--lavender-2);
  box-shadow: inset 0 0 0 1px rgba(167,139,250,.2);
}

/* ============================================
   CHIPS
   ============================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-family: var(--font-mono);
  letter-spacing: -.01em;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.chip[data-tone="warn"]    { background: rgba(251,191,36,.10); border-color: rgba(251,191,36,.20); color: var(--amber); }
.chip[data-tone="warn"] .chip-dot    { background: var(--amber); }
.chip[data-tone="danger"]  { background: rgba(251,113,133,.10); border-color: rgba(251,113,133,.20); color: var(--coral); }
.chip[data-tone="danger"] .chip-dot  { background: var(--coral); }
.chip[data-tone="success"] { background: rgba(52,211,153,.10); border-color: rgba(52,211,153,.20); color: var(--mint); }
.chip[data-tone="success"] .chip-dot { background: var(--mint); }
.chip[data-tone="info"]    { background: rgba(96,165,250,.10); border-color: rgba(96,165,250,.20); color: var(--sky); }
.chip[data-tone="info"] .chip-dot    { background: var(--sky); }
.chip[data-tone="lavender"]{ background: rgba(167,139,250,.10); border-color: rgba(167,139,250,.20); color: var(--lavender-2); }
.chip[data-tone="lavender"] .chip-dot{ background: var(--lavender); }

/* ============================================
   GENERIC CARD
   ============================================ */
.v2-dashboard .card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ============================================
   LIGHT THEME — overrides composants
   (les tokens [data-theme="light"] vivent dans baticed-tokens.css)
   ============================================ */
[data-theme="light"] .ambient::before { opacity: 0.06; }
[data-theme="light"] .card,
[data-theme="light"] .hero-cell,
[data-theme="light"] .qc,
[data-theme="light"] .pulse-card {
  box-shadow: 0 1px 3px rgba(15,15,20,0.06);
  border: 1px solid var(--line);
}
[data-theme="light"] .brand-mark { color: #ffffff; }
[data-theme="light"] .nav-item[data-active="true"] { background: rgba(124,58,237,0.08); }
[data-theme="light"] .v2-dashboard .tabs { background: rgba(15,15,20,0.04); }
[data-theme="light"] .v2-dashboard .tab[data-active="true"] {
  background: #ffffff; color: var(--text);
  box-shadow: 0 1px 2px rgba(15,15,20,0.06), 0 0 0 1px var(--line);
}
[data-theme="light"] .v2-dashboard .btn { background: #ffffff; border-color: var(--line); }
[data-theme="light"] .v2-dashboard .btn:hover { background: var(--surface-2); }
[data-theme="light"] .v2-dashboard .btn-primary { background: var(--lavender); color: #ffffff; }
[data-theme="light"] .v2-dashboard .btn-primary:hover { background: var(--lavender-2); }
[data-theme="light"] .context-pill { background: rgba(15,15,20,0.03); }
[data-theme="light"] .context-pill:hover { background: rgba(15,15,20,0.06); }
[data-theme="light"] .context-pill-mark.mhc,
[data-theme="light"] .context-pill-mark.flag {
  background: rgba(15,15,20,0.05);
  border-color: var(--line);
  color: var(--text-2);
}
[data-theme="light"] .icon-btn:hover { background: rgba(15,15,20,0.05); border-color: var(--line); }

/* === LIGHT THEME — couleurs hardcodées rgba override === */
/* Chips colorées : on remplace les rgba(couleurs dark) par rgba(couleurs light) */
[data-theme="light"] .chip                       { background: rgba(15,15,20,0.04); border-color: rgba(15,15,20,0.10); }
[data-theme="light"] .chip[data-tone="warn"]     { background: rgba(217,119,6,.10); border-color: rgba(217,119,6,.28); color: var(--amber); }
[data-theme="light"] .chip[data-tone="warn"] .chip-dot     { background: var(--amber); }
[data-theme="light"] .chip[data-tone="danger"]   { background: rgba(220,38,38,.10); border-color: rgba(220,38,38,.28); color: var(--coral); }
[data-theme="light"] .chip[data-tone="danger"] .chip-dot   { background: var(--coral); }
[data-theme="light"] .chip[data-tone="success"]  { background: rgba(5,150,105,.10); border-color: rgba(5,150,105,.28); color: var(--mint); }
[data-theme="light"] .chip[data-tone="success"] .chip-dot  { background: var(--mint); }
[data-theme="light"] .chip[data-tone="info"]     { background: rgba(37,99,235,.10); border-color: rgba(37,99,235,.28); color: var(--sky); }
[data-theme="light"] .chip[data-tone="info"] .chip-dot     { background: var(--sky); }
[data-theme="light"] .chip[data-tone="lavender"] { background: rgba(124,58,237,.10); border-color: rgba(124,58,237,.28); color: var(--lavender-2); }
[data-theme="light"] .chip[data-tone="lavender"] .chip-dot { background: var(--lavender); }

/* Hero delta chips */
[data-theme="light"] .hero-delta-chip.down       { background: rgba(220,38,38,.10); border-color: rgba(220,38,38,.28); color: var(--coral); }
[data-theme="light"] .hero-delta-chip.up         { background: rgba(5,150,105,.10);  border-color: rgba(5,150,105,.28); color: var(--mint); }

/* Hero pulse-dot (TAR eyebrow) */
[data-theme="light"] .pulse-dot                  { box-shadow: 0 0 0 4px rgba(124,58,237,.20); }

/* OGER status chip */
[data-theme="light"] .oger-status-chip           { background: rgba(5,150,105,.10);  border-color: rgba(5,150,105,.28); color: var(--mint); }
[data-theme="light"] .oger-status-chip.warn      { background: rgba(217,119,6,.10);  border-color: rgba(217,119,6,.28); color: var(--amber); }
[data-theme="light"] .oger-status-chip.bad       { background: rgba(220,38,38,.10);  border-color: rgba(220,38,38,.28); color: var(--coral); }
[data-theme="light"] .oger-status-dot            { box-shadow: 0 0 0 3px rgba(5,150,105,.22); }
[data-theme="light"] .oger-status-chip.warn .oger-status-dot { box-shadow: 0 0 0 3px rgba(217,119,6,.22); }
[data-theme="light"] .oger-status-chip.bad  .oger-status-dot { box-shadow: 0 0 0 3px rgba(220,38,38,.22); }

/* Pulse cards status dots */
[data-theme="light"] .pulse-card.s-on   .pulse-status-dot { box-shadow: 0 0 0 3px rgba(5,150,105,.22); }
[data-theme="light"] .pulse-card.s-late .pulse-status-dot { box-shadow: 0 0 0 3px rgba(217,119,6,.22); }
[data-theme="light"] .pulse-card.s-risk .pulse-status-dot { box-shadow: 0 0 0 3px rgba(220,38,38,.22); }
[data-theme="light"] .pulse-card.s-risk                   { border-color: rgba(220,38,38,.30); }

/* Quick card icons (3 cards en couleurs) */
[data-theme="light"] .qc.coral .qc-icon { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.25); color: var(--coral); }
[data-theme="light"] .qc.amber .qc-icon { background: rgba(217,119,6,.08); border-color: rgba(217,119,6,.25); color: var(--amber); }
[data-theme="light"] .qc.sky   .qc-icon { background: rgba(37,99,235,.08); border-color: rgba(37,99,235,.25); color: var(--sky); }

/* Section eyebrow num badge */
[data-theme="light"] .section-eyebrow .num { background: rgba(124,58,237,.12); color: var(--lavender); }

/* Tabs active */
[data-theme="light"] .v2-dashboard .tab[data-active="true"] { color: var(--lavender); }

/* Timeline event bloc badges */
[data-theme="light"] .tl-month[data-tone="done"]  .tl-event-bloc { background: rgba(5,150,105,.14);  color: var(--mint); }
[data-theme="light"] .tl-month[data-tone="doing"] .tl-event-bloc { background: rgba(124,58,237,.14); color: var(--lavender); }

/* Activity note */
[data-theme="light"] .act-note     { background: rgba(124,58,237,.08); border-left-color: var(--lavender); }
[data-theme="light"] .act-note-tag { color: var(--lavender); }
[data-theme="light"] .act-link     { color: var(--lavender); }

/* Banner pilot (rouge) */
[data-theme="light"] .v2-banner {
  background: linear-gradient(135deg, rgba(220,38,38,.10), rgba(220,38,38,.04));
  border-color: rgba(220,38,38,.30);
}

/* Hero IAP band fills (vérification — utilisent déjà var(), donc OK auto) */

/* Scrollbars */
.scrollx {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.scrollx::-webkit-scrollbar { height: 8px; }
.scrollx::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

.v2-dashboard :focus-visible { outline: 2px solid var(--lavender); outline-offset: 2px; }

/* Stat helper */
.stat-mini { display: flex; flex-direction: column; gap: 2px; }
.stat-mini-lbl {
  font-size: 10px; color: var(--text-3); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .08em;
}
.stat-mini-val { font-family: var(--font-mono); font-size: 16px; letter-spacing: -.02em; }

/* ============================================
   HERO
   ============================================ */
.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  grid-template-rows: auto auto;
  gap: 16px;
}
.hero-cell {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}
.hero-tar {
  grid-row: span 2;
  display: flex; flex-direction: column;
  min-height: 360px;
  position: relative;
}
.hero-tar::before {
  content: ''; position: absolute;
  top: 0; left: 24px; width: 36px; height: 2px;
  background: var(--lavender);
  border-radius: 0 0 2px 2px;
}
.hero-eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--text-3);
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.hero-eyebrow-mono {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-3);
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lavender);
  box-shadow: 0 0 0 4px rgba(167,139,250,.18);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}
.tar-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.tar-big {
  font-family: var(--font-mono);
  font-size: 130px; font-weight: 500;
  letter-spacing: -.07em; line-height: .85;
  color: var(--text);
}
.tar-big small {
  font-size: 36px;
  color: var(--text-3);
  font-weight: 500;
}
.tar-delta { text-align: right; padding-bottom: 14px; }
.tar-delta-val {
  font-family: var(--font-mono); font-size: 22px; font-weight: 500;
  letter-spacing: -.03em; color: var(--mint);
}
.tar-delta-val.neg { color: var(--coral); }
.tar-delta-lbl {
  font-size: 10px; color: var(--text-3); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .1em;
  margin-top: 4px;
}
.tar-bar {
  position: relative; height: 6px;
  background: var(--track-bg);
  border-radius: 999px; overflow: hidden;
  margin-bottom: 10px;
}
.tar-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  border-radius: 999px;
  background: var(--lavender);
}
.tar-bar-marker {
  position: absolute; top: -3px; bottom: -3px;
  width: 2px;
  background: var(--text);
  border-radius: 2px;
}
.tar-bar-meta {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-3);
  font-family: var(--font-mono);
}
.tar-bar-meta b { color: var(--text); font-weight: 500; }
.tar-mine {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
}
.tar-mine-label {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--text-3);
}
.tar-mine-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.tar-mine-cell {
  padding: 14px 16px;
  background: var(--inner-cell-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.tar-mine-val {
  font-family: var(--font-mono); font-size: 32px;
  font-weight: 500; letter-spacing: -.04em; line-height: 1;
  color: var(--text);
}
.tar-mine-lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-2); margin-top: 8px;
}

/* IAP / OGER / Points common */
.hero-iap, .hero-oger, .hero-points {
  display: flex; flex-direction: column; gap: 14px;
}
.hero-iap-head {
  display: flex; justify-content: space-between; align-items: center;
}
.hero-delta-chip {
  font-family: var(--font-mono); font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
}
.hero-delta-chip.down {
  background: rgba(251,113,133,.10);
  color: var(--coral);
  border: 1px solid rgba(251,113,133,.20);
}
.hero-delta-chip.up {
  background: rgba(52,211,153,.10);
  color: var(--mint);
  border: 1px solid rgba(52,211,153,.20);
}
.iap-figure {
  display: flex; align-items: center; gap: 18px;
}
.hero-iap-num {
  font-family: var(--font-mono);
  font-size: 56px; font-weight: 500;
  letter-spacing: -.05em; line-height: 1;
  color: var(--text);
}
.hero-iap-num small { font-size: 18px; color: var(--text-3); }
.hero-iap-foot { display: flex; flex-direction: column; gap: 8px; }
.iap-bar-row {
  display: grid; grid-template-columns: 56px 1fr 36px;
  gap: 10px; align-items: center;
}
.iap-rg-lbl {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}
.iap-rg-track {
  height: 4px; border-radius: 999px;
  background: var(--track-bg);
  overflow: hidden;
}
.iap-rg-fill { height: 100%; border-radius: 999px; }
.iap-rg-fill.good { background: var(--mint); }
.iap-rg-fill.warn { background: var(--amber); }
.iap-rg-fill.danger { background: var(--coral); }
.iap-rg-val {
  font-family: var(--font-mono); font-size: 12px;
  text-align: right; color: var(--text);
  letter-spacing: -.02em;
}

/* OGER */
.oger-status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px;
  padding: 3px 10px;
  background: rgba(52,211,153,.10);
  color: var(--mint);
  border: 1px solid rgba(52,211,153,.20);
  border-radius: 999px;
}
.oger-status-chip.warn { background: rgba(251,191,36,.10); color: var(--amber); border-color: rgba(251,191,36,.20); }
.oger-status-chip.bad { background: rgba(251,113,133,.10); color: var(--coral); border-color: rgba(251,113,133,.20); }
.oger-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(52,211,153,.18);
}
.oger-num-row {
  display: flex; align-items: baseline; gap: 6px;
}
.oger-big {
  font-family: var(--font-mono);
  font-size: 56px; font-weight: 500; letter-spacing: -.05em;
  line-height: 1; color: var(--text);
}
.oger-big small { font-size: 32px; color: var(--text-3); }
.oger-of {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--text-3);
}
.oger-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.oger-stat { display: flex; flex-direction: column; gap: 2px; }
.oger-stat-val {
  font-family: var(--font-mono); font-size: 18px;
  color: var(--text); letter-spacing: -.02em;
}
.oger-stat-lbl {
  font-size: 10px; color: var(--text-3); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .06em;
}

/* Points */
.hero-points { grid-column: span 2; }
.hero-points-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 4px;
}
.hero-points-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin-top: 4px; }
.hero-points-total {
  font-family: var(--font-mono); font-size: 32px;
  letter-spacing: -.04em;
  color: var(--text);
}
.pts-cells {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.pt-cell {
  padding: 16px 18px;
  background: var(--inner-cell-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: background .15s, border-color .15s;
}
.pt-cell:hover { background: var(--inner-cell-bg-hover); border-color: var(--line-strong); }
.pt-cell-num {
  font-family: var(--font-mono); font-size: 30px;
  font-weight: 500; letter-spacing: -.04em; line-height: 1;
  color: var(--text);
}
.pt-cell-lbl {
  font-size: 11px; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px;
}
.pt-cell-dot { width: 6px; height: 6px; border-radius: 50%; }
.pt-cell.attente .pt-cell-dot { background: var(--amber); }
.pt-cell.cours .pt-cell-dot { background: var(--sky); }
.pt-cell.resolus .pt-cell-dot { background: var(--mint); }
.pt-cell.anomalies .pt-cell-dot { background: var(--coral); }
.pt-cell-delta {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-2);
  margin-top: 4px;
}
.pt-cell-delta .muted { color: var(--text-4); }

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-points { grid-column: span 1; }
  .hero-tar { grid-row: auto; }
}

/* ============================================
   QUICK
   ============================================ */
.quick-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px;
}
.quick-grid--cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 2e ligne asymétrique : Demandes 1/3 (étroite) · Messages 2/3 (large).
   Même hauteur (stretch, dictée par Messages qui affiche tout sans scroll).
   Dans Demandes : en-tête en haut, chips centrées, boutons en bas (margin-top:auto x2). */
.quick-grid--cols2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.quick-grid--cols2 .qc-chips { margin-top: auto; }
.quick-grid + .quick-grid { margin-top: 16px; }
.qc {
  padding: 22px 24px;
  border-radius: var(--r-xl);
  background: var(--card-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 14px;
  min-height: 200px;
}
.qc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
}
.qc-head-left { display: flex; flex-direction: column; gap: 4px; }
.qc-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--inner-cell-bg-hover);
  border: 1px solid var(--line);
}
.qc.coral .qc-icon { color: var(--coral); background: rgba(251,113,133,.08); border-color: rgba(251,113,133,.2); }
.qc.amber .qc-icon { color: var(--amber); background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.2); }
.qc.sky   .qc-icon { color: var(--sky);   background: rgba(96,165,250,.08); border-color: rgba(96,165,250,.2); }
.qc-eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-3);
  margin-top: 6px;
}
.qc-name { font-size: 14px; font-weight: 600; letter-spacing: -.01em; color: var(--text); }
.qc-num {
  font-family: var(--font-mono);
  font-size: 48px; font-weight: 500;
  letter-spacing: -.05em; line-height: 1;
  color: var(--text);
}
.qc-meta { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.qc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.qc-foot { margin-top: auto; padding-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Carte « Messages information » — liste des messages diffusés par le super admin */
.qc--messages .qc-num { font-size: 28px; }
.qc-msg-list {
  display: flex; flex-direction: column; gap: 8px;
}
.qc-msg {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--text-4);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
}
.qc-msg[data-tone="info"]   { border-left-color: var(--sky); }
.qc-msg[data-tone="warn"]   { border-left-color: var(--amber); }
.qc-msg[data-tone="danger"] { border-left-color: var(--coral); }
.qc-msg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.qc-msg-title { font-weight: 600; font-size: 13px; color: var(--text); line-height: 1.3; }
.qc-msg-body { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.qc-msg-empty { font-size: 13px; color: var(--text-3); font-style: italic; padding: 10px 0; }
[data-theme="light"] .qc-msg { background: rgba(15,15,20,.02); }

@media (max-width: 1024px) {
  .quick-grid, .quick-grid--cols3, .quick-grid--cols2 { grid-template-columns: 1fr; }
}

/* ============================================
   PULSE (Site Pulse)
   ============================================ */
.pulse-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.pulse-card {
  position: relative; overflow: hidden;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 14px;
  text-decoration: none;
  color: inherit;
}
.pulse-card[hidden] { display: none !important; }
.pulse-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--inner-cell-bg); }
.pulse-card.s-risk { border-color: rgba(251,113,133,.18); }
.pulse-head {
  position: relative;
  display: flex; justify-content: space-between; align-items: center;
}
.pulse-id {
  font-family: var(--font-mono); font-size: 12px;
  font-weight: 600; letter-spacing: -.01em;
  padding: 3px 8px;
  background: var(--inner-cell-bg-hover);
  border-radius: 6px;
  color: var(--text-2);
}
.pulse-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .08em;
}
.pulse-status-dot { width: 7px; height: 7px; border-radius: 50%; }
.pulse-card.s-on .pulse-status { color: var(--mint); }
.pulse-card.s-on .pulse-status-dot { background: var(--mint); box-shadow: 0 0 0 3px rgba(52,211,153,.18); }
.pulse-card.s-late .pulse-status { color: var(--amber); }
.pulse-card.s-late .pulse-status-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(251,191,36,.18); }
.pulse-card.s-risk .pulse-status { color: var(--coral); }
.pulse-card.s-risk .pulse-status-dot { background: var(--coral); box-shadow: 0 0 0 3px rgba(251,113,133,.18); }
.pulse-name {
  font-size: 13px; color: var(--text-2); line-height: 1.3;
  position: relative;
}
.pulse-fig {
  position: relative;
  display: flex; align-items: center; justify-content: space-around; gap: 8px;
  padding: 4px 0;
}
.pulse-ring {
  position: relative;
  width: 88px; height: 88px;
  flex-shrink: 0;
}
.pulse-ring svg { display: block; }
.pulse-ring-arc { opacity: 0.6; }
[data-theme="light"] .pulse-ring-arc { opacity: 0.95; }
.pulse-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
  gap: 2px;
}
.pulse-ring-val {
  font-family: var(--font-mono); font-weight: 500;
  font-size: 22px; letter-spacing: -.04em; line-height: 1;
  color: var(--text);
}
.pulse-ring-val small { font-size: 11px; color: var(--text-3); margin-left: 1px; }
.pulse-ring-lbl {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: .1em;
}
.pulse-delta { font-family: var(--font-mono); font-size: 11px; }
.pulse-delta.good { color: var(--mint); }
.pulse-delta.warn { color: var(--amber); }
.pulse-delta.bad { color: var(--coral); }
.pulse-foot {
  display: flex; justify-content: space-between; gap: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  position: relative;
}
.pulse-foot-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px;
}
.pulse-foot-item .kpi-num {
  font-family: var(--font-mono); color: var(--text);
  letter-spacing: -.02em;
}
.pulse-foot-item .lbl { color: var(--text-3); font-family: var(--font-mono); font-size: 10px; }
.pulse-foot-item svg { color: var(--text-4); }

/* Pulse bars (alternative aux cercles, mobile only) */
.pulse-bars { display: none; }
.pulse-bar-row {
  display: grid;
  grid-template-columns: 28px 1fr 42px;
  gap: 8px;
  align-items: center;
}
.pulse-bar-lbl {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
}
.pulse-bar-track {
  height: 8px;
  background: var(--track-bg);
  border-radius: 999px;
  overflow: hidden;
}
.pulse-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  opacity: 0.85;
  transition: width 1s cubic-bezier(.16,1,.3,1) .15s;
}
.is-visible .pulse-bar-fill {
  width: calc(var(--w, 0) * 1%);
}
.pulse-bar-val {
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 500; letter-spacing: -.02em;
  color: var(--text);
  text-align: right;
}
.pulse-bar-val small { font-size: 10px; color: var(--text-3); margin-left: 1px; }

/* ============================================
   ZONES page — stats + grille de zone-cards
   ============================================ */
.zones-page { display: flex; flex-direction: column; gap: var(--s-6); }
.zones-stripe {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
}
@media (max-width: 900px) {
  .zones-stripe { grid-template-columns: repeat(2, 1fr); padding: 12px; gap: 8px; }
}

.zones-show-all-form { display: inline-flex; }
.zones-show-all-form .activity-chip-toggle { cursor: pointer; }

.zones-block-group {
  display: flex; flex-direction: column;
  gap: 12px;
}
.zones-block-group + .zones-block-group { margin-top: 8px; }
.zones-block-group .section-head { margin-bottom: 4px; }

.zones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
@media (max-width: 900px) {
  .zones-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 500px) {
  .zones-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* Zone card (réutilise .pulse-card mais avec contenu différent) */
.zone-card {
  display: flex; flex-direction: column; gap: 10px;
}
.zone-card-title {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
  line-height: 1.3;
  text-decoration: none;
  transition: color .12s;
}
.zone-card-title:hover { color: var(--lavender-2); }
[data-theme="light"] .zone-card-title:hover { color: var(--lavender); }
.zone-card-pilot {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.zone-card-pilot svg { color: var(--text-4); }
.zone-card-pilot span { color: var(--text-2); }
.zone-card-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 4px;
}
.zone-card-actions .btn { flex: 1; justify-content: center; padding: 6px 10px; font-size: 11px; }
.zone-card-open svg { color: var(--lavender-2); }
.zone-card-delete:hover {
  background: rgba(220,38,38,.12) !important;
  border-color: rgba(220,38,38,.30) !important;
  color: var(--coral) !important;
}

/* ============================================
   ACTIVITY page — filtres + liste + pagination
   ============================================ */
.activity-page { display: flex; flex-direction: column; gap: var(--s-6); }
.activity-toolbar {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 2fr) auto;
  gap: 18px;
  align-items: end;
}
.activity-filter-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.activity-filter-label {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-3);
}
.activity-select-wrap {
  position: relative;
}
.activity-select {
  width: 100%;
  background: var(--inner-cell-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 36px 10px 14px;
  color: var(--text);
  font-size: 13px; font-family: var(--font-sans);
  appearance: none;
  cursor: pointer;
  transition: border-color .15s;
  /* Force le browser à utiliser le bon scheme pour le dropdown natif */
  color-scheme: dark;
}
[data-theme="light"] .activity-select { color-scheme: light; }
.activity-select option {
  background: var(--surface);
  color: var(--text);
  padding: 8px;
}
.activity-select:hover { border-color: var(--line-strong); }
.activity-select:focus { outline: none; border-color: var(--lavender); }
.activity-select-wrap::after {
  content: '▾';
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none; font-size: 12px;
}
[data-theme="light"] .activity-select { background: #ffffff; }

.activity-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.activity-chip-toggle {
  cursor: pointer;
  user-select: none;
  opacity: .5;
  transition: opacity .15s, background .15s, border-color .15s, transform .15s;
}
.activity-chip-toggle[data-checked="true"] {
  opacity: 1;
  transform: scale(1.02);
}

.activity-filter-actions {
  display: flex; gap: 8px; align-items: center;
}

.activity-toolbar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.activity-summary {
  margin: 0;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text-3);
}
.activity-summary strong { color: var(--text-2); }
.activity-mark-all { margin: 0; }

/* Photos attachées aux activités */
.act-photos {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.act-photo {
  display: block;
  width: 84px; height: 84px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  transition: border-color .15s, transform .15s, box-shadow .2s;
  position: relative;
}
.act-photo:hover {
  border-color: var(--lavender);
  transform: scale(1.04);
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  z-index: 2;
}
.act-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
[data-theme="light"] .act-photo:hover { box-shadow: 0 6px 16px rgba(15,15,20,.10); }

/* Liste activités pleine page (réutilise .act-card + .act-row) */
.activity-page .act-card { padding: 0; }
.activity-page .act-row {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}
.activity-page .act-row:last-child { border-bottom: none; }
.activity-page .act-row:hover { background: var(--inner-cell-bg); }
.activity-page .act-row.is-unread {
  background: rgba(167,139,250,.04);
}
.activity-page .act-row.is-unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--lavender);
}
.activity-page .act-row { position: relative; }
.act-unread-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--lavender);
  box-shadow: 0 0 0 3px rgba(167,139,250,.18);
  margin-left: 4px;
  vertical-align: middle;
}

/* Pagination V2 */
.v2-pagination {
  display: flex; flex-direction: column; gap: 10px;
  align-items: center;
  padding: 12px 0;
}
.v2-pagination-info {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: .08em;
}
.v2-pagination-ctrl {
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
}
.v2-pagination-ellipsis {
  display: inline-flex; align-items: center;
  padding: 5px 10px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

@media (max-width: 900px) {
  .activity-toolbar {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .activity-filter-actions {
    flex-direction: column; align-items: stretch;
  }
  .activity-filter-actions .btn { width: 100%; justify-content: center; }
  .activity-toolbar-row { flex-direction: column; align-items: flex-start; }
  .activity-mark-all .btn { width: 100%; }
}

/* ====== Synthese — livraison prévisionnelle (ajout dans pulse-card) ====== */
.synthese-delivery {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  margin-top: 4px;
}
.synthese-delivery-lbl {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-3);
}
.synthese-delivery-lbl svg { color: var(--lavender); }
.synthese-delivery-val {
  font-family: var(--font-mono); font-size: 12px;
  font-weight: 500; color: var(--text);
  letter-spacing: -.01em;
}

/* ====== Synthese — card entreprise ====== */
.synthese-co-card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(20px);
  text-decoration: none;
  color: inherit;
  transition: transform .2s cubic-bezier(.16,1,.3,1), border-color .15s, background .15s, box-shadow .2s;
}
.synthese-co-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--inner-cell-bg);
  box-shadow: 0 12px 26px rgba(0,0,0,.2);
}
.synthese-co-card.s-risk { border-color: rgba(251,113,133,.25); }
.synthese-co-card.s-late { border-color: rgba(251,191,36,.20); }
[data-theme="light"] .synthese-co-card:hover { box-shadow: 0 10px 22px rgba(15,15,20,.08); }
.synthese-co-head {
  display: flex; align-items: center; gap: 12px;
}
.synthese-co-logo {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 16px;
  background: var(--inner-cell-bg-hover);
  color: var(--text-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.synthese-co-card.s-risk .synthese-co-logo { color: var(--coral); border-color: rgba(251,113,133,.30); background: rgba(251,113,133,.08); }
.synthese-co-card.s-late .synthese-co-logo { color: var(--amber); border-color: rgba(251,191,36,.30); background: rgba(251,191,36,.08); }
.synthese-co-name {
  font-size: 15px; font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.synthese-co-metrics {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.synthese-co-metric { display: flex; flex-direction: column; gap: 6px; }
.synthese-co-metric-lbl {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3);
}
.synthese-co-metric-lbl svg { color: var(--text-4); }
.synthese-co-metric-val {
  font-family: var(--font-mono); font-size: 28px;
  font-weight: 500; letter-spacing: -.04em; line-height: 1;
  color: var(--text);
}

/* Grilles synthese */
.synthese-grid-zones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.synthese-grid-companies {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) {
  .synthese-grid-zones { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .synthese-grid-companies { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .synthese-co-card { padding: 14px; }
  .synthese-co-logo { width: 36px; height: 36px; font-size: 14px; }
  .synthese-co-name { font-size: 14px; }
  .synthese-co-metric-val { font-size: 22px; }
}

/* ============================================
   PRESENCE
   ============================================ */
.v2-presence-card {
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.presence-summary {
  position: relative;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--s-4); margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.presence-eyebrow {
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--lavender-2);
}
.presence-num {
  display: flex; align-items: baseline; gap: 10px; margin-top: 6px;
}
.presence-num span.val {
  font-family: var(--font-mono); font-size: 48px; font-weight: 500;
  letter-spacing: -.05em; line-height: 1;
  color: var(--text);
}
.presence-num small {
  font-size: 12px; color: var(--text-3); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .08em;
}
.v2-presence-legend { display: flex; gap: 32px; flex-wrap: wrap; }
.chart-wrap {
  position: relative;
  height: 200px;
  padding-left: 36px;
  padding-bottom: 22px;
}
.chart-grid {
  position: absolute; inset: 0 0 22px 0;
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
}
.grid-line { height: 1px; background: var(--line); position: relative; }
.grid-line span {
  position: absolute; left: 0; top: -7px;
  font-size: 10px; font-family: var(--font-mono); color: var(--text-4);
}
.chart-bars {
  position: relative;
  display: flex; align-items: flex-end; gap: 6px;
  height: 100%; padding-left: 0;
}
.chart-col {
  flex: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.chart-bar-track {
  width: 100%; max-width: 32px;
  flex: 1;
  display: flex; align-items: flex-end;
}
.chart-bar-fill {
  width: 100%;
  background: rgba(167,139,250,.32);
  border-radius: 6px 6px 2px 2px;
  transition: background .15s, height .3s ease;
}
.chart-bar-fill[data-active="true"] { background: rgba(167,139,250,.6); }
.chart-bar-fill[data-today="true"] { background: var(--lavender); }
[data-theme="light"] .chart-bar-fill { background: rgba(124,58,237,.5); }
[data-theme="light"] .chart-bar-fill[data-active="true"] { background: rgba(124,58,237,.75); }
.chart-x {
  font-size: 10px; color: var(--text-3); font-family: var(--font-mono);
  height: 14px;
}
.chart-x[data-today="true"] { color: var(--lavender-2); font-weight: 600; }
.chart-col[data-active="true"] .chart-x { color: var(--text); }

/* ============================================
   TIMELINE
   ============================================ */
.tl-card { padding: 0; overflow: hidden; }
.tl-scroll { padding: 28px 24px; }
.tl-rail {
  position: relative;
  display: flex;
  gap: 28px;
  min-width: max-content;
  padding-top: 28px;
}
.tl-axis {
  position: absolute; top: 14px;
  left: 8px; right: 8px;
  height: 2px;
  background: linear-gradient(90deg,
    var(--mint) 0%, var(--mint) 50%,
    var(--lavender) 50%, var(--lavender) 66%,
    var(--text-4) 66%, var(--text-4) 100%);
  opacity: .5;
  border-radius: 2px;
}
.tl-month {
  min-width: 250px;
  display: flex; flex-direction: column;
  position: relative;
}
.tl-month-head {
  position: absolute; top: -42px; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
}
.tl-month-marker {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--canvas);
}
.tl-month[data-tone="done"] .tl-month-marker { background: var(--mint); box-shadow: 0 0 0 2px var(--mint), 0 0 12px var(--mint); }
.tl-month[data-tone="doing"] .tl-month-marker { background: var(--lavender); box-shadow: 0 0 0 2px var(--lavender), 0 0 16px var(--lavender); }
.tl-month[data-tone="todo"] .tl-month-marker { background: var(--text-4); box-shadow: 0 0 0 2px var(--text-4); }
.tl-month-label {
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 600; color: var(--text);
  letter-spacing: -.01em;
}
.tl-month-count {
  font-size: 10px; color: var(--text-3); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .06em;
}
.tl-events {
  display: flex; flex-direction: column; gap: 8px;
  padding-top: 16px;
}
.tl-event {
  display: grid; grid-template-columns: 36px 1fr;
  gap: 10px; align-items: center;
  padding: 8px 10px;
  background: var(--inner-cell-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: background .12s, border-color .12s;
}
.tl-event:hover { background: var(--inner-cell-bg-hover); border-color: var(--line-strong); }
.tl-event-bloc {
  font-family: var(--font-mono); font-size: 10px;
  font-weight: 600;
  padding: 3px 6px;
  background: var(--track-bg);
  border-radius: 4px;
  text-align: center;
  color: var(--text-2);
}
.tl-month[data-tone="done"] .tl-event-bloc { color: var(--mint-2); background: rgba(52,211,153,.12); }
.tl-month[data-tone="doing"] .tl-event-bloc { color: var(--lavender-2); background: rgba(167,139,250,.15); }
.tl-event-date {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-3);
}
.tl-event-label {
  font-size: 12px; color: var(--text); letter-spacing: -.01em;
  margin-top: 2px;
  line-height: 1.3;
}

/* ============================================
   COMPANIES + ACTIVITY (bottom grid)
   ============================================ */
.bottom-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px;
  align-items: stretch;
}
.bottom-left-stack {
  display: flex; flex-direction: column; gap: 24px;
  min-height: 0;
}
.bottom-left-stack > section,
.bottom-grid > section {
  display: flex; flex-direction: column;
  min-height: 0;
}
.bottom-left-stack > section:last-child { flex: 1; }
.bottom-left-stack > section > .card,
.bottom-grid > section > .card {
  flex: 1;
  display: flex; flex-direction: column;
}
@media (max-width: 1200px) {
  .bottom-grid { grid-template-columns: 1fr; }
}

/* ====== GED — Documents card ====== */
.ged-card {
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 18px;
}
/* Stripe KPIs en haut */
.ged-stripe {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line);
}
.ged-kpi {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--inner-cell-bg);
  border: 1px solid var(--line);
}
.ged-kpi-num {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 500;
  letter-spacing: -.04em; line-height: 1;
  color: var(--text);
}
.ged-kpi-lbl {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em;
  display: flex; align-items: center; gap: 5px;
}
.ged-kpi-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
.ged-kpi--info    .ged-kpi-dot { background: var(--sky); }
.ged-kpi--warn    .ged-kpi-dot { background: var(--amber); }
.ged-kpi--success .ged-kpi-dot { background: var(--mint); }
.ged-kpi--neutral .ged-kpi-dot { background: var(--lavender); }

/* 2 colonnes : Derniers ajouts / À valider */
.ged-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  flex: 1;
}
.ged-col {
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.ged-col-head {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-2);
}
.ged-col-dot { width: 6px; height: 6px; border-radius: 50%; }
.ged-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.ged-doc-row {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}
.ged-doc-row:hover { background: var(--inner-cell-bg); }
.ged-doc-name {
  font-size: 12px; color: var(--text);
  letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ged-doc-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.ged-doc-idx {
  padding: 1px 5px;
  background: var(--inner-cell-bg-hover);
  border-radius: 4px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 9px;
  letter-spacing: -.01em;
}
.ged-doc-user { color: var(--text-3); }
.ged-doc-date { margin-left: auto; color: var(--text-4); }
.ged-empty {
  font-size: 12px; color: var(--text-3);
  font-family: var(--font-mono);
  padding: 12px 4px;
}

@media (max-width: 900px) {
  .ged-stripe { grid-template-columns: repeat(2, 1fr); }
  .ged-lists { grid-template-columns: 1fr; }
}

.co-card { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.co-row {
  display: grid; grid-template-columns: 40px 1fr 60px;
  gap: 14px; align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  transition: background .12s;
}
.co-row:hover { background: var(--inner-cell-bg); }
.co-logo {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600;
  font-size: 14px; letter-spacing: -.02em;
  background: var(--inner-cell-bg-hover);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.co-meta { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.co-name-row { display: flex; align-items: baseline; gap: 8px; }
.co-rank {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}
.co-name {
  font-size: 14px; font-weight: 600; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.co-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.co-bar { height: 4px; background: var(--inner-cell-bg-hover); border-radius: 999px; overflow: hidden; }
.co-bar-fill { height: 100%; border-radius: 999px; }
.co-meta-row {
  display: flex; gap: 12px; align-items: center;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
}
.co-meta-row b { color: var(--text); font-weight: 500; }
.co-total-wrap { text-align: right; }
.co-total {
  font-family: var(--font-mono); font-size: 26px; font-weight: 500;
  letter-spacing: -.04em; line-height: 1;
  color: var(--text);
}
.co-total-lbl {
  font-size: 10px; color: var(--text-4); font-family: var(--font-mono);
  text-transform: uppercase; letter-spacing: .08em;
  margin-top: 2px;
}

/* Activity */
.act-card { padding: 8px; }
.act-row {
  display: grid; grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 10px 14px 14px;
  align-items: flex-start;
}
.act-rail {
  position: relative; height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.act-avatar {
  width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 11px;
  letter-spacing: -.02em;
  flex-shrink: 0;
  z-index: 1;
  background: var(--inner-cell-bg-hover);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.act-line { width: 1px; flex: 1; background: var(--line); min-height: 8px; }
.act-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.act-head {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  font-size: 13px;
}
.act-author { font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.act-action { color: var(--text-2); }
.act-time {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10px; color: var(--text-4);
}
.act-transition { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.act-loc {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-3);
  letter-spacing: -.01em; line-height: 1.4;
}
.act-note {
  font-size: 12px; color: var(--text-2);
  padding: 6px 10px;
  background: rgba(167,139,250,.06);
  border-left: 2px solid var(--lavender);
  border-radius: 0 6px 6px 0;
  white-space: pre-wrap;
}
.act-note-tag {
  font-family: var(--font-mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--lavender);
  margin-right: 6px;
}
.act-link {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--lavender-2);
  text-decoration: none;
}
.act-link:hover { color: var(--lavender); }

/* Activity filters */
.act-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 8px 12px;
}
.act-filter {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  color: var(--text-3);
  cursor: pointer;
  transition: all .12s;
  font-family: var(--font-mono);
}
.act-filter:hover { color: var(--text-2); border-color: var(--line-strong); }
.act-filter.is-active {
  background: rgba(167,139,250,.12);
  color: var(--lavender-2);
  border-color: rgba(167,139,250,.25);
}

.act-row.is-hidden { display: none; }

/* ============================================
   FOOTER
   ============================================ */
.v2-footer {
  padding-top: 32px; margin-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-4);
  font-family: var(--font-mono);
}

/* ============================================
   BANNER (pilot pending demands)
   ============================================ */
.v2-banner {
  margin: 0 0 24px;
  padding: 18px 22px;
  border-radius: 16px;
  border: 1px solid rgba(251,113,133, .25);
  background: linear-gradient(135deg, rgba(251,113,133,.12), rgba(251,113,133,.04));
  color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
}
.v2-banner-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================
   MOBILE NAV — burger button + drawer + backdrop
   ============================================ */
.mobile-burger {
  display: none;
  width: 38px; height: 38px;
  border-radius: 8px;
  flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  padding: 0;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  margin-right: 6px;
  transition: background .15s, border-color .15s;
}
.mobile-burger:hover { background: rgba(255,255,255,.08); border-color: var(--line-strong); }
.mobile-burger span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform .25s cubic-bezier(.16,1,.3,1), opacity .25s;
  transform-origin: center;
}
body.mobile-nav-open .mobile-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.mobile-nav-open .mobile-burger span:nth-child(2) { opacity: 0; }
body.mobile-nav-open .mobile-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 99;
  touch-action: manipulation;
}
body.mobile-nav-open .mobile-backdrop {
  opacity: 1;
  pointer-events: auto;
}
/* Drawer ouvert : bloquer le scroll du body pour que les taps ne dérivent pas
   et que le scroll dans la sidebar ne propage pas à la page derrière (scroll chain).
   On NE met PAS position: fixed sur body — ça cause un énorme reflow qui peut
   retarder le paint des items du bas de la sidebar sur iOS Safari.
   On NE met PAS `touch-action: none` sur body — ça se propage à la sidebar et
   bloque le scroll pan-y pendant que iOS Safari settle les layers GPU. */
body.mobile-nav-open {
  overflow: hidden;
  overscroll-behavior: none;
}
html.mobile-nav-locked {
  overflow: hidden;
}

.mobile-title {
  display: none;
  font-size: 16px; font-weight: 600;
  letter-spacing: -.015em;
  color: var(--text);
}

/* ============================================
   MOBILE — tablette (≤900px)
   ============================================ */
@media (max-width: 900px) {
  /* Casser le stacking context de .app pour que la sidebar fixed monte au niveau root */
  .app {
    grid-template-columns: 1fr;
    position: static;
    z-index: auto;
  }

  /* Sidebar en drawer — fond opaque, pas de blur, z-index très élevé.
     translate3d (au lieu de translateX) force un layer GPU dès le départ.
     Transition raccourcie à .22s. Pas de `contain` / `isolation` qui peuvent
     causer du paint différé sur iOS Safari sous pression mémoire GPU.
     Hauteur explicite (100vh + 100dvh) au lieu de top/bottom pour éviter le
     reflow quand l'address bar iOS Safari se montre/cache dynamiquement. */
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    height: 100dvh;
    width: 320px;
    max-width: 88vw;
    z-index: 200;
    transform: translate3d(-100%, 0, 0);
    transition: transform .22s cubic-bezier(.16,1,.3,1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    border-right: 1px solid var(--line);
    background: var(--canvas);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
    isolation: auto;
    padding: var(--s-6) var(--s-4);
    gap: var(--s-6);
    will-change: transform;
  }
  /* Mobile : couper TOUTES les animations d'entrée à l'intérieur de la sidebar.
     Forcer opacity 1 + transform none sur les ENFANTS pour éviter qu'un état
     `backwards` ou cached reste figé. !important pour battre les règles à
     specificity égale plus loin dans le CSS (`.nav-group:nth-of-type`).
     ATTENTION : ne PAS toucher transform sur .sidebar elle-même (slide drawer). */
  .sidebar * {
    animation: none !important;
  }
  .sidebar .nav-group,
  .sidebar .nav-item,
  .sidebar .sidebar-brand,
  .sidebar .sidebar-user {
    opacity: 1 !important;
    transform: none !important;
  }
  .mobile-backdrop { z-index: 150; }
  body.mobile-nav-open .sidebar { transform: translate3d(0, 0, 0); }
  [data-theme="light"] .sidebar { background: #ffffff; }
  /* Cacher le toggle collapse desktop (inutile en mobile = drawer) */
  #v2SidebarToggle { display: none; }
  /* Liens nav encore plus gros sur mobile pour faciliter le tap */
  .sidebar .nav-item {
    padding: 13px var(--s-4);
    font-size: 15px;
    border-radius: 12px;
    gap: var(--s-4);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-burger {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar .nav-icon { width: 20px; height: 20px; }
  .sidebar .nav-icon svg { width: 20px; height: 20px; }
  .sidebar .nav-badge { font-size: 12px; padding: 3px 9px; }
  .sidebar .nav-label { font-size: 12px; padding: var(--s-4) var(--s-4) var(--s-2); }
  .sidebar .brand-mark { width: 44px; height: 44px; font-size: 16px; }
  .sidebar .brand-name { font-size: 17px; }
  .sidebar .brand-org { font-size: 12px; }
  .sidebar .sidebar-user { padding: var(--s-4); }
  .sidebar .user-avatar { width: 42px; height: 42px; font-size: 13px; }
  .sidebar .user-name { font-size: 14px; }
  .sidebar .user-role { font-size: 11px; }

  /* Burger affiché */
  .mobile-burger { display: flex; }

  /* Header : titre retiré, sélecteur de projet à gauche après le burger */
  .header {
    padding: 0 var(--s-4);
    gap: 8px;
  }
  .header-greet { display: none; }
  .mobile-title { display: none; }
  .context-pill { padding: 6px 10px; }
  .context-pill-text { display: flex; }
  .context-pill-label { display: none; }
  .date-stamp { display: none; }
  .header-divider { display: none; }
  /* Le spacer ne sert plus, c'est le project-switcher qui pousse les icons à droite */
  .header-spacer { display: none; }
  /* Cacher le MOE pill, garder seulement le sélecteur de projet visible */
  .header > .context-pill:first-of-type { display: none; }
  /* Sélecteur de projet : juste après le burger, prend la largeur dispo et pousse les icons à droite */
  .project-switcher {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 220px;
    margin-right: auto;
  }
  .project-switcher-toggle {
    max-width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .context-pill-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Menu déroulant projet : ancré à gauche en mobile */
  .project-menu { left: 0; right: auto; }

  /* Page intro */
  .main-inner { padding: 0 var(--s-4) var(--s-7); gap: var(--s-6); }
  .page-intro {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .page-title { font-size: 28px; }
  .page-intro-actions { justify-content: flex-end; }
  .page-intro-actions .btn { flex: 0 1 50%; justify-content: center; }

  /* Hero — full width, padding réduit */
  .hero-cell { padding: 18px; }
  .tar-big { font-size: 86px; }
  .tar-big small { font-size: 26px; }
  .hero-iap-num, .oger-big { font-size: 42px; }
  .pts-cells { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pt-cell-num { font-size: 24px; }

  /* Site Pulse : 2 colonnes en mobile + barres au lieu des cercles */
  .pulse-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pulse-card { padding: 14px; gap: 10px; }
  .pulse-name { font-size: 12px; }
  .pulse-fig  { display: none; }
  .pulse-bars { display: flex; flex-direction: column; gap: 8px; }
  .pulse-foot { padding-top: 6px; }
  .pulse-foot-item { font-size: 10px; }
  /* Sur mobile : cacher le texte des labels statut, garder dot + nombre */
  .pulse-count-lbl,
  .pulse-count-sep,
  .pulse-status-lbl { display: none; }
  /* Belt and suspenders : si jamais le texte est en text node direct (PHP pas à jour),
     on neutralise quand même via font-size:0 sur .pulse-status, en restaurant la taille du dot */
  .pulse-status {
    font-size: 0;
    gap: 0;
  }
  .pulse-status-dot {
    font-size: initial;
  }
  /* Compact les chips compteurs : padding réduit, dot + nombre seulement */
  .pulse-count {
    padding: 4px 8px;
    gap: 4px;
    font-size: 11px;
  }
  .pulse-count .chip-dot { font-size: initial; }
  .pulse-count .pulse-count-num { font-size: 11px; font-weight: 600; }
  /* Section head du pulse devient empilé */
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head > div:nth-child(2) { flex-wrap: wrap; gap: 6px; }

  /* Quick : cards plus compactes (2 cols si possible, sinon 1) */
  .quick-grid { grid-template-columns: 1fr; gap: 10px; }
  .qc { padding: 16px 18px; min-height: 0; gap: 10px; }
  .qc-num { font-size: 36px; }

  /* Présence — mobile : 7 derniers jours, barres qui remplissent l'espace */
  .v2-presence-card { padding: 16px; }
  .presence-num span.val { font-size: 36px; }
  .chart-wrap { height: 160px; padding-left: 28px; }
  .chart-bars { gap: 6px; }
  .v2-presence-legend { gap: 18px; }
  .chart-col:nth-child(-n+8) { display: none; }
  /* Les 7 barres restantes prennent toute la largeur dispo */
  .chart-bar-track { max-width: none; }

  /* Timeline (déjà scrollable horizontalement) */
  .tl-scroll { padding: 28px 18px; }

  /* GED card mobile */
  .ged-stripe { grid-template-columns: repeat(2, 1fr); }
  .ged-lists { grid-template-columns: 1fr; gap: 12px; }
  .ged-card { padding: 16px; }

  /* Bottom grid : 1 col déjà géré */
  .bottom-grid { gap: 16px; }
  .bottom-left-stack { gap: 16px; }

  /* Activity items un peu plus compacts */
  .act-row { padding: 8px 12px 12px; }

  /* Footer mobile */
  .v2-footer { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ============================================
   MOBILE — petit téléphone (≤500px)
   ============================================ */
@media (max-width: 500px) {
  /* Site Pulse reste en 2 colonnes mais on rétrécit le padding et les barres */
  .pulse-card { padding: 12px; gap: 8px; }
  .pulse-bar-row { grid-template-columns: 24px 1fr 38px; gap: 6px; }
  .pulse-bar-val { font-size: 12px; }
  .pulse-name { font-size: 11px; }
  .ged-stripe { grid-template-columns: 1fr 1fr; }
  .page-title { font-size: 24px; }
  .tar-big { font-size: 72px; }
  .header { padding: 0 12px; }
  .main-inner { padding: 0 12px var(--s-7); }
  /* Cacher aussi le projet pill — garder juste le titre */
  .header > .context-pill { display: none; }
}

/* ============================================
   ANIMATIONS — entrée, hovers, attention
   ============================================ */

/* ---- Keyframes ---- */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes drawRing {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: var(--final-offset, 0); }
}
@keyframes barRise {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(251,113,133,.18); }
  50%      { box-shadow: 0 0 0 6px rgba(251,113,133,.08); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes ringPing {
  0%   { transform: scale(1); opacity: .6; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ---- Sections du main : reveal-on-scroll via IntersectionObserver ---- */
.main-inner > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s cubic-bezier(.16,1,.3,1), transform .55s cubic-bezier(.16,1,.3,1);
  will-change: opacity, transform;
}
.main-inner > *.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sidebar : entrée des groupes nav */
.nav-group { animation: fadeSlideUp .4s cubic-bezier(.16,1,.3,1) backwards; }
.nav-group:nth-of-type(1) { animation-delay: .1s; }
.nav-group:nth-of-type(2) { animation-delay: .18s; }
.nav-group:nth-of-type(3) { animation-delay: .26s; }
.nav-group:nth-of-type(4) { animation-delay: .34s; }
.sidebar-brand { animation: fadeIn .5s ease-out; }
.sidebar-user  { animation: fadeIn .8s ease-out .4s backwards; }

/* Hero - chiffres et anneau (déclenchés quand section .is-visible) */
.tar-big, .hero-iap-num, .oger-big, .hero-points-total { display: inline-block; }
.is-visible .tar-big       { animation: scaleIn .7s cubic-bezier(.16,1,.3,1) .15s backwards; }
.is-visible .hero-iap-num  { animation: scaleIn .7s cubic-bezier(.16,1,.3,1) .25s backwards; }
.is-visible .oger-big      { animation: scaleIn .7s cubic-bezier(.16,1,.3,1) .20s backwards; }
.is-visible .hero-points-total { animation: scaleIn .7s cubic-bezier(.16,1,.3,1) .30s backwards; }

/* Anneaux SVG — état initial caché, "drawing" déclenché par .is-visible parent */
.pulse-ring-arc { stroke-dashoffset: 100; }
.iap-ring-arc   { stroke-dashoffset: 100; }
.is-visible .pulse-ring-arc {
  animation: drawRing 1.2s cubic-bezier(.16,1,.3,1) .2s forwards;
}
.is-visible .iap-ring-arc {
  animation: drawRing 1.4s cubic-bezier(.16,1,.3,1) .25s forwards;
}

/* Barres Présence — état initial caché, monte staggered quand section .is-visible */
.chart-bar-fill {
  transform-origin: bottom;
  transform: scaleY(0);
}
.is-visible .chart-bar-fill {
  animation: barRise .65s cubic-bezier(.16,1,.3,1) forwards;
}
.is-visible .chart-col:nth-child(1)  .chart-bar-fill { animation-delay: .10s; }
.is-visible .chart-col:nth-child(2)  .chart-bar-fill { animation-delay: .14s; }
.is-visible .chart-col:nth-child(3)  .chart-bar-fill { animation-delay: .18s; }
.is-visible .chart-col:nth-child(4)  .chart-bar-fill { animation-delay: .22s; }
.is-visible .chart-col:nth-child(5)  .chart-bar-fill { animation-delay: .26s; }
.is-visible .chart-col:nth-child(6)  .chart-bar-fill { animation-delay: .30s; }
.is-visible .chart-col:nth-child(7)  .chart-bar-fill { animation-delay: .34s; }
.is-visible .chart-col:nth-child(8)  .chart-bar-fill { animation-delay: .38s; }
.is-visible .chart-col:nth-child(9)  .chart-bar-fill { animation-delay: .42s; }
.is-visible .chart-col:nth-child(10) .chart-bar-fill { animation-delay: .46s; }
.is-visible .chart-col:nth-child(11) .chart-bar-fill { animation-delay: .50s; }
.is-visible .chart-col:nth-child(12) .chart-bar-fill { animation-delay: .54s; }
.is-visible .chart-col:nth-child(13) .chart-bar-fill { animation-delay: .58s; }
.is-visible .chart-col:nth-child(14) .chart-bar-fill { animation-delay: .62s; }
.is-visible .chart-col:nth-child(15) .chart-bar-fill { animation-delay: .66s; }

/* ---- Hover effects renforcés ---- */

/* Cards Pulse : lift + glow lavender */
.pulse-card {
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s ease, border-color .15s, background .15s;
}
.pulse-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0,0,0,.3), 0 0 0 1px var(--lavender);
}
[data-theme="light"] .pulse-card:hover {
  box-shadow: 0 14px 28px rgba(15,15,20,.10), 0 0 0 1px var(--lavender);
}

/* Quick cards : lift */
.qc {
  transition: transform .25s cubic-bezier(.16,1,.3,1), box-shadow .25s, border-color .15s;
}
.qc:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(0,0,0,.22);
}
.qc:hover .qc-icon { transform: scale(1.08); }
.qc-icon { transition: transform .25s cubic-bezier(.16,1,.3,1); }
[data-theme="light"] .qc:hover { box-shadow: 0 12px 24px rgba(15,15,20,.08); }

/* Hero cells : subtle lift au hover */
.hero-cell {
  transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .15s, box-shadow .25s;
}
.hero-cell:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.hero-cell:hover.hero-tar { box-shadow: 0 8px 24px rgba(167,139,250,.12); }
.hero-cell:hover.hero-iap { box-shadow: 0 8px 24px rgba(167,139,250,.12); }
.hero-cell:hover.hero-oger { box-shadow: 0 8px 24px rgba(52,211,153,.12); }

/* Companies rows : slide-right + accent */
.co-row {
  transition: background .18s ease, transform .18s ease, padding-left .18s ease;
}
.co-row:hover {
  background: var(--inner-cell-bg);
  transform: translateX(4px);
}

/* GED doc rows : slide-right + couleur */
.ged-doc-row {
  transition: background .18s ease, padding-left .18s ease, color .18s ease;
}
.ged-doc-row:hover {
  background: var(--inner-cell-bg);
  padding-left: 14px;
}
.ged-doc-row:hover .ged-doc-name { color: var(--lavender-2); }
[data-theme="light"] .ged-doc-row:hover .ged-doc-name { color: var(--lavender); }

/* Activity rows : highlight au hover */
.act-row {
  transition: background .18s ease;
  border-radius: 8px;
}
.act-row:hover { background: var(--inner-cell-bg); }

/* Boutons primary : shimmer au hover */
.v2-dashboard .btn-primary {
  position: relative;
  overflow: hidden;
}
.v2-dashboard .btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.25) 50%, transparent 100%);
  transform: translateX(-100%);
  pointer-events: none;
}
.v2-dashboard .btn-primary:hover::after {
  animation: shimmer .8s ease;
}

/* Boutons standards : transform au hover */
.v2-dashboard .btn {
  transition: background .15s, border-color .15s, transform .15s, box-shadow .2s;
}
.v2-dashboard .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
}
[data-theme="light"] .v2-dashboard .btn:hover { box-shadow: 0 4px 10px rgba(15,15,20,.08); }

/* Context-pill (header MOE/Projet) */
.context-pill { transition: background .15s, border-color .15s, transform .15s; }
.context-pill:hover { transform: translateY(-1px); }

/* Icon-btn (header) : scale au hover */
.icon-btn { transition: background .15s, color .15s, border-color .15s, transform .15s; }
.icon-btn:hover { transform: scale(1.1); }

/* ---- Attention micro-animations ---- */

/* Notif dot dans header : pulse infini */
.icon-btn .notif-dot {
  animation: pulse 1.8s ease-in-out infinite;
}
.icon-btn .notif-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--coral);
  animation: ringPing 1.8s ease-out infinite;
  pointer-events: none;
}

/* Pulse cards à risque : status dot pulse */
.pulse-card.s-risk .pulse-status-dot {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* Hover sur compteur chips */
.chip { transition: transform .15s ease; }
.chip:hover { transform: translateY(-1px); }

/* GED KPI cells : scale au hover */
.ged-kpi { transition: transform .15s ease, background .15s; }
.ged-kpi:hover { transform: translateY(-2px); background: var(--inner-cell-bg-hover); }

/* Chart bars (présence) : subtle scale */
.chart-col { transition: transform .15s ease; }
.chart-col:hover { transform: scale(1.04); }

/* Désactiver animations si reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
