/* STRIMA × Venkai — démo UX améliorée. Jetons de la DA Venkai : papier, encre, filets, UNE marque. */
:root {
  --paper: #f5f2ec; --raised: #fbf9f5; --sunken: #ede8df; --rule: #dcd5c8; --rule-strong: #8f8069;
  --ink: #191512; --ink-2: #4a433a; --ink-3: #6b6256; --mark: #105664; --mark-wash: #ddf8fd; --live: #2f6b3f;
  --bad: #9b2c1f; --bad-wash: #f8e4df; --warn: #7a5410; --warn-wash: #f6ead2;
  --serif: "Source Serif 4", Charter, Georgia, serif; --sans: "Public Sans", system-ui, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17140f; --raised: #201c16; --sunken: #100e0a; --rule: #332d24; --rule-strong: #756b5c;
    --ink: #f0ebe1; --ink-2: #cfc7b8; --ink-3: #a59b8a; --mark: #12a2be; --mark-wash: #0e2b33; --live: #6fbf85;
    --bad: #f08a7a; --bad-wash: #3a1d17; --warn: #e3b25c; --warn-wash: #33270f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #17140f; --raised: #201c16; --sunken: #100e0a; --rule: #332d24; --rule-strong: #756b5c;
  --ink: #f0ebe1; --ink-2: #cfc7b8; --ink-3: #a59b8a; --mark: #12a2be; --mark-wash: #0e2b33; --live: #6fbf85;
  --bad: #f08a7a; --bad-wash: #3a1d17; --warn: #e3b25c; --warn-wash: #33270f; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
body { min-height: 100vh; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.mono, code { font-family: var(--mono); font-size: 13px; }
.dim { color: var(--ink-3); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
[hidden] { display: none !important; }

/* bandeau de démonstration */
.demo-band { background: var(--sunken); border-bottom: 1px solid var(--rule); color: var(--ink-2); font-size: 12.5px; padding: 6px 20px; letter-spacing: 0.01em; }
.demo-band b { letter-spacing: 0.06em; }

/* shell */
.shell { display: grid; grid-template-columns: 200px 1fr; min-height: calc(100vh - 31px); }
nav.side { border-right: 1px solid var(--rule); padding: 22px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: calc(100vh - 31px); }
.brand { font-family: var(--serif); font-size: 19px; font-weight: 600; padding: 0 10px 2px; }
.brand-sub { font-size: 11px; color: var(--ink-3); padding: 0 10px 18px; }
nav.side a { text-decoration: none; padding: 6px 10px; border-radius: 6px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
nav.side a:hover { background: var(--sunken); color: var(--ink); }
nav.side a.on { background: var(--raised); color: var(--ink); box-shadow: inset 2px 0 0 var(--ink); }
nav.side .sep { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 16px 10px 4px; }
nav.side .count { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
nav.side .foot { margin-top: auto; font-size: 12px; color: var(--ink-3); padding: 0 10px; display: grid; gap: 6px; }
.linklike { background: none; border: 0; padding: 0; color: var(--ink-3); text-decoration: underline; cursor: pointer; font-size: 12px; text-align: left; }

main { padding: 28px 36px 80px; max-width: 1280px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.head p { margin: 6px 0 0; color: var(--ink-2); }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 8px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); margin-bottom: 26px; }
.kpi { padding: 14px 18px; border-right: 1px solid var(--rule); }
.kpi:last-child { border-right: 0; }
.kpi .l { font-size: 12.5px; color: var(--ink-3); }
.kpi .v { font-family: var(--serif); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.kpi .down { color: var(--bad); }

/* blocks & cards */
section.block { margin: 0 0 30px; }
section.block > .bh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
.card { background: var(--raised); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--sunken); }
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); }
.tablewrap table th:first-child, .tablewrap table td:first-child { padding-left: 16px; }
.tablewrap tr:last-child td { border-bottom: 0; }
td.changed { background: var(--warn-wash); }
.was { text-decoration: line-through; color: var(--ink-3); margin-right: 6px; }

/* pills */
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--rule-strong); color: var(--ink-2); white-space: nowrap; }
.pill.haute { border-color: var(--bad); color: var(--bad); }
.pill.moyenne { border-color: var(--warn); color: var(--warn); }
.pill.ok { border-color: var(--live); color: var(--live); }
.pill.mark { border-color: var(--mark); color: var(--mark); }

