  :root {
    --ink: #17303a;
    --ink-soft: #55707c;
    --ink-faint: #93a7b0;
    --paper: #f2f6f5;
    --card: #ffffff;
    --line: #dde8e6;
    --line-soft: #eaf1ef;
    --accent: #4ba63f;
    --accent-soft: #e7f4e3;
    --accent-ink: #2f6d24;
    --blue: #1d4e6f;
    --blue-soft: #e3edf3;
    --blue-ink: #143a53;
    --clay: #1d4e6f;
    --clay-soft: #e3edf3;
    --cream: #f6efd6;
    --grad: linear-gradient(120deg, #4a9d5b 0%, #2f7a6d 45%, #1d4e6f 100%);
    --shadow: 0 1px 2px rgba(23,48,58,.05), 0 6px 22px rgba(23,48,58,.06);
    --r: 10px;
    --font-display: "Poppins", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: var(--font-sans);
    background: var(--paper);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
  }
  button { font-family: inherit; cursor: pointer; }
  input, select, textarea { font-family: inherit; font-size: 14px; }

  /* ---------- Layout ---------- */
  .app { display: grid; grid-template-columns: 300px 1fr; min-height: 100vh; }
  .sidebar {
    background: var(--card);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    max-height: 100vh; position: sticky; top: 0;
  }
  .main { display: flex; flex-direction: column; min-width: 0; }

  /* ---------- Brand ---------- */
  .brand { padding: 22px 22px 18px; border-bottom: 1px solid var(--line-soft); }
  .brand-logo { font-family: var(--font-display); font-weight: 700; font-size: 26px; letter-spacing: -.02em; line-height: 1; }
  .brand-logo .b-green { color: var(--accent); }
  .brand-logo .b-blue { color: var(--blue); }
  .brand p { color: var(--ink-faint); font-size: 11.5px; margin-top: 6px; letter-spacing: .01em; font-style: italic; }

  /* ---------- Client picker ---------- */
  .clients { padding: 16px 14px 8px; border-bottom: 1px solid var(--line-soft); }
  .section-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .09em;
    color: var(--ink-faint); font-weight: 600; margin-bottom: 8px; padding: 0 8px;
    display: flex; justify-content: space-between; align-items: center;
  }
  .section-label button {
    border: none; background: none; color: var(--accent); font-size: 12px;
    font-weight: 600; letter-spacing: 0; text-transform: none; padding: 2px 4px;
  }
  .client-row {
    display: flex; align-items: center; gap: 9px; padding: 8px 10px;
    border-radius: 8px; margin-bottom: 2px; color: var(--ink-soft);
    font-weight: 500; width: 100%; border: none; background: none; text-align: left;
  }
  .client-row:hover { background: var(--paper); }
  .client-row.active { background: var(--accent-soft); color: var(--accent-ink); }
  .client-row .avatar {
    width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; background: var(--accent);
  }
  .client-row.active .avatar { background: var(--accent-ink); }
  .client-row .meta { font-size: 11px; color: var(--ink-faint); margin-left: auto; }

  /* ---------- Tree ---------- */
  .tree-wrap { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
  .tree-empty { color: var(--ink-faint); font-size: 13px; padding: 20px 12px; text-align: center; }
  .node { }
  .node-head {
    display: flex; align-items: center; gap: 6px; padding: 6px 8px;
    border-radius: 7px; cursor: pointer; position: relative;
  }
  .node-head:hover { background: var(--paper); }
  .node-head.sel { background: var(--accent-soft); }
  .node-head.dragging { opacity: .45; }
  .drag-grip { width: 12px; flex-shrink: 0; color: var(--ink-faint); font-size: 10px; letter-spacing: -2px; cursor: grab; opacity: 0; text-align: center; line-height: 1; }
  .node-head:hover .drag-grip { opacity: .6; }
  .drag-grip:active { cursor: grabbing; }
  /* indicateurs de dépôt */
  .node-head.cue-into { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
  .node-head.cue-before { box-shadow: inset 0 2px 0 0 var(--accent); }
  .node-head.cue-after { box-shadow: inset 0 -2px 0 0 var(--accent); }
  .caret {
    width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center;
    justify-content: center; color: var(--ink-faint); font-size: 10px;
    transition: transform .12s ease;
  }
  .caret.open { transform: rotate(90deg); }
  .caret.leaf { visibility: hidden; }
  .node-label { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .node-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .tier-tag {
    font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--ink-faint); border: 1px solid var(--line); border-radius: 4px;
    padding: 1px 4px; flex-shrink: 0;
  }
  .node-add {
    border: none; background: none; color: var(--ink-faint); font-size: 15px;
    line-height: 1; padding: 0 4px; opacity: 0; border-radius: 4px;
  }
  .node-head:hover .node-add { opacity: 1; }
  .node-add:hover { color: var(--accent); background: #fff; }
  .children { margin-left: 14px; border-left: 1px solid var(--line-soft); padding-left: 4px; }

  /* ---------- Topbar ---------- */
  .topbar {
    display: flex; align-items: center; gap: 16px; padding: 16px 28px;
    border-bottom: 1px solid var(--line); background: var(--card);
    position: sticky; top: 0; z-index: 5;
    border-image: var(--grad) 1; border-bottom-width: 2px; border-bottom-style: solid;
  }
  .crumbs { font-size: 13px; color: var(--ink-soft); flex: 1; min-width: 0; }
  .crumbs .sep { color: var(--ink-faint); margin: 0 7px; }
  .crumbs b { color: var(--ink); font-weight: 600; }
  .tabs { display: flex; gap: 2px; background: var(--paper); padding: 3px; border-radius: 9px; }
  .tab {
    border: none; background: none; padding: 7px 15px; border-radius: 7px;
    font-size: 13px; font-weight: 500; color: var(--ink-soft);
  }
  .tab.active { background: var(--card); color: var(--accent-ink); box-shadow: var(--shadow); font-weight: 600; }
  .undo-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); padding: 7px 13px; border-radius: 8px; font-size: 13px; font-weight: 500; }
  .save-btn { border: none; background: var(--accent); color: #fff; padding: 8px 15px; border-radius: 8px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
  .save-btn:hover { background: var(--accent-ink); }
  .save-btn.flash { animation: saveflash .6s ease; }
  @keyframes saveflash { 0%{ background:#2f6d24; } 50%{ background:#1d4e6f; } 100%{ background:var(--accent); } }
  .restore-btn { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); padding: 8px 15px; border-radius: 8px; font-size: 13px; font-weight: 600; }
  .restore-btn:hover { background: var(--accent); color: #fff; }
  .undo-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
  .undo-btn:disabled { opacity: .4; cursor: default; }
  .client-line { display: flex; align-items: center; gap: 2px; }
  .client-line .client-row { flex: 1; }
  .client-del { border: none; background: none; color: var(--ink-faint); font-size: 13px; padding: 6px 7px; border-radius: 7px; opacity: 0; flex-shrink: 0; }
  .client-line:hover .client-del { opacity: 1; }
  .client-del:hover { background: #f7dede; color: #9a2f2f; }

  /* ---------- Content ---------- */
  .content { flex: 1; overflow-y: auto; padding: 26px 28px 60px; }

  /* ---------- Dashboard ---------- */
  .kpi-band { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
  .kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); border-top: 3px solid var(--line); }
  .kpi.good { border-top-color: var(--accent); }
  .kpi.warn { border-top-color: #d9932b; }
  .kpi.bad { border-top-color: #c85252; }
  .kpi-v { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
  .kpi-k { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

  .dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .dash2 { display: flex; flex-direction: column; gap: 16px; }
  .db-span { width: 100%; }
  .dash2 .dash-grid { margin: 0; }
  /* Bloc avancement global */
  .av-body { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; padding-top: 14px; }
  .av-donut { flex: 0 0 auto; }
  .av-right { flex: 1; min-width: 240px; }
  .av-pct { display: flex; align-items: baseline; gap: 8px; }
  .av-pctv { font-family: var(--font-display); font-weight: 700; font-size: 40px; color: var(--accent-ink); line-height: 1; }
  .av-pctk { font-size: 13px; color: var(--ink-faint); }
  .av-bar { height: 10px; border-radius: 6px; background: var(--paper); margin: 12px 0 16px; overflow: hidden; }
  .av-bar span { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s; }
  .av-stats { display: flex; flex-wrap: wrap; gap: 16px; }
  .av-stat { display: flex; align-items: center; gap: 6px; }
  .av-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
  .av-sv { font-weight: 700; font-size: 15px; }
  .av-sk { font-size: 12.5px; color: var(--ink-soft); }
  /* Points de vigilance */
  .vig-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
  .vig-row:last-child { border: none; }
  .vig-row:hover { opacity: .75; }
  .vig-name { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vig-tag { flex-shrink: 0; font-size: 11px; color: var(--ink-faint); }
  .soon-days { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--blue-ink); }
  .dash-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
  .dash-head { display: flex; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); }
  .dash-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; }
  .dash-head .count { margin-left: auto; font-size: 12px; color: var(--ink-faint); }
  .dh-ic { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .dh-ic.bad { background: #c85252; }
  .dash-body { padding: 6px 16px 14px; flex: 1; }
  .dash-empty { color: var(--ink-faint); font-size: 13px; padding: 24px 4px; text-align: center; }
  .dash-more { font-size: 12px; color: var(--ink-faint); padding: 8px 4px 2px; }

  /* Retards */
  .late-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
  .late-row:last-child { border: none; }
  .late-row:hover { background: #f7faf9; }
  .late-name { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .late-days { font-size: 12px; font-weight: 600; color: #9a2f2f; background: #f7dede; border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
  .owner.sm { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }

  /* Donut vue d'ensemble */
  .donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 6px 0; }
  .donut { width: 150px; height: 150px; flex-shrink: 0; }
  .dn-num { text-anchor: middle; font-family: var(--font-display); font-weight: 600; font-size: 26px; fill: var(--ink); }
  .dn-lbl { text-anchor: middle; font-size: 10px; fill: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; }
  .dn-legend { display: flex; flex-direction: column; gap: 7px; }
  .dn-leg { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
  .dn-leg b { margin-left: auto; color: var(--ink); font-weight: 600; min-width: 22px; text-align: right; }
  .dn-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

  /* Charge de l'équipe */
  .load-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
  .load-who { width: 130px; flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
  .load-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .load-track { height: 18px; border-radius: 5px; overflow: hidden; display: flex; min-width: 4px; background: var(--paper); }
  .ld-seg { height: 100%; }
  .load-tot { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink); min-width: 20px; text-align: right; font-variant-numeric: tabular-nums; }
  .load-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--ink-soft); }
  .load-legend span { display: flex; align-items: center; gap: 5px; }
  .load-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

  /* Activité récente */
  .act-row { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
  .act-row:last-child { border: none; }
  .dash-mtg-grp { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; padding: 10px 0 4px; }
  .dash-mtg-grp:first-child { padding-top: 0; }
  .dash-mtg { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
  .dash-mtg:last-child { border: none; }
  .dash-mtg:hover { opacity: .75; }
  .dash-mtg .mtg-badge { flex-shrink: 0; }
  .dash-mtg .dm-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dash-mtg .dm-date { flex-shrink: 0; font-size: 12px; color: var(--ink-faint); }
  .act-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; position: relative; top: 4px; }
  .act-txt { flex: 1; font-size: 13px; color: var(--ink-soft); line-height: 1.4; }
  .act-txt b { color: var(--ink); font-weight: 600; }
  .act-when { font-size: 11px; color: var(--ink-faint); white-space: nowrap; flex-shrink: 0; }

  .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden; }
  .panel-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
  .panel-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
  .panel-head .count { margin-left: 8px; font-size: 12px; color: var(--ink-faint); }

  /* ---------- List / rows ---------- */
  .list { padding: 6px 0; }
  .row {
    display: flex; align-items: center; gap: 12px; padding: 12px 18px;
    border-bottom: 1px solid var(--line-soft);
  }
  .row:last-child { border: none; }
  .row:hover { background: #f7faf9; }
  .row .chk {
    width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line);
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; background: #fff;
  }
  .row.done .chk { background: var(--accent); border-color: var(--accent); }
  .lcaret { width: 18px; height: 18px; flex-shrink: 0; border: 1px solid var(--line); background: var(--card); border-radius: 5px; color: var(--ink-soft); font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
  .lcaret:hover { border-color: var(--accent); color: var(--accent); }
  .lcaret.leaf { visibility: hidden; }
  .lrow .row-actions .icon-btn { opacity: 0; }
  .lrow:hover .row-actions .icon-btn { opacity: 1; }
  .row .title { flex: 1; min-width: 0; }
  .row .title .t { font-size: 14px; font-weight: 500; }
  .row.done .title .t { text-decoration: line-through; color: var(--ink-faint); }
  .row .title .sub { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }
  .row-desc { color: var(--ink-soft); font-style: italic; }
  .row .owner {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: #fff;
  }
  .badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
  .st-todo { background: #eef2f1; color: #55707c; }
  .st-doing { background: var(--blue-soft); color: var(--blue-ink); }
  .st-blocked { background: #fdeccf; color: #9a6511; }
  .st-late { background: #f7dede; color: #9a2f2f; }
  .st-done { background: var(--accent-soft); color: var(--accent-ink); }
  .st-select {
    width: 92px; box-sizing: border-box; border: none; border-radius: 20px;
    font-size: 11px; font-weight: 600; padding: 4px 8px; cursor: pointer;
    font-family: inherit; -webkit-appearance: none; appearance: none;
    text-align: center; text-align-last: center;
  }
  .st-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .filter-bar { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); background: #f7faf9; flex-wrap: wrap; }
  .filter-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; }
  .filter-sel { padding: 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; }
  .filter-sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .filter-clear { padding: 7px 12px; font-size: 12px; color: var(--ink-soft); }
  .lrow-dim { opacity: .5; }
  .lrow-dim:hover { opacity: 1; }
  .due { font-size: 12px; color: var(--ink-soft); width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
  .due.late { color: #9a2f2f; font-weight: 600; }
  .row-actions { display: flex; gap: 2px; }
  .icon-btn { border: none; background: none; color: var(--ink-faint); padding: 5px; border-radius: 6px; font-size: 14px; }
  .icon-btn:hover { background: var(--paper); color: var(--ink); }

  /* Code hiérarchique */
  .lcode, .node-code {
    font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, monospace);
    font-size: 11px; font-weight: 600; color: var(--blue-ink);
    background: var(--blue-soft); border-radius: 5px; padding: 2px 6px;
    white-space: nowrap; flex-shrink: 0; letter-spacing: .02em;
  }
  .node-code { font-size: 10px; padding: 1px 5px; }
  .cb-code { font-family: var(--font-mono, monospace); font-size: 11px; color: var(--blue); font-weight: 600; }

  /* En-têtes de colonnes en vue liste + largeurs fixes pour alignement */
  .list-head {
    display: flex; align-items: center; gap: 12px; padding: 9px 18px;
    border-bottom: 1px solid var(--line); background: #f7faf9;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--ink-faint);
  }
  .lh-code { width: 74px; flex-shrink: 0; }
  .lh-title { flex: 1; }
  .lh-status { width: 92px; flex-shrink: 0; }
  .lh-desc { width: 150px; flex-shrink: 0; }
  .lh-prog { width: 104px; flex-shrink: 0; }
  .lh-resp { width: 92px; flex-shrink: 0; }
  .lh-contrib { width: 110px; flex-shrink: 0; }
  .lh-due { width: 90px; flex-shrink: 0; text-align: right; }
  .lh-act { width: 92px; flex-shrink: 0; }
  .lrow .badge { width: 92px; text-align: center; box-sizing: border-box; }
  .lrow .lcol-resp { width: 92px; flex-shrink: 0; display: flex; align-items: center; }
  .lrow .lcol-prog { width: 104px; flex-shrink: 0; display: flex; align-items: center; gap: 7px; }
  .lrow .lcol-desc { width: 150px; flex-shrink: 0; display: flex; align-items: center; overflow: hidden; }
  .desc-chip { max-width: 100%; text-align: left; background: none; border: none; padding: 2px 0; font-size: 12.5px; color: var(--ink-soft); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .desc-chip:hover { color: var(--accent-ink); text-decoration: underline; }
  .desc-empty { color: var(--ink-faint); font-size: 12.5px; }
  .desc-pop { width: 300px; max-height: 300px; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
  .desc-pop-head { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; color: var(--ink); }
  .desc-pop-body { padding: 12px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); overflow-y: auto; }
  .prog-mini { flex: 1; height: 6px; background: var(--paper); border-radius: 4px; overflow: hidden; }
  .prog-mini-bar { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
  .prog-mini-v { font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
  .prog-inline { width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; color: var(--ink); cursor: pointer; }
  .prog-inline:hover { border-color: var(--accent); }
  .prog-inline:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  body.readonly .prog-inline { pointer-events: none; background: transparent; border-color: transparent; }
  .pct-hint { font-size: 11px; color: var(--ink-faint); margin-top: 5px; line-height: 1.35; }
  /* Bannière consultation (mode client lecture seule) */
  #consultBanner { position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: var(--blue); color: #fff; font-size: 13px; padding: 9px 18px; display: flex; align-items: center; gap: 9px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
  #consultBanner b { font-weight: 700; }
  #consultBanner .cb-dot { width: 8px; height: 8px; border-radius: 50%; background: #9fe6a0; display: inline-block; flex-shrink: 0; }
  body.has-consult-banner { padding-top: 38px; }
  #previewExit { position: fixed; right: 16px; bottom: 16px; z-index: 300; background: var(--ink); color: #fff; border: none; border-radius: 22px; padding: 11px 18px; font-size: 13px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.28); }
  #previewExit:hover { background: #000; }
  body.has-consult-banner #consultBanner { }
  /* Verrouillage lecture seule : on masque tout ce qui permet de modifier */
  body.readonly .st-select { pointer-events: none; }
  body.readonly [data-add], body.readonly .add-line, body.readonly #addMeeting, body.readonly #addRisk, body.readonly #addDecision,
  body.readonly .icon-del, body.readonly [data-delmtg], body.readonly [data-delrisk], body.readonly [data-deldec],
  body.readonly .row-add, body.readonly .list-add, body.readonly .lrow .lcaret ~ .badd,
  body.readonly .admin-open, body.readonly #undoBtn { display: none !important; }
  body.readonly .mcell, body.readonly .rsel, body.readonly .cell-dd { pointer-events: none; background: transparent !important; border-color: transparent !important; }
  body.readonly .cr-btn { display: inline-flex; } /* le CR reste consultable (ouvre le relevé en lecture seule) */
  .ro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
  .ro-grid > div { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
  .ro-k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); font-weight: 600; }
  .ro-line { padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; line-height: 1.4; }
  .ro-line:last-child { border: none; }
  .ro-empty { margin: 0; color: var(--ink-faint); font-size: 13px; }
  .lrow .lcol-contrib { width: 110px; flex-shrink: 0; display: flex; align-items: center; }
  .lrow .row-actions { width: 92px; justify-content: flex-end; flex-shrink: 0; }
  .icon-del:hover { background: #f7dede; color: #9a2f2f; }

  .add-line { padding: 12px 18px; }
  .add-line button {
    border: 1px dashed var(--line); background: none; color: var(--ink-soft);
    padding: 9px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; width: 100%;
  }
  .add-line button:hover { border-color: var(--accent); color: var(--accent); }

  /* ---------- Gantt ---------- */
  .cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
  .cal-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
  .cal-legend { margin-left: auto; display: flex; gap: 16px; font-size: 12px; color: var(--ink-soft); }
  .cal-legend span { display: flex; align-items: center; gap: 6px; }
  .cal-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

  .gantt { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
  .g-scroll { overflow-x: auto; overflow-y: hidden; }
  .g-inner { min-width: 100%; position: relative; }
  .g-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #8e44ad; z-index: 4; pointer-events: none; }
  .g-today-line .g-today-tag { position: absolute; top: 2px; left: 3px; background: #8e44ad; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 0 6px 6px 0; white-space: nowrap; }
  .g-header { display: flex; position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); }
  .g-corner { width: var(--labelW); flex-shrink: 0; padding: 10px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); border-right: 1px solid var(--line); position: sticky; left: 0; background: var(--card); z-index: 4; }
  .g-timeline { position: relative; height: 38px; flex-shrink: 0; }
  .g-tick { position: absolute; top: 0; height: 38px; border-left: 1px solid var(--line-soft); padding: 10px 0 0 6px; font-size: 11px; color: var(--ink-faint); white-space: nowrap; box-sizing: border-box; }
  .g-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--clay); z-index: 2; }

  .g-row { display: flex; border-bottom: 1px solid var(--line-soft); }
  .g-row:last-child { border-bottom: none; }
  .g-row:hover { background: #f7faf9; }
  .g-label { width: var(--labelW); flex-shrink: 0; display: flex; align-items: center; gap: 7px; padding: 9px 14px 9px 8px; border-right: 1px solid var(--line); position: sticky; left: 0; background: inherit; z-index: 1; box-sizing: border-box; }
  .g-caret { width: 18px; height: 18px; flex-shrink: 0; border: 1px solid var(--line); background: var(--card); border-radius: 5px; color: var(--ink-soft); font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; }
  .g-caret:hover { border-color: var(--accent); color: var(--accent); }
  .g-caret.leaf { visibility: hidden; }
  .g-lname { flex: 1; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
  .g-lname:hover { color: var(--accent); }
  .g-row:hover .g-label { background: #f7faf9; }
  .g-label { background: var(--card); }
  .g-tier-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
  .g-bar-rolled { border-style: dashed; border-width: 1.5px; }
  .g-tier { font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; flex-shrink: 0; }
  .g-track { position: relative; flex-shrink: 0; height: 40px; }
  .g-bar { position: absolute; top: 8px; height: 24px; border: 1px solid; border-radius: 6px; overflow: hidden; cursor: pointer; display: flex; align-items: center; }
  .g-bar:hover { filter: brightness(.97); }
  .g-fill { position: absolute; left: 0; top: 0; bottom: 0; opacity: .35; }
  .g-bar-label { position: relative; font-size: 11px; font-weight: 600; color: var(--ink); padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* --- Différenciation visuelle par niveau (projet fort -> tâche discrète) --- */
  /* Libellés : taille/graisse dégressives */
  .g-row-projet .g-lname   { font-size: 14.5px; font-weight: 800; color: var(--ink); }
  .g-row-chantier .g-lname { font-size: 13.5px; font-weight: 700; color: var(--ink); }
  .g-row-action .g-lname   { font-size: 13px;   font-weight: 500; color: var(--ink); }
  .g-row-tache .g-lname    { font-size: 12.5px; font-weight: 400; color: var(--ink-soft); }
  /* Pastille de niveau : plus grande pour les strates hautes */
  .g-row-projet .g-tier-dot   { width: 12px; height: 12px; border-radius: 3px; }
  .g-row-chantier .g-tier-dot { width: 10px; height: 10px; border-radius: 3px; }
  .g-row-action .g-tier-dot   { width: 9px; height: 9px; }
  .g-row-tache .g-tier-dot    { width: 7px; height: 7px; }
  /* Barres : épaisseur dégressive (toujours centrées dans la piste de 40px) */
  .g-bar-projet   { top: 5px;  height: 30px; border-width: 2px; border-radius: 7px; }
  .g-bar-chantier { top: 7px;  height: 26px; border-width: 1.5px; border-radius: 6px; }
  .g-bar-action   { top: 10px; height: 20px; border-width: 1px; border-radius: 5px; }
  .g-bar-tache    { top: 12px; height: 16px; border-width: 1px; border-radius: 4px; opacity: .92; }
  .g-bar-projet .g-bar-label { font-weight: 700; }
  .g-bar-tache .g-bar-label  { font-weight: 500; }
  .g-mtg { position: absolute; top: 12px; width: 15px; height: 15px; background: var(--blue); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(20,58,83,.4); cursor: pointer; z-index: 3; transform: translateX(-50%); }
  .g-mtg.done { background: var(--accent); }
  .g-mtg.up { background: var(--blue); }
  .g-mtg:hover { filter: brightness(1.1); }
  .g-shape-diamond { transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
  .g-shape-square { transform: translateX(-50%); border-radius: 2px; }
  .g-shape-circle { transform: translateX(-50%); border-radius: 50%; }
  /* triangle : on utilise un fond en clip-path pour garder la bordure blanche via drop-shadow */
  .g-shape-triangle { transform: translateX(-50%); border: none; width: 16px; height: 15px; box-shadow: none; clip-path: polygon(50% 0, 100% 100%, 0 100%); filter: drop-shadow(0 1px 2px rgba(20,58,83,.4)); }
  .lg-diamond { width: 11px; height: 11px; transform: rotate(45deg); background: var(--blue); display: inline-block; border-radius: 2px; }
  /* Réunions */
  .mtg-list { padding: 6px 0 10px; }
  .mtg-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; padding: 14px 18px 6px; }
  .mtg-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
  .mtg-row:hover { background: #f7faf9; }
  .mtg-badge { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; margin-top: 2px; }
  .mtg-badge.up { background: var(--blue-soft); color: var(--blue-ink); }
  .mtg-badge.done { background: var(--accent-soft); color: var(--accent-ink); }
  .mtg-main { flex: 1; min-width: 0; }
  .mtg-title { font-size: 14px; font-weight: 600; }
  .mtg-meta { font-size: 12px; color: var(--ink-faint); margin-top: 1px; }
  .mtg-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
  .mtg-tag { font-size: 11px; background: var(--blue-soft); color: var(--blue-ink); padding: 2px 8px; border-radius: 5px; font-family: var(--font-mono); }
  .mtg-report { font-size: 12px; color: var(--ink-soft); margin-top: 6px; font-style: italic; line-height: 1.4; }
  .mtg-parts { display: flex; align-items: center; flex-shrink: 0; }
  .mtg-parts .contrib { width: 24px; height: 24px; border-radius: 50%; margin-left: -6px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; border: 2px solid var(--card); }
  .mtg-parts .contrib.more { background: #e6ecea; color: var(--ink-soft); }
  /* Tag picker (rattachement réunion) */
  .tag-picker { max-height: 180px; overflow-y: auto; }
  .tagchip .tag-code { font-family: var(--font-mono); font-size: 10px; opacity: .8; margin-right: 3px; }
  .tagchip.t-projet { border-left: 3px solid var(--accent); }
  .tagchip.t-chantier { border-left: 3px solid var(--blue); }
  .tagchip.t-action { border-left: 3px solid #8e44ad; }
  .tagchip.t-tache { border-left: 3px solid var(--ink-faint); }
  /* Multi-select déroulant (réunions) */
  .ms-dd { position: relative; }
  .ms-toggle { width: 100%; text-align: left; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }
  .ms-toggle::after { content: '▾'; float: right; color: var(--ink-faint); }
  .ms-toggle:hover { border-color: var(--accent); }
  .ms-menu { display: none; position: absolute; z-index: 5; left: 0; right: 0; margin-top: 4px; max-height: 220px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(23,48,58,.14); padding: 4px; }
  .ms-dd.open .ms-menu { display: block; }
  .ms-opt { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; font-size: 13px; cursor: pointer; }
  .ms-opt:hover { background: var(--paper); }
  .ms-opt input { width: auto; margin: 0; flex-shrink: 0; }
  .ms-av { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
  .ms-opt .tag-code { font-family: var(--font-mono); font-size: 10px; color: var(--blue-ink); background: var(--blue-soft); padding: 1px 5px; border-radius: 4px; flex-shrink: 0; }
  .ms-opt.ms-tag { border-left: 3px solid transparent; }
  .ms-opt.t-projet { border-left-color: var(--accent); }
  .ms-opt.t-chantier { border-left-color: var(--blue); }
  .ms-opt.t-action { border-left-color: #8e44ad; }
  .ms-opt.t-tache { border-left-color: var(--ink-faint); }
  /* Rattachement : recherche + arbre */
  .ms-tree-menu { padding: 0; max-height: 380px; display: flex; flex-direction: column; }
  .ms-search { padding: 10px; border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; background: #fff; z-index: 2; }
  .ms-search input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; box-sizing: border-box; }
  .ms-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .ms-tree { overflow-y: auto; padding: 6px; }
  .mt-row { display: flex; align-items: center; gap: 8px; border-radius: 7px; min-height: 40px; box-sizing: border-box; }
  .mt-row:hover { background: var(--paper); }
  .mt-caret { width: 24px; height: 24px; flex: 0 0 24px; border: 1px solid var(--line); background: #fff; border-radius: 6px; color: var(--ink-soft); font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; padding: 0; margin: 0; cursor: pointer; }
  .mt-caret:hover { border-color: var(--accent); color: var(--accent); }
  .mt-caret.leaf { visibility: hidden; }
  .mt-lbl { display: flex; align-items: center; gap: 10px; padding: 8px 6px; font-size: 14.5px; cursor: pointer; flex: 1; min-width: 0; }
  .mt-lbl input[type="checkbox"] { width: 19px !important; height: 19px; min-width: 19px; margin: 0; padding: 0; flex: 0 0 19px; cursor: pointer; accent-color: var(--accent); box-shadow: none !important; }
  .mt-lbl .mt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mt-lbl .tag-code { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--blue-ink); background: var(--blue-soft); padding: 2px 6px; border-radius: 5px; flex-shrink: 0; }
  .mt-empty { padding: 18px; text-align: center; color: var(--ink-faint); font-size: 14px; }
  /* Tableau réunions éditable */
  .mtbl-wrap { overflow-x: auto; }
  .mtbl { width: 100%; border-collapse: collapse; min-width: 780px; }
  .mtbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .mtbl td { padding: 6px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
  .mtbl tbody tr:hover { background: #f7faf9; }
  .mtbl-empty { text-align: center; color: var(--ink-faint); font-style: italic; padding: 22px 10px !important; }
  .mc-obj { min-width: 200px; width: 30%; }
  .mtbl-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); align-items: center; }
  .mf-input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; box-sizing: border-box; }
  .mf-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  #mf_q { flex: 1 1 200px; min-width: 160px; }
  .mc-kind { width: 116px; }
  .mkind-copil { color: var(--blue-ink); font-weight: 600; }
  .mkind-coproj { color: #7a4fb0; font-weight: 600; }
  .mkind-atelier { color: var(--accent-ink); font-weight: 600; }
  .mkind-autre { color: var(--ink-soft); }
  .g-legend { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; padding: 8px 4px 2px; font-size: 12px; color: var(--ink-soft); }
  .g-legend .gl { display: inline-flex; align-items: center; gap: 6px; }
  .g-legend .gl-mk { width: 13px; height: 13px; background: var(--blue); display: inline-block; }
  .g-legend .gl-diamond { transform: rotate(45deg); border-radius: 2px; }
  .g-legend .gl-square { border-radius: 2px; }
  .g-legend .gl-circle { border-radius: 50%; }
  .g-legend .gl-triangle { background: none; width: 14px; height: 13px; clip-path: polygon(50% 0,100% 100%,0 100%); background-color: var(--blue); }
  .mc-date { width: 140px; }
  .mc-time { width: 96px; }
  .mc-part { width: 130px; }
  .mc-link { width: 140px; }
  .mc-cr, .mc-del { width: 44px; text-align: center; }
  .mcell { width: 100%; box-sizing: border-box; padding: 8px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; font-size: 13.5px; color: var(--ink); }
  .mcell:hover { border-color: var(--line); background: #fff; }
  .mcell:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
  .mcell-title { font-weight: 500; }
  .cell-dd { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-size: 12.5px; color: var(--ink-soft); min-height: 34px; }
  .cell-dd:hover { border-color: var(--accent); }
  .cell-dd .contrib { width: 22px; height: 22px; border-radius: 50%; margin-left: -5px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; border: 2px solid #fff; }
  .cell-dd .contrib:first-child { margin-left: 0; }
  .cell-dd-txt.has { color: var(--blue-ink); font-weight: 600; }
  .cr-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; width: 32px; height: 32px; font-size: 14px; cursor: pointer; }
  .cr-btn:hover { border-color: var(--accent); }
  .cr-btn.has { background: var(--accent-soft); border-color: var(--accent); }
  /* Popovers de cellule */
  .cell-pop { position: fixed; z-index: 60; width: 280px; max-height: 340px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(23,48,58,.22); display: flex; flex-direction: column; overflow: hidden; }
  .cell-pop-lg { width: 340px; }
  .pop-search { padding: 8px; border-bottom: 1px solid var(--line-soft); }
  .pop-search input { width: 100%; box-sizing: border-box; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 13.5px; }
  .pop-bulk { display: flex; gap: 6px; padding: 0 8px 8px; border-bottom: 1px solid var(--line-soft); }
  .pop-bulk-btn { flex: 1; padding: 6px 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
  .pop-bulk-btn:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
  .pop-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .pop-list { overflow-y: auto; padding: 6px; }
  .pop-opt { display: flex; align-items: center; gap: 9px; padding: 8px 8px; border-radius: 7px; font-size: 14px; cursor: pointer; min-height: 38px; box-sizing: border-box; }
  .pop-opt:hover { background: var(--paper); }
  .pop-opt input[type="checkbox"] { width: 18px !important; height: 18px; min-width: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--accent); box-shadow: none !important; }
  .pop-opt .ms-av { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
  .pop-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .pop-empty { padding: 16px; text-align: center; color: var(--ink-faint); font-size: 13px; }
  .pop-foot { border-top: 1px solid var(--line-soft); padding: 6px; }
  .pop-clear { width: 100%; border: none; background: none; color: var(--ink-soft); font-size: 12.5px; padding: 8px; border-radius: 6px; cursor: pointer; }
  .pop-clear:hover { background: var(--paper); color: #9a2f2f; }
  .pop-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .pop-count { font-size: 12px; color: var(--ink-faint); padding-left: 4px; }
  .pop-validate { padding: 7px 16px; font-size: 13px; }
  /* RIDA (relevé de réunion) */
  .rida-lbl { display: inline-flex !important; align-items: center; gap: 7px; }
  .rida-lbl::before { content: ''; width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
  .rida-i::before { background: var(--blue); }
  .rida-d::before { background: #8e44ad; }
  .rida-a::before { background: var(--accent); }
  .rida-o::before { background: #d9932b; }
  .rida-push { font-size: 12px; border-color: var(--blue); color: var(--blue-ink); background: var(--blue-soft); }
  .rida-push:hover { background: var(--blue); color: #fff; }
  .rida-toast { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%) translateY(8px); background: var(--ink); color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 8px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 5; white-space: nowrap; }
  .rida-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  /* Registre décisions */
  .dtbl .dc-type { width: 140px; }
  .dtbl .dc-title { min-width: 220px; width: 36%; }
  .dtbl .dc-who { width: 130px; }
  .dtbl .dc-date { width: 140px; }
  .dtbl .dc-link { width: 150px; }
  .dtbl .dc-stat { width: 120px; }
  .dtype-open { color: #b57d13; font-weight: 600; }
  .dtype-decision { color: var(--accent-ink); font-weight: 600; }
  .dstat-settled { color: var(--accent-ink); }
  tr.dec-open { background: #fff9ef; }
  tr.dec-open:hover { background: #fdf3df; }
  .dc-title { position: relative; }
  .dec-src { color: var(--blue-ink); font-weight: 700; margin-left: 4px; }
  /* Actions RIDA structurées */
  .ra-list { display: flex; flex-direction: column; gap: 10px; }
  .ra-empty { font-size: 13px; color: var(--ink-faint); font-style: italic; padding: 6px 2px; }
  .ra-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fbfcfb; display: flex; flex-direction: column; gap: 8px; }
  .ra-line1 { display: flex; align-items: center; gap: 8px; }
  .ra-title { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; box-sizing: border-box; font-weight: 500; }
  .ra-line2 { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
  .ra-f { padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; box-sizing: border-box; }
  .ra-owner { width: 100%; }
  .ra-date { flex: 0 0 auto; }
  .ra-datefield, .ra-selfield { display: inline-flex; flex-direction: column; gap: 3px; }
  .ra-datefield { flex: 0 0 auto; }
  .ra-selfield { flex: 1 1 150px; min-width: 130px; }
  .ra-selfield .ra-f { width: 100%; box-sizing: border-box; }
  .ra-dlabel { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); font-weight: 600; }
  .ra-target { width: 100%; }
  .ra-title:focus, .ra-f:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .ra-conv { border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; flex: 0 0 auto; }
  .ra-conv:hover { background: var(--accent); color: #fff; }
  .ra-linked { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); white-space: nowrap; padding: 0 8px; flex: 0 0 auto; }
  .ra-hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 8px; line-height: 1.4; }
  .from-mtg { background: var(--blue-soft); color: var(--blue-ink); font-size: 12.5px; padding: 8px 11px; border-radius: 8px; margin-bottom: 14px; }
  /* Risques */
  .rtbl .rc-title { min-width: 240px; width: 32%; }
  .rtbl .rc-sel { width: 104px; }
  .rtbl .rc-crit { width: 92px; text-align: center; }
  .rtbl .rc-resp { width: 116px; }
  .rtbl .rc-who { width: 130px; }
  .rtbl .rc-link { width: 150px; }
  .rtbl .rc-stat { width: 130px; }
  .rsel { appearance: auto; padding: 7px 6px; border: 1px solid transparent; border-radius: 7px; background: transparent; font-size: 13px; width: 100%; box-sizing: border-box; cursor: pointer; }
  .rsel:hover { border-color: var(--line); background: #fff; }
  .rsel:focus { outline: none; border-color: var(--accent); background: #fff; }
  .crit-badge { display: inline-block; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
  .rstat-closed { color: var(--ink-faint); text-decoration: line-through; }
  .rstat-controlled { color: var(--accent-ink); }
  .row-flash { animation: rowflash 1.2s ease; }
  @keyframes rowflash { 0%,100%{ background: transparent; } 30%{ background: var(--accent-soft); } }
  /* Matrice risques */
  .risk-matrix-wrap { padding: 16px 18px 4px; }
  .risk-matrix { display: grid; grid-template-columns: 28px 90px 1fr 1fr 1fr; grid-auto-rows: minmax(48px,auto); gap: 4px; max-width: 640px; }
  .rm-corner { grid-column: 1/3; grid-row: 1; }
  .rm-xhead { grid-column: 3/6; grid-row: 1; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; text-align: center; align-self: center; }
  .rm-xlabel { font-size: 12px; color: var(--ink-soft); text-align: center; font-weight: 500; padding-bottom: 2px; }
  .rm-yhead { grid-column: 1; grid-row: 3/6; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; text-align: center; align-self: center; justify-self: center; }
  .rm-ylabel { grid-column: 2; font-size: 12px; color: var(--ink-soft); font-weight: 500; align-self: center; text-align: right; padding-right: 6px; }
  .rm-cell { border: 1px solid; border-radius: 8px; padding: 5px; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
  .rm-dot { min-width: 26px; height: 26px; padding: 0 4px; box-sizing: border-box; border-radius: 6px; color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .rc-num { width: 42px; text-align: center; }
  .risk-num { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 12px; background: var(--paper); color: var(--ink); font-weight: 700; font-size: 12px; }
  .rm-dot:hover { filter: brightness(1.12); }
  .rm-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink-soft); }
  .rm-legend span { display: inline-flex; align-items: center; gap: 6px; }
  .rm-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

  /* ---------- People cell (owner + contributors) ---------- */
  .people-cell { display: flex; align-items: center; gap: 6px; }
  .contrib-stack { display: flex; align-items: center; }
  .contrib-stack .contrib {
    width: 22px; height: 22px; border-radius: 50%; margin-left: -6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 700; color: #fff; border: 2px solid var(--card);
  }
  .contrib-stack .contrib.more { background: #e6ecea; color: var(--ink-soft); }

  /* ---------- Directory (table) ---------- */
  .dir-table-wrap { overflow-x: auto; }
  .dir-table { width: 100%; border-collapse: collapse; }
  .dir-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 600; padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
  .dir-table th.num, .dir-table td.num { text-align: center; }
  .dir-table td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; vertical-align: middle; }
  .dir-table tbody tr { cursor: pointer; }
  .dir-table tbody tr:last-child td { border-bottom: none; }
  .dir-table tbody tr:hover { background: #f7faf9; }
  .dir-cell-name { display: flex; align-items: center; gap: 10px; font-weight: 500; white-space: nowrap; }
  .mail-cell { display: inline-flex; align-items: center; gap: 6px; }
  .mail-link { color: var(--blue-ink); text-decoration: none; font-size: 13px; }
  .mail-link:hover { text-decoration: underline; }
  .mail-none { color: var(--ink-faint); }
  .mail-copy { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); width: 24px; height: 24px; border-radius: 6px; font-size: 12px; line-height: 1; cursor: pointer; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
  .mail-copy:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
  .mail-copy.copied { border-color: var(--accent); color: #fff; background: var(--accent); }
  .dir-av-sm { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
  .dir-td-edit { text-align: right; width: 44px; }
  .kind-tag { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }

  /* ---------- Chip picker (contributors in modal) ---------- */
  .chip-picker { display: flex; flex-wrap: wrap; gap: 7px; }
  .chip { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 500; }
  .chip:hover { border-color: var(--accent); }
  .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

  /* ---------- Modal ---------- */
  .overlay { position: fixed; inset: 0; background: rgba(28,26,23,.32); display: none; align-items: flex-start; justify-content: center; z-index: 50; padding: 60px 20px; overflow-y: auto; }
  .overlay.show { display: flex; }
  .modal { background: var(--card); border-radius: 14px; width: 460px; max-width: 100%; box-shadow: 0 20px 60px rgba(28,26,23,.25); overflow: hidden; }
  .modal.wide { width: 560px; }
  .modal-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line-soft); }
  .modal-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 19px; }
  .modal-head p { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
  .modal-body { padding: 18px 22px; }
  .field { margin-bottom: 15px; }
  .field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
  .field input, .field select, .field textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
    background: #fff; color: var(--ink);
  }
  .field textarea { resize: vertical; font-family: inherit; line-height: 1.5; }
  .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .field-row { display: flex; gap: 12px; }
  .field-row .field { flex: 1; }
  .modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
  .btn { padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--ink); }
  .btn:hover { border-color: var(--ink-faint); }
  .btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
  .btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
  .btn-danger { color: #9a2f2f; border: none; background: none; margin-right: auto; padding: 9px 4px; }
  .btn-danger:hover { text-decoration: underline; }
  .btn-danger-solid { background: #c0392b; border-color: #c0392b; color: #fff; }
  .btn-danger-solid:hover { background: #a5301f; border-color: #a5301f; }
  .confirm-msg { font-size: 14px; line-height: 1.55; color: var(--ink); }

  .empty-state { text-align: center; padding: 70px 20px; color: var(--ink-faint); }
  .empty-state .big { font-family: var(--font-display); font-size: 22px; color: var(--ink-soft); margin-bottom: 8px; }
  .empty-state .btn-primary { margin-top: 18px; display: inline-block; }

  @media (max-width: 980px) {
    .dash-grid { grid-template-columns: 1fr; }
    .kpi-band { grid-template-columns: repeat(3, 1fr); }
  }
  @media (max-width: 820px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: static; max-height: none; }
    .kpi-band { grid-template-columns: repeat(2, 1fr); }
  }
  /* ---------- Auth / Login ---------- */
  .login-screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--grad); padding: 20px; z-index: 100; }
  .login-card { background: var(--card); border-radius: 16px; padding: 34px 32px; width: 380px; max-width: 100%; box-shadow: 0 20px 60px rgba(20,58,83,.3); }
  .login-brand { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: -.02em; text-align: center; }
  .login-brand .b-green { color: var(--accent); } .login-brand .b-blue { color: var(--blue); }
  .login-sub { text-align: center; color: var(--ink-faint); font-size: 12.5px; font-style: italic; margin: 4px 0 24px; }
  .login-field { margin-bottom: 14px; }
  .login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
  .login-field input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 14px; }
  .login-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
  .login-btn { width: 100%; margin-top: 8px; padding: 12px; font-size: 14px; }
  .login-err { color: #9a2f2f; font-size: 13px; min-height: 18px; margin-bottom: 4px; }
  .login-hint { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--ink-faint); line-height: 1.6; }
  .login-hint code { background: var(--paper); padding: 1px 5px; border-radius: 4px; font-family: var(--font-mono); color: var(--blue-ink); }

  /* ---------- Demo banner ---------- */
  .demo-banner { background: #fdeccf; color: #7a5410; font-size: 12.5px; padding: 9px 44px 9px 18px; text-align: center; position: relative; border-bottom: 1px solid #f0d9ad; line-height: 1.4; }
  .demo-banner b { color: #5e4109; }
  .demo-banner button { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); border: none; background: none; color: #7a5410; font-size: 14px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
  .demo-banner button:hover { background: rgba(122,84,16,.12); }

  /* ---------- Sidebar footer (user + logout) ---------- */
  .side-foot { border-top: 1px solid var(--line-soft); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
  .side-foot .su-av { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
  .side-foot .su-id { flex: 1; min-width: 0; }
  .side-foot .su-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-foot .su-role { font-size: 11px; color: var(--ink-faint); }
  .side-foot .su-role.admin { color: var(--accent-ink); }
  .side-foot .icon-btn { flex-shrink: 0; }
  .admin-open { width: 100%; margin: 0 14px 12px; width: calc(100% - 28px); padding: 9px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-size: 13px; }
  .admin-open:hover { background: var(--accent); color: #fff; }

  /* Admin console */
  .admin-sec { margin-bottom: 22px; }
  .admin-sec h4 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
  .acct-row { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .acct-row:last-child { border: none; }
  .acct-av { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
  .acct-id { flex: 1; min-width: 0; }
  .acct-name { font-size: 13px; font-weight: 600; }
  .acct-meta { font-size: 11.5px; color: var(--ink-faint); }
  .role-pill { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 20px; }
  .role-pill.admin { background: var(--accent-soft); color: var(--accent-ink); }
  .role-pill.client { background: var(--blue-soft); color: var(--blue-ink); }
  .link-box { display: flex; gap: 8px; margin-top: 8px; }
  .link-box input { flex: 1; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); background: var(--paper); }
  /* Page admin dédiée */
  .admin-page { max-width: 960px; }
  .admin-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--line); }
  .admin-title { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; }
  .admin-title .b-green { color: var(--accent); }
  .admin-page-sub { color: var(--ink-faint); font-size: 13px; margin-top: 3px; }
  .admin-page .admin-sec { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
  /* Tableau projets clients (console) */
  .proj-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
  .proj-head, .proj-row { display: grid; grid-template-columns: 1fr 70px 150px auto; align-items: center; gap: 10px; padding: 10px 14px; }
  .proj-head { background: #f7faf9; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); font-weight: 600; border-bottom: 1px solid var(--line); }
  .proj-row { border-bottom: 1px solid var(--line-soft); }
  .proj-row:last-child { border-bottom: none; }
  .proj-row:hover { background: #f7faf9; }
  .pc-name { display: flex; align-items: center; gap: 10px; }
  .pc-name .acct-name { display: block; }
  .pc-name .acct-meta { display: block; }
  .pc-proj { text-align: center; font-weight: 600; }
  .sub-ok { font-size: 12px; color: var(--accent-ink); }
  .sub-none { font-size: 12px; color: var(--ink-faint); font-style: italic; }
  .pc-act { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
