/* ---------------------------------------------------------------
   Interface RGPD & Cybersécurité — feuille de style unique.
   Thème clair par défaut, thème sombre via prefers-color-scheme
   ou l'attribut data-theme posé par le bouton de la barre haute.
   --------------------------------------------------------------- */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --ok: #059669;
  --ok-soft: #d1fae5;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --neutral-soft: #e2e8f0;
  /* Couleurs des deux chantiers : elles portent la lecture du Gantt */
  --track-rgpd: #7c3aed;
  --track-rgpd-soft: #ede9fe;
  --track-cyber: #0891b2;
  --track-cyber-soft: #cffafe;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
  --radius: 14px;
  --sidebar-w: 260px;
  --gantt-label-w: 320px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120;
    --surface: #111a2e;
    --surface-2: #16213a;
    --surface-3: #1b2942;
    --border: #24324f;
    --border-strong: #35486e;
    --text: #e8eefc;
    --text-muted: #93a4c4;
    --accent: #60a5fa;
    --accent-soft: #1c2f52;
    --ok: #34d399;
    --ok-soft: #0d3f33;
    --info: #60a5fa;
    --info-soft: #1c2f52;
    --warn: #fbbf24;
    --warn-soft: #43320c;
    --danger: #f87171;
    --danger-soft: #4a1d1d;
    --neutral-soft: #24324f;
    --track-rgpd: #a78bfa;
    --track-rgpd-soft: #2e2352;
    --track-cyber: #22d3ee;
    --track-cyber-soft: #0e3a45;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111a2e;
  --surface-2: #16213a;
  --surface-3: #1b2942;
  --border: #24324f;
  --border-strong: #35486e;
  --text: #e8eefc;
  --text-muted: #93a4c4;
  --accent: #60a5fa;
  --accent-soft: #1c2f52;
  --ok: #34d399;
  --ok-soft: #0d3f33;
  --info: #60a5fa;
  --info-soft: #1c2f52;
  --warn: #fbbf24;
  --warn-soft: #43320c;
  --danger: #f87171;
  --danger-soft: #4a1d1d;
  --neutral-soft: #24324f;
  --track-rgpd: #a78bfa;
  --track-rgpd-soft: #2e2352;
  --track-cyber: #22d3ee;
  --track-cyber-soft: #0e3a45;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100; }
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- structure ---------- */

.layout { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { padding: 26px 24px 40px; flex: 1; min-width: 0; }
.main-bare { padding: 0; display: flex; }
.stack > * + * { margin-top: 18px; }

/* ---------- barre latérale ---------- */

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px; border-bottom: 1px solid var(--border); }
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text small { color: var(--text-muted); font-size: 12px; }

.nav { padding: 10px; overflow-y: auto; flex: 1; }
.nav-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); padding: 14px 10px 6px; }

.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-muted);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }

.build-stamp { padding: 0 18px 12px; color: var(--text-muted); font-size: 10.5px; letter-spacing: .03em; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px 18px 8px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.team { display: flex; }
.team .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.team .avatar:first-child { margin-left: 0; }
.team-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- barre haute ---------- */

.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.crumb-root, .crumb-sep { color: var(--text-muted); }
.crumb-current { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text-muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.burger { display: none; }

/* ---------- en-tête de page ---------- */

.page-head-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--text-muted); max-width: 76ch; }
.page-head-actions { margin-left: auto; }

/* ---------- éléments communs ---------- */

.avatar {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  vertical-align: middle;
}
.avatar[data-person="patrick"] { background: var(--track-cyber-soft); color: var(--track-cyber); }
.avatar[data-person="marie"] { background: var(--track-rgpd-soft); color: var(--track-rgpd); }
.avatar[data-person="marietton"] { background: var(--ok-soft); color: var(--ok); }
.avatar-name { margin-left: 8px; vertical-align: middle; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-neutral { background: var(--neutral-soft); color: var(--text-muted); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; }
.tag-rgpd { background: var(--track-rgpd-soft); color: var(--track-rgpd); }
.tag-cyber { background: var(--track-cyber-soft); color: var(--track-cyber); }

.code-chip { padding: 3px 8px; border-radius: 7px; background: var(--surface-3); color: var(--text-muted); font-size: 12px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.notice { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text-muted); font-size: 13px; }
.notice svg { width: 17px; height: 17px; flex: 0 0 17px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--border-strong); }
.btn svg { width: 17px; height: 17px; }
.btn-ai { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ai:hover { filter: brightness(1.07); }
.btn[disabled] { opacity: .6; cursor: default; }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.seg { border: 0; background: transparent; color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }

.chip { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text-muted); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }

/* ---------- panneaux, cartes ---------- */

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.panel-hint { margin-left: auto; color: var(--text-muted); font-size: 12.5px; }
.panel-body { padding: 18px; }
.panel-body-flush { padding: 0; }