/* bar */
.bar { height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--ink-2); }

/* marque */
.marked { box-shadow: inset 3px 0 0 var(--mark); }
.marked .mtitle { color: var(--mark); }

/* alertes */
.alert { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.alert:last-child { border-bottom: 0; }
.alert .t { font-weight: 600; }
.alert .r { color: var(--ink-2); font-size: 14px; }
.alert .side { text-align: right; font-size: 13px; }

/* boutons */
.btn { appearance: none; border: 1px solid var(--rule-strong); background: var(--raised); padding: 7px 14px; border-radius: 7px; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--sunken); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { opacity: 0.9; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* grilles */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }

/* facts */
dl.facts { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--ink-3); }
dl.facts dd { margin: 0; }
.formula { font-family: var(--mono); font-size: 14px; background: var(--sunken); border: 1px solid var(--rule); border-radius: 7px; padding: 10px 12px; overflow-x: auto; white-space: nowrap; }
.formula .eq { color: var(--ink); font-weight: 600; }

/* onglets */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { text-decoration: none; padding: 8px 14px; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

/* chaîne */
.chain { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--raised); overflow: hidden; }
.chain > div { padding: 12px 14px; border-right: 1px solid var(--rule); }
.chain > div:last-child { border-right: 0; }
.chain .l { font-size: 12px; color: var(--ink-3); }
.chain .v { font-family: var(--serif); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chain .s { font-size: 12px; color: var(--ink-2); }

/* documents */
.doc { border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; background: var(--raised); font-size: 14px; }
.doc .dh { display: flex; justify-content: space-between; gap: 10px; }
.doc q { display: block; color: var(--ink-2); margin-top: 6px; quotes: none; font-size: 13.5px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 2px 9px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper); cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--rule-strong); }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 13px; }
.timeline .live { color: var(--live); font-size: 12px; }

/* décisions */
.decision { border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 12px; }
textarea, input[type=text], input[type=password], select { width: 100%; background: var(--paper); color: var(--ink); border: 1px solid var(--rule-strong); border-radius: 7px; padding: 8px 10px; font: inherit; }
textarea { min-height: 64px; resize: vertical; }

/* assistant */
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; font-size: 16px; padding: 10px 12px; }
.answer h3 { margin-bottom: 8px; }
.answer .sec { margin-top: 14px; }
.answer .sec > .k { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.answer ul { margin: 0; padding-left: 18px; }
.answer li { margin: 3px 0; }

/* svg */
svg text { font-family: var(--sans); }
.chart { width: 100%; height: auto; }

/* pitch */
.slides { position: fixed; inset: 0; background: var(--paper); z-index: 50; display: grid; grid-template-rows: 1fr auto; }
.slide { padding: 7vh 9vw; display: flex; flex-direction: column; justify-content: center; gap: 2.4vh; max-width: 1400px; margin: 0 auto; width: 100%; }
.slide .eyebrow { font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.slide h1 { font-size: clamp(30px, 4.4vw, 60px); line-height: 1.08; }
.slide p, .slide li { font-size: clamp(17px, 1.6vw, 24px); line-height: 1.45; color: var(--ink-2); max-width: 60ch; }
.slide ul { margin: 0; padding-left: 1.1em; display: grid; gap: 1vh; }
.slide .flow { display: flex; gap: 0; flex-wrap: wrap; font-size: clamp(14px, 1.3vw, 19px); }
.slide .flow span { padding: 10px 14px; border: 1px solid var(--rule-strong); margin: -1px 0 0 -1px; background: var(--raised); }
.slide .flow span.marked { box-shadow: inset 0 -3px 0 var(--mark); }
.slidebar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); }
.rule-marked { position: relative; height: 1px; background: var(--rule); margin: 1vh 0; }
.rule-marked::after { content: ""; position: absolute; top: -1px; left: var(--at, 38%); width: 54px; height: 3px; background: var(--mark); }

