/* Jetons repris de la charte Sovra (sovra/web/src/index.css) : parchemin, encre, un seul orange.
   La couleur n'est utilisée que quand elle porte une information (statut, gravité). */
:root {
  --bg: #ecece9; --surface: #ffffff; --side: #e3e2de; --raised: #f7f7f5;
  --ink: #121212; --ink2: #373734; --muted: #7b7974; --faint: #a3a19b;
  --line: #d9d8d3; --line2: #ebeae6; --hover: #f4f3f0; --sel: #d6d5cf;
  --clay: #b05733; --red: #b23f37; --amber: #9a6416; --green: #3b7350; --blue: #3a5f92; --violet: #6a559c;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.08);
  --ease: cubic-bezier(.23,1,.32,1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #1b1b18; --surface: #222220; --side: #161614; --raised: #2a2a27;
  --ink: #ecebe6; --ink2: #cfcdc6; --muted: #9a9890; --faint: #6d6b65;
  --line: #34332f; --line2: #2c2b28; --hover: #2a2a27; --sel: #3a3935;
  --clay: #cb714d; --red: #dd6b62; --amber: #d29a4c; --green: #6fae84; --blue: #82a3d6; --violet: #a895db;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; display: block; }
.serif { font-family: "Iowan Old Style", "Source Serif 4", Charter, Georgia, serif; font-weight: 400; letter-spacing: -.015em; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--ink2); outline-offset: 2px; border-radius: 6px; }

.app { display: grid; grid-template-columns: 252px 1fr; height: 100vh; }

/* Barre latérale */
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: var(--ink); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.brand b { font-size: 15px; } .brand span { font-size: 12px; color: var(--muted); display: block; margin-top: -2px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; height: 28px; border-radius: 7px; font-size: 13px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }
.search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: pointer; width: 100%; text-align: left; }
.search kbd, kbd { margin-left: auto; font: 11px ui-monospace, Menlo, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; background: var(--raised); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav h6 { margin: 12px 8px 4px; font-size: 11px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: .01em; }
.nav a { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--ink2); text-decoration: none; font-size: 14px; transition: background .15s; }
.nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nav a[aria-current="page"] { background: var(--sel); color: var(--ink); font-weight: 500; }
.nav a .cnt { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav a .cnt.alert { color: var(--red); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.me div { min-width: 0; } .me b { font-size: 13px; display: block; } .me span { font-size: 12px; color: var(--muted); }

/* Zone principale */
main { overflow-y: auto; min-width: 0; position: relative; }
.top { position: sticky; top: 0; z-index: 6; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumb b { color: var(--ink); font-weight: 500; }
.top .grow { flex: 1; }
.menu-btn { display: none !important; }
.dot-badge { position: relative; }
.dot-badge[data-n]::after { content: attr(data-n); position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.page { padding: 28px 28px 96px; max-width: 1320px; margin: 0 auto; animation: vue .2s var(--ease); }
@keyframes vue { from { opacity: 0; transform: translateY(4px); } }
.ph { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.ph h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.ph p { margin: 4px 0 0; color: var(--muted); max-width: 640px; }
.ph .actions { margin-left: auto; display: flex; gap: 8px; }

/* Boutons */
.btn { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s, transform .15s var(--ease); }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { background: var(--ink2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { color: var(--red); }
.btn .n { background: var(--ink); color: var(--surface); border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 16px; }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; }
.card-h h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-h .sub { font-size: 12.5px; color: var(--muted); }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.link { color: var(--muted); font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; cursor: pointer; background: none; border: 0; padding: 0; }
.link:hover { color: var(--ink); }

/* Pastilles : ensembles finis de valeurs, couleur tirée de la donnée */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); white-space: nowrap; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.neutral { --c: var(--ink2); background: transparent; border: 1px solid var(--line); color: var(--ink2); }
.chip.lock { --c: var(--muted); }

/* Avatars : initiales, teinte stable par personne */
.av { --h: 20; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 600; background: hsl(var(--h) 35% 88%); color: hsl(var(--h) 40% 28%); flex: none; letter-spacing: .02em; }
:root[data-theme="dark"] .av { background: hsl(var(--h) 22% 27%); color: hsl(var(--h) 45% 82%); }
.av.lg { width: 36px; height: 36px; font-size: 13px; }
.av.none { background: transparent; border: 1px dashed var(--faint); color: var(--faint); }
.who { display: inline-flex; align-items: center; gap: 8px; }

/* Tableaux */
.tablewrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 500; text-align: left; padding: 0 12px; height: 38px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; z-index: 1; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th .thi { display: inline-flex; align-items: center; gap: 6px; }
.tbl td { padding: 0 12px; height: 46px; border-bottom: 1px solid var(--line2); white-space: nowrap; transition: background .12s; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.row { cursor: pointer; }
.tbl tbody tr.row:hover td { background: var(--hover); }
.tbl tbody tr.selected td { background: color-mix(in srgb, var(--blue) 7%, var(--surface)); }
.tbl tr.dim td { opacity: .5; }
.tbl tr.group td { height: 34px; background: var(--raised); font-size: 12px; color: var(--muted); font-weight: 500; cursor: default; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .chk { width: 36px; padding-right: 0; }
.trunc { display: block; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idcell { display: inline-flex; align-items: center; gap: 4px; }
.reveal { opacity: 0; transition: opacity .15s; }
tr:hover .reveal, .reveal:focus-visible, li:hover > .reveal { opacity: 1; }
.mini { width: 22px; height: 22px; border-radius: 6px; border: 0; background: none; display: inline-grid; place-items: center; color: var(--muted); cursor: pointer; }
.mini:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--ink); cursor: pointer; margin: 0; }
.conf { display: inline-flex; color: var(--red); }

/* Barre d'outils */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs button { white-space: nowrap; flex: none; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); background: var(--hover); }
.tabs button[aria-selected="true"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); font-weight: 500; }
.tabs button span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.field { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); }
.field input { border: 0; outline: 0; background: none; width: 180px; color: var(--ink); }
.toolbar .right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Accueil */
.hero { display: flex; align-items: flex-end; gap: 24px; margin: 4px 0 24px; flex-wrap: wrap; }
.hero h1 { font-size: 40px; line-height: 1.1; margin: 0; }
.hero p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.hero .stats { margin-left: auto; display: flex; gap: 28px; align-items: flex-end; }
.stat .lbl { font-size: 12px; color: var(--muted); display: block; }
.stat b { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); display: block; }
.home { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 16px; }
.attn { list-style: none; margin: 0; padding: 0 8px 8px; }
.attn li { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 12px 10px; border-radius: 10px; }
.attn li + li { border-top: 1px solid var(--line2); }
.attn li:hover { background: var(--raised); }
.attn .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 11%, transparent); }
.attn .txt b { font-weight: 600; font-size: 14px; display: block; }
.attn .txt span { font-size: 13px; color: var(--muted); display: block; margin-top: 1px; }
.attn .when { font-size: 12px; }
.attn .act { display: flex; align-items: center; gap: 14px; justify-content: flex-end; }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.empty b { color: var(--ink); display: block; margin-bottom: 4px; font-weight: 600; }
.owners { list-style: none; margin: 0; padding: 4px 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.owners li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; }
.owners .t { display: flex; justify-content: space-between; font-size: 13px; }
.owners .t small { color: var(--muted); }
.owners .late { color: var(--red); }
.stack { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line2); margin-top: 6px; gap: 2px; }
.stack i { display: block; height: 100%; border-radius: 3px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); padding: 0 18px 16px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.next { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); border-top: 1px solid var(--line2); overflow-x: auto; }
.next > div { padding: 14px 16px 16px; border-right: 1px solid var(--line2); min-width: 150px; }
.next > div:last-child { border-right: 0; }
.next .d { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.next .d i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.next .d small { font-weight: 400; color: var(--muted); margin-left: auto; font-size: 12px; }
.next p { margin: 8px 0 2px; font-size: 13px; font-weight: 500; }
.next .s { font-size: 12px; color: var(--muted); display: block; margin-bottom: 10px; }
.next .who { font-size: 12.5px; color: var(--ink2); }

/* Liste de démarrage */
.onb { position: fixed; right: 20px; bottom: 20px; width: 300px; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); animation: monte .24s var(--ease); }
@keyframes monte { from { opacity: 0; transform: translateY(10px); } }
.onb header { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; }
.onb header b { font-size: 13.5px; }
.onb .bar { height: 4px; background: var(--line2); border-radius: 2px; margin: 8px 14px 6px; overflow: hidden; }
.onb .bar i { display: block; height: 100%; background: var(--ink); border-radius: 2px; transition: width .3s var(--ease); }
.onb ul { list-style: none; margin: 0; padding: 4px 6px 8px; }
.onb li button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13px; }
.onb li button:hover { background: var(--hover); }
.onb .ck { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; flex: none; }
.onb .done .ck { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.onb .done span { color: var(--muted); text-decoration: line-through; }
.onb.min ul, .onb.min .bar { display: none; }

/* Graphiques */
.chart { padding: 4px 18px 14px; }
.chart .big { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart .big small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end; height: 120px; margin-top: 12px; border-bottom: 1px solid var(--line); position: relative; }
.bars div { background: var(--ink); opacity: .82; border-radius: 3px 3px 0 0; min-height: 0; transition: opacity .15s; }
.bars div:hover { opacity: 1; }
.bars div.zero { background: var(--line); opacity: 1; height: 2px !important; }
.bars div.crit { background: var(--red); }
.axis { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.axis span { text-align: center; white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi b { display: block; font-size: 24px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.alert b { color: var(--red); }

/* Tiroir et modales */
.overlay { position: fixed; inset: 0; background: rgba(18,18,18,.18); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 31; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(102%); transition: transform .24s var(--ease); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.dh { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.db { overflow-y: auto; padding: 20px 22px 40px; flex: 1; }
.db h2 { margin: 6px 0 14px; font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.props { display: grid; grid-template-columns: 130px 1fr; gap: 10px 12px; align-items: center; font-size: 13px; margin-bottom: 22px; }
.props dt { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.props dd { margin: 0; min-width: 0; }
.sel { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 0 8px; cursor: pointer; max-width: 100%; }
.sel:hover { background: var(--hover); }
.sec { margin: 22px 0 10px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.prose { font-size: 14px; line-height: 1.6; color: var(--ink2); margin: 0; }
.steps { margin: 0; padding-left: 20px; color: var(--ink2); line-height: 1.7; font-size: 14px; }
.notice { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--c, var(--amber)) 10%, transparent); color: var(--ink2); align-items: flex-start; }
.notice .ic { color: var(--c, var(--amber)); margin-top: 1px; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl li { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 6px 0; }
.tl .pt { width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--c, var(--muted)); z-index: 1; }
.tl .pt.av { border: 0; }
.tl p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink2); }
.tl p b { color: var(--ink); font-weight: 600; }
.tl small { color: var(--muted); font-size: 12px; }
.tl .cmt { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; color: var(--ink2); background: var(--raised); }
.mention { color: var(--blue); font-weight: 500; }
.composer { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.composer textarea { border: 0; outline: 0; resize: vertical; min-height: 54px; background: none; font-size: 14px; }
.composer div { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); margin: 6px 0 22px; }
.stepper div { position: relative; text-align: center; font-size: 12px; color: var(--muted); padding-top: 26px; }
.stepper div::before { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.stepper div:first-child::before { display: none; }
.stepper div.ok::before, .stepper div.cur::before { background: var(--ink); }
.stepper div i { position: absolute; top: 2px; left: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); }
.stepper div.ok i { background: var(--ink); border-color: var(--ink); }
.stepper div.cur i { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 12%, transparent); }
.stepper div.cur, .stepper div.ok { color: var(--ink); }
.stepper b { display: block; font-weight: 500; } .stepper small { color: var(--muted); }
.signals { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.signals li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.signals li .ic { color: var(--c); margin-top: 2px; }
.signals li span { color: var(--muted); display: block; font-size: 12.5px; }
.mlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mlist li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; font-size: 13.5px; cursor: pointer; }
.mlist li + li { border-top: 1px solid var(--line2); }
.mlist li:hover { background: var(--hover); }

.modal-wrap { position: fixed; inset: 0; z-index: 40; display: grid; place-items: start center; padding-top: 12vh; background: rgba(18,18,18,.22); animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); animation: pop .2s var(--ease); max-height: 76vh; display: flex; flex-direction: column; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.modal header { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal header b { font-size: 15px; }
.modal .body { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
label.f small { font-weight: 400; color: var(--muted); }
.inp { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); outline: 0; }
textarea.inp { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; }
.inp:focus { border-color: var(--ink2); }
.hors-session .app { filter: grayscale(.25); opacity: .42; pointer-events: none; }
#auth { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 28px; overflow-y: auto; }
/* Vide une fois connecté : le calque ne doit plus couvrir l'application (sinon il avale tous les clics). */
#auth:empty { display: none; }
.auth { width: min(460px, 100%); animation: pop .24s var(--ease); }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 30px; }
.auth .brand { padding: 0; margin-bottom: 32px; }
.auth h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.15; letter-spacing: -.025em; }
.auth-intro { margin: 0 0 24px; color: var(--muted); max-width: 48ch; }
.auth form { display: grid; gap: 16px; }
.auth .inp { width: 100%; height: 40px; }
.mdp { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.mdp:focus-within { border-color: var(--ink2); }
.mdp .inp { border: 0; min-width: 0; }
.auth .big { width: 100%; justify-content: center; height: 42px; margin-top: 4px; }
.auth-pied { margin: 20px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }
@media (max-width: 520px) { #auth { padding: 16px; align-items: start; padding-top: 48px; } .auth-card { padding: 24px 20px; border-radius: 14px; } }
.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.radios label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-weight: 400; cursor: pointer; }
.radios label:has(input:checked) { border-color: var(--ink); background: var(--raised); }
.ro { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); padding: 8px 10px; border-radius: 8px; background: var(--raised); }

/* Photos et vidéos jointes */
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 14px; border: 1.5px dashed var(--line); border-radius: 10px; color: var(--muted); font-weight: 400; font-size: 13px; cursor: pointer; text-align: center; transition: border-color .15s, background .15s, color .15s; }
.drop b { color: var(--ink); font-weight: 500; }
.drop:hover, .drop.over { border-color: var(--ink2); background: var(--raised); color: var(--ink2); }
.drop:focus-within { outline: 2px solid var(--ink2); outline-offset: 2px; }
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.thumbs li { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--raised); animation: pop .16s var(--ease); }
.thumbs button.media { display: block; width: 100%; padding: 0; border: 0; background: #000; cursor: zoom-in; }
.thumbs img, .thumbs video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; }
.thumbs .cap { display: flex; gap: 4px; align-items: center; font-size: 11px; padding: 4px 6px; color: var(--muted); }
.thumbs .cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumbs .kind { position: absolute; left: 6px; top: 6px; display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: #fff; background: rgba(0,0,0,.6); border-radius: 5px; padding: 2px 6px; pointer-events: none; }
.thumbs .rm { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.thumbs .rm:hover { background: rgba(0,0,0,.8); }
.confirm { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.confirm.need { border-color: var(--red); background: color-mix(in srgb, var(--red) 6%, transparent); }
.confirm input { margin-top: 2px; }
.ferr { color: var(--red); font-size: 12.5px; margin: 0; }
.viewer { width: min(920px, calc(100vw - 32px)); }
.viewer .body { padding: 0; background: #000; align-items: center; }
.viewer img, .viewer video { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; }

/* Palette de commandes */
.palette { padding-top: 14vh; }
.palette .modal { max-height: 60vh; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pal-in input { border: 0; outline: 0; background: none; flex: 1; font-size: 16px; }
.pal-res { overflow-y: auto; padding: 6px; }
.pal-res h6 { margin: 10px 10px 4px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.pal-res button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 14px; }
.pal-res button[aria-selected="true"] { background: var(--hover); }
.pal-res button small { margin-left: auto; color: var(--muted); font-size: 12px; }
.pal-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

/* Popovers, menus, info-bulles, toasts */
.pop { position: fixed; z-index: 50; min-width: 220px; max-width: 360px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; animation: pop .16s var(--ease); }
.pop h6 { margin: 8px 8px 6px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.pop .opt { width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 8px; border-radius: 7px; cursor: pointer; text-align: left; font-size: 13.5px; }
.pop .opt:hover { background: var(--hover); }
.pop .opt .ck { margin-left: auto; color: var(--ink); }
.pop hr { border: 0; border-top: 1px solid var(--line2); margin: 6px 0; }
.share { width: 380px; max-width: calc(100vw - 24px); padding: 12px; }
.share .row1 { display: flex; gap: 6px; }
.share .row1 .inp { flex: 1; min-width: 0; height: 34px; }
.share .row1 select { height: 34px; }
.people { list-style: none; margin: 4px 0 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; }
.people li div { min-width: 0; flex: 1; }
.people li div > b { font-size: 13px; font-weight: 500; display: block; }
.people li div > span { font-size: 12px; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; }
.notifs { width: 360px; padding: 0; }
.notifs header { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notifs header b { font-size: 14px; }
.notifs ul { list-style: none; margin: 0; padding: 4px; max-height: 380px; overflow-y: auto; }
.notifs li { display: grid; grid-template-columns: 28px 1fr 8px; gap: 10px; padding: 10px; border-radius: 8px; cursor: pointer; align-items: start; }
.notifs li:hover { background: var(--hover); }
.notifs li p { margin: 0; font-size: 13px; color: var(--ink2); }
.notifs li small { color: var(--muted); font-size: 12px; }
.notifs .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-top: 6px; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12px; padding: 5px 8px; border-radius: 6px; max-width: 260px; opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s; }
.tip.on { opacity: 1; transform: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 70; background: var(--ink); color: var(--surface); border-radius: 10px; padding: 10px 14px; font-size: 13px; display: flex; gap: 8px; align-items: center; opacity: 0; transition: opacity .2s, transform .2s var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.bulk { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 25; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); animation: monte .2s var(--ease); font-size: 13px; }
.bulk .btn { background: color-mix(in srgb, var(--surface) 12%, transparent); border-color: transparent; color: var(--surface); }
.bulk .btn:hover { background: color-mix(in srgb, var(--surface) 22%, transparent); }
.bulk .sep { width: 1px; height: 20px; background: color-mix(in srgb, var(--surface) 25%, transparent); }

/* Versions, équipe, réglages */
.vers { display: flex; flex-direction: column; gap: 14px; }
.ver { padding: 18px 20px; display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.ver h3 { margin: 0; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.ver .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ver ul.fix { list-style: none; padding: 0; margin: 12px 0 0; }
.ver ul.fix li { display: flex; gap: 10px; align-items: center; padding: 6px 0; font-size: 13.5px; border-top: 1px solid var(--line2); cursor: pointer; }
.ver ul.fix li:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line); }
.ver > div { min-width: 0; }
.ver ul.fix li .trunc, .mlist li .trunc { max-width: none; min-width: 0; }
.ver aside h6 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.adopt { height: 6px; background: var(--line2); border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.adopt i { display: block; height: 100%; background: var(--green); }
.gantt { display: grid; grid-template-columns: 180px 1fr; }
.gantt .days { display: grid; grid-template-columns: repeat(30, 1fr); }
.gantt .days span { font-size: 10.5px; color: var(--muted); text-align: center; padding: 8px 0; border-left: 1px solid var(--line2); }
.gantt .days span.we { background: var(--raised); }
.gantt .days span.today { color: var(--ink); font-weight: 700; }
.gantt .name { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px; border-top: 1px solid var(--line2); font-size: 13.5px; }
.gantt .lane { position: relative; height: 44px; border-top: 1px solid var(--line2); display: grid; grid-template-columns: repeat(30, 1fr); }
.gantt .lane span { border-left: 1px solid var(--line2); }
.gantt .lane span.we { background: var(--raised); }
.gantt .blk.pending { border-style: dashed; background: transparent; }
.gantt .blk { position: absolute; top: 10px; height: 24px; border-radius: 6px; background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); font-size: 11.5px; font-weight: 500; padding: 0 8px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.secret { display: inline-flex; align-items: center; gap: 6px; }
.secret .mask { letter-spacing: .12em; color: var(--muted); }
.settings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.integ { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.integ .top-r { display: flex; align-items: center; gap: 10px; }
.integ .badge-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line); }
.integ p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.integ .foot { display: flex; gap: 8px; align-items: center; }

@media (max-width: 1100px) {
  .home { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .settings { grid-template-columns: 1fr; }
  .ver { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 272px; z-index: 35; transform: translateX(-102%); transition: transform .24s var(--ease); box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex !important; }
  .top { padding: 0 16px; }
  .page { padding: 20px 16px 96px; }
  .hero h1 { font-size: 30px; }
  .hero .stats { margin-left: 0; gap: 20px; }
  .attn li { grid-template-columns: 36px 1fr; }
  .attn .act { grid-column: 2; justify-content: flex-start; }
  .field input { width: 120px; }
  .onb { left: 16px; right: 16px; width: auto; }
  .gantt { grid-template-columns: 120px 1fr; }
  .props { grid-template-columns: 110px 1fr; }
  .top .hide-sm, .ph .hide-sm, .toolbar .hide-sm { display: none; }
  .card-h { flex-wrap: wrap; }
  .card-h .sub { display: none; }
  .ph .actions { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Liste de tickets à cocher (fenêtre d'une version) */
.pick { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; max-height: 240px; overflow-y: auto; }
.pick li + li { border-top: 1px solid var(--line2); }
.pick label { display: flex; gap: 10px; align-items: center; padding: 8px 12px; font-size: 13.5px; cursor: pointer; }
.pick label:hover { background: var(--hover); }
.pick .trunc { max-width: none; min-width: 0; }
/* Blocs d'absence : de vrais boutons, cliquables */
button.blk { border: 0; font: inherit; cursor: pointer; text-align: left; }
input.sel[type="date"] { height: 30px; }
