/* Documentation utilisateur ProcNest — complète css/styles.css (variables, boutons, header, footer). */

.docs-body { background: var(--bg-alt); }
.header .nav a.is-current { color: var(--blue); }

/* Mise en page : sommaire à gauche, article à droite */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; padding: 40px 0 80px; align-items: start; }
.side { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; font-size: .92rem; }
.side h2 { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.side ol { counter-reset: s; display: grid; gap: 2px; }
.side li a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.side li a::before { counter-increment: s; content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--border); font-size: .72rem; font-weight: 700; display: grid; place-items: center; color: var(--muted); }
.side li a:hover { background: #fff; }
.side li a[aria-current="page"] { background: #fff; font-weight: 600; box-shadow: 0 2px 10px rgba(11, 27, 58, .06); }
.side li a[aria-current="page"]::before { background: var(--grad); color: #fff; border-color: transparent; }
.side__toc { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.side__toc a { display: block; padding: 5px 10px; color: var(--muted); border-left: 2px solid var(--border); }
.side__toc a:hover { color: var(--blue); border-color: var(--blue); }

.article { background: #fff; border: 1px solid var(--border); border-radius: 20px; padding: 44px 48px; box-shadow: var(--shadow); min-width: 0; }
.article h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); margin-bottom: 14px; }
.article h2 { font-size: 1.5rem; margin: 52px 0 14px; padding-top: 8px; }
.article h3 { font-size: 1.1rem; margin: 28px 0 8px; }
.article p { margin: 0 0 14px; }
.article .lead { font-size: 1.12rem; color: var(--muted); margin-bottom: 22px; }
.article ul.list, .article ol.list { margin: 0 0 16px 4px; display: grid; gap: 8px; }
.article ul.list li { padding-left: 24px; position: relative; }
.article ul.list li::before { content: ''; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--grad); }
.article code, .kbd { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .88em; background: var(--bg-alt); border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; }
.ui { font-weight: 600; color: var(--navy); background: #eaf1ff; padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
.meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.meta span { font-size: .82rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); color: var(--muted); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; }

/* Encadrés */
.note { display: flex; gap: 14px; padding: 16px 18px; border-radius: 14px; margin: 20px 0; border: 1px solid; font-size: .96rem; }
.note > b:first-child { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .85rem; }
.note p { margin: 0; }
.note--tip { background: #effaf6; border-color: #bfeadc; } .note--tip > b:first-child { background: var(--green); }
.note--info { background: #eef4ff; border-color: #cfe0ff; } .note--info > b:first-child { background: var(--blue); }
.note--warn { background: #fff7e8; border-color: #f8dfaa; } .note--warn > b:first-child { background: #f5a524; }

/* Étapes numérotées */
.steps { counter-reset: st; display: grid; grid-template-columns: 1fr; gap: 14px; margin: 20px 0 26px; }
.steps::before { display: none; }
.steps > li { min-width: 0; } .steps .ui { white-space: normal; }
.steps > li { counter-increment: st; position: relative; padding: 16px 18px 16px 62px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 14px; }
.steps > li::before { content: counter(st); position: absolute; left: 16px; top: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 700; display: grid; place-items: center; }
.steps b.t { display: block; color: var(--navy); margin-bottom: 2px; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }
.steps p + p { margin-top: 6px; }

/* Tableaux */
.tbl { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: .94rem; }
.tbl th, .tbl td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl th { background: var(--bg-alt); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }

/* Cartes de parcours / définitions */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 22px 0; }
.tile { display: block; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #fff; transition: transform .15s, box-shadow .2s, border-color .2s; }
a.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--blue); }
.tile__n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--grad); color: #fff; font-weight: 700; margin-bottom: 10px; }
.tile h3 { margin: 0 0 6px; font-size: 1.02rem; }
.tile p { margin: 0; color: var(--muted); font-size: .92rem; }
.tile small { display: block; margin-top: 10px; color: var(--blue); font-weight: 600; font-size: .8rem; }
.tile--artifact { border-top: 4px solid var(--violet); } .tile--process { border-top: 4px solid var(--blue); }
.tile--instance { border-top: 4px solid var(--green); } .tile--tasks { border-top: 4px solid #f5a524; } .tile--activity { border-top: 4px solid #e5484d; }
.tile--access { border-top: 4px solid #0b1b3a; }
.tile--campaign { border-top: 4px solid #7a4dff; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: grid; gap: 2px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 14px; min-width: 0; }
.pager a:hover { border-color: var(--blue); }
.pager small { color: var(--muted); font-size: .78rem; }
.pager b { color: var(--navy); }
.pager a:last-child { text-align: right; margin-left: auto; }

/* ------------------------------------------------------------------ */
/* Schémas animés (SVG)                                                */
/* ------------------------------------------------------------------ */
.figure { margin: 26px 0; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: #fff; }
.figure figcaption { padding: 12px 18px; font-size: .88rem; color: var(--muted); border-top: 1px solid var(--border); background: var(--bg-alt); }
.figure svg { display: block; width: 100%; height: auto; background: linear-gradient(180deg, #fbfdff, #f1f6ff); }
.figure video, .figure img.shot { display: block; width: 100%; height: auto; }
.anim text { font-family: Inter, system-ui, sans-serif; font-weight: 600; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes blink { 50% { opacity: .35; } }
.js .anim .n { opacity: 0; }
.js .anim .l { stroke-dasharray: 400; stroke-dashoffset: 400; }
.js .anim.is-visible .n { animation: appear .55s var(--d, 0s) both; }
.js .anim.is-visible .l { animation: draw .7s var(--d, 0s) forwards; }
.anim .pulse { animation: blink 1.6s infinite; }

/* ------------------------------------------------------------------ */
/* Démos animées (maquettes de l'interface, rejouées en boucle)        */
/* ------------------------------------------------------------------ */
.demo { margin: 26px 0 30px; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 8px 30px rgba(11, 27, 58, .08); }
.demo__chrome { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: #eef2fa; border-bottom: 1px solid var(--border); font-size: .76rem; color: var(--muted); }
.demo__chrome i { width: 10px; height: 10px; border-radius: 50%; background: #cbd5ea; }
.demo__chrome span { margin-left: 10px; font-weight: 600; }
.demo__stage { position: relative; height: 372px; background: #f7f9fe; overflow: hidden; font-size: 12.5px; color: #1b2745; }
.scene { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .35s; }
.scene.is-active { opacity: 1; visibility: visible; }
.demo__bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); }
.demo__cap { flex: 1; min-width: 0; font-size: .92rem; }
.demo__cap > b:first-child { color: var(--blue); margin-right: 6px; }
.demo__cap b { color: var(--navy); }
.demo__ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.demo__ctrl button { border: 1px solid var(--border); background: #fff; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: .85rem; color: var(--navy); }
.demo__ctrl button:hover { border-color: var(--blue); }
.demo__dots { display: flex; gap: 6px; margin: 0 6px; }
.demo__dots i { width: 8px; height: 8px; border-radius: 50%; background: #cfd8ec; cursor: pointer; }
.demo__dots i.on { background: var(--blue); width: 22px; border-radius: 6px; transition: width .2s; }
.demo__progress { height: 3px; background: var(--grad); width: 0; }
.demo.is-playing .demo__progress { animation: prog var(--step, 4.5s) linear forwards; }
@keyframes prog { to { width: 100%; } }

/* Primitives d'interface (pour les maquettes) */
.m-top { display: flex; gap: 4px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--border); align-items: center; }
.m-logo { font-weight: 800; color: var(--navy); margin-right: 12px; }
.m-tab { padding: 6px 11px; border-radius: 8px; color: #5b6b8c; font-weight: 600; position: relative; }
.m-tab.on { background: #e6efff; color: #1550c8; }
.m-page { padding: 14px 18px; }
.m-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.m-head h4 { margin: 0; font-size: 15px; color: var(--navy); }
.m-head small { color: #7d8aa6; display: block; font-size: 11px; font-weight: 400; }
.m-sp { flex: 1; }
.m-btn { position: relative; padding: 6px 12px; border-radius: 7px; border: 1px solid #cfd8ec; background: #fff; font-weight: 600; font-size: 12px; white-space: nowrap; color: var(--navy); }
.m-btn.p { background: #2f6fe4; border-color: #2f6fe4; color: #fff; }
.m-btn.ok { background: #18a97f; border-color: #18a97f; color: #fff; }
.m-search { width: 150px; padding: 6px 10px; border-radius: 7px; border: 1px solid #cfd8ec; background: #fff; color: #9aa6c0; }
.m-chips { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.m-chip { padding: 4px 11px; border-radius: 999px; border: 1px solid #cfd8ec; background: #fff; font-weight: 600; font-size: 11.5px; }
.m-chip.on { background: #2f6fe4; color: #fff; border-color: #2f6fe4; }
.m-chip.alert b { color: #d13438; } .m-chip.on.alert b { color: #fff; }
.m-list { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.m-row { display: grid; grid-template-columns: 1fr 120px 90px 90px; gap: 10px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #eef2fa; }
.m-row:last-child { border-bottom: 0; }
.m-row--h { background: #f3f6fd; color: #7d8aa6; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.m-row--2 { grid-template-columns: 1fr 110px auto; }
.m-row.hl { background: #eaf1ff; }
.m-av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; margin-right: 8px; vertical-align: middle; flex: none; }
.m-av.a { background: #7a4dff; } .m-av.b { background: #18a97f; } .m-av.c { background: #e8833a; } .m-av.d { background: #2f6fe4; }
.m-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-weight: 600; font-size: 11px; }
.m-badge.g { background: #dff6ec; color: #0b7a58; } .m-badge.b { background: #e3edff; color: #1550c8; } .m-badge.o { background: #fff0d6; color: #9a6200; }
.m-badge.r { background: #fde2e3; color: #b1262b; } .m-badge.n { background: #eef1f7; color: #5b6b8c; }
.m-sub { color: #7d8aa6; font-size: 11px; display: block; }
.m-panel { position: absolute; top: 0; right: 0; bottom: 0; width: 62%; background: #fff; border-left: 1px solid var(--border); box-shadow: -10px 0 30px rgba(11, 27, 58, .12); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.m-panel h5 { margin: 0; font-size: 14px; color: var(--navy); }
.m-panel .m-foot { margin-top: auto; display: flex; gap: 8px; justify-content: flex-end; padding-top: 10px; border-top: 1px solid #eef2fa; }
.m-field .m-label { display: block; font-weight: 600; font-size: 11.5px; margin-bottom: 4px; }
.m-input { min-height: 28px; padding: 5px 9px; border: 1px solid #cfd8ec; border-radius: 6px; background: #fff; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.m-input.focus { border-color: #2f6fe4; box-shadow: 0 0 0 2px #d6e5ff; }
.m-type { display: inline-block; overflow: hidden; white-space: nowrap; vertical-align: bottom; }
.is-active .m-type { animation: type var(--t, 1.4s) steps(var(--n, 20), end) var(--d, 0s) both; }
@keyframes type { from { max-width: 0; } to { max-width: 40ch; } }
.m-pill { padding: 2px 8px; border-radius: 999px; background: #e8efff; color: #1550c8; font-weight: 600; font-size: 11px; }
.m-file { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid #dde5f5; border-radius: 8px; background: #fbfcff; }
.m-file i { width: 20px; height: 24px; border-radius: 3px; background: #2f6fe4; color: #fff; font-style: normal; font-size: 8px; font-weight: 800; display: grid; place-items: center; }
.m-file i.p { background: #d9531e; } .m-file i.d { background: #c4314b; }
.m-menu { position: absolute; background: #fff; border: 1px solid #cfd8ec; border-radius: 9px; box-shadow: 0 10px 28px rgba(11, 27, 58, .18); padding: 4px; min-width: 170px; z-index: 5; }
.m-menu div { padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.m-menu div.on { background: #e6efff; color: #1550c8; font-weight: 600; }
.m-canvas { position: absolute; inset: 0; background-image: radial-gradient(#d5def0 1px, transparent 1px); background-size: 16px 16px; }
.m-stencil { position: absolute; left: 0; top: 40px; bottom: 0; width: 132px; background: #fff; border-right: 1px solid var(--border); padding: 10px; display: grid; gap: 7px; align-content: start; }
.m-stencil div { padding: 6px 8px; border: 1px solid #dde5f5; border-radius: 7px; font-weight: 600; font-size: 11.5px; background: #fbfcff; }
.m-bar { position: absolute; left: 0; right: 0; top: 0; height: 40px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; padding: 0 12px; }
.m-node { position: absolute; padding: 8px 12px; border-radius: 10px; background: #fff; border: 2px solid #2f6fe4; font-weight: 600; box-shadow: 0 4px 12px rgba(11, 27, 58, .08); white-space: nowrap; text-align: center; }
.m-node.q { border-color: #7a4dff; } .m-node.o { border-color: #18a97f; } .m-node.e { border-color: #e8833a; } .m-node.l { border-color: #f5a524; }
.m-node small { display: block; font-weight: 500; color: #7d8aa6; font-size: 10px; }
.m-wire { position: absolute; background: #8aa0c8; }
.m-ring { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid #f5a524; opacity: 0; pointer-events: none; z-index: 9; }
.is-active .m-ring { animation: ring 1.1s var(--d, 1s) 2 both; }
@keyframes ring { 0% { transform: scale(.4); opacity: .95; } 100% { transform: scale(1.7); opacity: 0; } }
.m-cursor { position: absolute; left: var(--x0); top: var(--y0); width: 20px; height: 20px; z-index: 10; pointer-events: none; opacity: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.is-active .m-cursor { animation: cur 1s ease-in-out var(--d, .3s) forwards; }
@keyframes cur { 0% { opacity: 0; left: var(--x0); top: var(--y0); } 15% { opacity: 1; } 100% { opacity: 1; left: var(--x1); top: var(--y1); } }
.is-active .m-in { animation: appear .5s var(--d, 0s) both; }
.is-active .m-panel { animation: slide .5s var(--d, 0s) both; }
@keyframes slide { from { transform: translateX(100%); } to { transform: none; } }
.m-dim { position: absolute; inset: 0; background: rgba(11, 27, 58, .18); }
.m-tag { font-family: ui-monospace, Consolas, monospace; background: #fff3c9; border-radius: 4px; padding: 0 4px; color: #7a5a00; font-weight: 700; }
.m-doc { background: #fff; border: 1px solid #dde5f5; border-radius: 8px; padding: 12px 14px; line-height: 1.9; box-shadow: 0 4px 14px rgba(11, 27, 58, .08); }
.m-toast { position: absolute; right: 14px; bottom: 12px; background: #fff; border: 1px solid #bfeadc; border-left: 4px solid #18a97f; border-radius: 8px; padding: 8px 12px; box-shadow: 0 8px 20px rgba(11, 27, 58, .15); font-weight: 600; z-index: 6; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .86rem; color: var(--muted); margin: -8px 0 20px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

@media (max-width: 960px) {
  .docs { grid-template-columns: 1fr; gap: 20px; }
  .side { position: static; max-height: none; }
  .side ol { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
  .side__toc { display: none; }
  .article { padding: 28px 20px; }
  .demo__stage { height: 330px; font-size: 11.5px; }
  .m-row { grid-template-columns: 1fr 80px 70px; } .m-row > :nth-child(4) { display: none; }
  .m-panel { width: 78%; }
}
@media (prefers-reduced-motion: reduce) {
  .anim .n, .anim .l, .m-in, .m-panel, .m-type, .m-ring, .m-cursor { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; transform: none !important; }
  .m-ring, .m-cursor { display: none; }
  .demo__progress { display: none; }
}

/* Rangées de nœuds de la maquette d'éditeur */
.m-flow { position: absolute; right: 4%; display: flex; align-items: center; z-index: 1; }
.m-flow .m-node { position: static; flex: none; }
.m-link { flex: 1; min-width: 14px; height: 2px; background: #8aa0c8; position: relative; }
.m-link::after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left: 7px solid #8aa0c8; border-right: 0; }
.m-stencil { gap: 5px; padding: 8px 10px; }
.m-stencil div { padding: 4px 8px; font-size: 11px; }

/* Sans JavaScript : la première scène de chaque démo reste visible */
html:not(.js) .scene:first-child { opacity: 1; visibility: visible; }