/* connexion */
.login { max-width: 400px; margin: 12vh auto; padding: 0 16px; }
.login form { display: grid; gap: 12px; margin-top: 18px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; }

/* ── NOUVEAU : sélecteur de rôle ─────────────────────────────────────────── */
.role-selector { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.role-btns { display: flex; gap: 4px; }
.role-btn { appearance: none; border: 1px solid var(--rule); background: var(--paper); padding: 5px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--ink-3); transition: all 0.15s; }
.role-btn:hover { border-color: var(--rule-strong); color: var(--ink); }
.role-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ── NOUVEAU : blocs d'accueil ──────────────────────────────────────────── */
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.home-block { background: var(--raised); border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; }
.home-block h3 { margin-bottom: 10px; font-size: 15px; }
.home-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); gap: 12px; }
.home-item:last-child { border-bottom: 0; }
.home-item:hover { background: var(--sunken); margin: 0 -8px; padding: 8px; border-radius: 6px; }
.home-item .t { font-weight: 600; font-size: 14px; }
.home-more { display: block; font-size: 13px; color: var(--mark); text-decoration: none; margin-top: 8px; }
.home-more:hover { text-decoration: underline; }

/* ── NOUVEAU : recherche sur la home ────────────────────────────────────── */
.search-home { background: var(--raised); border: 1px solid var(--rule); border-radius: 10px; padding: 20px 22px; }
.search-home h3 { margin-bottom: 12px; }

/* ── NOUVEAU : workflow cards ───────────────────────────────────────────── */
.workflow-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.workflow-card { background: var(--raised); border: 1px solid var(--rule); border-radius: 10px; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.workflow-card h3 { font-size: 16px; }
.workflow-card .dim { flex: 1; }
.wf-icon { font-size: 28px; line-height: 1; }

/* ── NOUVEAU : Forge orchestration ──────────────────────────────────────── */
.forge-steps { display: flex; align-items: center; gap: 0; flex-wrap: wrap; margin-bottom: 16px; padding: 12px 16px; background: var(--sunken); border: 1px solid var(--rule); border-radius: 8px; }
.forge-step { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.forge-step.done { color: var(--live); }
.forge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); flex-shrink: 0; }
.forge-step.done .forge-dot { background: var(--live); }
.forge-arrow { color: var(--ink-3); margin: 0 4px; font-size: 12px; }

/* ── NOUVEAU : en-tête projet ───────────────────────────────────────────── */
.project-header { margin-bottom: 22px; }
.ph-top { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ph-sub { color: var(--ink-2); font-size: 14px; margin-bottom: 12px; }
.project-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.ps { display: flex; flex-direction: column; gap: 2px; }
.ps .dim { font-size: 12px; }
.ps b { font-family: var(--serif); font-size: 16px; }

/* ── NOUVEAU : réponse avec orchestration ───────────────────────────────── */
.answer-block { margin-top: 18px; }

/* responsive */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  nav.side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--rule); padding: 10px; }
  nav.side .sep, nav.side .brand-sub, nav.side .foot { display: none; }
  main { padding: 18px 16px 60px; min-width: 0; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .chain { grid-template-columns: repeat(3, 1fr); }
  dl.facts { grid-template-columns: 1fr; }
  .tablewrap table { min-width: 720px; }
  nav.side .count { margin-left: 4px; }
  .home-grid { grid-template-columns: 1fr; }
  .workflow-cards { grid-template-columns: 1fr; }
  .project-stats { gap: 16px; }
}
@media print { nav.side, .demo-band .no-print { display: none; } .shell { grid-template-columns: 1fr; } }