/* Risqure — feuille de style principale (sans framework, mobile d'abord) */
@font-face { font-family: "Plex"; font-style: normal; font-weight: 100 700; font-stretch: 85% 100%; font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex"; font-style: normal; font-weight: 100 700; font-display: swap;
  src: url(/fonts/ibm-plex-sans-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-weight: 600 700; font-display: swap; src: url(/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2) format("woff2"); }
:root {
  --navy: #14203a;
  --navy-2: #1f2e52;
  --navy-3: #2b3c66;
  --signal: #f5c400;
  --blue: #2457d6;
  --blue-soft: #eaf0fd;
  --ink: #18202f;
  --muted: #576175;
  --line: #e0e4eb;
  --bg: #f4f6f9;
  --white: #fff;
  --low: #2e9e5b;
  --moderate: #d9a815;
  --high: #e8741e;
  --critical: #d13f3f;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(20, 32, 58, .06);
  font-family: Plex, "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-feature-settings: "tnum" 0;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.icon { flex-shrink: 0; vertical-align: -0.2em; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.22; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.012em; text-wrap: balance; }
h1 { font-size: 1.7rem; letter-spacing: -.02em; }
h2 { font-size: 1.22rem; }
h3 { font-size: 1.02rem; }
p { text-wrap: pretty; }
.score, .stat .value, .kpi strong, .count, .big-number, td.ref, .ref { font-variant-numeric: tabular-nums; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid #8fb0ff; outline-offset: 2px; border-radius: 4px; }
::selection { background: #ffe680; color: var(--ink); }

/* ---------- Mise en page ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--navy); color: #c9d3ea; flex-shrink: 0;
  display: flex; flex-direction: column; padding: 1.25rem .9rem; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; font-weight: 600; font-size: 1.18rem; letter-spacing: -.01em; margin: 0 .35rem 1.6rem; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex-shrink: 0; color: #fff; display: block; }
.nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -.3rem; padding: 0 .3rem; scrollbar-width: thin; scrollbar-color: var(--navy-3) transparent; }
.nav a { display: flex; align-items: center; gap: .65rem; color: #c3cde3; padding: .5rem .65rem; border-radius: 7px; margin-bottom: 1px; position: relative; font-size: .94rem; }
.nav a .icon { opacity: .8; }
.nav a:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--navy-2); color: #fff; }
.nav a.active::before { content: ""; position: absolute; inset-inline-start: -.3rem; top: .45rem; bottom: .45rem; width: 3px; border-radius: 3px; background: var(--signal); }
.nav a.active .icon { opacity: 1; }
.nav .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.nav .nav-new { color: #93a1c2; }
.nav .count { margin-inline-start: auto; background: var(--critical); color: #fff; border-radius: 99px; font-size: .72rem; font-weight: 600; padding: 0 .45rem; line-height: 1.45; }
.nav-title { font-size: .78rem; font-weight: 600; color: #7d8aa9; margin: 1.3rem .65rem .35rem; }
.sidebar-foot { margin-top: .75rem; padding-top: .85rem; border-top: 1px solid var(--navy-2); font-size: .86rem; }
.sidebar-foot select { width: 100%; background: var(--navy-2); border-color: var(--navy-3); color: #fff; }
.org-name { color: #fff; font-weight: 600; padding: 0 .35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row { display: flex; align-items: center; gap: .4rem; margin: .45rem 0 .6rem; }
.user-link { display: flex; align-items: center; gap: .45rem; color: #c3cde3; min-width: 0; flex: 1; padding: .3rem .35rem; border-radius: 6px; }
.user-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-link:hover { background: var(--navy-2); color: #fff; text-decoration: none; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px; background: none; color: #c3cde3; cursor: pointer; }
.icon-btn:hover { background: var(--navy-2); color: #fff; }
.locales { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 .1rem; }
.locales a { color: #7d8aa9; font-size: .74rem; font-weight: 600; padding: .15rem .4rem; border-radius: 4px; letter-spacing: .02em; }
.locales a:hover { color: #fff; text-decoration: none; background: var(--navy-2); }
.locales a.on { color: var(--navy); background: #dfe5f1; }
.main { flex: 1; min-width: 0; }
.topbar { display: none; }
.content { padding: 1.75rem 2rem 3rem; max-width: 1280px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: .75rem; background: var(--navy); color: #fff; padding: .7rem 1rem; position: sticky; top: 0; z-index: 40; }
  .topbar .brand { margin: 0; font-size: 1.05rem; }
  .topbar button { background: none; border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; padding: .2rem; }
  .topbar-bell { margin-inline-start: auto; color: #fff; display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }
  .content { padding: 1.1rem 1rem 3rem; }
}

/* ---------- Composants ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.35rem; margin-bottom: 1.25rem; }
.card > h2:first-child, .card-head h2 { font-size: 1.08rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .9rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4, .grid-side { grid-template-columns: 1fr; } }
@media (min-width: 600px) and (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 1px solid #d3d9e3; background: var(--white); color: var(--ink);
  padding: .55rem 1rem; border-radius: 7px; font: inherit; font-weight: 600; font-size: .94rem; line-height: 1.3; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s, box-shadow .12s; }
.btn:hover { text-decoration: none; border-color: #b6bfcd; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: inset 0 -2px 0 rgba(0,0,0,.14); }
.btn-primary:hover { background: #1d48b8; border-color: #1d48b8; }
.btn-danger { color: var(--critical); }
.btn-ai { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-ai .icon { color: var(--signal); }
.btn-ai:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn-sm { padding: .3rem .65rem; font-size: .85rem; }
.btn-lg { padding: .75rem 1.25rem; font-size: 1rem; }
.btn-link { background: none; border: 0; color: var(--blue); padding: 0; font: inherit; cursor: pointer; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=file], select, textarea {
  width: 100%; border: 1px solid #c9d0db; border-radius: 7px; padding: .55rem .7rem; font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid var(--blue-soft); }
.field { margin-bottom: 1rem; }
.field-error { color: var(--critical); font-size: .85rem; margin-top: .25rem; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; }
.check input { margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 1rem; }

.alert { padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid; }
.alert-success { background: #eaf7ef; border-color: #b8e2c7; color: #1d6b3d; }
.alert-error { background: #fdecec; border-color: #f3c0c0; color: #9c2b2b; }
.alert-info { background: var(--blue-soft); border-color: #c4d6fb; color: #1e4fb8; }
.alert-warning { background: #fff8e1; border-color: #f2d98a; color: #6b5300; }
.alert-warning a { color: #6b5300; font-weight: 600; text-decoration: underline; }

.badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 99px; padding: .1rem .55rem; font-size: .78rem; font-weight: 600; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.src-mark { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #eef1f5; color: var(--muted); vertical-align: middle; }
.src-mark .icon { width: 12px; height: 12px; }
.lvl { color: #fff; }
.lvl-low { background: var(--low); }
.lvl-moderate { background: var(--moderate); }
.lvl-high { background: var(--high); }
.lvl-critical { background: var(--critical); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.score { display: inline-grid; place-items: center; min-width: 2.1rem; height: 2.1rem; border-radius: 8px; color: #fff; font-weight: 700; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:hover td { background: #fafbfd; }
td.ref, th.ref { white-space: nowrap; width: 1%; }
td.ref { font-weight: 600; color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; }
@media (max-width: 700px) {
  table.responsive thead { display: none; }
  table.responsive tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .75rem; padding: .4rem .2rem; background: #fff; }
  table.responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .6rem; }
  table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: .8rem; }
}

.stat { padding: 1rem 1.1rem; }
.stat .value { font-size: 1.8rem; font-weight: 600; letter-spacing: -.02em; }
.stat .label { color: var(--muted); font-size: .85rem; }
.bar { height: 8px; border-radius: 99px; background: #eef1f5; overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.progress { height: 8px; border-radius: 99px; background: #eef1f5; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--blue); }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters > * { width: auto; min-width: 140px; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { color: #a3adbf; margin-bottom: .5rem; }
.list-clean { list-style: none; margin: 0; padding: 0; }
.list-clean li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.list-clean li:last-child { border-bottom: 0; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; white-space: nowrap; }
.tabs a.active { color: var(--blue); border-color: var(--blue); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
details.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
details.panel > summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 600; display: flex; align-items: center; gap: .5rem; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary .icon { color: var(--blue); transition: transform .15s; }
details.panel[open] > summary .icon { transform: rotate(45deg); }
details.panel > div { padding: 0 1.1rem 1.1rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: inline-grid; place-items: center; font-size: .75rem; font-weight: 700; flex-shrink: 0; }
.comment { display: flex; gap: .7rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.comment-body { white-space: pre-line; }

/* ---------- Matrice ---------- */
.matrix-wrap { display: grid; grid-template-columns: auto 1fr; gap: .5rem; }
.matrix { display: grid; grid-template-columns: 110px repeat(5, minmax(0, 1fr)); gap: 4px; }
.matrix .axis { font-size: .78rem; color: var(--muted); display: flex; align-items: center; justify-content: center; text-align: center; padding: .25rem; }
.matrix .axis strong { display: block; color: var(--ink); }
.cell { min-height: 92px; border-radius: 8px; padding: 6px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; position: relative; transition: outline .1s; }
.cell::after { content: attr(data-score); position: absolute; inset-inline-end: 6px; bottom: 4px; font-size: .7rem; font-weight: 700; opacity: .45; }
.cell.drop { outline: 3px dashed var(--navy); outline-offset: -3px; }
.cell-low { background: #d7f0e0; }
.cell-moderate { background: #fbefc4; }
.cell-high { background: #fddcc2; }
.cell-critical { background: #f8cccc; }
.chip { background: #fff; border: 1px solid rgba(0,0,0,.12); border-radius: 5px; padding: 1px 6px; font-size: .75rem; font-weight: 600; cursor: grab; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chip:hover { text-decoration: none; border-color: var(--navy); }
.chip[draggable=false] { cursor: pointer; }
.y-label { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 700; color: var(--muted); text-align: center; font-size: .85rem; }
.matrix-mobile { display: none; }
@media (max-width: 700px) { .matrix-desktop { display: none; } .matrix-mobile { display: block; } }

/* ---------- Pages publiques ---------- */
.public-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 2rem; background: var(--navy); }
.public-nav .brand { margin: 0; }
.public-nav nav { display: flex; gap: 1.2rem; align-items: center; }
.public-nav nav a { color: #d3dbeb; font-size: .94rem; }
.public-nav nav a:hover { color: #fff; }
.public-nav nav .btn { color: var(--ink); }
.public-nav nav .btn-primary { color: #fff; }
.hero { background: var(--navy); color: #fff; padding: 4.5rem 2rem 5rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(-45deg, var(--signal) 0 14px, var(--navy) 14px 28px); opacity: .9; }
.hero-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 3.5rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); line-height: 1.08; letter-spacing: -.028em; margin-bottom: 1.1rem; max-width: 15ch; }
.hero p { color: #c3cde3; font-size: 1.1rem; max-width: 34rem; }
.hero .hero-actions { margin-top: 1.75rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.hero .hero-note { color: #8e9cbc; font-size: .9rem; margin-top: 1rem; }
.btn-ghost { background: transparent; border-color: #4a5a82; color: #fff; }
.btn-ghost:hover { background: var(--navy-2); border-color: #6a7aa2; color: #fff; }
.section { max-width: 1120px; margin: 0 auto; padding: 4rem 2rem; }
.section > h2 { font-size: 1.6rem; letter-spacing: -.02em; margin-bottom: .4rem; }
.section-lead { color: var(--muted); font-size: 1.05rem; max-width: 42rem; margin-bottom: 2rem; }
.feature h3 { margin-top: .5rem; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem; }
.auth-box { max-width: 460px; margin: 3rem auto; }
@media (max-width: 860px) { .hero-inner { grid-template-columns: 1fr; gap: 2.5rem; } .hero { padding: 3rem 1.25rem 3.5rem; } .public-nav { padding: 1rem; } .section { padding: 3rem 1.25rem; } }

/* Tableau d'exemple de la page d'accueil */
.board { background: #fff; color: var(--ink); border-radius: 12px; padding: 1.1rem 1.2rem 1rem; box-shadow: 0 18px 40px -18px rgba(0,0,0,.55); }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.board-head strong { font-size: .95rem; }
.board-head span { color: var(--muted); font-size: .82rem; }
.board-grid { display: grid; grid-template-columns: 1.4rem repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(40px, 1fr)) 1.3rem; gap: 3px; }
.board-grid .ax { font-size: .72rem; color: var(--muted); display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.board-grid .c { border-radius: 4px; position: relative; display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; padding: 2px; }
.board-grid .c b { font-size: .68rem; font-weight: 600; background: #fff; border-radius: 4px; padding: 0 4px; line-height: 1.5; box-shadow: 0 0 0 1px rgba(0,0,0,.14); font-variant-numeric: tabular-nums; }
.board-grid .c b.res { background: transparent; box-shadow: 0 0 0 1px rgba(0,0,0,.45) inset; border-radius: 4px; }
.board-axes { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); margin: .3rem 0 0 1.6rem; }
.board-list { list-style: none; margin: .9rem 0 0; padding: .8rem 0 0; border-top: 1px solid var(--line); display: grid; gap: .35rem; font-size: .85rem; }
.board-list li { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: .5rem; align-items: center; }
.board-list li > span:nth-child(2) small { display: block; color: var(--muted); font-size: .74rem; line-height: 1.35; }
.board .board-total { display: flex; align-items: center; gap: .6rem; margin: .7rem 0 0; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.board .board-total strong { color: var(--ink); display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; margin-inline-start: auto; }
.board .board-total em { font-style: normal; font-weight: 600; color: #fff; background: var(--low); border-radius: 4px; padding: 0 .4rem; font-size: .76rem; }
.board-list .ref { color: var(--muted); font-weight: 600; font-size: .8rem; }
.board-list .move { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.board-list .move i { display: inline-block; width: 18px; text-align: center; border-radius: 4px; color: #fff; font-style: normal; font-weight: 600; font-size: .72rem; line-height: 1.5; }
.board-list .move .icon { width: 12px; height: 12px; }

.steps-line { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; counter-reset: st; }
.steps-line li { position: relative; padding-top: 3.1rem; counter-increment: st; }
.steps-line li::before { content: counter(st); position: absolute; top: 0; inset-inline-start: 0; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 600; }
.steps-line li:not(:last-child)::after { content: ""; position: absolute; top: 1.1rem; inset-inline-start: 2.9rem; inset-inline-end: -1.3rem; height: 2px; background: repeating-linear-gradient(90deg, #c7cfdc 0 6px, transparent 6px 11px); }
.steps-line h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.steps-line p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .steps-line { grid-template-columns: 1fr; gap: 1.5rem; } .steps-line li { padding: 0 0 0 3.2rem; } .steps-line li::after { display: none; } [dir=rtl] .steps-line li { padding: 0 3.2rem 0 0; } }

.feature-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem 2.5rem; margin: 0; }
.feature-list > div { display: grid; grid-template-columns: 2.4rem 1fr; gap: .15rem .8rem; align-content: start; }
.feature-list .fi { grid-row: span 2; width: 2.4rem; height: 2.4rem; border-radius: 8px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; }
.feature-list dt { font-weight: 600; margin-top: .1rem; }
.feature-list dd { margin: 0; color: var(--muted); font-size: .94rem; }
@media (max-width: 900px) { .feature-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .feature-list { grid-template-columns: 1fr; } }
.feature-pro { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); }
.feature-pro .icon { color: var(--signal); }
.band { background: #fff; border-block: 1px solid var(--line); }
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; max-width: 1120px; margin: 0 auto; padding: 2rem; }
.trust div { display: flex; gap: .75rem; align-items: flex-start; }
.trust .icon { color: var(--navy); margin-top: .15rem; }
.trust strong { display: block; }
.trust span { color: var(--muted); font-size: .92rem; }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr; padding: 1.5rem 1.25rem; } }

/* ---------- Impression ---------- */
@media print { .sidebar, .topbar, .page-head .actions, .no-print { display: none !important; } .content { padding: 0; } .card { box-shadow: none; } }

/* ---------- Assistant de projet ---------- */
.steps { list-style: none; display: flex; gap: .4rem; padding: 0; margin: 0 0 1.5rem; flex-wrap: wrap; counter-reset: s; }
.steps li { flex: 1; min-width: 140px; }
.steps button { width: 100%; background: #f1f3f7; border: 0; border-radius: 8px; padding: .55rem .7rem; font: inherit; font-size: .85rem; color: var(--muted); cursor: pointer; text-align: start; display: flex; gap: .5rem; align-items: center; }
.steps button span { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #dde2ea; display: inline-grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.steps li.active button { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.steps li.active button span { background: var(--blue); color: #fff; }
.steps li.done button span { background: var(--low); color: #fff; }
.wizard section h2 { margin-bottom: .75rem; }
.wizard-nav { display: flex; gap: .6rem; align-items: center; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; flex-wrap: wrap; }
.tag-group { border: 0; padding: 0; margin: 0 0 1.25rem; }
.tag-group legend { font-weight: 700; margin-bottom: .5rem; }
.tag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem; }
.tag-check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; cursor: pointer; background: #fff; margin: 0; }
.tag-check:hover { border-color: #b9c3d3; }
.tag-check input { margin-top: .2rem; accent-color: var(--blue); }
.tag-check:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.choice-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem; }
.choice-card { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; border: 1px solid var(--line); border-radius: 8px; padding: .7rem; cursor: pointer; margin: 0; }
.choice-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
fieldset.field { border: 0; padding: 0; }
fieldset.field legend { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }

/* ---------- Nœud papillon ---------- */
.bowtie { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: stretch; }
.bowtie-side { display: flex; flex-direction: column; gap: .5rem; }
.bowtie-box { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; background: #fff; font-size: .9rem; }
.bowtie-box h4 { margin: 0 0 .25rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.bowtie-barrier { border-inline-start: 4px solid var(--blue); }
.bowtie-barrier.protection { border-left-color: var(--moderate); }
.bowtie-barrier.done { opacity: .65; }
.bowtie-event { align-self: center; background: var(--navy); color: #fff; border-radius: 50%; width: 150px; height: 150px; display: grid; place-items: center; text-align: center; padding: 1rem; font-weight: 600; font-size: .85rem; }
.bowtie-empty { color: var(--muted); font-size: .85rem; font-style: italic; }
@media (max-width: 800px) { .bowtie { grid-template-columns: 1fr; } .bowtie-event { width: auto; height: auto; border-radius: 10px; } }

/* ---------- Phase 2 : Kanban, calendrier, évolution, incidents ---------- */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: .9rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-col { background: #e9edf3; border-radius: 10px; padding: .6rem; min-height: 240px; transition: background .15s; }
.kanban-col.over { background: #e3ebf7; outline: 2px dashed var(--blue); }
.kanban-col h3 { display: flex; justify-content: space-between; font-size: .9rem; margin: .2rem .2rem .6rem; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .55rem .65rem; margin-bottom: .5rem; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.kcard[draggable=true] { cursor: grab; }
.kcard.dragging { opacity: .45; }
.kcard .title { font-weight: 600; font-size: .9rem; display: block; margin-bottom: .25rem; }
.kcard small { color: var(--muted); }
.kcard .late { color: var(--critical); font-weight: 700; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 96px; padding: .3rem; font-size: .78rem; }
.cal .dow { min-height: auto; background: #f4f6f9; font-weight: 700; text-align: center; }
.cal .out { background: #fafbfc; color: #b6bcc6; }
.cal .today { background: #fff8e6; }
.cal .num { font-weight: 700; display: block; margin-bottom: .2rem; }
.cal .ev { display: block; border-radius: 4px; padding: 1px 4px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.cal .ev-action { background: #e3ebf7; }
.cal .ev-review { background: #fdecc8; }
.cal .ev:hover { text-decoration: none; filter: brightness(.95); }
.trend-chart { width: 100%; height: auto; }
.trend-chart text { font-size: 11px; fill: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; }
.kpi strong { display: block; font-size: 1.5rem; }
.kpi small { color: var(--muted); }
.sev-1, .sev-2 { background: #e6f4ea; color: #1e7b34; }
.sev-3 { background: #fdecc8; color: #8a5a00; }
.sev-4, .sev-5 { background: #fbe0e0; color: #a3161b; }
@media (max-width: 760px) {
  .cal { grid-template-columns: 1fr; }
  .cal .dow, .cal .out, .cal .empty { display: none; }
  .cal > div { min-height: auto; }
}

/* ---------- Pages publiques (référencement) ---------- */
.footer-cols { max-width: 1100px; margin: 0 auto 1.2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; text-align: start; }
.footer-cols strong { display: block; color: var(--ink); margin-bottom: .4rem; }
.footer-cols a { display: block; color: var(--muted); padding: .12rem 0; }
.prose { max-width: 780px; }
.prose h2 { margin-top: 2rem; }
.prose p, .prose li { line-height: 1.65; }
.prose table { margin: 1rem 0; }
.crumbs-public { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.crumbs-public a { color: var(--muted); }
.cta-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.5rem 1.6rem; margin: 2rem 0; display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; border-top: 4px solid var(--signal); }
.cta-box p, .faq .cta-box p { margin: 0; color: #d3dbeb; }
.cta-box strong { color: #fff; font-size: 1.15rem; display: block; }
.sector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.sector-grid a { display: flex; flex-wrap: wrap; gap: .15rem .6rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; color: var(--ink); font-weight: 600; transition: border-color .12s; }
.sector-grid a:hover { border-color: var(--blue); text-decoration: none; color: var(--blue); }
.sector-grid small { display: block; flex-basis: 100%; color: var(--muted); font-weight: 400; font-size: .82rem; }
.sector-grid { margin-bottom: 2rem; }
.sector-grid + h2, .section > h2 + .sector-grid { margin-top: .75rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex-shrink: 0; width: 10px; height: 10px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); transition: transform .15s; }
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq summary:hover { color: var(--blue); }
.faq p { margin: 0 0 1rem; color: var(--muted); max-width: 44rem; }
.barrier-list li { margin-bottom: .5rem; }
.big-number { font-size: 2rem; font-weight: 800; color: var(--navy); display: block; }
@media (max-width: 700px) { .hide-sm { display: none; } .public-nav { padding: 1rem; } .public-nav nav { gap: .6rem; } }

/* ---------- Création de projet ---------- */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.type-card { display: flex; gap: .6rem; align-items: center; text-align: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .65rem .75rem; cursor: pointer; font: inherit; color: var(--ink); }
.type-card:hover { border-color: var(--blue); }
.type-card.selected { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px var(--blue) inset; }
.type-card strong { display: block; font-size: .9rem; line-height: 1.25; }
.type-card small { color: var(--muted); font-size: .75rem; }
.type-icon { font-size: 1.6rem; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip-choice input { position: absolute; opacity: 0; pointer-events: none; }
.chip-choice span { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: .4rem .85rem; cursor: pointer; background: #fff; font-size: .9rem; }
.chip-choice input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-choice input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 1rem; }
fieldset.field legend { font-weight: 600; margin-bottom: .4rem; }
@media print {
  .public-nav, .footer, .cta-box, .btn, .crumbs-public { display: none !important; }
  .section { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none; border: 0; }
  table { font-size: 9pt; }
}
.legal-layout { display: grid; grid-template-columns: 230px 1fr; gap: 2rem; align-items: start; }
.legal-nav { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .15rem; font-size: .9rem; }
.legal-nav a { padding: .35rem .6rem; border-radius: 6px; color: var(--muted); }
.legal-nav a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.legal article h2 { font-size: 1.15rem; }
@media (max-width: 800px) { .legal-layout { grid-template-columns: 1fr; } .legal-nav { position: static; flex-direction: row; flex-wrap: wrap; } }

/* ---------- Langues de droite à gauche (arabe) ---------- */
[dir=rtl] body { font-family: "Plex Arabic", Plex, "Segoe UI", Tahoma, Arial, sans-serif; }
[dir=rtl] h1, [dir=rtl] h2, [dir=rtl] h3 { letter-spacing: 0; }
@media (max-width: 900px) {
  [dir=rtl] .sidebar { left: auto; right: -260px; transition: right .2s; }
  [dir=rtl] .sidebar.open { right: 0; }
}
[dir=rtl] .matrix-wrap, [dir=rtl] .matrix, [dir=rtl] .trend-chart { direction: ltr; }
[dir=rtl] .crumbs-public, [dir=rtl] .crumbs { direction: rtl; }

/* ---------- Articles ---------- */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; }
.article-card { display: flex; flex-direction: column; gap: .35rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; color: var(--ink); }
.article-card:hover { border-color: var(--blue); text-decoration: none; }
.article-card strong { font-size: 1.02rem; line-height: 1.3; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; align-items: start; }
.article-aside { position: sticky; top: 1rem; }
.article-aside li { margin: .35rem 0; font-size: .92rem; }
.article-body h2 { margin-top: 2rem; }
.article-body h3 { margin-top: 1.4rem; }
.article-body table { width: 100%; }
.article-body blockquote { border-inline-start: 4px solid var(--blue); margin: 1rem 0; padding: .4rem 1rem; background: var(--blue-soft); }
.toc { background: #f4f6f9; border-radius: var(--radius); padding: .8rem 1.1rem; margin: 1rem 0 1.5rem; }
.toc ol { margin: .4rem 0 0; padding-inline-start: 0; list-style: none; }
.toc li { margin: .2rem 0; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } .article-aside { position: static; } }

/* ---------- Outils gratuits ---------- */
.calc-result { display: flex; justify-content: space-between; align-items: center; color: #fff; border-radius: 10px; padding: .8rem 1rem; margin: 1rem 0 .6rem; font-size: 1.15rem; }
.calc-matrix { border-collapse: separate; border-spacing: 3px; margin: .5rem 0; width: auto; }
.calc-matrix td.lvl-low { background: var(--low); } .calc-matrix td.lvl-moderate { background: var(--moderate); } .calc-matrix td.lvl-high { background: var(--high); } .calc-matrix td.lvl-critical { background: var(--critical); }
.calc-matrix tr > th:first-child { text-align: end; white-space: nowrap; padding-inline-end: .6rem; }
.calc-matrix th { font-size: .8rem; font-weight: 600; padding: .3rem .5rem; text-align: center; }
.calc-matrix td { width: 3.4rem; height: 2.6rem; text-align: center; color: #fff; font-weight: 600; border-radius: 6px; border: 0; vertical-align: middle; }
.calc-matrix th { border: 0; }
.calc-matrix td.on { outline: 3px solid var(--ink); outline-offset: 1px; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: .45rem .55rem; text-align: start; vertical-align: top; }
.sheet .sign td { height: 2.2rem; }
.lmra-card { max-width: 560px; border: 2px solid var(--ink); border-radius: 12px; padding: 1.2rem 1.4rem; background: #fff; }
.lmra-card ol li { margin-bottom: .45rem; }
.lmra-card .stop { border: 2px solid var(--critical); border-radius: 8px; padding: .6rem .8rem; margin: .8rem 0; }
.glossary dt { font-weight: 700; margin-top: 1rem; scroll-margin-top: 1rem; }
.glossary dd { margin: .25rem 0 0; }
.glossary-letters { display: flex; flex-wrap: wrap; gap: .3rem; margin: 1rem 0; }
.glossary-letters a { padding: .2rem .55rem; border: 1px solid var(--line); border-radius: 6px; }
@media print { .sheet, .lmra-card { border: 0; padding: 0; } .sheet th, .sheet td { border-color: #999; } }
[x-cloak] { display: none !important; }

/* ---------- Finitions ---------- */
[dir=rtl] .flip-rtl { transform: scaleX(-1); }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; cursor: pointer; color: #d3dbeb; display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 600; padding: .3rem .5rem; border-radius: 6px; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { background: var(--navy-2); color: #fff; }
.lang-menu > div { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 28px -10px rgba(20,32,58,.35); padding: .3rem; min-width: 10rem; z-index: 60; display: grid; }
.public-nav .lang-menu > div a { color: var(--ink); padding: .4rem .65rem; border-radius: 5px; font-size: .92rem; }
.public-nav .lang-menu > div a:hover { background: var(--bg); text-decoration: none; }
.public-nav .lang-menu > div a.on { font-weight: 600; color: var(--blue); }
.footer { background: #fff; border-top: 1px solid var(--line); padding: 3rem 2rem 2rem; }
.footer-cols { font-size: .9rem; }
.footer > p { margin: 1.5rem auto 0; max-width: 1120px; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.footer-cols a:hover { color: var(--blue); }
.waiting-mark { color: var(--signal); background: var(--navy); width: 64px; height: 64px; border-radius: 16px; display: inline-grid; place-items: center; margin-bottom: .75rem; }
.stat { position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px; background: var(--lvl, transparent); }
a.stat:hover { text-decoration: none; border-color: #c3cad6; }
strong, b { font-weight: 600; }
.btn-icon { padding-inline: .65rem; }
.stat .dot { display: none; }
.stat .label:first-child { font-weight: 600; color: var(--ink); }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { flex: 0 1 auto; width: auto; }
.page-head .actions form { margin: 0; }
.article-card .fi { width: 2.4rem; height: 2.4rem; border-radius: 8px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; margin-bottom: .3rem; }
.notif-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef1f5; color: var(--muted); margin-inline-end: .4rem; vertical-align: middle; }
.notif-mark.is-critical { background: #fbe0e0; color: var(--critical); }
.ok-mark { color: var(--low); }
.cal .ev .icon { vertical-align: -1px; }
.btn-link .icon { vertical-align: middle; }
.error-page { min-height: 100vh; display: flex; flex-direction: column; }
.error-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 3rem 1.25rem 5rem; max-width: 34rem; margin: 0 auto; }
.error-code { font-size: 4.5rem; font-weight: 600; letter-spacing: -.04em; line-height: 1; margin-bottom: 1rem; color: var(--navy);
  background: repeating-linear-gradient(-45deg, var(--signal) 0 10px, transparent 10px 20px) left bottom / 100% 8px no-repeat; padding-bottom: .9rem; }
/* ---------- Documents de prévention ---------- */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.doc-card { display: flex; flex-direction: column; margin: 0; }
.doc-card-head { display: grid; grid-template-columns: 2.6rem 1fr; gap: .85rem; align-items: start; }
.doc-card-head h2 { font-size: 1.05rem; margin-bottom: .3rem; }
.doc-card-head .badge { vertical-align: 2px; margin-inline-start: .2rem; }
.doc-icon { width: 2.6rem; height: 2.6rem; border-radius: 8px; background: var(--navy); color: var(--signal); display: grid; place-items: center; }
.doc-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.1rem 0 .4rem; }
.doc-actions form { margin: 0; }
.version-list { margin-top: .6rem; border-top: 1px solid var(--line); }
.version-list li { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .45rem 0; }
.version-list a { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; }
.small-note { font-size: .86rem; margin: .6rem 0 0; padding-top: .6rem; border-top: 1px solid var(--line); }
.unit-row { display: flex; gap: .75rem; align-items: flex-start; }
.unit-edit { position: relative; }
.unit-edit > summary { list-style: none; }
.unit-edit > summary::-webkit-details-marker { display: none; }
.unit-pop { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 20; width: min(300px, 80vw); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .9rem; box-shadow: 0 12px 28px -10px rgba(20,32,58,.35); }
.unit-pop form { margin: 0; }
.unit-pop label input { margin-top: .25rem; font-weight: 400; }
.unit-add { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
details.panel > summary::after { content: ""; margin-inline-start: auto; flex-shrink: 0; width: 8px; height: 8px; border-inline-end: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
details.panel[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
details.panel > summary:hover { color: var(--blue); }
.next-steps { border-inline-start: 4px solid var(--signal); }
.next-steps h2 { font-size: 1rem; margin-bottom: .4rem; }
.next-steps ol { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .35rem; }
.next-steps li a { font-weight: 600; }
.next-steps li small { display: block; }

.btn-link.btn-danger { color: var(--critical); }
.unit-risks { margin-top: .4rem; }
.unit-risks > summary { cursor: pointer; color: var(--blue); font-size: .88rem; font-weight: 600; }
.unit-risk-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; margin: .5rem 0 .6rem; display: grid; gap: .15rem; }
.unit-risk-list .check { font-size: .9rem; margin: 0; }
/* ---------- Signalement terrain ---------- */
.report-wrap { max-width: 560px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.report-wrap h1 { font-size: 1.5rem; }
.report-site { display: flex; align-items: center; gap: .4rem; color: var(--muted); font-size: .9rem; font-weight: 600; margin-bottom: .75rem; }
.report-emergency { font-size: .9rem; }
.report-form legend { font-weight: 600; margin-bottom: .5rem; }
.report-types { display: grid; gap: .5rem; }
.report-type input { position: absolute; opacity: 0; }
.report-type > span { display: grid; grid-template-columns: 1.8rem 1fr; gap: 0 .6rem; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; cursor: pointer; background: #fff; }
.report-type > span .icon { grid-row: span 2; color: var(--muted); }
.report-type small { color: var(--muted); font-weight: 400; }
.report-type input:checked + span { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.report-type input:checked + span .icon { color: var(--navy); }
.report-type input:focus-visible + span { outline: 3px solid #8fb0ff; outline-offset: 2px; }
.photo-previews { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.photo-previews img, .incident-photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.incident-photos { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .35rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.small-print { font-size: .82rem; margin: .75rem 0 0; text-align: center; }
.report-done { text-align: center; padding: 2rem 1.5rem; }
.report-done-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #e6f4ea; color: var(--low); margin-bottom: .75rem; }
.badge-new { background: var(--signal); color: var(--navy); }
.qr-card { display: grid; grid-template-columns: 120px 1fr; gap: 1rem; align-items: start; }
.qr-card [data-qr] svg { width: 120px; height: 120px; display: block; }
@media (max-width: 600px) { .qr-card { grid-template-columns: 1fr; } }
.poster-page { background: #e9edf3; }
.poster-tools { display: flex; gap: .5rem; justify-content: center; padding: 1rem; }
.poster { width: 190mm; min-height: 270mm; margin: 0 auto 2rem; background: #fff; padding: 0 16mm; text-align: center; display: flex; flex-direction: column; align-items: center; }
.poster-band { align-self: stretch; height: 10mm; margin: 0 -16mm; background: repeating-linear-gradient(-45deg, var(--signal) 0 18px, var(--navy) 18px 36px); }
.poster h1 { font-size: 30pt; line-height: 1.1; margin: 14mm 0 4mm; color: var(--navy); }
.poster-sub { font-size: 13pt; color: var(--muted); margin-bottom: 8mm; }
.poster-qr svg { width: 95mm; height: 95mm; }
.poster-steps { text-align: start; font-size: 14pt; margin: 8mm auto 4mm; max-width: 140mm; display: grid; gap: 2mm; }
.poster-url { font-size: 9pt; color: var(--muted); word-break: break-all; }
.poster-emergency { margin: auto 0 6mm; font-size: 11pt; font-weight: 600; color: var(--critical); }
@media print {
  @page { size: A4; margin: 10mm; }
  .poster-page { background: #fff; }
  .poster { width: auto; min-height: 270mm; margin: 0; box-shadow: none; }
  .poster-band { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
#field-reports ~ .grid td select, .table-wrap td select[name=status] { min-width: 9.5rem; width: auto; }

/* Chantier : check-lists d'ouverture et de fermeture */
.site-switch { display: flex; gap: .6rem; margin: 0 0 1rem; flex-wrap: wrap; }
.site-switch a { display: flex; align-items: baseline; gap: .6rem; padding: .65rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--ink); }
.site-switch a:hover { text-decoration: none; border-color: var(--navy-3); }
.site-switch a.on { border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--signal); }
.site-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; margin-bottom: 1rem; }
.site-top .card { margin: 0; }
.site-info { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.site-info .field { margin-bottom: .7rem; }
.site-percent { margin: 0 0 .5rem; font-size: .95rem; }
.site-percent strong { font-size: 1.6rem; color: var(--navy); margin-inline-end: .35rem; }
.site-counts { display: flex; gap: 1rem; flex-wrap: wrap; margin: .8rem 0 1rem; font-size: .9rem; }
.site-counts li { display: flex; align-items: center; gap: .35rem; }
.dot { width: .65rem; height: .65rem; border-radius: 3px; display: inline-block; }
.dot-done { background: var(--low); } .dot-na { background: #9aa3b5; } .dot-todo { background: var(--signal); }
.site-section .card-head { margin-bottom: .25rem; }
.site-items { list-style: none; margin: 0; padding: 0; counter-reset: site; }
.site-item { padding: .8rem 0 .8rem 2.2rem; border-top: 1px solid var(--line); position: relative; counter-increment: site; }
.site-item:first-child { border-top: 0; }
.site-item::before { content: counter(site); position: absolute; left: 0; top: .85rem; width: 1.55rem; height: 1.55rem; border-radius: 6px; background: #eef1f5; color: var(--muted); font-size: .78rem; font-weight: 600; display: grid; place-items: center; }
.site-item.is-done::before { background: var(--low); color: #fff; content: "✓"; }
.site-item.is-na::before { background: #9aa3b5; color: #fff; content: "–"; }
.site-item-main { display: flex; gap: 1rem; align-items: flex-start; justify-content: space-between; }
.site-label { margin: .15rem 0 0; line-height: 1.45; }
.site-item.is-na .site-label { color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.seg label { margin: 0; font-weight: 500; font-size: .84rem; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: .38rem .7rem; color: var(--muted); border-inline-start: 1px solid var(--line); white-space: nowrap; }
.seg label:first-child span { border-inline-start: 0; }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: -2px; }
.seg-todo input:checked + span { background: #fff6cc; color: #6b5300; }
.seg-done input:checked + span { background: var(--low); color: #fff; }
.seg-na input:checked + span { background: #6b7487; color: #fff; }
.seg input:disabled + span { cursor: default; }
.site-item-meta { display: flex; gap: .5rem; margin-top: .55rem; flex-wrap: wrap; align-items: center; }
.site-item-meta input { font-size: .88rem; padding: .38rem .55rem; width: 11rem; }
.site-item-meta input[type=date] { width: 9.5rem; }
.site-item-meta .site-note { flex: 1; min-width: 12rem; }
.site-bar { position: sticky; bottom: 0; display: flex; gap: .6rem; padding: .85rem 0; background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 5; }
@media (max-width: 860px) {
  .site-top { grid-template-columns: 1fr; }
  .site-info { grid-template-columns: 1fr; }
  .site-item-main { flex-direction: column; gap: .5rem; }
  .site-item-meta input, .site-item-meta input[type=date] { width: 100%; }
}
.sheet .box-cell { text-align: center; font-size: 1.15rem; line-height: 1; color: var(--muted); }

/* Grille de cotation */
.rating-guide { margin: .25rem 0 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .55rem .8rem; background: #fafbfc; }
.rating-guide summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--navy); }
.rating-tables { display: grid; gap: 1rem; margin-top: .75rem; }
.rating-tables table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.rating-tables caption { text-align: start; font-weight: 600; padding-bottom: .3rem; }
.rating-tables th, .rating-tables td { border-top: 1px solid var(--line); padding: .35rem .5rem; text-align: start; vertical-align: top; }
.rating-tables th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.rating-tables td:first-child { width: 1.5rem; color: var(--muted); }
.badge.ctl { font-size: .72rem; }
.ctl-1, .ctl-2 { background: #e3f4ea; color: #1d6b3d; }
.ctl-3 { background: #e7eefc; color: #1e4fb8; }
.ctl-4, .ctl-5 { background: #f1f3f6; color: #4a5468; }
.ctl-6 { background: #fdf0e3; color: #8a4a0c; }
.existing-list { list-style: none; padding: 0; margin: 0 0 .75rem; }
.existing-list li { display: flex; gap: .4rem; align-items: baseline; padding: .15rem 0; }
.existing-list .icon { color: var(--low); flex-shrink: 0; }

/* Analyse et suivi des incidents */
.incident-follow { margin-top: .5rem; border-top: 1px dashed var(--line); padding-top: .4rem; }
.incident-follow > summary { cursor: pointer; font-size: .84rem; font-weight: 600; color: var(--navy); display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.incident-follow[open] { background: #fafbfc; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.incident-analysis, .incident-action-form { margin-top: .6rem; }
.incident-analysis .field, .incident-action-form .field { margin-bottom: .5rem; }
.deadline-box { margin: .6rem 0; padding: .55rem .75rem; border-radius: var(--radius-sm); background: var(--blue-soft); font-size: .86rem; }
.deadline-box li { padding: .2rem 0; }
.deadline-box li.is-done { color: #1d6b3d; }
.deadline-box li.is-late { color: var(--critical); font-weight: 600; }
.deadline-box li small { margin-inline-start: .35rem; }

/* Indicateurs HSE du tableau de bord */
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 700px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .85rem; display: flex; flex-direction: column; gap: .2rem; }
.kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--navy); line-height: 1.1; }
.kpi-label { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.kpi-alert { border-color: #f3c0c0; background: #fdf3f3; }
.kpi-alert .kpi-value { color: var(--critical); }

/* Registre : sélection et actions groupées */
th.sel, td.sel { width: 2rem; padding-inline-end: 0; }
tr.selected td { background: var(--blue-soft); }
.bulk-bar { position: sticky; bottom: .75rem; z-index: 20; margin-top: .75rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
  background: var(--navy); color: #fff; padding: .65rem .85rem; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(20, 32, 58, .25); }
.bulk-bar select { width: auto; max-width: 14rem; font-size: .88rem; padding: .35rem .5rem; }
.bulk-bar strong { margin-inline-end: .25rem; }
.quick-action { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; padding: .6rem; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.quick-action .qa-title { flex: 1 1 18rem; min-width: 0; }
.quick-action select, .quick-action input[type=date] { width: auto; max-width: 13rem; }
.unit-matrix { width: 100%; border-collapse: collapse; font-size: .9rem; }
.unit-matrix td, .unit-matrix th { padding: .4rem .5rem; border-top: 1px solid var(--line); text-align: start; }
.unit-matrix select { width: 100%; font-size: .88rem; padding: .3rem .45rem; }
.contractors { width: 100%; border-collapse: collapse; }
.contractors th { text-align: start; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .3rem .35rem; }
.contractors td { padding: .25rem .35rem; }
.contractors input { width: 100%; font-size: .88rem; padding: .35rem .5rem; }

/* Offres */
.pricing { max-width: 1040px; }
.pricing h1 { font-size: 2rem; letter-spacing: -.02em; margin-bottom: .5rem; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0; align-items: stretch; }
.pricing-card { display: flex; flex-direction: column; gap: .45rem; margin: 0; }
.pricing-card .btn { margin-top: auto; align-self: flex-start; }
.pricing-main { border-color: var(--navy); box-shadow: inset 0 3px 0 var(--signal); }
.pricing-price { font-size: 1.9rem; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.pricing-price small { font-size: .82rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.pricing-list { list-style: none; padding: 0; margin: .25rem 0 1rem; }
.pricing-list li { display: flex; gap: .45rem; align-items: baseline; margin-bottom: .35rem; }
.pricing-list .icon { color: var(--low); }
.pricing-facts { padding-left: 1.1rem; }
.pricing-facts li { margin-bottom: .35rem; }
.org-logo-preview { max-width: 220px; max-height: 80px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .4rem; background: #fff; }
.pro-nudge { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin-top: 1.5rem; color: var(--muted); }
.pro-nudge p { margin: 0; flex: 1 1 18rem; }
.pro-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--signal); }
.sidebar-pro { display: flex; align-items: center; gap: .45rem; color: #c3cde3; font-size: .84rem; margin-bottom: .6rem; }
.sidebar-pro:hover { color: #fff; text-decoration: none; }
.pro-nudge .icon-btn { color: var(--muted); }
.pro-nudge .icon-btn:hover { background: var(--bg); color: var(--ink); }

/* Mode d'emploi des outils gratuits */
.tool-guide { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); max-width: 46rem; }
.tool-guide h2 { font-size: 1.25rem; margin: 1.6rem 0 .5rem; }
.tool-guide h2:first-child { margin-top: 0; }
.tool-guide .faq { margin-top: .5rem; }
.tool-guide-cta { margin-top: 2rem; }

/* Consignation (lockout-tagout) */
.lockout-banner { font-size: 1rem; border-width: 2px; }
.lockout-status { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #fde8e8; color: #9b2c2c; }
.lockout-status.is-draft { background: #fff6dc; color: #8a6400; }
.lockout-status.is-closed { background: #eaf7ef; color: #1d6b3d; }
.lockout-status.is-cancelled { background: var(--bg); color: var(--muted); }
.badge-critical { background: #fde8e8; color: #9b2c2c; }
.energy { display: inline-block; padding: .05rem .45rem; border-radius: 4px; font-size: .78rem; font-weight: 600; background: var(--bg); color: var(--ink); white-space: nowrap; }
.energy-electrical { background: #fff3c4; color: #6b5200; }
.energy-pneumatic { background: #e4f1fb; color: #1d4f7a; }
.energy-hydraulic { background: #e2eefc; color: #1e3f8a; }
.energy-mechanical { background: #eceff4; color: #33405a; }
.energy-thermal, .energy-steam { background: #fde9df; color: #8a3a12; }
.energy-chemical { background: #eaf6e7; color: #2f6b22; }
.lockout-add { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.lockout-register-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.lockout-register-form input { width: auto; }
.lockout-instructions { background: #fff9e3; border-inline-start: 4px solid var(--signal); padding: .6rem .8rem; border-radius: 6px; margin-bottom: 1rem; font-size: .92rem; }
.lockout-editor { list-style: none; padding: 0; margin: 0; counter-reset: lp; }
.lockout-point-edit { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem .6rem; margin-bottom: .8rem; background: #fbfcfd; }
.lockout-point-edit .lp-tag { max-width: 7rem; }
.lp-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.lockout-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.lockout-actions form { margin: 0; }
.lockout-steps { list-style: none; display: flex; gap: 0; padding: 0 1px 0 0; margin: 0 0 1.25rem; counter-reset: st; overflow-x: auto; scrollbar-width: none; }
.lockout-steps::-webkit-scrollbar { display: none; }
.lockout-steps li { flex: 1 1 0; min-width: 7rem; position: relative; padding: .55rem .6rem .55rem 2.1rem; font-size: .84rem; color: var(--muted); background: #fff; border: 1px solid var(--line); margin-inline-end: -1px; counter-increment: st; }
.lockout-steps li::before { content: counter(st); position: absolute; inset-inline-start: .6rem; top: 50%; transform: translateY(-50%); width: 1.15rem; height: 1.15rem; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.lockout-steps li.done { color: var(--ink); }
.lockout-steps li.done::before { content: "✓"; background: var(--low); color: #fff; }
.lockout-steps li.now { color: var(--ink); font-weight: 600; border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--signal); z-index: 1; }
.lockout-steps li.now::before { background: var(--navy); color: #fff; }
.lockout-run { list-style: none; padding: 0; margin: 0 0 .5rem; }
.lockout-run-item { border: 1px solid var(--line); border-inline-start: 4px solid #d9a815; border-radius: 8px; padding: .7rem .9rem; margin-bottom: .7rem; }
.lockout-run-item.is-isolated { border-inline-start-color: var(--high); }
.lockout-run-item.is-verified { border-inline-start-color: var(--low); background: #f6fbf8; }
.lr-head { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.lr-state { margin-inline-start: auto; font-size: .82rem; font-weight: 600; }
.lr-where { margin: .3rem 0 .5rem; color: var(--muted); font-size: .9rem; }
.lr-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin: .4rem 0 0; }
.lr-form input[type=text], .lr-form input:not([type]) { flex: 1 1 12rem; width: auto; }
.lr-form.lr-verify { flex-direction: column; align-items: stretch; }
.lr-form.lr-verify input { flex: none; width: 100%; }
.lr-form.lr-verify button { align-self: flex-start; }
.lockout-workers li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.lockout-workers form.inline { margin-inline-start: auto; }
.lockout-more { margin-top: .8rem; }
.lockout-more summary { cursor: pointer; color: var(--blue); font-size: .9rem; }
.lockout-checks { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .9rem; margin: 0 0 .9rem; }
.lockout-checks legend { font-weight: 600; padding: 0 .3rem; }
.lockout-checks .check { display: flex; margin: .35rem 0; }
.lockout-log { list-style: none; padding: 0; margin: 0 0 .8rem; font-size: .88rem; }
.lockout-log li { padding: .35rem 0; border-bottom: 1px dashed var(--line); }
.lockout-log .nowrap { margin-inline-end: .4rem; }
.lockout-facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: 0; font-size: .92rem; }
.lockout-facts dt { color: var(--muted); }
.lockout-facts dd { margin: 0; }
.lockout-public .lp-status { display: grid; justify-items: center; gap: .3rem; text-align: center; padding: 1.4rem 1rem; border-radius: 12px; margin: 1rem 0; }
.lockout-public .lp-status strong { font-size: 1.25rem; letter-spacing: .01em; }
.lockout-public .lp-status.is-locked { background: #c53030; color: #fff; }
.lockout-public .lp-status.is-free { background: #eaf7ef; color: #1d6b3d; }
.lockout-label { max-width: 90mm; margin: 1rem auto; border: 3px solid #c53030; border-radius: 10px; padding: 0 0 .8rem; text-align: center; background: #fff; }
.ll-band { background: #c53030; color: #fff; font-weight: 700; padding: .5rem; display: flex; gap: .4rem; justify-content: center; align-items: center; text-transform: none; }
.ll-code { font-size: 1.8rem; font-weight: 700; margin: .6rem 0 0; letter-spacing: .02em; }
.ll-name { margin: 0; font-weight: 600; }
.ll-loc, .ll-org { margin: .1rem 0; color: var(--muted); font-size: .85rem; }
.ll-qr { margin: .7rem auto; }
.ll-help { font-size: .85rem; margin: 0 1rem .3rem; }

.lockout-residual { background: #fff6dc; border-radius: 6px; padding: .4rem .6rem; margin: .3rem 0; font-size: .9rem; }