.placeholder { border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-2); padding: 26px 20px; text-align: center; color: var(--text-muted); }
.placeholder strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 15px; }
.placeholder p { margin: 0 auto; max-width: 54ch; font-size: 14px; }

/* ---------- jauges ---------- */

.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.gauge { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-align: center; }
.gauge svg { width: 108px; height: 108px; }
.gauge-bg { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.gauge-fg { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .5s ease; }
.gauge-ok .gauge-fg { stroke: var(--ok); }
.gauge-info .gauge-fg { stroke: var(--info); }
.gauge-warn .gauge-fg { stroke: var(--warn); }
.gauge-danger .gauge-fg { stroke: var(--danger); }
.gauge-text { fill: var(--text); font-size: 22px; font-weight: 700; text-anchor: middle; }
.gauge-label { font-weight: 600; font-size: 14px; margin-top: 4px; }
.gauge-hint { color: var(--text-muted); font-size: 12px; }

/* ---------- rétroplanning (Gantt) ---------- */

.gantt { overflow-x: auto; }
.gantt-row { display: flex; align-items: stretch; min-height: 40px; border-bottom: 1px solid var(--border); min-width: 780px; }
.gantt-row:last-child { border-bottom: 0; }
.gantt-label { flex: 0 0 var(--gantt-label-w); display: flex; align-items: center; gap: 9px; padding: 8px 14px; border-right: 1px solid var(--border); min-width: 0; }
.gantt-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.gantt-track { position: relative; flex: 1; min-width: 0; }
.gantt-grid { position: absolute; inset: 0; display: flex; }
.gantt-col { border-right: 1px solid var(--border); }
.gantt-col:last-child { border-right: 0; }

.gantt-head { background: var(--surface-2); position: sticky; top: 0; z-index: 2; font-size: 12px; font-weight: 600; color: var(--text-muted); min-height: 44px; }
.gantt-months { display: flex; }
.gantt-month { display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--border); font-size: 12px; }
.gantt-month:last-child { border-right: 0; }
.gantt-month small { color: var(--text-muted); font-size: 10px; }

.gantt-row-phase { background: var(--surface-2); min-height: 32px; }
.gantt-row-phase .gantt-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }

.gantt-bar {
  position: absolute; top: 9px; height: 22px;
  border-radius: 6px; overflow: hidden;
  display: flex; align-items: center;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
}
.gantt-bar-rgpd { background: var(--track-rgpd-soft); border-color: var(--track-rgpd); }
.gantt-bar-cyber { background: var(--track-cyber-soft); border-color: var(--track-cyber); }
.gantt-bar.is-late { border-style: dashed; border-color: var(--danger); }
.gantt-fill { position: absolute; inset: 0 auto 0 0; opacity: .45; }
.gantt-bar-rgpd .gantt-fill { background: var(--track-rgpd); }
.gantt-bar-cyber .gantt-fill { background: var(--track-cyber); }
.gantt-bar-text { position: relative; padding: 0 8px; font-size: 11px; font-weight: 700; color: var(--text); white-space: nowrap; }

/* ---------- tableaux ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .sub { display: block; color: var(--text-muted); font-size: 12px; }
.table-foot { margin: 0; padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12.5px; background: var(--surface-2); }

/* ---------- onglets ---------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab { padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.tab:hover { color: var(--text); }
.tab.is-current { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- vue en deux volets (CyberVadis) ---------- */

.split { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.split-main { min-width: 0; }

.tree { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tree-group + .tree-group { border-top: 1px solid var(--border); }
.tree-group-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.tree-count { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); }
.tree-item { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 10px 14px; text-decoration: none; color: var(--text); border-left: 3px solid transparent; }
.tree-item:hover { background: var(--surface-2); }
.tree-item.is-current { background: var(--accent-soft); border-left-color: var(--accent); }
.tree-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.tree-title { font-size: 13.5px; line-height: 1.4; }
.tree-meta { grid-column: 2; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0; }
.fields dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 4px; }
.fields dd { margin: 0; font-size: 14px; font-weight: 600; }

.dropzone { border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); padding: 22px; text-align: center; color: var(--text-muted); }
.dropzone svg { width: 26px; height: 26px; color: var(--text-muted); }
.dropzone strong { display: block; color: var(--text); margin: 6px 0 4px; }
.dropzone p { margin: 0 auto; max-width: 58ch; font-size: 13px; }

.ai-block { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface-2); }
.ai-hint { display: block; margin-top: 8px; color: var(--text-muted); font-size: 12.5px; }
.ai-answer { margin-top: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; font-size: 14px; }
.ai-answer p { margin: 0; color: var(--text-muted); }
.ai-answer-head { font-weight: 700; margin-bottom: 6px; }
.ai-answer-foot, .msg-foot { margin-top: 10px; color: var(--text-muted); font-size: 12px; font-style: italic; }
.ai-loading, .msg-bot.is-loading { color: var(--text-muted); font-style: italic; }
.btn-ai.is-loading { opacity: .7; }

