/* Tableau de bord stratégique AKT – alliance CCI
   Charte AKT : Purple 01 #710097, 02 #A730DC, 03 #BB7EDE, 04 #ECDCF0, typographie Gotham. */
:root {
  --p1: #710097; --p2: #A730DC; --p3: #BB7EDE; --p4: #ECDCF0;
  --ink: #23102F; --ink2: #4D3D5A; --muted: #85788F;
  --line: #E8E0ED; --line2: #D9CCE2;
  --bg: #F7F4F9; --surface: #FFFFFF; --label: #F1EBF6;
  --danger: #B42318; --ok: #0F766E; --warn: #B45309;
  --r: 10px;
  --font: "Gotham", "Gotham HTF", "Montserrat", "Poppins", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(35, 16, 47, .06), 0 10px 30px -14px rgba(35, 16, 47, .22);
  --label-w: 150px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--p1); }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.logo { display: inline-block; line-height: 0; color: var(--p1); }
.logo svg { height: 100%; width: auto; display: block; }

/* ---------- Barre supérieure ---------- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 18px; height: 60px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo { height: 24px; }
.brand-title { border-left: 1px solid var(--line2); padding-left: 12px; font-weight: 700; font-size: 13px; line-height: 1.2; white-space: nowrap; }
.brand-title small { display: block; font-weight: 600; color: var(--muted); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
nav.tabs { display: flex; gap: 2px; }
nav.tabs button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; color: var(--ink2); font-weight: 600; font-size: 13px; white-space: nowrap; }
nav.tabs button:hover { background: var(--label); }
nav.tabs button[aria-current="page"] { background: var(--p1); color: #fff; }
.spacer { flex: 1; }
.undo-btn { padding: 6px 11px; }
.undo-n { font-size: 10px; font-weight: 700; color: var(--p1); background: var(--label); border-radius: 999px; padding: 0 6px; min-width: 18px; text-align: center; }
.undo-btn:disabled .undo-n { display: none; }
.live { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #16A34A; box-shadow: 0 0 0 3px rgba(22, 163, 74, .15); }
.live.off i { background: var(--warn); box-shadow: 0 0 0 3px rgba(180, 83, 9, .15); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.presence { display: flex; padding-left: 6px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 700; border: 2px solid #fff; margin-left: -6px; flex: none; background: var(--uc, var(--p1)); }
.avatar.sm { width: 22px; height: 22px; font-size: 9px; margin: 0; border-width: 0; }
.usermenu { position: relative; }
.usermenu > button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px 3px 3px; font-size: 12.5px; font-weight: 600; }
.usermenu .role { color: var(--muted); font-weight: 500; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; min-width: 220px; z-index: 50; }
.menu button { display: flex; width: 100%; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 10px; border-radius: 6px; text-align: left; font-size: 13px; }
.menu button:hover { background: var(--label); }

/* ---------- Boutons et contrôles ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line2); background: #fff; color: var(--ink); padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--p3); background: #FDFBFE; }
.btn.primary { background: var(--p1); border-color: var(--p1); color: #fff; }
.btn.primary:hover { background: #5E007E; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: #FEF3F2; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-fill:hover { background: #912018; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--label); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn.icon { padding: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink2); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--line2); position: relative; margin: 0; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked { background: var(--p1); }
.switch input:checked::after { transform: translateX(14px); }
:focus-visible { outline: 2px solid var(--p2); outline-offset: 2px; }

main { padding: 20px 20px 60px; }
.view-head { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.view-head h1 { font-size: 20px; font-weight: 800; margin: 0; color: var(--ink); letter-spacing: -.01em; }
.view-head .sub { color: var(--muted); font-size: 13px; }

/* ---------- Cadre ---------- */
.cadre-scroll { overflow-x: auto; padding-bottom: 8px; }
.board-head { display: flex; align-items: center; gap: 22px; margin: 4px 0 16px; min-width: 1180px; }
.board-head .logo { height: 64px; }
.board-head .rule { width: 1.5px; align-self: stretch; background: var(--p1); margin: 6px 0; }
.board-head .baseline { color: var(--p1); text-transform: uppercase; font-size: 19px; line-height: 1.22; letter-spacing: .04em; font-weight: 400; }
.board-head .baseline b { font-weight: 700; }
.board-head .meta { margin-left: auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.board-head .meta .status { white-space: nowrap; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--p2); }
.board-head .tools { display: flex; gap: 8px; align-items: center; }

