/* ==========================================================================
   iProject — feuille de style
   ========================================================================== */

:root {
  color-scheme: light;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --surface-3: #f1efe9;
  --border: #e7e4dc;
  --border-strong: #d6d2c7;
  --text: #16151b;
  --text-2: #4a4855;
  --muted: #85838e;

  --primary: #2f4fd1;
  --primary-hover: #2541b3;
  --primary-soft: #edf0fc;
  --primary-ink: #2440b0;
  --accent: #a87a26;
  --accent-soft: #f7efdf;
  --success: #12804f;
  --success-soft: #e5f3ec;
  --warning: #a8650c;
  --warning-soft: #fbf0dc;
  --danger: #c0392f;
  --danger-soft: #fbe9e7;

  --side-bg: #111219;
  --side-bg-2: #171822;
  --side-text: #a3a5b4;
  --side-strong: #f3f3f6;
  --side-hover: rgba(255, 255, 255, .05);
  --side-active: rgba(255, 255, 255, .09);
  --side-border: rgba(255, 255, 255, .07);

  /* Données (palette validée : catégorielle, séquentielle, statuts) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --status-neutral: #c9c6bc;
  --grid: #e8e6df;
  --axis: #c3c2b7;
  --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95;
  --div-neg-2: #d03b3b; --div-neg-1: #f2b8b2; --div-mid: #f0efec; --div-pos-1: #9ec5f4; --div-pos-2: #256abf;

  --shadow-xs: 0 1px 2px rgba(22, 21, 27, .05);
  --shadow: 0 1px 2px rgba(22, 21, 27, .04), 0 6px 20px -8px rgba(22, 21, 27, .10);
  --shadow-lg: 0 24px 60px -20px rgba(22, 21, 27, .35);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-w: 264px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0f14;
    --surface: #16171f;
    --surface-2: #1a1b24;
    --surface-3: #21222d;
    --border: #282a36;
    --border-strong: #353746;
    --text: #ededf2;
    --text-2: #c2c2cf;
    --muted: #8b8b9a;
    --primary: #7088ff;
    --primary-hover: #8a9dff;
    --primary-soft: rgba(112, 136, 255, .13);
    --primary-ink: #9fb0ff;
    --accent: #d7a954;
    --accent-soft: rgba(215, 169, 84, .13);
    --success: #3cc68a;
    --success-soft: rgba(60, 198, 138, .12);
    --warning: #e7a94a;
    --warning-soft: rgba(231, 169, 74, .13);
    --danger: #f07a70;
    --danger-soft: rgba(240, 122, 112, .13);
    --side-bg: #0a0b0f;
    --side-bg-2: #101118;
    --series-1: #3987e5;
    --series-2: #d95926;
    --status-neutral: #4a4a52;
    --grid: #2a2b33;
    --axis: #3b3c45;
    --div-mid: #383835; --div-neg-1: #8c3a35; --div-pos-1: #2f5d93;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f14;
  --surface: #16171f;
  --surface-2: #1a1b24;
  --surface-3: #21222d;
  --border: #282a36;
  --border-strong: #353746;
  --text: #ededf2;
  --text-2: #c2c2cf;
  --muted: #8b8b9a;
  --primary: #7088ff;
  --primary-hover: #8a9dff;
  --primary-soft: rgba(112, 136, 255, .13);
  --primary-ink: #9fb0ff;
  --accent: #d7a954;
  --accent-soft: rgba(215, 169, 84, .13);
  --success: #3cc68a;
  --success-soft: rgba(60, 198, 138, .12);
  --warning: #e7a94a;
  --warning-soft: rgba(231, 169, 74, .13);
  --danger: #f07a70;
  --danger-soft: rgba(240, 122, 112, .13);
  --side-bg: #0a0b0f;
  --side-bg-2: #101118;
  --series-1: #3987e5;
  --series-2: #d95926;
  --status-neutral: #4a4a52;
  --grid: #2a2b33;
  --axis: #3b3c45;
  --div-mid: #383835; --div-neg-1: #8c3a35; --div-pos-1: #2f5d93;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: var(--primary-ink); text-decoration: none; }
a:hover { color: var(--primary); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
img, svg { display: block; }
[data-lucide], .icon { width: 16px; height: 16px; stroke-width: 1.75; flex-shrink: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
::selection { background: var(--primary-soft); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 28px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------------------
   Layout applicatif
   -------------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-2) 100%);
  color: var(--side-text);
  border-right: 1px solid var(--side-border);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 22px 20px 18px; color: var(--side-strong); }
.brand:hover { color: var(--side-strong); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3d5cf0 0%, #2337a8 55%, #b8862f 140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px -6px rgba(61, 92, 240, .7);
  font-family: var(--font-display); font-weight: 600; font-size: 19px; color: #fff; font-style: italic;
}
.brand-name { font-family: var(--font-display); font-size: 21px; font-weight: 500; letter-spacing: -.02em; }
.brand-name em { font-style: italic; color: #c9a25a; font-weight: 500; }

.project-switch { margin: 0 14px 10px; position: relative; }
.project-switch summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04);
  border: 1px solid var(--side-border); color: var(--side-strong);
}
.project-switch summary::-webkit-details-marker { display: none; }
.project-switch summary:hover { background: rgba(255,255,255,.07); }
.project-switch .ps-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-text); }
.project-switch .ps-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.project-switch .ps-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); padding: 6px;
  background: #1c1d28; border: 1px solid var(--side-border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.project-switch .ps-menu button, .project-switch .ps-menu a {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px;
  background: none; border: 0; color: var(--side-text); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.project-switch .ps-menu button:hover, .project-switch .ps-menu a:hover { background: var(--side-hover); color: var(--side-strong); }
.project-switch .ps-menu .is-current { color: var(--side-strong); }

.nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: #2b2d3a transparent; }
.nav-section { margin-top: 16px; }
.nav-title { padding: 0 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #6c6e7e; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0;
  border-radius: 9px; color: var(--side-text); font-weight: 500; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--side-hover); color: var(--side-strong); }
.nav a.active { background: var(--side-active); color: var(--side-strong); box-shadow: inset 2px 0 0 #c9a25a; }
.nav a.active [data-lucide] { color: #c9a25a; }
.nav .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: grid; place-items: center; font-size: 11px; font-weight: 600;
  background: #3d5cf0; color: #fff;
}
.sidebar-foot { padding: 14px; border-top: 1px solid var(--side-border); display: flex; align-items: center; gap: 10px; }
.sidebar-foot .who { flex: 1; min-width: 0; color: var(--side-strong); }
.sidebar-foot .who a { color: var(--side-strong); }
.sidebar-foot .who small { display: block; color: var(--side-text); font-size: 11.5px; }
.side-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--side-text); cursor: pointer;
}
.side-btn:hover { background: var(--side-hover); color: var(--side-strong); border-color: var(--side-border); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 60px; padding: 0 32px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .5; }
.crumbs .here { color: var(--text); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.today-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px;
}

.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 32px 64px; }

/* --------------------------------------------------------------------------
   En-têtes de page
   -------------------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}
.page-title { font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1.12; letter-spacing: -.02em; }
.page-title em { font-style: italic; color: var(--primary); }
.page-sub { margin-top: 8px; color: var(--text-2); max-width: 760px; font-size: 14.5px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 15px; font-weight: 600; margin: 32px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title small { font-weight: 400; color: var(--muted); font-size: 13px; }

/* --------------------------------------------------------------------------
   Grilles
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) 340px; }
.span-2 { grid-column: span 2; }

/* --------------------------------------------------------------------------
   Cartes
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs); min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.card-title [data-lucide] { color: var(--muted); }
.card-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 16px 20px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.card-link { font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.card.pad { padding: 20px; }
.card.flat { box-shadow: none; }
.card-hover { transition: border-color .15s, box-shadow .2s, transform .2s; }
.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }

/* KPI */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi-label { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.kpi-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi-icon.gold { background: var(--accent-soft); color: var(--accent); }
.kpi-icon.green { background: var(--success-soft); color: var(--success); }
.kpi-icon.red { background: var(--danger-soft); color: var(--danger); }
.kpi-value { margin-top: 14px; font-size: 30px; font-weight: 600; letter-spacing: -.025em; line-height: 1; }
.kpi-value small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi-meta { margin-top: 10px; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi .progress { margin-top: 14px; }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 26px 28px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(201, 162, 90, .22) 0%, transparent 45%),
    radial-gradient(90% 120% at 0% 100%, rgba(61, 92, 240, .35) 0%, transparent 55%),
    linear-gradient(135deg, #151726 0%, #1b1f3a 60%, #22264a 100%);
  color: #eef0fb; border: 1px solid rgba(255,255,255,.06);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 40%, #000 100%);
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { color: #d9b46c; }
.hero-title { font-family: var(--font-display); font-weight: 500; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; max-width: 680px; }
.hero-title em { color: #d9b46c; }
.hero-sub { color: #b9bdd6; margin-top: 10px; max-width: 640px; }
.hero-stats { display: flex; gap: 34px; margin-top: 22px; flex-wrap: wrap; }
.hero-stat .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: #fff; }
.hero-stat .l { font-size: 12px; color: #9da2c2; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
.hero-countdown { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.hero-countdown .big { font-size: 34px; font-weight: 600; color: #fff; line-height: 1; letter-spacing: -.03em; }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 4px 12px -4px color-mix(in srgb, var(--primary) 60%, transparent); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-dark { background: var(--text); color: var(--surface); }
.btn-dark:hover { opacity: .9; color: var(--surface); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--surface-2); border-color: var(--muted); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; gap: 6px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-xs.btn-icon { width: 26px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.inline-form { display: inline; }

/* --------------------------------------------------------------------------
   Badges, pastilles
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2);
}
.badge [data-lucide] { width: 12px; height: 12px; }
.badge-primary { background: var(--primary-soft); color: var(--primary-ink); }
.badge-gold { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 5px; font-size: 11px; font-weight: 600; letter-spacing: .02em; background: var(--surface-3); color: var(--text-2); }
.tag-ac { background: var(--primary-soft); color: var(--primary-ink); }
.tag-pc { background: var(--accent-soft); color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--muted); }
.dot-todo { background: var(--status-neutral); }
.dot-doing { background: var(--series-1); }
.dot-blocked { background: var(--status-critical); }
.dot-done { background: var(--status-good); }

.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.health [data-lucide] { width: 14px; height: 14px; }
.health-ok { color: var(--success); }
.health-surveiller { color: var(--warning); }
.health-alerte { color: var(--danger); }

.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; }
.prio [data-lucide] { width: 13px; height: 13px; }
.prio-critique { color: var(--danger); }
.prio-haute { color: var(--warning); }
.prio-normale { color: var(--muted); }
.prio-basse { color: var(--muted); opacity: .8; }

/* --------------------------------------------------------------------------
   Avatars
   -------------------------------------------------------------------------- */
.avatar {
  --size: 32px;
  width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center; color: #fff; font-weight: 600;
  font-size: calc(var(--size) * .38); letter-spacing: .02em; background: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.avatar-xs { --size: 22px; }
.avatar-sm { --size: 28px; }
.avatar-lg { --size: 44px; }
.avatar-xl { --size: 64px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person-name { font-weight: 500; line-height: 1.25; }
.person-meta { color: var(--muted); font-size: 12px; }

/* --------------------------------------------------------------------------
   Progression
   -------------------------------------------------------------------------- */
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress.gold > span { background: var(--accent); }
.progress.green > span { background: var(--success); }
.progress-lg { height: 8px; }

.ring {
  --v: 0; --size: 56px; --thick: 6px; --color: var(--primary);
  width: var(--size); height: var(--size); border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--color) calc(var(--v) * 1%), var(--surface-3) 0);
  display: grid; place-items: center; position: relative;
}
.ring::before { content: ""; position: absolute; inset: var(--thick); border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.ring-lg { --size: 84px; --thick: 8px; }
.ring-lg span { font-size: 19px; }
.ring-sm { --size: 40px; --thick: 4px; }
.ring-sm span { font-size: 11px; }

/* Barre segmentée (répartition des statuts) */
.segbar { display: flex; gap: 2px; height: 10px; border-radius: 4px; overflow: hidden; }
.segbar > span { display: block; height: 100%; min-width: 0; }
.segbar > span:first-child { border-radius: 4px 0 0 4px; }
.segbar > span:last-child { border-radius: 0 4px 4px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend b { font-weight: 600; color: var(--text); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 2px; width: 14px; border-radius: 2px; }

/* Liste de barres horizontales (une série) */
.barlist { display: flex; flex-direction: column; gap: 11px; }
.barlist-row { display: grid; grid-template-columns: minmax(110px, 170px) 1fr 52px; align-items: center; gap: 12px; position: relative; }
.barlist-row .lbl { font-size: 13px; color: var(--text-2); }
.barlist-row .lbl a { color: inherit; }
.barlist-row .lbl a:hover { color: var(--primary); }
.barlist-row .track { position: relative; height: 18px; display: flex; align-items: center; }
.barlist-row .track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--grid); }
.barlist-row .fill { position: relative; height: 14px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.barlist-row .val { font-size: 12.5px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.barlist-row:hover .fill { filter: brightness(1.08); }
.barlist-row .target { position: absolute; top: -1px; bottom: -1px; width: 2px; background: var(--text); opacity: .35; border-radius: 1px; }

/* Infobulle */
.tip {
  position: fixed; z-index: 100; pointer-events: none; padding: 8px 10px; border-radius: 8px;
  background: var(--text); color: var(--surface); font-size: 12px; line-height: 1.4; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; max-width: 260px;
}
.tip.show { opacity: 1; transform: none; }
.tip { white-space: pre-line; }
.tip::first-line { font-weight: 600; }

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2385838e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-sm, .select-sm { height: 32px; font-size: 13px; border-radius: 8px; }
.input-icon { position: relative; }
.input-icon [data-lucide] { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 34px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
input[type="range"] { accent-color: var(--primary); width: 100%; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.form-section { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--text); margin: 8px 0 -4px; grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.form-section::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.filters .select, .filters .input { width: auto; min-width: 150px; }
.filters .input-icon { min-width: 240px; }
.filters .input-icon .input { width: 100%; min-width: 0; }

/* Choix de membres */
.picker { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 12px; padding: 6px; background: var(--surface-2); }
.picker label { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.picker label:hover { background: var(--surface-3); }
.picker input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* Notation 1–5 */
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.score-row:last-child { border-bottom: 0; }
.score-row .crit-name { font-weight: 600; }
.score-row .crit-desc { color: var(--muted); font-size: 12.5px; }
.score-row .input { grid-column: 1 / -1; height: 32px; font-size: 12.5px; }
.score-pills { display: flex; gap: 4px; }
.score-pills input { position: absolute; opacity: 0; pointer-events: none; }
.score-pills label {
  width: 38px; height: 34px; display: grid; place-items: center; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--border-strong); font-weight: 600; color: var(--text-2); background: var(--surface);
  transition: all .12s;
}
.score-pills label:hover { border-color: var(--primary); color: var(--primary); }
.score-pills input:checked + label { color: #fff; border-color: transparent; }
.score-pills input[value="1"]:checked + label { background: var(--div-neg-2); }
.score-pills input[value="2"]:checked + label { background: #e0766c; }
.score-pills input[value="3"]:checked + label { background: #8d8b84; }
.score-pills input[value="4"]:checked + label { background: var(--seq-4); }
.score-pills input[value="5"]:checked + label { background: var(--seq-5); }
.score-pills input:focus-visible + label { outline: 2px solid var(--primary); outline-offset: 2px; }

/* --------------------------------------------------------------------------
   Tableaux
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table th:first-child { border-top-left-radius: 10px; }
.table th:last-child { border-top-right-radius: 10px; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact td { padding: 8px 12px; }
.card > .table-wrap .table th:first-child, .card > .table-wrap .table td:first-child { padding-left: 20px; }
.card > .table-wrap .table th:last-child, .card > .table-wrap .table td:last-child { padding-right: 20px; }
.card > .table-wrap .table th { border-radius: 0; }
.card > .table-wrap:first-child .table th:first-child { border-top-left-radius: var(--radius-lg); }
.card > .table-wrap:first-child .table th:last-child { border-top-right-radius: var(--radius-lg); }

/* Matrices (cartes de chaleur) */
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: 12.5px; }
.heat th { font-weight: 600; color: var(--muted); font-size: 11.5px; padding: 6px 8px; text-align: center; vertical-align: bottom; }
.heat th.rowh { text-align: left; color: var(--text-2); font-size: 13px; white-space: nowrap; font-weight: 500; }
.heat td { height: 36px; min-width: 52px; text-align: center; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--muted); position: relative; }
.heat td.na { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--surface-3) 4px, var(--surface-3) 8px); }
.heat td.s1 { background: var(--seq-1); color: #0d366b; }
.heat td.s2 { background: var(--seq-2); color: #0d366b; }
.heat td.s3 { background: var(--seq-3); color: #0b2a55; }
.heat td.s4 { background: var(--seq-4); color: #fff; }
.heat td.s5 { background: var(--seq-5); color: #fff; }
.heat td.s6 { background: var(--seq-6); color: #fff; }
.heat td.d1 { background: var(--div-neg-2); color: #fff; }
.heat td.d2 { background: var(--div-neg-1); color: #5e1712; }
.heat td.d3 { background: var(--div-mid); color: var(--text-2); }
.heat td.d4 { background: var(--div-pos-1); color: #0d366b; }
.heat td.d5 { background: var(--div-pos-2); color: #fff; }
:root[data-theme="dark"] .heat td.d2 { color: #fff; }
:root[data-theme="dark"] .heat td.d4 { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .heat td.d2, :root:not([data-theme="light"]) .heat td.d4 { color: #fff; } }
.heat td a { position: absolute; inset: 0; }
.heat tr:hover th.rowh { color: var(--primary); }
.scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.scale .sw { display: flex; gap: 2px; }
.scale .sw i { width: 22px; height: 10px; border-radius: 3px; }

/* --------------------------------------------------------------------------
   Onglets & contrôle segmenté
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-weight: 500;
  color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs .active { color: var(--text); border-bottom-color: var(--accent); }
.tabs .badge { height: 19px; font-size: 11px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border); }
.segmented a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* --------------------------------------------------------------------------
   Listes, flux d'activité
   -------------------------------------------------------------------------- */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.list-item .grow { min-width: 0; }
.list-title { font-weight: 500; line-height: 1.35; }
.list-title a { color: var(--text); }
.list-title a:hover { color: var(--primary); }
.list-meta { margin-top: 3px; color: var(--muted); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.feed-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex-shrink: 0; }
.feed-icon [data-lucide] { width: 14px; height: 14px; }
.date-chip { width: 44px; flex-shrink: 0; text-align: center; border-radius: 10px; border: 1px solid var(--border); overflow: hidden; background: var(--surface); }
.date-chip .m { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-3); color: var(--text-2); padding: 2px 0; font-weight: 600; }
.date-chip .d { font-size: 17px; font-weight: 600; padding: 3px 0 4px; }
.date-chip.late { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.date-chip.late .m { background: var(--danger-soft); color: var(--danger); }

.announce { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); position: relative; }
.announce + .announce { margin-top: 10px; }
.announce.important { border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.announce.urgent { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--danger-soft); }
.announce h4 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.announce p { margin-top: 6px; color: var(--text-2); font-size: 13px; }
.announce .meta { margin-top: 8px; font-size: 12px; color: var(--muted); }

.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.empty-icon [data-lucide] { width: 22px; height: 22px; }
.empty h3 { color: var(--text); font-size: 15px; margin-bottom: 4px; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--primary-soft); color: var(--text-2); font-size: 13px; }
.callout [data-lucide] { color: var(--primary); margin-top: 2px; }
.callout.gold { background: var(--accent-soft); }
.callout.gold [data-lucide] { color: var(--accent); }

/* Forces / faiblesses */
.sw-col h4 { font-size: 13px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }
.sw-col.force h4 { color: var(--success); }
.sw-col.vigil h4 { color: var(--warning); }
.sw-col.lacune h4 { color: var(--danger); }
.sw-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 6px; font-size: 13px; }
.sw-item .score { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.sw-col.force .sw-item { border-left: 3px solid var(--status-good); }
.sw-col.vigil .sw-item { border-left: 3px solid var(--status-warning); }
.sw-col.lacune .sw-item { border-left: 3px solid var(--status-critical); }
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bullets li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.bullets li [data-lucide] { margin-top: 2px; width: 15px; height: 15px; }
.bullets.good [data-lucide] { color: var(--success); }
.bullets.bad [data-lucide] { color: var(--danger); }

/* --------------------------------------------------------------------------
   Équipes
   -------------------------------------------------------------------------- */
.team-card { display: flex; flex-direction: column; padding: 20px; gap: 16px; color: var(--text); }
.team-card:hover { color: var(--text); }
.team-card .region { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.team-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 21px; letter-spacing: -.015em; margin-top: 3px; }
.team-card .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.team-card .facts .v { font-weight: 600; font-size: 15px; }
.team-card .facts .l { font-size: 11.5px; color: var(--muted); }
.team-card .estabs { display: flex; flex-wrap: wrap; gap: 4px; }
.estab-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); }
.estab-chip.done { background: var(--success-soft); color: var(--success); }
.region-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.region-filter button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.region-filter button.active { background: var(--text); color: var(--surface); border-color: var(--text); }

.member-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: 0; }

.estab-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.estab-row:last-child { border-bottom: 0; }
.visit-btn { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: transparent; transition: all .15s; }
.visit-btn:hover { border-color: var(--success); color: var(--success); }
.visit-btn.on { background: var(--success); border-color: var(--success); color: #fff; }
.visit-btn [data-lucide] { width: 14px; height: 14px; stroke-width: 2.5; }

.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.stat-strip > div { padding: 18px 20px; border-right: 1px solid var(--border); }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip .l { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-strip .v { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.stat-strip .v small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* --------------------------------------------------------------------------
   Kanban
   -------------------------------------------------------------------------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100vh - 250px); min-height: 200px; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; font-weight: 600; font-size: 13px; }
.kcol-head .badge { margin-left: auto; }
.kcol-body { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; transition: background .15s; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kcol.drag-over .kcol-body { background: var(--primary-soft); }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 12px 10px; cursor: grab; box-shadow: var(--shadow-xs); transition: box-shadow .15s, border-color .15s, transform .15s; color: var(--text); display: block; }
.kcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow); color: var(--text); }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kcard .kt { font-weight: 500; font-size: 13px; line-height: 1.4; }
.kcard .kmeta { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.kcard .kmeta .late { color: var(--danger); font-weight: 600; }
.kcard .kfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.kcard .ktags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.kcard .progress { height: 4px; margin-top: 10px; }

/* --------------------------------------------------------------------------
   Planning (Gantt)
   -------------------------------------------------------------------------- */
.gantt { position: relative; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.gantt-head { border-bottom: 1px solid var(--border); }
.gantt-scale { position: relative; height: 40px; }
.gantt-week { position: absolute; top: 0; bottom: 0; padding: 12px 8px; font-size: 11.5px; color: var(--muted); border-left: 1px solid var(--grid); white-space: nowrap; }
.gantt-label { padding: 12px 16px 12px 20px; display: flex; flex-direction: column; justify-content: center; border-right: 1px solid var(--border); min-width: 0; }
.gantt-label a { font-weight: 600; color: var(--text); }
.gantt-label a:hover { color: var(--primary); }
.gantt-row { border-bottom: 1px solid var(--border); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-row:hover { background: var(--surface-2); }
.gantt-track { position: relative; height: 58px; }
.gantt-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--grid); }
.gantt-bar {
  position: absolute; top: 15px; height: 28px; border-radius: 7px; padding: 0 10px;
  display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #fff;
  background: var(--series-1); white-space: nowrap; overflow: hidden; min-width: 8px;
  box-shadow: 0 4px 12px -6px rgba(42, 120, 214, .7);
}
.gantt-bar.wave-2 { background: var(--series-2); box-shadow: 0 4px 12px -6px rgba(235, 104, 52, .7); }
.gantt-prep { position: absolute; top: 26px; height: 6px; border-radius: 3px; background: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 4px, var(--border-strong) 4px, var(--border-strong) 6px); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 2; border-radius: 1px; }
.gantt-today::before { content: "Aujourd'hui"; position: absolute; top: 4px; left: 6px; font-size: 10.5px; font-weight: 600; color: var(--danger); white-space: nowrap; background: var(--surface); padding: 0 4px; border-radius: 4px; }
.gantt-body { position: relative; }
.gantt-today-layer { position: absolute; top: 0; bottom: 0; left: 220px; right: 0; pointer-events: none; }

/* --------------------------------------------------------------------------
   Messagerie
   -------------------------------------------------------------------------- */
.chat { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; height: calc(100vh - 60px - 56px); min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.chat-channels { border-right: 1px solid var(--border); background: var(--surface-2); overflow-y: auto; padding: 14px 10px; }
.chat-channels h5 { margin: 12px 8px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.chan { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; font-size: 13px; }
.chan:hover { background: var(--surface-3); color: var(--text); }
.chan.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); border: 1px solid var(--border); }
.chan .hash { color: var(--muted); }
.chan .count { margin-left: auto; background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.chat-head h2 { font-size: 16px; }
.chan-select { display: none; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.chat-stream { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; color: var(--muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.msg { display: flex; gap: 12px; padding: 6px 8px; border-radius: 10px; position: relative; }
.msg:hover { background: var(--surface-2); }
.msg.cont { padding-top: 1px; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.msg .mhead { display: flex; align-items: baseline; gap: 8px; }
.msg .mname { font-weight: 600; font-size: 13.5px; }
.msg .mtime { font-size: 11.5px; color: var(--muted); }
.msg .mbody { font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; color: var(--text); }
.msg .mdel { position: absolute; right: 8px; top: 6px; opacity: 0; }
.msg:hover .mdel { opacity: 1; }
.attach { display: inline-flex; align-items: center; gap: 10px; margin-top: 6px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; max-width: 360px; }
.attach [data-lucide] { color: var(--primary); }
.composer { padding: 14px 18px 18px; border-top: 1px solid var(--border); }
.composer-box { border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.composer textarea { width: 100%; border: 0; resize: none; padding: 12px 14px 4px; font: inherit; font-size: 13.5px; background: transparent; color: var(--text); max-height: 180px; outline: none; }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px 10px; }
.composer-bar .hint { font-size: 11.5px; color: var(--muted); }
.composer-bar .btn-primary { margin-left: auto; }
.file-pill { display: none; align-items: center; gap: 6px; font-size: 12px; background: var(--primary-soft); color: var(--primary-ink); padding: 3px 8px; border-radius: 6px; }
.file-pill.show { display: inline-flex; }
.chat-side { border-left: 1px solid var(--border); padding: 18px; overflow-y: auto; background: var(--surface-2); }
.chat-side h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 10px; }
.chat-side h4:first-child { margin-top: 0; }

/* --------------------------------------------------------------------------
   Documents
   -------------------------------------------------------------------------- */
.doc-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.doc-nav { position: sticky; top: 84px; }
.doc-nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; }
.doc-nav a:hover { background: var(--surface-3); color: var(--text); }
.doc-nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); border: 1px solid var(--border); }
.doc-nav a .n { margin-left: auto; font-size: 12px; color: var(--muted); }
.doc-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.doc-icon.pdf { background: var(--danger-soft); color: var(--danger); }
.doc-icon.xls, .doc-icon.xlsx, .doc-icon.csv, .doc-icon.xlsm, .doc-icon.ods { background: var(--success-soft); color: var(--success); }
.doc-icon.ppt, .doc-icon.pptx, .doc-icon.odp { background: var(--warning-soft); color: var(--warning); }
.doc-icon.png, .doc-icon.jpg, .doc-icon.jpeg, .doc-icon.gif, .doc-icon.webp { background: var(--accent-soft); color: var(--accent); }
.dropzone { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 28px; text-align: center; background: var(--surface-2); cursor: pointer; transition: all .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone [data-lucide] { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--primary); }
.dropzone .files { margin-top: 10px; font-size: 12.5px; color: var(--text-2); }

/* --------------------------------------------------------------------------
   Fenêtres modales
   -------------------------------------------------------------------------- */
dialog.modal { border: 0; padding: 0; border-radius: 20px; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog.modal::backdrop { background: rgba(14, 15, 22, .45); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .18s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 0; }
.modal-head h3 { font-family: var(--font-display); font-weight: 500; font-size: 21px; }
.modal-body { padding: 18px 22px 22px; }
.modal-body .form-actions { margin-top: 18px; }

/* --------------------------------------------------------------------------
   Notifications
   -------------------------------------------------------------------------- */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: slidein .25s cubic-bezier(.2,.8,.2,1); }
.toast [data-lucide] { margin-top: 1px; }
.toast.success [data-lucide] { color: var(--success); }
.toast.error [data-lucide] { color: var(--danger); }
.toast.info [data-lucide] { color: var(--primary); }
.toast.hide { opacity: 0; transform: translateX(12px); transition: all .3s; }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Authentification
   -------------------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); }
.auth-visual {
  position: relative; overflow: hidden; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; color: #eef0fb;
  background:
    radial-gradient(70% 60% at 85% 10%, rgba(201,162,90,.28) 0%, transparent 60%),
    radial-gradient(80% 80% at 0% 100%, rgba(61,92,240,.45) 0%, transparent 60%),
    linear-gradient(150deg, #0f1120 0%, #181c38 55%, #20254a 100%);
}
.auth-visual::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: radial-gradient(80% 70% at 70% 40%, #000 0%, transparent 75%); }
.auth-visual > * { position: relative; z-index: 1; }
.auth-visual .brand { padding: 0; }
.auth-quote { font-family: var(--font-display); font-size: 40px; line-height: 1.12; letter-spacing: -.025em; font-weight: 400; max-width: 560px; }
.auth-quote em { color: #d9b46c; }
.auth-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: 620px; }
.auth-points div { border-top: 1px solid rgba(255,255,255,.15); padding-top: 14px; font-size: 13px; color: #b9bdd6; }
.auth-points b { display: block; color: #fff; font-size: 14px; margin-bottom: 4px; font-weight: 600; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 32px; letter-spacing: -.02em; }
.auth-card .page-sub { margin-bottom: 28px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .btn { height: 44px; font-size: 14.5px; border-radius: 12px; }
.auth-card .input { height: 44px; border-radius: 12px; }

/* --------------------------------------------------------------------------
   Rapport (impression)
   -------------------------------------------------------------------------- */
.report { max-width: 980px; margin: 0 auto; }
.report-cover { padding: 36px 40px; border-radius: var(--radius-lg); }
.report h2 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.report .num-big { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }

/* --------------------------------------------------------------------------
   Divers
   -------------------------------------------------------------------------- */
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.numbered { counter-reset: n; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0; }
.numbered > li { counter-increment: n; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.numbered > li:last-child { border-bottom: 0; }
.code-chip { display: inline-grid; place-items: center; width: 40px; height: 26px; border-radius: 7px; background: var(--surface-3); font-size: 11.5px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 200px; }
.chart-box.lg { height: 340px; }
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.pill-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.pill-link:hover { background: var(--primary-soft); color: var(--primary-ink); }
.backdrop { display: none; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat { grid-template-columns: 230px minmax(0, 1fr); }
  .chat-side { display: none; }
}
@media (max-width: 1024px) {
  .grid-main, .grid-side, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-nav { position: static; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .doc-nav a { white-space: nowrap; }
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 48px; }
  .today-chip { display: none; }
  .crumbs > *:not(.here) { display: none; }
  .crumbs .here { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-actions .btn span { display: none; }
  .page-title { font-size: 26px; }
  .grid-2, .grid-4, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > div:nth-child(2) { border-right: 0; }
  .stat-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .chat { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 60px - 40px); }
  .chat-channels { display: none; }
  .chan-select { display: block; }
  .composer-bar .hint { display: none; }
  .gantt-head, .gantt-row { grid-template-columns: 130px minmax(0, 1fr); }
  .gantt-label { padding-left: 12px; }
  .gantt-today-layer { left: 130px; }
  .hero { padding: 22px 20px; }
  .hero-title { font-size: 23px; }
  .kanban { grid-template-columns: repeat(4, minmax(260px, 82vw)); }
  .barlist-row { grid-template-columns: minmax(90px, 120px) 1fr 44px; }
  .kv { grid-template-columns: 1fr !important; gap: 2px 0; }
  .page-actions { width: 100%; }
  .filters .select, .filters .input, .filters .input-icon { min-width: 0; flex: 1 1 140px; }
  .card-head { flex-wrap: wrap; }
  .barlist-row .target { display: block; }
  .kv dd { margin-bottom: 8px; }
}

@media print {
  .sidebar, .topbar, .page-actions, .toasts, .no-print { display: none !important; }
  .app { display: block; }
  body { background: #fff; font-size: 12px; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  .hero, .report-cover { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .heat td, .segbar span, .progress span, .ring { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; }
}

/* Page de messagerie : pleine hauteur */
.content.chat-page { padding-top: 20px; padding-bottom: 20px; max-width: none; }
.chat { height: calc(100vh - 60px - 40px); }

/* Sélection multiple : pastilles cochables (équipes, établissements) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .12s; user-select: none; }
.chip:hover { border-color: var(--primary); color: var(--text); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
.chip:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.chip:has(input:disabled) { opacity: .5; cursor: default; }
.chip [data-lucide] { width: 14px; height: 14px; }
.est-group { padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.est-group[hidden] { display: none; }

/* Tâche nouvellement assignée */
.tag-new { background: var(--primary); color: #fff; }

/* --- dates effectives d'une équipe --- */
.trip { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.trip-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.trip-title [data-lucide] { width: 15px; height: 15px; color: var(--success); }
.trip-title .badge { margin-left: auto; }
.trip-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.trip-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.trip-form .btn { grid-column: 1 / -1; justify-self: start; }
.trip-gap { display: inline-block; font-size: 11.5px; font-weight: 500; }
.trip-gap.ok { color: var(--success); }
.trip-gap.late { color: var(--warning); }
.trip-gap.early { color: var(--primary); }
.gantt-actual { position: absolute; top: 47px; height: 5px; border-radius: 3px; background: var(--success); min-width: 6px; }
.gantt-actual.open { background: linear-gradient(90deg, var(--success) 70%, transparent); }
.gbl-card { display: block; color: inherit; }
.gbl-card-v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.gbl-card-v small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* --- création de tâches : sélection rapide et une tâche par personne --- */
.group-chip { font-family: inherit; }
.group-chip .group-n { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; }
.group-chip[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-ink); }
.group-chip[aria-pressed="true"] .group-n { background: var(--primary); color: #fff; }
.split-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.split-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.split-opt input { margin-top: 3px; accent-color: var(--primary); }
.split-opt b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.split-opt b [data-lucide] { width: 15px; height: 15px; color: var(--primary); }
.split-opt small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.split-opt:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.split-preview { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.split-preview > [data-lucide] { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--primary); }
.split-preview b { color: var(--text); }
.pv-people { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pv-person { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--text); }
.pv-person em { font-style: normal; color: var(--muted); }
@media (max-width: 700px) { .split-choice { grid-template-columns: minmax(0, 1fr); } }

/* --- sous-entrées du menu (Contrôles clients) --- */
.nav a.nav-sub { padding-left: 42px; font-size: 13px; min-height: 30px; }
.nav a.nav-sub [data-lucide] { width: 14px; height: 14px; }

.gbl-line { display: block; padding: 10px 12px; margin: 0 -12px; border-radius: 10px; color: inherit; transition: background .15s; }
.gbl-line:hover { background: var(--surface-2); }
.gbl-line .gbl-card-v { margin: 6px 0 8px; font-size: 22px; }