/* ---------- cycle de vie documentaire ---------- */

.flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.flow-step { flex: 1 1 170px; display: flex; flex-direction: column; gap: 2px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; color: var(--text-muted); }
.flow-num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; margin-bottom: 4px; }
.flow-step strong { color: var(--text); font-size: 14px; }
.flow-arrow { align-self: center; color: var(--text-muted); }

/* ---------- assistant IA ---------- */

.ask { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px; width: 100%; }
.ask-inner { width: 100%; max-width: 720px; text-align: center; }
.ask-inner.has-thread { align-self: flex-start; }
.ask-mark { width: 46px; height: 46px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.ask-mark svg { width: 24px; height: 24px; }
.ask-inner h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.ask-sub { margin: 0 0 22px; color: var(--text-muted); }

.ask-form { display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 18px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: var(--shadow); }
.ask-form:focus-within { border-color: var(--accent); }
.ask-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; padding: 8px 0; }
.ask-send { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: #fff; cursor: pointer; }
.ask-send svg { width: 18px; height: 18px; }

.ask-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.ask-thread { margin-top: 22px; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.msg { padding: 12px 16px; border-radius: 14px; font-size: 14.5px; }
.msg-user { align-self: flex-end; max-width: 85%; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg-bot { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg-bot p { margin: 0; }
.sources { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.sources-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.source-chip { padding: 3px 10px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 600; }
.ask-scope { margin-top: 26px; color: var(--text-muted); font-size: 12.5px; }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .burger { display: grid; }
  .sidebar { position: fixed; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  :root { --gantt-label-w: 220px; }
}

@media (max-width: 620px) {
  .main { padding: 20px 16px 32px; }
  .topbar { padding: 12px 16px; }
  .flow-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


/* ---------- les deux espaces (note de cadrage §04) ---------- */

/* Espace collaborateur : ni menu latéral, ni barre de projet — le chat, rien d'autre. */
.collabbar { display: none; }
body[data-space="collab"] .sidebar,
body[data-space="collab"] .topbar { display: none; }
body[data-space="collab"] .collabbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.collabbar .brand-mark { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 9px; }
.collabbar .brand-mark svg { width: 18px; height: 18px; }
.collabbar-title { font-weight: 700; letter-spacing: -.01em; }
.collabbar .space-switch { margin-left: auto; }

.space-switch {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text-muted);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.space-switch:hover { color: var(--text); border-color: var(--border-strong); }
.space-switch svg { width: 15px; height: 15px; }

/* ---------- jalons et repère du jour ---------- */

.gantt-inner { position: relative; min-width: 780px; }
.gantt-overlay { position: absolute; left: var(--gantt-label-w); right: 0; top: 44px; bottom: 0; pointer-events: none; z-index: 3; }

.gantt-milestone { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dotted var(--accent); }
.gantt-milestone-flag {
  position: absolute; top: 2px; left: 4px; white-space: nowrap;
  padding: 1px 7px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 10.5px; font-weight: 700;
}
.gantt-milestone.is-low .gantt-milestone-flag { top: 20px; }
.gantt-milestone.is-flipped .gantt-milestone-flag { left: auto; right: 4px; }

.gantt-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--danger); }
.gantt-today span {
  position: absolute; top: 2px; left: 4px; white-space: nowrap;
  padding: 1px 7px; border-radius: 5px;
  background: var(--danger-soft); color: var(--danger);
  font-size: 10.5px; font-weight: 700;
}

/* La barre du Gantt est cliquable : elle ouvre la fiche de tâche. */
button.gantt-bar { cursor: pointer; padding: 0; font: inherit; }
button.gantt-bar:hover { filter: brightness(1.04); box-shadow: 0 0 0 2px var(--accent-soft); }

.linklike { border: 0; background: none; padding: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.linklike:hover { color: var(--accent); text-decoration: underline; }

/* ---------- fiche de tâche (panneau latéral) ---------- */

.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .38); z-index: 50; border: 0; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100%);
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow); z-index: 51; display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0; font-size: 15.5px; letter-spacing: -.01em; flex: 1; min-width: 0; }
.drawer-head .icon-btn { flex: 0 0 36px; }
.drawer-body { padding: 18px; overflow-y: auto; }
.drawer-title { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }

.evidence-list { list-style: none; margin: 0 0 14px; padding: 0; }
.evidence-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.evidence-list li:first-child { border-top: 0; }
.evidence-list svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--text-muted); }
.evidence-list span:nth-of-type(1) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--text-muted); font-size: 13.5px; margin: 0 0 14px; }
.dropzone-sm { padding: 16px; }
.dropzone-sm p { font-size: 12.5px; }

@media (max-width: 620px) {
  .space-switch span { display: none; }
}