.board { display: grid; grid-template-columns: var(--label-w) repeat(var(--n), minmax(170px, 1fr)); gap: 8px; min-width: 1180px; }
.rl { background: var(--label); border-radius: var(--r); padding: 14px 14px 14px 18px; font-weight: 800; color: var(--p1); text-transform: uppercase; font-size: 13px; line-height: 1.25; letter-spacing: .01em; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rl .chev { display: inline-block; width: 9px; height: 13px; margin: 0 4px 0 0; vertical-align: -1px; }
.cell { background: var(--surface); border-radius: var(--r); padding: 14px 16px; position: relative; min-width: 0; }
.tinted { background: color-mix(in srgb, var(--tint, #F4F0F8) 55%, #fff); }
.chev svg { display: block; width: 100%; height: 100%; }
.chev.right svg { transform: scaleX(-1); }

.besoins { display: flex; align-items: stretch; gap: 12px; background: var(--label); }
.besoins > .besoin { flex: 1 1 0; min-width: 0; padding: 4px 6px; }
.besoin h4 { margin: 0 0 3px; color: var(--p1); font-size: 14px; font-weight: 700; line-height: 1.25; }
.besoin p { margin: 0; color: var(--ink2); font-size: 12.5px; }
.flow { flex: none; align-self: center; width: 11px; height: 18px; color: var(--p3); }

.vision-cell { background: var(--label); display: grid; place-items: center; padding: 14px 20px; }
.vision { text-align: center; font-weight: 800; text-transform: uppercase; color: var(--p1); font-size: clamp(16px, 1.65vw, 25px); letter-spacing: .005em; line-height: 1.2; padding: 2px 8px; }

.moteur-cell { background: var(--tint); text-align: center; padding: 18px 12px 16px; }
.moteur h2 { margin: 0; font-size: clamp(30px, 3.1vw, 48px); line-height: 1; font-weight: 900; letter-spacing: -.005em; text-transform: uppercase; color: var(--p1); }
.moteur p { margin: 8px 0 0; text-transform: uppercase; letter-spacing: .2em; font-weight: 700; font-size: 12px; color: var(--ink2); }

.imp-cell { text-align: center; padding: 10px; display: grid; place-items: center; }
.imp { font-weight: 800; font-size: 21px; letter-spacing: .2em; color: var(--p1); line-height: 1; padding: 4px 8px 4px calc(8px + .2em); }
.imp.neg { color: var(--p3); }
.imp.zero { color: var(--muted); }
.imp-bar { display: flex; gap: 3px; margin-top: 6px; justify-content: center; }
.imp-bar i { width: 10px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--p1) 14%, transparent); }
.imp-bar i.on { background: var(--p1); }
.imp-bar i.on.neg { background: var(--p3); }

.levier-cell { display: flex; flex-direction: column; padding: 16px 18px; }
.levier { display: flex; flex-direction: column; flex: 1; }
.levier h3 { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: var(--p1); letter-spacing: -.01em; }
.levier .intro { margin: 0 0 6px; color: var(--ink2); }
.levier ul { margin: 0; padding: 0; list-style: none; }
.levier li { position: relative; padding-left: 13px; margin: 2px 0; color: var(--ink2); font-size: 13px; line-height: 1.35; }
.levier li::before { content: ""; position: absolute; left: 1px; top: .55em; width: 5px; height: 5px; border-radius: 50%; background: var(--p1); }
.promesse { margin-top: auto; padding-top: 12px; }
.promesse > div { border-top: 1.5px solid var(--p3); padding-top: 10px; font-weight: 700; color: var(--p1); font-size: 13.5px; line-height: 1.32; }

ol.objs { list-style: none; margin: 0; padding: 0; counter-reset: obj; }
ol.objs > li { counter-increment: obj; position: relative; padding: 3px 4px 3px 24px; margin: 1px -4px; color: var(--ink2); font-size: 13px; line-height: 1.35; }
ol.objs > li::before { content: counter(obj) "."; position: absolute; left: 4px; top: 3px; color: var(--ink2); }
.count { display: inline-block; margin-left: 4px; font-size: 10px; font-weight: 700; color: var(--p1); background: color-mix(in srgb, var(--p1) 10%, #fff); border-radius: 999px; padding: 0 6px; vertical-align: 1px; }

.actions-cell { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.agroup { display: flex; flex-direction: column; gap: 5px; min-height: 10px; border-radius: 8px; }
.agroup-h { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.act { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--pc, var(--line2)); border-radius: 7px; padding: 6px 8px; font-size: 12.5px; line-height: 1.3; position: relative; }
.act-t { font-weight: 600; color: var(--ink); }
.act-m { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; color: var(--c, var(--ink2)); background: color-mix(in srgb, var(--c, var(--ink2)) 11%, #fff); white-space: nowrap; }
.tag.cci { --c: #5B4A68; }
.cf { font-size: 11px; color: var(--muted); margin-top: 3px; }
.cf b { font-weight: 600; color: var(--ink2); }
.none { color: var(--muted); font-size: 12px; font-style: italic; }

/* Éléments cliquables, édition */
.ed { cursor: pointer; border-radius: 7px; position: relative; transition: outline-color .12s, box-shadow .12s; }
.ed { outline: 2px solid transparent; outline-offset: 4px; }
.ed:hover { outline-color: color-mix(in srgb, var(--p2) 35%, transparent); }
.ed.selected { outline-color: var(--p2); }
.ed.being-edited { outline-color: var(--uc); }
.act.ed, ol.objs > li.ed { outline-offset: 1px; }
body.drawer-open main { padding-right: 500px; }
.edit-tag { position: absolute; top: -9px; left: 8px; background: var(--uc); color: #fff; font-size: 9.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; z-index: 2; text-transform: none; }
.cbadge { position: absolute; top: -7px; right: -7px; display: inline-flex; align-items: center; gap: 2px; background: var(--p2); color: #fff; font-size: 9.5px; font-weight: 700; height: 17px; border-radius: 9px; padding: 0 5px; z-index: 2; letter-spacing: 0; text-transform: none; }
.add { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed var(--p3); background: color-mix(in srgb, #fff 70%, transparent); color: var(--p1); border-radius: 7px; padding: 4px 8px; font-size: 11.5px; font-weight: 600; }
.add:hover { background: #fff; border-style: solid; }
.add.block { width: 100%; justify-content: center; margin-top: 8px; }
.add.mini { padding: 3px; border-radius: 6px; }
.add.mini span { display: none; }
/* Glisser-déposer */
.ed[draggable="true"]:active { cursor: grabbing; }
.dragging { opacity: .35; }
.drop-before { box-shadow: 0 -3px 0 0 var(--p2) !important; }
.besoins .drop-before { box-shadow: -3px 0 0 0 var(--p2) !important; }
.drop-end { box-shadow: inset 0 -3px 0 0 var(--p2) !important; }
.cell.drop-l { box-shadow: inset 4px 0 0 0 var(--p2) !important; }
.cell.drop-r { box-shadow: inset -4px 0 0 0 var(--p2) !important; }
.cell.drop-into, .placeholder.drop-into { box-shadow: inset 0 0 0 2px var(--p2) !important; background: color-mix(in srgb, var(--p2) 8%, #fff); }
.ed.drop-into { outline-color: var(--p2) !important; background: color-mix(in srgb, var(--p2) 10%, transparent); }
body.dnd .ed:hover { outline-color: transparent; }
.agroup.empty-drop { display: none; }
body.dnd-action .agroup.empty-drop { display: flex; border: 1px dashed var(--p3); padding: 4px 6px; min-height: 30px; }
body.dnd-action .actions-cell .none { display: none; }
.dnd-hint { font-size: 11.5px; color: var(--muted); }
.toast-btn { margin-left: auto; border: 1px solid rgba(255, 255, 255, .5); background: transparent; color: #fff; border-radius: 6px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.toast-btn:hover { background: rgba(255, 255, 255, .15); }
.placeholder { border: 1.5px dashed var(--line2); background: transparent; display: grid; place-items: center; color: var(--muted); font-size: 12px; }

/* ---------- Panneau latéral ---------- */
.drawer { position: fixed; top: 60px; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -18px 0 40px -24px rgba(35, 16, 47, .35); z-index: 35; display: flex; flex-direction: column; animation: slidein .16s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: 0; } }
.dr-head { padding: 16px 18px 0; border-bottom: 1px solid var(--line); }
.dr-kicker { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--p2); }
.dr-kicker .spacer { flex: 1; }
.dr-title { font-size: 18px; font-weight: 800; margin: 6px 0 2px; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
.dr-path { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.dr-tabs { display: flex; gap: 2px; margin: 0 -4px; }
.dr-tabs button { border: 0; background: none; padding: 9px 10px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.dr-tabs button[aria-selected="true"] { color: var(--p1); border-bottom-color: var(--p1); }
.dr-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; }
.dr-foot { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 8px; align-items: center; background: #FDFBFE; }
.dr-meta { font-size: 11.5px; color: var(--muted); margin-top: 18px; line-height: 1.5; }
.banner { border-radius: 9px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.banner.warn { background: #FFF7ED; border: 1px solid #FED7AA; color: #7C2D12; }
.banner.info { background: var(--label); border: 1px solid var(--p4); color: var(--ink2); }
.banner .row { display: flex; gap: 6px; flex-wrap: wrap; }

.field { margin-bottom: 14px; }
.field > label, .field > .flabel { display: block; font-size: 11px; font-weight: 700; color: var(--ink2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .06em; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.inp, .field input:not([type="checkbox"]):not([type="color"]):not([type="file"]), .field textarea, .field select { width: 100%; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; background: #fff; font-size: 13.5px; }
.field textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.inp:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid color-mix(in srgb, var(--p2) 45%, transparent); border-color: var(--p2); outline-offset: 0; }
.field input:disabled, .field textarea:disabled, .field select:disabled { background: #FAF8FB; color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line2); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; background: #fff; display: inline-flex; align-items: center; gap: 6px; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--p1)); }
.chip[aria-pressed="true"] { background: var(--c, var(--p1)); border-color: var(--c, var(--p1)); color: #fff; }
.chip[aria-pressed="true"] .dot { background: #fff; }
.chip:disabled { cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--line2); background: #fff; min-width: 46px; padding: 7px 8px; font-weight: 800; font-size: 13px; color: var(--p1); letter-spacing: .08em; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--p1); color: #fff; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 7px; border: 1px solid rgba(0,0,0,.08); background: var(--c); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--p1); }
.swatches input[type="color"] { width: 36px; height: 30px; border: 1px solid var(--line2); border-radius: 7px; padding: 2px; background: #fff; }
.order { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

.comments { display: flex; flex-direction: column; gap: 12px; }
.comment { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.comment .who { font-size: 12.5px; font-weight: 700; }
.comment .when { font-size: 11.5px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.comment .txt { white-space: pre-wrap; font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.comment .ops { display: flex; gap: 4px; margin-top: 4px; }
.comment.resolved { opacity: .6; }
.comment.resolved .txt { text-decoration: line-through; text-decoration-color: var(--p3); }
.composer { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.composer textarea { width: 100%; min-height: 70px; border: 1px solid var(--line2); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.composer .row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
details.resolved-list summary { cursor: pointer; font-size: 12.5px; color: var(--muted); font-weight: 600; margin: 4px 0 10px; }

.timeline { display: flex; flex-direction: column; }
.rev { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.rev:last-child { border-bottom: 0; }
.rev .sum { font-size: 13px; overflow-wrap: anywhere; }
.rev .by { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rev .ops { display: flex; gap: 4px; }
.op { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; margin-right: 6px; background: var(--label); color: var(--p1); vertical-align: 1px; }
.op.delete { background: #FEF3F2; color: var(--danger); }
.op.create { background: #ECFDF3; color: var(--ok); }
.op.restore, .op.apply { background: #FFF7ED; color: var(--warn); }
.diff { margin-top: 8px; font-size: 12.5px; border-left: 2px solid var(--p4); padding-left: 10px; display: flex; flex-direction: column; gap: 6px; }
.diff .k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.diff del { background: #FEF3F2; color: #912018; text-decoration: none; padding: 0 3px; border-radius: 3px; white-space: pre-wrap; }
.diff ins { background: #ECFDF3; color: #05603A; text-decoration: none; padding: 0 3px; border-radius: 3px; white-space: pre-wrap; }

/* ---------- Vues tableau ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .inp { width: auto; min-width: 150px; padding: 7px 10px; }
.search { position: relative; }
.search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .inp { padding-left: 30px; min-width: 240px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.panel-h { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.panel-h h2 { font-size: 14px; margin: 0; font-weight: 800; }
.panel-b { padding: 14px 16px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FCFAFD; position: sticky; top: 60px; z-index: 1; }
table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover td { background: #FCF9FD; }
table.grid tbody tr.selected td { background: var(--label); }
.where { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--p1); }
.where i { width: 10px; height: 10px; border-radius: 3px; background: var(--tint); border: 1px solid rgba(0,0,0,.06); }
.where-l { font-size: 12px; color: var(--ink2); }
.desc { color: var(--muted); font-size: 12px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 0 0 6px; font-size: 16px; }
.summary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 120px; text-align: left; }
button.stat:hover { border-color: var(--p3); }
.stat b { display: block; font-size: 22px; font-weight: 800; line-height: 1.1; color: var(--c, var(--ink)); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.stat[aria-pressed="true"] { border-color: var(--c, var(--p1)); box-shadow: 0 0 0 1px var(--c, var(--p1)); }

/* Vue CCI */
.cci-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-bottom: 16px; }
.cci-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.cci-card:hover { border-color: var(--p3); }
.cci-card .logo { height: 40px; align-self: flex-start; }
.cci-card .lbl { font-weight: 700; font-size: 13px; }
.cci-card .n { font-size: 26px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.cci-card .n small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.stack { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); gap: 1px; }
.stack i { background: var(--c); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
table.matrix { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 12.5px; }
table.matrix th { font-weight: 700; font-size: 11px; text-align: center; padding: 8px 6px; border-radius: 6px; }
table.matrix th.m { background: var(--tint); color: var(--p1); text-transform: uppercase; letter-spacing: .08em; }
table.matrix th.l { background: color-mix(in srgb, var(--tint) 50%, #fff); color: var(--ink2); }
table.matrix th.rowh { width: 1%; text-align: left; background: var(--label); color: var(--ink); font-size: 12.5px; white-space: nowrap; }
table.matrix td { text-align: center; padding: 0; border-radius: 6px; background: color-mix(in srgb, var(--p1) calc(var(--v, 0) * 70%), #F6F2F8); color: var(--ink); height: 40px; font-weight: 700; font-variant-numeric: tabular-nums; }
table.matrix td.hot { color: #fff; }
table.matrix td button { width: 100%; height: 100%; border: 0; background: none; color: inherit; font-weight: inherit; }
table.matrix td.zero { color: var(--muted); font-weight: 400; }
table.matrix td.tot { background: var(--label); }

/* Journal */
.journal { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.snap { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.snap:last-child { border-bottom: 0; }
.snap .t { font-weight: 700; font-size: 13px; }
.snap .d { font-size: 11.5px; color: var(--muted); }
.snap .ops { margin-left: auto; display: flex; gap: 4px; flex: none; }
.pill { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line2); padding: 0 5px; border-radius: 4px; margin-left: 6px; }

/* Paramètres */
.params { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.params nav { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 2px; }
.params nav button { text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink2); }
.params nav button[aria-current="true"] { background: var(--label); color: var(--p1); }
.params section { margin-bottom: 18px; }
.params .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.rows-table { width: 100%; border-collapse: collapse; }
.rows-table td, .rows-table th { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.rows-table th { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.rows-table .inp { padding: 6px 8px; font-size: 13px; }
.rows-table input[type="color"] { width: 40px; height: 32px; border: 1px solid var(--line2); border-radius: 7px; padding: 2px; background: #fff; }
.savebar { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); margin-top: 8px; }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }

/* Toasts */
#toasts { position: fixed; left: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 40px)); }
.toast { background: var(--ink); color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: toastin .18s ease-out; }
.toast.err { background: #912018; }
.toast.warn { background: #92400E; }
.toast.ok { background: #05603A; }
.toast .avatar { border: 0; margin: 0; }
@keyframes toastin { from { transform: translateY(8px); opacity: 0; } }

/* Fenêtres modales */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(35, 16, 47, .45); color: var(--ink); }
dialog.modal::backdrop { background: rgba(35, 16, 47, .35); }
.modal-b { padding: 20px 22px 6px; }
.modal-b h2 { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.modal-b p { margin: 0 0 12px; color: var(--ink2); }
.modal-f { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 15px; background: var(--label); padding: 10px 12px; border-radius: 8px; letter-spacing: .04em; user-select: all; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; background: #fff; }
.login .bg-chev { position: absolute; color: var(--p4); width: 46vh; height: 72vh; right: -6vh; bottom: -8vh; opacity: .9; }
.login .bg-chev.two { color: color-mix(in srgb, var(--p4) 45%, #fff); width: 30vh; height: 47vh; right: 30vh; bottom: 26vh; }
.login-card { position: relative; width: min(400px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 30px 30px 26px; box-shadow: var(--shadow); }
.login-card .logo { height: 42px; margin-bottom: 22px; }
.login-card h1 { font-size: 19px; margin: 0 0 4px; font-weight: 800; }
.login-card p.lead { margin: 0 0 22px; color: var(--muted); font-size: 13px; }
.login-card .btn { width: 100%; padding: 10px; margin-top: 4px; }
.err-msg { color: var(--danger); font-size: 13px; min-height: 18px; margin: 0 0 8px; }

@media (max-width: 1100px) {
  .brand-title { display: none; }
  .journal { grid-template-columns: 1fr; }
  .live span { display: none; }
}
@media (max-width: 1000px) { body.drawer-open main { padding-right: 20px; } }
@media (max-width: 760px) {
  .topbar { overflow-x: auto; gap: 10px; padding: 0 12px; }
  main { padding: 16px 12px 60px; }
  .params { grid-template-columns: 1fr; }
  .params nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .params .grid2 { grid-template-columns: 1fr; }
}

/* ---------- Impression A3 paysage ---------- */
.print-only { display: none; }
@page { size: A3 landscape; margin: 9mm; }
@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 12.5px; }
  .topbar, .drawer, #toasts, .board-head .tools, .add, .cbadge, .edit-tag, .no-print { display: none !important; }
  .print-only { display: block; }
  span.print-only { display: inline; }
  main { padding: 0; }
  .cadre-scroll { overflow: visible; }
  .board, .board-head { min-width: 0; }
  .board { gap: 6px; --label-w: 132px; }
  .ed, .ed.selected, .ed.being-edited { box-shadow: none !important; outline: none !important; }
  body.drawer-open main { padding-right: 0; }
  .cell, .rl { break-inside: avoid; }
  .board-head .logo { height: 58px; }
  .actions-cell .act { break-inside: avoid; }
}
