/* EFCMD — système de design
   Bleu nuit (confiance, laboratoire) + orange EFCMD (accent, identique aux PDF).
   Mobile d'abord, tableaux denses lisibles, alertes jamais portées par la couleur seule. */

:root {
  --ink: #17212f;
  --ink-2: #3c4858;
  --muted: #6b7686;
  --line: #dfe3ea;
  --line-2: #eef1f5;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --navy: #1f3a5f;
  --navy-2: #284a78;
  --navy-ink: #e9eef6;
  --orange: #e8781e;
  --orange-soft: #fdf0e5;
  --ok: #17803d;
  --ok-soft: #e7f5ec;
  --warn: #9a5b00;
  --warn-soft: #fff4dc;
  --danger: #c0262d;
  --danger-soft: #fdeceb;
  --info: #1f5fa8;
  --info-soft: #e8f0fb;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --sidebar: 248px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg);
  font-variant-numeric: tabular-nums;
}
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: .95rem; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.lg { width: 28px; height: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────────── Mise en page ───────────── */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--navy); color: var(--navy-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 14px 10px;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 10px 18px; color: #fff; font-weight: 700; letter-spacing: .02em; }
.brand-logo { display: block; width: 150px; max-width: 100%; height: auto; }
.brand small { display: block; font-weight: 500; opacity: .7; font-size: .72rem; letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--navy-ink);
  font-weight: 500; position: relative;
}
.nav a:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.nav a.active { background: rgba(255, 255, 255, .14); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--orange); }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .12); margin: 10px 6px; }
.nav .count { margin-left: auto; font-size: .72rem; background: rgba(255, 255, 255, .16); border-radius: 10px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; padding: 10px; font-size: .8rem; opacity: .85; }
.sidebar-foot form { display: inline; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 24px;
  background: rgba(244, 246, 249, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.menu-btn { display: none; }
.search { flex: 1; max-width: 560px; position: relative; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.search .icon { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.bell { position: relative; color: var(--ink-2); }
.bell .dot { position: absolute; top: -4px; right: -6px; background: var(--danger); color: #fff; font-size: .65rem; border-radius: 8px; padding: 0 5px; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: .85rem; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.content { padding: 22px 24px 60px; max-width: 1400px; width: 100%; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head .titles { flex: 1; min-width: 220px; }
.page-head .sub { color: var(--muted); margin: 0; }
.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ───────────── Composants ───────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .card + .grid, .grid + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  min-height: 38px;
}
.btn:hover { text-decoration: none; border-color: #c5ccd6; background: #fafbfc; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.accent:hover { filter: brightness(.96); }
.btn.danger { color: var(--danger); border-color: #f0c6c8; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: .85rem; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid rgba(232, 120, 30, .45); outline-offset: 1px;
}
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge.neutral { background: var(--line-2); color: var(--ink-2); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: #f3c2c4; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 8px; border: 1px solid; margin-bottom: 14px; }
.alert .icon { margin-top: 1px; }
.alert.ok { background: var(--ok-soft); border-color: #bfe3cb; color: #0f5a2b; }
.alert.error, .alert.danger { background: var(--danger-soft); border-color: #f3c2c4; color: #8c1a20; }
.alert.warn { background: var(--warn-soft); border-color: #f2d9a6; color: #6e4200; }
.alert.info { background: var(--info-soft); border-color: #c4d8f2; color: #194a85; }

/* Valeurs négatives / ruptures : rouge + icône + texte */
.neg { color: var(--danger); font-weight: 700; }
.neg::before { content: "▼ "; font-size: .7em; }
.pos { color: var(--ok); }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.small { font-size: .82rem; }

/* ───────────── Tableaux ───────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
table.data th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; position: sticky; top: 0; white-space: nowrap;
}
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data tbody tr:hover td { background: #fafbfd; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data td.qty, table.data th.qty { text-align: center; white-space: nowrap; }
table.data tr.row-danger td { background: #fff8f8; }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; margin-bottom: 8px; color: #b6bfcc; }

/* ───────────── Formulaires ───────────── */
.form-grid { display: grid; gap: 12px 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; grid-column: span 6; min-width: 0; }
.field.s3 { grid-column: span 3; } .field.s4 { grid-column: span 4; } .field.s2 { grid-column: span 2; }
.field.s8 { grid-column: span 8; } .field.s12 { grid-column: span 12; }
label, .label { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.hint { font-size: .76rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid #cdd3dc; border-radius: var(--radius-sm);
  padding: 8px 10px; width: 100%; min-height: 38px;
}
textarea { min-height: 72px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-height: 0; accent-color: var(--navy); }
input[readonly] { background: var(--line-2); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: .9rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.inline-form .field { grid-column: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.toolbar .grow { flex: 1; }
input.qty-input { width: 80px; text-align: center; }
input.money-input { width: 110px; text-align: right; }

/* Éditeur de lignes */
.lines-editor td { padding: 6px; }
.lines-editor input, .lines-editor textarea { min-height: 34px; padding: 6px 8px; }
.lines-editor textarea { min-height: 34px; height: 34px; }
.lines-editor .article-pick { position: relative; min-width: 140px; }
.suggest {
  position: absolute; z-index: 30; left: 0; top: 100%; width: 420px; max-width: 80vw; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 300px; overflow-y: auto;
}
.suggest button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; cursor: pointer; font: inherit; }
.suggest button:hover, .suggest button.on { background: var(--info-soft); }
.suggest .code { font-family: var(--mono); font-weight: 600; margin-right: 6px; }
.totals-box { margin-left: auto; min-width: 280px; }
.totals-box div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals-box .grand { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 1.05rem; }

/* ───────────── Accueil ───────────── */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.hero h1 { margin: 0; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; min-height: 128px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); position: relative; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #c9d3e1; text-decoration: none; }
.tile .tile-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--info-soft); color: var(--navy); }
.tile .tile-icon .icon { width: 24px; height: 24px; }
.tile .tile-label { font-weight: 700; font-size: 1rem; }
.tile .tile-count {
  position: absolute; top: 14px; right: 14px; min-width: 28px; height: 28px; border-radius: 14px; padding: 0 8px; display: grid; place-items: center;
  font-weight: 800; background: var(--line-2); color: var(--ink-2);
}
.tile.danger .tile-count { background: var(--danger); color: #fff; }
.tile.danger .tile-hint { color: var(--danger); font-weight: 600; }
.tile .tile-hint { font-size: .78rem; color: var(--muted); margin-top: auto; }
.tile:nth-child(2) .tile-icon { background: #eaf6ef; color: #17803d; }
.tile:nth-child(3) .tile-icon, .tile:nth-child(4) .tile-icon { background: var(--orange-soft); color: #b55c12; }
.tile:nth-child(5) .tile-icon { background: #eef0ff; color: #3b45a8; }
.tile:nth-child(6) .tile-icon { background: #e7f5f3; color: #0c7468; }
.tile:nth-child(8) .tile-icon { background: #fdeceb; color: var(--danger); }
.tile:nth-child(9) .tile-icon { background: #f3ecfb; color: #6b3fa0; }
.tile:nth-child(10) .tile-icon { background: var(--line-2); color: var(--ink-2); }

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi { padding: 14px 16px; }
.kpi .k-label { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .k-value { font-size: 1.35rem; font-weight: 800; margin-top: 4px; }
.kpi.danger { border-color: #f3c2c4; background: #fffafa; }
.kpi.danger .k-value { color: var(--danger); }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.feed li:last-child { border-bottom: 0; }
.feed .when { margin-left: auto; color: var(--muted); font-size: .76rem; white-space: nowrap; }

.stat-strip { display: flex; flex-wrap: wrap; gap: 0; }
.stat-strip > div { flex: 1; min-width: 120px; padding: 12px 16px; border-right: 1px solid var(--line-2); }
.stat-strip > div:last-child { border-right: 0; }
.stat-strip .v { font-size: 1.3rem; font-weight: 800; }
.stat-strip .l { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-color: var(--orange); }

details.disclosure { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
details.disclosure > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure[open] > summary { border-bottom: 1px solid var(--line-2); }
details.disclosure > div { padding: 14px; }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .82rem; }
dl.kv dd { margin: 0; font-weight: 500; }

/* ───────────── Connexion ───────────── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background:
  radial-gradient(1200px 600px at 10% -10%, rgba(232, 120, 30, .18), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, rgba(31, 58, 95, .25), transparent 60%), var(--bg); }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth .brand { color: var(--navy); padding: 0 0 18px; }
.auth h1 { font-size: 1.25rem; }

/* ───────────── Scan ───────────── */
.scan-video { width: 100%; max-width: 480px; border-radius: 12px; background: #000; aspect-ratio: 4/3; object-fit: cover; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1100px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 40; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 8px 12px; }
  .user-chip .name { display: none; }
  .content { padding: 16px 12px 80px; }
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .field, .field.s2, .field.s3, .field.s4, .field.s8 { grid-column: span 12; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 112px; padding: 14px; }
  .page-head h1 { font-size: 1.2rem; }
  .totals-box { min-width: 0; width: 100%; }
  table.data.stack thead { display: none; }
  table.data.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  table.data.stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 4px 12px; text-align: right; }
  table.data.stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; font-size: .78rem; }
}

@media print {
  .sidebar, .topbar, .actions, .no-print, .toolbar { display: none !important; }
  .app { display: block; }
  body { background: #fff; font-size: 11px; }
  .card { box-shadow: none; border: 0; }
  .content { padding: 0; max-width: none; }
  @page { size: A4 landscape; margin: 10mm; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Correctifs de spécificité */
.btn.menu-btn { display: none; }
.toolbar input[type="checkbox"], .inline-form input[type="checkbox"] { min-width: 0; width: 18px; }
.field.check { flex-direction: row; align-items: center; align-self: end; min-height: 38px; }
@media (max-width: 860px) { .btn.menu-btn { display: inline-flex; } }
[hidden] { display: none !important; }

/* ───────────── Barre d'onglets mobile ───────────── */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: none;
    color: var(--muted); font: inherit; font-size: .68rem; font-weight: 600; text-decoration: none; cursor: pointer;
  }
  .tabbar .icon { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--navy); }
  .tabbar a.tab-scan .icon { width: 26px; height: 26px; color: #fff; background: var(--orange); border-radius: 50%; padding: 6px;
    box-sizing: content-box; margin-top: -18px; box-shadow: 0 4px 12px rgba(232, 120, 30, .45); }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .btn.menu-btn { display: none; }
}

/* ───────────── Messages flash ───────────── */
.alert.flash { align-items: center; animation: flash-in .25s ease-out; }
.alert.flash .grow { flex: 1; }
.flash-close { border: 0; background: none; color: inherit; opacity: .6; cursor: pointer; padding: 4px; }
.flash-close:hover { opacity: 1; }
.alert.flash.leaving { opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
@keyframes flash-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ───────────── Boutons occupés ───────────── */
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; animation: spin .7s linear infinite;
}
.btn.primary.busy::after, .btn.accent.busy::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── Mode application installée ───────────── */
@media (display-mode: standalone) {
  .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }
}

/* ───────────── Résultat de scan ───────────── */
.scan-card { border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px; padding: 14px; background: var(--surface);
  box-shadow: var(--shadow); animation: flash-in .2s ease-out; }
.scan-card.warn { border-left-color: var(--orange); }
.scan-title { font-weight: 700; font-size: 1.02rem; display: block; margin-bottom: 8px; }
.scan-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.scan-figures div { background: var(--line-2); border-radius: 8px; padding: 8px; text-align: center; }
.scan-figures span { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.scan-figures b { font-size: 1.3rem; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ───────────── Inventaire par scan ───────────── */
.inv-scan { position: sticky; top: 62px; z-index: 15; }
.inv-status { margin-top: 10px; font-weight: 600; padding: 8px 10px; border-radius: 8px; }
.inv-status.ok { background: var(--ok-soft); color: var(--ok); }
.inv-status.warn { background: var(--warn-soft); color: var(--warn); }
tr.hit td { background: var(--ok-soft) !important; transition: background .3s; }
@media (max-width: 860px) { .inv-scan { top: 54px; } .inv-scan .scan-video { max-height: 30vh; } }

/* ───────────── Dupliquer ───────────── */
details.dup { position: relative; }
details.dup > summary { list-style: none; }
details.dup > summary::-webkit-details-marker { display: none; }
.dup-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 300px; padding: 14px; display: grid; gap: 8px;
  box-shadow: var(--shadow-lg); }
@media (max-width: 860px) { .dup-pop { left: 0; right: auto; width: min(300px, 90vw); } }

/* ───────────── Chaîne documentaire ───────────── */
.chain-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.chain-item { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); min-width: 140px; position: relative; color: var(--ink); }
.chain-item:hover { border-color: #c5ccd6; text-decoration: none; box-shadow: var(--shadow); }
.chain-item > span:first-child { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.chain-item b { font-family: var(--mono); font-size: .9rem; }
.chain-item.current { border-color: var(--navy); background: var(--info-soft); }
.chain-item .badge { align-self: flex-start; }
.chain-row .chain-item + .chain-item::before { content: "→"; position: absolute; left: -9px; top: 50%; transform: translate(-50%, -50%);
  color: var(--muted); font-weight: 700; }
.chain-group { margin-bottom: 10px; }
.chain-group > .label { display: block; margin-bottom: 6px; }

/* ───────────── Matrice des droits ───────────── */
.perm-grid td, .perm-grid th { white-space: nowrap; }
.perm-grid td:first-child { white-space: normal; min-width: 220px; }
.perm-grid tr.perm-group td { background: var(--line-2); font-weight: 700; color: var(--navy); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.perm-grid td.changed, .legend-changed { background: var(--orange-soft) !important; }
.legend-changed { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; border: 1px solid #f2c79e; }

/* Lignes de liste cliquables */
table.data.stack tbody tr:has(a[href]) { cursor: pointer; }
@media (max-width: 860px) {
  table.data.stack tbody tr:has(a[href]):active td { background: var(--info-soft); }
}

/* ───────────── Menu utilisateur ───────────── */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; border-radius: 999px; padding: 2px 4px 2px 2px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--line-2); }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 250px; padding: 6px; box-shadow: var(--shadow-lg); }
.user-pop-head { display: flex; flex-direction: column; gap: 2px; padding: 10px 10px 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.user-pop a, .user-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0;
  background: none; color: var(--ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.user-pop a:hover, .user-pop button:hover { background: var(--line-2); text-decoration: none; }
.user-pop form button { color: var(--danger); }
.qr { width: 180px; height: 180px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.qr svg { width: 100%; height: 100%; }

/* ───────────── Sélecteur de quantité −/+ ───────────── */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid #cdd3dc; border-radius: 8px; overflow: hidden; background: var(--surface); }
.stepper button { width: 36px; border: 0; background: var(--line-2); color: var(--ink); font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.stepper button:hover { background: var(--line); }
.stepper input { width: 64px; border: 0; border-radius: 0; text-align: center; font-weight: 700; min-height: 36px; padding: 4px; }
.stepper input:focus-visible { outline: none; background: var(--info-soft); }

/* ───────────── Barre d'action collante ───────────── */
.sticky-bar { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 12px 16px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 16px rgba(16, 24, 40, .06); }
.sticky-bar .sum { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; }
.sticky-bar .sum b { font-size: 1rem; }
.sticky-bar .grow { flex: 1; }
@media (max-width: 860px) { .sticky-bar { bottom: calc(64px + env(safe-area-inset-bottom)); border-radius: 0; margin: 0 -12px; } }

/* ───────────── Segmented control ───────────── */
.segmented { display: inline-flex; background: var(--line-2); border-radius: 9px; padding: 3px; gap: 3px; }
.segmented label { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--muted); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--navy); box-shadow: var(--shadow); }
.segmented label:has(input:focus-visible) { outline: 3px solid rgba(232, 120, 30, .45); }

/* ───────────── Commander aux fournisseurs ───────────── */
.plan-notes { display: grid; gap: 6px; margin-bottom: 14px; }
.plan-notes > div { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; color: var(--info); background: var(--info-soft);
  border: 1px solid #c4d8f2; border-radius: 8px; padding: 8px 12px; }
.plan-formula { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: .78rem; }
.plan-list { display: grid; gap: 0; }
.plan-group { border-bottom: 1px solid var(--line); }
.plan-group.is-hidden { display: none; }
.pg-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; background: #f7f9fc; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; z-index: 2; }
.pg-icon { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--navy); }
.pg-icon .icon { width: 17px; height: 17px; }
.pg-t { display: grid; min-width: 0; } .pg-t small { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pg-t a, .pg-t span { font-size: 1.08rem; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-t a:hover { color: var(--navy); }
.pg-sum { margin-left: auto; font-size: .84rem; color: var(--muted); white-space: nowrap; } .pg-sum b { color: var(--ink); }
.plan-group.is-on .pg-icon { background: var(--orange); border-color: var(--orange); color: #fff; }
.plan-item { display: grid; grid-template-columns: 28px minmax(220px, 1.5fr) minmax(200px, auto) auto minmax(200px, 1fr);
  gap: 10px 22px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--line-2); transition: background .12s; }
.pg-head + .plan-item { border-top: 0; }
.plan-item.covered:not(:has(input[data-sel]:checked)) .pi-des, .plan-item.covered:not(:has(input[data-sel]:checked)) .pi-calc { opacity: .6; }
.plan-item:has(input[data-sel]:checked) { background: #fffaf4; box-shadow: inset 3px 0 0 var(--orange); }
.pi-check input { width: 19px; height: 19px; accent-color: var(--orange); }
.pi-top { display: flex; align-items: center; gap: 8px; } .pi-top .mono { font-size: .8rem; }
.pi-des { font-weight: 600; margin-top: 2px; line-height: 1.3; }
.pi-origin { font-size: .75rem; color: var(--muted); margin-top: 3px; }
.pi-calc { display: flex; align-items: baseline; gap: 8px; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.pi-calc b { font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 2px; } .pi-calc i { font-style: normal; color: #b9c3d1; }
.pi-qty { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pi-hint { font-size: .72rem; color: var(--muted); }
.pi-sup-l { display: grid; gap: 4px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pi-sup-l select { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .86rem; color: var(--ink); }
.pi-sup-l select.single { appearance: none; -webkit-appearance: none; border-color: transparent; background: transparent; padding-left: 0; pointer-events: none; }
.pi-amount { font-size: .78rem; color: var(--muted); margin-top: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.plan-item.is-hidden { display: none; }
@media (max-width: 1100px) {
  .plan-item { grid-template-columns: 28px 1fr auto; grid-template-areas: "c a q" "c k k" "c f f"; }
  .pi-check { grid-area: c; align-self: start; padding-top: 2px; } .pi-art { grid-area: a; } .pi-qty { grid-area: q; align-self: start; }
  .pi-calc { grid-area: k; } .pi-sup { grid-area: f; }
}
@media (max-width: 520px) {
  .plan-item { grid-template-columns: 24px 1fr; grid-template-areas: "c a" "c k" "c q" "c f"; padding: 14px 12px; gap: 8px 12px; }
  .pi-qty { flex-direction: row; justify-content: space-between; width: 100%; }
  .pi-calc { flex-wrap: wrap; white-space: normal; gap: 2px 6px; }
  .pg-head { padding: 12px; flex-wrap: wrap; row-gap: 4px; } .pg-t { flex: 1; } .pg-t a, .pg-t span { white-space: normal; }
  .pg-sum { flex-basis: 100%; margin-left: 46px; font-size: .78rem; }
}

/* ───────────── Éditeur de kit ───────────── */
.kit-editor { display: grid; gap: 12px; }
.kit-rows { display: grid; gap: 8px; }
.kit-row { display: grid; grid-template-columns: minmax(240px, 1fr) auto 110px 120px 70px 40px; gap: 12px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.kit-row:focus-within { border-color: #9fb6d6; box-shadow: 0 0 0 3px var(--info-soft); }
.kr-num { text-align: right; }
.kr-num span { display: block; font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.kr-num b { font-variant-numeric: tabular-nums; }
.kit-add { justify-self: start; border-style: dashed; }
.kit-summary { display: grid; gap: 6px; margin-left: auto; width: min(100%, 420px); background: var(--line-2); border-radius: 12px; padding: 14px 16px; }
.ks-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ks-disc input { width: 70px; text-align: right; min-height: 32px; padding: 4px 8px; }
.ks-total { border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; font-size: 1.15rem; }
.ks-total b { font-weight: 800; color: var(--navy); }
.kit-editor .suggest .muted { font-size: .78rem; }
@media (max-width: 860px) {
  .kit-row { grid-template-columns: 1fr auto; grid-template-areas: "a a" "q del" "p s" "d d"; }
  .kr-art { grid-area: a; } .kr-qty { grid-area: q; } .kr-del { grid-area: del; justify-self: end; }
  .kr-pu { grid-area: p; text-align: left; }
  .kr-sub { grid-area: s; }
  .kr-av { grid-area: d; text-align: left; display: flex; gap: 6px; align-items: baseline; }
  .kr-av span { display: inline; }
  .kit-summary { width: 100%; }
}

/* ───────────── Formulaire article ───────────── */
.article-form { display: grid; gap: 16px; }
.article-form .card + .card { margin-top: 0; }
.kit-toggle > summary, .disclosure-card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 14px 16px; }
.kit-toggle > summary::-webkit-details-marker, .disclosure-card > summary::-webkit-details-marker { display: none; }
.kit-toggle[open] > summary, .disclosure-card[open] > summary { border-bottom: 1px solid var(--line-2); }
.disclosure-card > summary::after, .kit-toggle > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.form-actions { border-radius: var(--radius); }
.grid-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
input[readonly][name=sale_price_ht] { background: var(--info-soft); font-weight: 700; color: var(--navy); }

/* ───────────── Constitution de kits ───────────── */
.assemble { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line-2); }
.assemble-box { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.assemble-box > div:first-child { display: grid; gap: 2px; }
.assemble-act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Correctifs mobiles (kits / achats) */
.card-head { flex-wrap: wrap; }
.kit-row .stepper { justify-self: start; }
@media (max-width: 860px) {
  .card-head > .muted.small { flex-basis: 100%; }
  .ks-line:last-child { flex-wrap: wrap; }
  .ks-line .segmented { margin-left: auto; }
  .plan .toolbar .grow { display: none; }
}

/* ───────────── Documents & notes d'article ───────────── */
.memo-pins { display: grid; gap: 8px; margin-bottom: 14px; }
.memo { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); border: 1px solid #f2d9a6; color: #5c3a00; }
.memo-text, .note-text { white-space: pre-wrap; margin-top: 4px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.photo-grid figure { margin: 0; position: relative; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--line-2); display: block; }
.photo-grid figcaption { font-size: .72rem; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(23, 33, 47, .7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-del .icon { width: 14px; height: 14px; }
.doc-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; }
.doc-ico { width: 36px; height: 36px; border-radius: 8px; background: var(--info-soft); color: var(--navy); display: grid; place-items: center; flex: none; }
.doc-main { flex: 1; min-width: 0; }
.doc-main > a { font-weight: 600; word-break: break-word; }
.note-form { display: grid; gap: 8px; margin-bottom: 14px; }
.note { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); margin-bottom: 8px; }
.note.pinned { border-color: #f2d9a6; background: #fffbf2; }
.note.legacy { background: var(--line-2); }
.note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.note-head .grow { flex: 1; }
.avatar.sm { width: 24px; height: 24px; font-size: .7rem; }
.note-actions { margin-left: auto; display: inline-flex; gap: 2px; }
.note-actions form { margin: 0; }
#docs, #notes { align-self: start; margin-top: 0; }

/* ───────────── Alertes de réapprovisionnement ───────────── */
.restock-alert { display: flex; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--danger-soft, #fdecec); border: 1px solid #f3c2c2; color: #7a1d1d; }
.restock-alert.ok { background: var(--info-soft); border-color: #c9d8ee; color: var(--navy); }
.restock-alert ul { margin: 6px 0 8px; padding-left: 18px; }
.restock-alert .btn { margin-top: 2px; }
.bell { position: relative; }
.bell-dot { position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d93025; color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }

/* ───────────── Suggestions de désignation ───────────── */
.ac-wrap { position: relative; }
.ac-list { width: 100%; max-width: 100%; max-height: 340px; padding: 4px 0; }
.ac-list button { display: flex; align-items: baseline; gap: 6px; padding: 9px 12px; line-height: 1.3; }
.ac-list button b { font-weight: 700; color: var(--navy); }
.ac-head { padding: 6px 12px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ac-head.warn { color: #9a5b00; border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 8px; }
.ac-tag { margin-left: auto; font-size: .68rem; color: var(--muted); background: var(--line-2); border-radius: 6px; padding: 1px 6px; }
.ac-article .ac-open { margin-left: auto; font-size: .75rem; color: var(--navy); white-space: nowrap; }
.ac-label { min-width: 0; }
.ac-tag.warn { background: #fff4e0; color: #9a5b00; }
.ac-tag { white-space: nowrap; flex: none; }
.ac-refs { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
.ac-ref { font-size: .74rem; color: var(--muted); }
.ac-ref .mono { color: var(--ink-2); font-weight: 600; }
.ac-ref { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; background: var(--line-2); }
.ac-sup { font-weight: 600; color: var(--ink); }
.ac-ref-code { color: var(--muted); }
.ac-ref { flex-wrap: wrap; max-width: 100%; }
.ac-ref-code, .ac-sup { white-space: nowrap; }
@media (max-width: 520px) { .ac-article { flex-wrap: wrap; } .ac-article .code { flex-basis: 100%; } }
@media (min-width: 900px) { td.col-des { min-width: 260px; } td.nowrap { white-space: nowrap; } }

/* ───────────── Colonnes au choix + colonnes figées ───────────── */
.col-chooser { position: relative; }
.col-chooser > summary { list-style: none; }
.col-chooser > summary::-webkit-details-marker { display: none; }
.col-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px; padding: 12px; display: grid; gap: 8px; box-shadow: var(--shadow-lg); }
@media (min-width: 861px) {
  table.sticky-cols .sticky-c1, table.sticky-cols .sticky-c2 { position: sticky; z-index: 2; background: var(--surface); }
  table.sticky-cols th.sticky-c1, table.sticky-cols th.sticky-c2 { z-index: 3; background: #fafbfc; }
  table.sticky-cols .sticky-c1 { left: 0; }
  table.sticky-cols .sticky-c2 { left: var(--c1w, 110px); box-shadow: 6px 0 6px -6px rgba(23, 33, 47, .18); }
  table.sticky-cols tr.row-danger td.sticky-c1, table.sticky-cols tr.row-danger td.sticky-c2 { background: #fff8f8; }
}
.col-pop { left: 0; right: auto; }

/* ───────────── Droits par personne ───────────── */
.perm-grid th.person { text-transform: none; letter-spacing: 0; white-space: normal; min-width: 130px; vertical-align: top; }
.pp-name { font-weight: 700; color: var(--ink); font-size: .82rem; }
.pp-meta { font-size: .72rem; color: var(--muted); margin: 2px 0 4px; word-break: break-all; }
.link-btn { border: 0; background: none; color: var(--navy); cursor: pointer; padding: 2px 0; text-decoration: underline; }

/* Création rapide d'un composant depuis l'éditeur de kit */
.kit-quick { border-top: 1px solid var(--line-2); }
.kit-quick .kq-open { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.kit-quick .kq-open:hover { background: var(--info-soft); }
.kq-form { display: grid; gap: 8px; padding: 10px 12px; }
.kq-form label { display: grid; gap: 3px; font-size: .75rem; color: var(--muted); font-weight: 600; }
.kq-form input { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.kq-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.kq-actions .kq-err { margin-right: auto; }
.kit-editor .article-pick { position: relative; } .kit-editor .suggest { width: 100%; min-width: 280px; max-width: 560px; }
.suggest-host { position: relative; }
.suggest-float { position: fixed; z-index: 120; max-height: 320px; }

/* ───────────── Prix article ───────────── */
.input-group { display: flex; gap: 6px; }
.input-group input { flex: 1; min-width: 0; }
.input-group select { width: auto; flex: none; }
.pc-margin-v { padding: 9px 0; font-weight: 700; color: var(--ink); }
[data-pc-sale][readonly] { background: var(--line-2); color: var(--ink); font-weight: 700; }

/* Détail des composants d'un kit à constituer */
.kit-gaps { margin: 6px 0 8px; padding: 8px 10px; background: rgba(255,255,255,.7); border: 1px solid rgba(0,0,0,.06); border-radius: 8px; color: var(--ink); }
.kg-head { font-size: .82rem; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.kg-link { margin-left: auto; font-weight: 600; display: inline-flex; gap: 4px; align-items: center; }
.kit-gaps ul { margin: 6px 0 0; padding-left: 16px; font-size: .82rem; }
.kit-gaps li { margin: 2px 0; }
.kg-nums { color: var(--muted); }
.kg-missing .kg-nums { color: var(--ink-2); }
.kg-ok .icon { width: 12px; height: 12px; color: var(--ok, #16a34a); vertical-align: -1px; }

/* Kit et ses composants dans le suivi de commande / le BL */
table.data tr.kit-parent td { border-bottom-color: transparent; font-weight: 600; }
table.data tr.kit-child td { background: #fafbfd; font-size: .82rem; padding-top: 6px; padding-bottom: 6px; }
table.data tr.kit-child.row-danger td { background: #fff6f6; }
.kc-branch { color: var(--muted); margin-right: 2px; }
.nav a.nav-sub { padding-left: 34px; font-size: .86rem; opacity: .9; }
.nav a.nav-sub .icon { width: 15px; height: 15px; }
.alloc-link { font-weight: 600; white-space: nowrap; }

/* Lien ↗ vers la fiche article à côté d'un champ code */
.code-open { display: flex; align-items: center; gap: 4px; }
.code-open input { flex: 1; min-width: 0; }
.art-open { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--navy); font-weight: 700; text-decoration: none; }
.art-open:hover { background: var(--info-soft); text-decoration: none; }

/* Onglets (documents liés d'un article) */
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 10px 10px; font: inherit; font-size: .84rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tab .icon { width: 15px; height: 15px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--navy); border-bottom-color: var(--navy); }
.tab[data-empty] { opacity: .55; }
.tab-n { font-size: .72rem; background: var(--line-2); border-radius: 9px; padding: 1px 7px; color: var(--ink-2); }
.tab.on .tab-n { background: var(--info-soft); color: var(--navy); }
.rel-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.rel-chips .chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--navy); text-decoration: none; }
.rel-chips .chip:hover { background: var(--info-soft); }
.rel-chips .chip .icon { width: 14px; height: 14px; }
.dl-bar { flex-wrap: wrap; gap: 8px 10px; }
.dl-quick { display: inline-flex; gap: 2px; }
.vat-form input[name=vat_paid_mad] { width: 100px; } .vat-form input[name=vat_doc_ref] { width: 110px; }
.kpi-link { color: inherit; text-decoration: none; } .kpi-link:hover { box-shadow: var(--shadow-lg); text-decoration: none; }

/* ───────────── Liens visiblement cliquables ───────────── */
/* Dans les tableaux : liens soulignés (et non plus seulement colorés) */
table.data td a:not(.btn):not(.art-open):not(.doc-chip):not(.chip) {
  font-weight: 600; text-decoration: underline; text-decoration-color: rgba(31, 58, 95, .35);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
table.data td a:not(.btn):not(.art-open):not(.doc-chip):not(.chip):hover { text-decoration-color: currentColor; }
/* Numéros de documents (commande, devis, BL, facture, BC…) : pastille avec flèche */
.doc-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 8px; border-radius: 999px;
  background: var(--info-soft); border: 1px solid #c9d8ee; color: var(--navy); font-family: var(--mono);
  font-size: .8rem; font-weight: 700; white-space: nowrap; text-decoration: none; line-height: 1.5;
}
.doc-chip::after { content: "›"; font-family: var(--font, inherit); font-size: 1rem; line-height: 1; opacity: .7; }
.doc-chip:hover { background: var(--navy); border-color: var(--navy); color: #fff; text-decoration: none; }
.vat-missing { margin: 0 16px 16px; border: 1px solid #f3c2c2; border-radius: 10px; overflow: hidden; }
.vm-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--danger-soft); color: #7a1d1d; font-weight: 600; font-size: .86rem; }
tr.rec-novat td { background: #fff8f8; }
tr:target td { background: #fff4d6 !important; }
.import-kinds { margin-bottom: 12px; display: inline-flex; } .import-kinds a { padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); text-decoration: none; } .import-kinds a.on { background: var(--surface); color: var(--navy); box-shadow: var(--shadow); } .import-steps { margin-bottom: 12px; }
.mail-card { max-width: 980px; }
.mail-card textarea { font-family: inherit; line-height: 1.5; }
.mail-attach { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .86rem; }
.mail-actions { flex-wrap: wrap; gap: 8px; }
.field.mail-attach { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.segmented a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; text-decoration: none; font-size: .86rem; }
.segmented a.on { background: var(--surface); color: var(--navy); box-shadow: var(--shadow); }

/* ───────────── Accueil : Mes tâches ───────────── */
.tasks { margin: 4px 0 22px; }
.tasks-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.tasks-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.15rem; }
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.task-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; border-top: 3px solid var(--navy); }
.task-card.tone-danger { border-top-color: #d93025; }
.task-card.tone-warn { border-top-color: #e8890c; }
.task-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 6px; }
.tc-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--info-soft); color: var(--navy); }
.tone-danger .tc-icon { background: var(--danger-soft); color: #b42318; }
.tone-warn .tc-icon { background: #fff4e0; color: #9a5b00; }
.tc-count { margin-left: auto; font-weight: 800; font-size: 1.05rem; }
.task-list { list-style: none; margin: 0; padding: 0 6px; flex: 1; }
.task-list li { display: flex; align-items: center; gap: 8px; border-radius: 8px; }
.task-list li:hover { background: var(--line-2); }
.task-list a { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 7px 8px; text-decoration: none; color: inherit; }
.tl-title { font-weight: 600; font-size: .86rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-sub { font-size: .76rem; color: var(--muted); }
.task-list .badge { margin-right: 6px; flex: none; }
.tc-more { padding: 8px 14px 12px; font-size: .82rem; font-weight: 600; }
.task-grid > .card { margin: 0; }
.bar-col { width: 160px; }
.bar { display: block; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
@media (max-width: 860px) { .bar-col { display: none; } }

/* ───────────── Tableau de bord par période ───────────── */
.period-card .kpis { padding: 0 16px 16px; }
.period-card .kpi { box-shadow: none; border: 1px solid var(--line-2); }
.delta { display: inline-block; font-size: .76rem; font-weight: 700; color: var(--muted); }
.delta.up { color: #15803d; }
.delta.down { color: #b42318; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.chart-bars i { display: block; width: 42%; border-radius: 3px 3px 0 0; min-height: 1px; }
.b-inv { background: var(--navy); }
.b-cash { background: #e8890c; }
.chart-label { font-size: .66rem; color: var(--muted); }
.chart-legend { display: flex; gap: 14px; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.aged { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0 16px 12px; }
.aged-b { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 8px; background: var(--line-2); font-size: .74rem; color: var(--muted); }
.aged-b b { font-size: .9rem; color: var(--ink); }
.aged-b.late { background: var(--danger-soft); }
.aged-b.late b { color: #b42318; }
@media (max-width: 860px) { .aged { grid-template-columns: repeat(2, 1fr); } }
.kpis > .card, .kpis > a.card { margin: 0; }

/* ───────────── Disponibilité estimée & agenda ───────────── */
.eta-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--info-soft); border: 1px solid #c9d8ee; color: var(--navy); }
.eta-banner.late { background: var(--danger-soft); border-color: #f3c2c2; color: #7a1d1d; }
.eta-banner.ok { background: #ecfdf3; border-color: #bbe5c8; color: #14532d; }
.agenda { display: grid; gap: 10px; }
.agenda-day { padding: 12px 14px; margin: 0; }
.agenda-day.late { border-left: 4px solid #d93025; }
.agenda-date { margin-bottom: 6px; font-size: .92rem; }
.agenda-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.agenda-day li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; }
.ag-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--line-2); }
.ag-ico .icon { width: 14px; height: 14px; }
.k-del .ag-ico { background: var(--info-soft); color: var(--navy); }
.k-rec .ag-ico { background: #fff4e0; color: #9a5b00; }
.k-in .ag-ico { background: #ecfdf3; color: #15803d; }
.k-out .ag-ico { background: var(--danger-soft); color: #b42318; }
.ag-amt { margin-left: auto; font-weight: 700; }

/* Listes : tri, pagination, filtres */
th.sortable a { color: inherit; text-decoration: none !important; display: inline-flex; gap: 4px; align-items: center; font-weight: inherit; }
th.sortable a:hover, th.sorted a { color: var(--navy); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); }
.list-filters { flex-wrap: wrap; }
.date-f { display: inline-flex; align-items: center; gap: 4px; }
.date-f input { width: auto; }

/* Petits tableaux (fiches) : défilement horizontal sur mobile plutôt que débordement */
@media (max-width: 860px) {
  table.data:not(.stack) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
/* Les cartes d'une grille ne doivent jamais s'élargir au-delà de leur colonne (mobile) */
.grid > *, .kpis > *, .task-grid > * { min-width: 0; }
.stat-strip .badge { white-space: normal; max-width: 100%; }
.chart { overflow: hidden; }
.mini-field { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; color: var(--muted); font-weight: 600; } .mini-field .qty-input { width: 56px; }

/* ───────────── Menu regroupé par famille ───────────── */
.sidebar { overflow-y: auto; }
.nav { gap: 1px; }
.nav a { padding-top: 7px; padding-bottom: 7px; }
.nav-group { margin-top: 8px; }
.nav-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 6px 10px 4px;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); border-radius: 6px; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: "▾"; margin-left: auto; font-size: .8rem; opacity: .7; transition: transform .15s; }
.nav-group:not([open]) > summary::after { transform: rotate(-90deg); }
.nav-group > summary:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.nav-group[data-current] > summary { color: #fff; }
.nav-group > a { margin-left: 4px; }

/* Accueil : raccourcis regroupés par famille (mêmes familles que le menu) */
.home-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.home-group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); }
.hg-title { display: flex; align-items: center; gap: 8px; margin: 2px 4px 8px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hg-title .icon { width: 16px; height: 16px; color: var(--navy); }
.hg-tiles { display: grid; gap: 2px; }
.hg-tile { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.hg-tile:hover { background: var(--info-soft); text-decoration: none; }
.hg-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--line-2); color: var(--navy); flex: none; }
.hg-icon .icon { width: 16px; height: 16px; }
.hg-label { display: flex; flex-direction: column; font-weight: 600; font-size: .9rem; min-width: 0; }
.hg-label small { font-weight: 500; font-size: .74rem; color: var(--muted); }
.hg-count { margin-left: auto; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--line-2); font-size: .76rem; font-weight: 700; display: grid; place-items: center; }
.hg-tile.danger .hg-count { background: #d93025; color: #fff; }
.hg-tile.danger .hg-label small { color: #b42318; }
.section-eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.section-eyebrow .icon { width: 13px; height: 13px; }
.doc-code { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: var(--info-soft); color: var(--navy); font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .04em; }

/* Offres fournisseurs */
.offer-sup { margin-top: 16px; }
.offer-sup-title { font-size: 1.05rem; margin: 0 0 8px; }
.offer-card { padding: 0; margin-bottom: 10px; overflow: hidden; }
.offer-card > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 12px 16px; }
.offer-card > summary::-webkit-details-marker { display: none; }
.offer-card > summary::before { content: "▸"; color: var(--muted); }
.offer-card[open] > summary::before { content: "▾"; }
.offer-card[open] > summary { border-bottom: 1px solid var(--line-2); }
.offer-bulk { border-top: 1px solid var(--line-2); background: #fafbfd; }
.delta-up { color: #b42318; font-weight: 700; } .delta-down { color: #15803d; font-weight: 700; }

/* ───────────── Envoi de fichiers (composant unique) ───────────── */
.upload-box { display: grid; gap: 12px; margin-top: 14px; padding: 14px; border: 1px solid var(--line-2); border-radius: 12px; background: #fafbfd; }
.upload-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; color: var(--ink); }
.upload-title .icon { width: 16px; height: 16px; color: var(--navy); }
.upload-actions { display: flex; justify-content: flex-end; }
.fdrop { display: grid; gap: 8px; }
.fdrop-zone { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 18px; border: 2px dashed #c9d2de; border-radius: 12px;
  background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.fdrop-zone:hover, .fdrop.over .fdrop-zone { border-color: var(--navy); background: var(--info-soft); }
.fdrop.over .fdrop-zone { box-shadow: 0 0 0 4px rgba(31, 58, 95, .08); }
.fdrop-zone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.fdrop-zone input[type=file]:focus-visible + .fdrop-ico { outline: 2px solid var(--navy); outline-offset: 3px; }
.fdrop-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--info-soft); color: var(--navy); }
.fdrop-ico .icon { width: 20px; height: 20px; }
.fdrop-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fdrop-text b { font-size: .92rem; color: var(--ink); }
.fdrop-text span { font-size: .78rem; color: var(--muted); }
.fdrop-text u { color: var(--navy); font-weight: 600; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
.fdrop-btn { flex: none; pointer-events: none; }
.fdrop.compact .fdrop-zone { padding: 10px 12px; gap: 10px; border-width: 1.5px; }
.fdrop.compact .fdrop-ico { width: 34px; height: 34px; }
.fdrop.compact .fdrop-ico .icon { width: 16px; height: 16px; }
.fdrop.has-files .fdrop-zone { border-style: solid; border-color: #bcd0ea; }
.fdrop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fdrop-list li { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .84rem; }
.fdrop-list .fl-ico { flex: none; }
.fdrop-list .fl-name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fdrop-list .fl-size { flex: none; color: var(--muted); font-size: .76rem; }
.fdrop-list .fl-x { flex: none; width: 24px; height: 24px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.fdrop-list .fl-x:hover { background: var(--danger-soft); color: #b42318; }
.fdrop-list li.too-big { border-color: #f3c2c2; background: var(--danger-soft); }
.fdrop-list li.too-big .fl-size { color: #b42318; font-weight: 700; }
.fdrop-current { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; }
.fdrop-current .icon { width: 14px; height: 14px; }
@media (max-width: 600px) { .fdrop-btn { display: none; } .fdrop-zone { padding: 14px; } }
.upload-box, .fdrop { min-width: 0; }
.upload-box > *, .fdrop > * { min-width: 0; }
.fdrop-text span { overflow-wrap: anywhere; }
@media (max-width: 600px) { .upload-actions .btn { width: 100%; justify-content: center; } }
.fdrop-list { grid-template-columns: minmax(0, 1fr); }

/* Import : éléments manquants à créer */
.missing-card { margin-top: 16px; border-color: #f2d9a6; }
.missing-card .card-head { background: var(--warn-soft); }
.missing-card .card-head h3 { display: flex; align-items: center; gap: 8px; color: #6e4200; }
.missing-body { display: grid; gap: 12px; }
.missing-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.missing-items { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 600; font-size: .85rem; color: var(--navy); text-decoration: none; }
.chip-btn:hover { border-color: var(--navy); background: var(--info-soft); }
.chip-btn small { font-weight: 500; color: var(--muted); }
.chip-btn .icon { width: 14px; height: 14px; }
.chip-btn.disabled { color: var(--muted); }
.btn.xs { padding: 3px 8px; min-height: 24px; font-size: .76rem; gap: 4px; }
.btn.xs .icon { width: 12px; height: 12px; }
.row-fix { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.err-text { color: var(--danger); font-weight: 600; }

/* ───────────── Travail en équipe : commentaires, historique, projets, caisse, calendrier ───────────── */
.collab { margin-top: 16px; }
.collab-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .collab-grid { grid-template-columns: minmax(0, 1fr); } }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 4px; }
.note-form-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.mention { color: var(--navy); background: var(--info-soft); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention-wrap { position: relative; }
.mention-wrap textarea { width: 100%; }
.mention-suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; max-width: 360px; }
.versions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-bottom: 1px solid var(--line-2); }
.versions .small { width: 100%; }
.timeline { list-style: none; margin: 0; padding: 6px 16px 12px; max-height: 460px; overflow: auto; }
.timeline > li { position: relative; padding: 8px 0 8px 18px; border-left: 2px solid var(--line); margin-left: 4px; }
.timeline > li::before { content: ""; position: absolute; left: -6px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--navy); }
.tl-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.tl-changes { margin: 4px 0 0; padding-left: 16px; font-size: .84rem; color: var(--ink-2); overflow-wrap: anywhere; }
.tip { position: fixed; z-index: 400; max-width: 260px; padding: 5px 9px; border-radius: 6px; background: #17212f; color: #fff; font-size: .76rem; font-weight: 500;
  line-height: 1.3; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.ok-text { color: var(--ok); font-weight: 700; }
.row-actions form { display: inline-block; margin: 0; }
.check-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px; }
.project-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.project-card:hover { border-color: var(--navy); box-shadow: var(--shadow-lg); text-decoration: none; }
.pc-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.pc-desc { margin: 0; font-size: .86rem; color: var(--ink-2); }
.pc-foot { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: auto; }
.avatars { display: inline-flex; } .avatars .avatar { margin-right: -6px; border: 2px solid var(--surface); }
.progress { height: 6px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.progress.flat { border-radius: 0; height: 4px; }
.progress span { display: block; height: 100%; background: var(--ok); }
.task-list { list-style: none; margin: 0; padding: 4px 16px; }
.task-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.task-list li:last-child { border-bottom: 0; }
.task-list form { margin: 0; }
.task-list .grow { flex: 1; min-width: 0; }
.task-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #b9c3d1; background: var(--surface); display: grid; place-items: center; cursor: pointer; padding: 0; color: #fff; }
.task-check .icon { width: 14px; height: 14px; }
.task-list li.done .task-check { background: var(--ok); border-color: var(--ok); }
.task-list li.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-add { border-top: 1px solid var(--line-2); }
.cash-check { display: grid; gap: 12px; }
.cash-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.cash-line.big { font-size: 1.15rem; padding-top: 10px; border-top: 2px solid var(--line); }
.cash-decide { display: grid; gap: 8px; margin-top: 6px; }
.row-strong td { font-weight: 700; background: #fafbfd; }
.total-row td { border-top: 2px solid var(--line); }
.cal-head { gap: 8px; flex-wrap: wrap; } .cal-head h3 { min-width: 150px; text-align: center; } .cal-head .grow { flex: 1; }
.cal-legend { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.cal { width: 100%; min-width: 760px; border-collapse: collapse; table-layout: fixed; }
.cal th { padding: 8px; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; border-bottom: 1px solid var(--line); }
.cal td { vertical-align: top; height: 104px; padding: 4px 5px; border: 1px solid var(--line-2); }
.cal td.out { background: #fafbfd; } .cal td.out .cal-day { color: #b3bccb; }
.cal td.we { background: #f7f8fb; }
.cal td.today { box-shadow: inset 0 0 0 2px var(--orange); }
.cal-day { font-size: .78rem; font-weight: 700; color: var(--ink-2); margin-bottom: 3px; }
.cal-ev { display: block; margin-bottom: 2px; padding: 1px 6px; border-radius: 4px; font-size: .72rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none; border-left: 3px solid; background: var(--line-2); color: var(--ink); }
a.cal-ev:hover { filter: brightness(.95); text-decoration: none; }
.cal-ev.k-absence { background: #fdecef; border-color: #d6455d; color: #8c1a2e; }
.cal-ev.k-absence.pending { background: repeating-linear-gradient(135deg, #fdecef, #fdecef 6px, #fff 6px, #fff 12px); }
.cal-ev.k-delivery { background: var(--info-soft); border-color: #2f6fca; color: #194a85; }
.cal-ev.k-reception { background: #fff3e0; border-color: #e08a1e; color: #7a4a05; }
.cal-ev.k-delivered, .cal-ev.k-received { background: var(--ok-soft); border-color: #2f9e5b; color: #0f5a2b; }
.cal-ev.k-cash_in { background: #f1edfb; border-color: #7a5cd0; color: #45308c; }
.cal-ev.k-project { background: #eef2f6; border-color: #5c6b80; color: #2f3b4c; }
.sup-cell .sup-line { line-height: 1.5; white-space: nowrap; }
.pref-star { color: var(--orange); margin-left: 4px; font-size: .8rem; }
.dispo-ok { color: var(--ok); font-weight: 700; }
.line-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: 0 24px 60px rgba(15, 23, 42, .35); color: var(--ink); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.modal-body { padding: 16px; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); background: #fafbfd; border-radius: 0 0 14px 14px; }
.modal-foot .grow { flex: 1; }
.collab-grid.single { grid-template-columns: minmax(0, 1fr); }
.cash-line { width: 100%; }
.reset-box { display: grid; gap: 12px; }
.reset-pwd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.reset-pwd code { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; letter-spacing: .06em; padding: 8px 14px; border-radius: 8px; background: var(--info-soft); color: var(--navy); user-select: all; }
form.inline { display: inline; margin: 0; }

/* ───────────── Journal d'audit ───────────── */
.audit-filters input[type=date] { width: auto; min-width: 0; }
.audit-row { cursor: pointer; }
.audit-row:hover td, .audit-row.on td { background: var(--info-soft); }
.audit-row:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; }
.audit-sum { max-width: 520px; font-size: .86rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.who { display: inline-flex; align-items: center; gap: 6px; }
dialog.modal.modal-wide { width: min(860px, calc(100vw - 24px)); }
.audit-detail { display: grid; gap: 14px; max-height: calc(100vh - 190px); overflow: auto; }
.audit-detail h4 { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.audit-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0; }
.audit-meta dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.audit-meta dd { margin: 2px 0 0; font-weight: 600; }
.audit-diff { width: 100%; table-layout: fixed; }
.audit-diff col.c-field { width: 28%; } .audit-diff col.c-arrow { width: 32px; }
.audit-diff th[scope=row] { text-align: left; font-weight: 600; color: var(--ink-2); text-transform: none; letter-spacing: 0; font-size: .88rem; }
.audit-diff td { overflow-wrap: anywhere; }
.audit-diff .arrow { text-align: center; color: var(--muted); padding-left: 0; padding-right: 0; }
.audit-diff tr.changed .v-before { color: #8c1a20; background: #fdf1f1; text-decoration: line-through; text-decoration-color: rgba(140, 26, 32, .35); }
.audit-diff tr.changed .v-after { color: #0f5a2b; background: #eefaf2; font-weight: 600; }
.audit-diff tr.same td, .audit-diff tr.same th { color: var(--muted); font-weight: 400; }
.audit-diff.single col.c-field { width: 38%; }
.audit-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.audit-lines li { padding: 6px 10px; border-radius: 6px; border-left: 3px solid; font-size: .88rem; }
.audit-lines li.add { background: #eefaf2; border-color: #2f9e5b; }
.audit-lines li.del { background: #fdf1f1; border-color: #d6455d; }
.audit-lines li.mod { background: var(--info-soft); border-color: #2f6fca; }
details.raw summary { cursor: pointer; font-size: .8rem; color: var(--muted); }
details.raw pre { margin: 8px 0 0; padding: 10px; background: #f6f8fb; border-radius: 8px; font-size: .76rem; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.audit-page .modal-head [data-modal-close], .audit-page .modal-foot [data-modal-close] { display: none; }
@media (max-width: 600px) { .audit-diff col.c-field { width: 34%; } .audit-diff col.c-arrow { width: 18px; } }
.restock-card { margin-top: 16px; border-color: #f3c2c4; }
.restock-card .card-head { background: #fff6f6; }
.restock-body { display: grid; gap: 12px; }
.restock-pos { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.restock-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.restock-form .field:first-child { flex: 1; min-width: 240px; }
.restock-form .qty-input { width: 100px; }
.col-editor { white-space: nowrap; }
.editor { display: inline-flex; align-items: center; gap: 6px; }
.editor > span:last-child { display: grid; line-height: 1.2; }
.editor-name { font-size: .84rem; font-weight: 600; }
.editor-when { font-size: .72rem; color: var(--muted); }
.avatar.xs { width: 20px; height: 20px; font-size: .62rem; flex: none; }
.last-edit-wrap:empty { display: none; }
.last-edit { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.last-edit .icon { width: 13px; height: 13px; }
.last-edit b { color: var(--ink-2); font-weight: 600; }
.select-add { display: flex; gap: 6px; align-items: stretch; }
.select-add select { flex: 1; min-width: 0; }
.select-add .quick-add { flex: none; padding: 0 10px; }
dialog.quick-dlg { width: min(460px, calc(100vw - 24px)); }
.match-hit { color: var(--ok); font-weight: 600; }

/* ── Veille des avis ── */
table.veille td:nth-child(3) { min-width: 280px; }
.fav { color: var(--orange); }
.chip-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ── Référencement ── */
.match + .match { border-top: 1px solid var(--line); }
.match-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.match-head .grow { flex: 1; }
ul.gaps { list-style: none; padding: 0; margin: 6px 0; color: var(--warn); }
ul.gaps li { display: flex; gap: 6px; align-items: flex-start; }
ul.gaps .icon { width: 14px; height: 14px; margin-top: 3px; flex: none; }
details.run { border-top: 1px solid var(--line); padding: 8px 4px; }
details.run > summary { cursor: pointer; }
.run-body { padding: 8px 0 4px 18px; overflow-x: auto; }

/* ── Marchés : bandeaux chiffrés (libellé / valeur / précision, l'un sous l'autre) ── */
.stat-strip > div > span, .stat-strip > div > b { display: block; }
.stat-strip > div > b { font-size: 1.2rem; font-weight: 800; margin: 2px 0; white-space: nowrap; }
table.data select { min-width: 64px; }

/* ── Marchés publics : tableau de bord ── */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; border-left: 4px solid var(--line); }
.kpi:hover { border-color: var(--navy); }
.kpi b { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.kpi .k-label { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi .k-hint { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.danger { border-left-color: var(--danger); } .kpi.danger b { color: var(--danger); }
.kpi.warn { border-left-color: var(--warn); } .kpi.info { border-left-color: var(--info); }
@media (max-width: 860px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

.tender-cards { display: flex; flex-direction: column; gap: 10px; }
.tender-card { display: grid; grid-template-columns: 92px 1fr 190px; gap: 16px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
.tender-card:hover { border-color: var(--navy); box-shadow: 0 1px 6px rgba(20, 40, 70, .08); }
.tender-card.urgent { border-left: 4px solid var(--danger); }
.tc-date { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: .78rem; color: var(--muted); }
.tc-date b { font-size: 1.6rem; color: var(--navy); line-height: 1; }
.tc-title { font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.tc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.progress { display: block; width: 120px; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 4px; }
.progress > span { display: block; height: 100%; background: var(--ok); }
@media (max-width: 860px) {
  .tender-card { grid-template-columns: 64px 1fr; }
  .tc-side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; text-align: left; }
}

/* ── Étapes d'un marché ── */
.steps { display: flex; list-style: none; margin: 0 0 16px; padding: 0; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.steps .step { flex: 1; min-width: 108px; }
.steps .step a { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; border: 1px solid transparent; height: 100%; }
.steps .step a:hover { background: var(--info-soft); }
.steps .step.current a { border-color: var(--orange); background: var(--surface); }
.steps .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; background: var(--line-2); color: var(--muted); }
.steps .done .dot { background: var(--ok); color: #fff; }
.steps .warn .dot { background: var(--warn); color: #fff; }
.steps .na { opacity: .55; }
.steps .txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.steps .txt b { font-size: .82rem; }
.steps .txt small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps.compact { margin: 8px 0 0; gap: 2px; }
.steps.compact .step { flex: none; min-width: 0; }
.steps.compact .step a { padding: 0; }
.steps.compact .dot { width: 18px; height: 18px; font-size: .62rem; }
.steps.compact .step + .step::before { content: ""; }

/* ── Fiche marché : bandeau des faits ── */
.facts-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 14px; }
.facts-strip > div { padding: 10px 14px; border-right: 1px solid var(--line-2); min-width: 0; }
.facts-strip > div:last-child { border-right: 0; }
.facts-strip .l { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.facts-strip b { display: block; font-size: 1.05rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facts-strip .neg { color: var(--danger); }
@media (max-width: 860px) {
  .facts-strip { grid-template-columns: repeat(2, 1fr); }
  .facts-strip > div { border-bottom: 1px solid var(--line-2); }
  .facts-strip > div.f-status { display: none; }  /* le statut est déjà à côté du titre */
  .steps .step { min-width: 92px; }
  .actionbar { padding: 10px; }
}
.steps.compact .step-in { display: inline-flex; }

/* ── Bordereau d'un marché : lignes en cartes sur téléphone ── */
@media (max-width: 860px) {
  table.bord thead { display: none; }
  table.bord, table.bord tbody, table.bord tfoot { display: block; }
  table.bord tbody tr { display: grid; grid-template-columns: 64px 64px 1fr 1fr; gap: 6px 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.bord tbody td { display: flex; flex-direction: column; padding: 0; border: 0; text-align: left; min-width: 0; }
  table.bord tbody td::before { content: attr(data-label); font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; }
  table.bord tbody td.c-des, table.bord tbody td.c-art { grid-column: 1 / -1; }
  table.bord tbody td.c-act { grid-column: 4; justify-self: end; align-self: end; }
  table.bord tbody td.c-act::before { content: none; }
  table.bord input, table.bord textarea { width: 100% !important; }
  table.bord tfoot tr { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 12px; }
  table.bord tfoot td { display: block; border: 0; padding: 0; text-align: left !important; }
  table.bord tfoot td:empty { display: none; }
}

/* ── Veille : verdicts et cartes sur téléphone ── */
.v-pa { margin-bottom: 4px; }
.chip-btn.v-poursuivre.on { background: var(--ok); border-color: var(--ok); }
.chip-btn.v-ecarter.on { background: var(--danger); border-color: var(--danger); }
.chip-btn.v-etudier.on { background: var(--warn); border-color: var(--warn); }
@media (max-width: 860px) {
  table.veille.stack tbody tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; padding: 12px; }
  table.veille.stack td { display: block; padding: 0; text-align: left; }
  table.veille.stack td::before { content: none; }
  table.veille.stack td.v-sel { grid-row: 1; grid-column: 1; }
  table.veille.stack td.v-date { grid-row: 1; grid-column: 2; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  table.veille.stack td.v-date div { display: inline; }
  table.veille.stack td.v-act { grid-row: 1; grid-column: 3; }
  table.veille.stack td.v-obj, table.veille.stack td.v-buyer { grid-column: 1 / -1; }
  table.veille.stack td.v-place, table.veille.stack td.v-pub { display: inline; grid-column: auto; }
  table.veille.stack td.v-place { grid-column: 1 / 3; }
  table.veille.stack td.v-obj > a { font-weight: 600; }
}

/* ── Marché : barre d'actions et chaîne des documents ── */
.actionbar { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.ab-next { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-chain { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.dc { flex: none; display: flex; flex-direction: column; gap: 2px; min-width: 128px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .8rem; }
.dc > span:first-child { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.dc b { font-size: .88rem; display: inline-flex; align-items: center; gap: 4px; }
.dc b .icon { width: 14px; height: 14px; }
.dc small { color: var(--muted); }
.dc .badge { align-self: flex-start; }
a.dc.on:hover { border-color: var(--navy); background: var(--info-soft); }
a.dc.todo { border-style: dashed; border-color: var(--orange); color: var(--orange); }
a.dc.todo b { color: var(--orange); }
a.dc.todo:hover { background: #fff6ee; }
.dc.off { opacity: .55; border-style: dashed; }
.dc-arrow { align-self: center; color: var(--muted); font-weight: 700; }
.art-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: .78rem; color: var(--navy); }
.art-chip .icon { width: 13px; height: 13px; }
.stock-line { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.stock-line .badge .icon { width: 12px; height: 12px; }

/* Administration → Intelligence artificielle */
#ai .ai-model { display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line-2); }
#ai .ai-model select { max-width: 560px; }
#ai .ai-label { font-weight: 600; font-size: .85rem; }
#ai .ai-providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
#ai .ai-provider { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
#ai .ai-provider.is-active { border-color: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
#ai .ai-provider header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#ai .ai-provider .grow, #ai .ai-actions .grow { flex: 1; }
#ai .ai-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#ai .ai-foot .check { font-weight: 400; white-space: nowrap; }
#ai .ai-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line-2); }
#ai .ai-status { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#ai .ai-meta { margin: 0; padding: 0 16px 12px; }

/* Bordereau : un onglet par lot */
.lot-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.lot-tabs a { display: flex; flex-direction: column; gap: 2px; min-width: 140px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .85rem; }
.lot-tabs a span { color: var(--muted); font-size: .78rem; }
.lot-tabs a .badge { align-self: flex-start; }
.lot-tabs a.on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy-ink); }
.lot-tabs a.on b { color: var(--navy); }

/* Mémoire technique : les étapes */
.memo-steps { margin: 8px 0 0; padding-left: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 8px; }
.memo-steps li { counter-increment: step; position: relative; padding: 8px 10px 8px 40px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: .9rem; }
.memo-steps li::before { content: counter(step); position: absolute; left: 10px; top: 8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--line-2); color: var(--ink-2); }
.memo-steps li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.memo-steps li .small { margin-left: 6px; }

/* ── Marché : navigation par étapes, action suivante, en-tête d'étape ── */
.flow-nav { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; padding-bottom: 2px; }
.flow-step { flex: 1 0 128px; scroll-snap-align: start; display: flex; align-items: flex-start; gap: 8px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; min-width: 0; }
.flow-step:hover { border-color: var(--navy-2); }
.flow-step .dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: var(--line-2); color: var(--ink-2); }
.flow-step .dot .icon { width: 14px; height: 14px; }
.flow-step .txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.flow-step .txt b { font-size: .84rem; }
.flow-step .txt small { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-step.done .dot { background: var(--ok); color: #fff; }
.flow-step.warn .dot { background: var(--warn); color: #fff; }
.flow-step.na { opacity: .6; }
.flow-step.next { border-color: var(--orange); border-style: dashed; }
.flow-step.on { border-color: var(--navy); background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.flow-step.on .txt small { color: var(--navy-ink); }
.flow-step.on .dot { background: #fff; color: var(--navy); }
.flow-step.overview { flex: 0 0 auto; }

.next-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; border-radius: var(--radius);
  background: var(--orange-soft); border: 1px solid #f5c79f; }
.next-card.done { background: var(--ok-soft); border-color: #b9e0c6; }
.next-card .nc-text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.next-card .nc-kicker { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange); }
.next-card.done .nc-kicker { color: var(--ok); }
.next-card .nc-text b { font-size: 1.02rem; }
.next-card .nc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.next-card .btn.accent { font-size: .95rem; padding: 10px 16px; }

.step-guide { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius); }
.step-guide .sg-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--navy); color: #fff; }
.step-guide .sg-text { flex: 1 1 360px; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; color: var(--ink-2); min-width: 0; }
.step-guide .sg-text b { font-size: 1rem; color: var(--ink); }
.step-guide .sg-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.step-guide .sg-actions:empty { display: none; }

.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 12px rgba(16, 24, 40, .06); }
.actionbar .ab-head { display: flex; align-items: baseline; gap: 8px; }
.actionbar .ab-head b { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 720px) {
  .flow-step { flex-basis: 132px; }
  .next-card .nc-actions, .next-card .nc-actions .btn, .next-card .nc-actions form { width: 100%; }
  .next-card .nc-actions .btn { justify-content: center; }
  .sticky-actions { bottom: 64px; }
}

.tc-next { margin-top: 6px; font-size: .82rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.v-btns { display: flex; flex-direction: column; gap: 4px; align-items: stretch; min-width: 112px; }
.v-btns .btn { justify-content: center; }
@media (max-width: 720px) { .v-btns { flex-direction: row; flex-wrap: wrap; } }

.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; width: 100%; }
.alert-row .alert-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.auto-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-size: .9rem; }
.auto-status > span { flex: 1 1 320px; }
.auto-status.on { border-left: 4px solid var(--ok); }
.auto-status.off { border-left: 4px solid var(--warn); background: var(--warn-soft); }
.auto-status.late { border-left: 4px solid var(--danger); background: var(--danger-soft); }

/* Préanalyse : fiche de décision */
.decision { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin: 6px 0 10px; }
.dc-verdict { flex: none; width: 112px; padding: 10px; border-radius: var(--radius); text-align: center; display: flex; flex-direction: column; gap: 2px; }
.dc-verdict.ok { background: var(--ok-soft); color: var(--ok); }
.dc-verdict.warn { background: var(--warn-soft); color: var(--warn); }
.dc-verdict.danger { background: var(--danger-soft); color: var(--danger); }
.dc-score { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.dc-score small { font-size: .8rem; font-weight: 600; opacity: .7; }
.dc-main { flex: 1 1 320px; min-width: 0; }
.dc-headline { font-size: 1.02rem; font-weight: 600; margin: 0 0 8px; }
.dc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.dc-chips .chip { font-size: .8rem; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.dc-h { margin: 14px 0 6px; font-size: .9rem; }
.dc-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dc-checks li { display: flex; gap: 10px; align-items: flex-start; padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); }
.dc-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.dc-checks .ok .dc-ico { background: var(--ok-soft); color: var(--ok); }
.dc-checks .bad { border-color: #f3c2c4; background: var(--danger-soft); }
.dc-checks .bad .dc-ico { background: var(--danger); color: #fff; }
.dc-checks .tbd .dc-ico { background: var(--warn-soft); color: var(--warn); }
.dc-actions { margin: 0; padding-left: 20px; }
.dc-actions li { margin: 3px 0; }
/* ───────────── Barre de document (actions, étapes, documents liés) ───────────── */
.docbar { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 16px; box-shadow: var(--shadow); }
.db-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
.db-crumbs { font-size: 1.05rem; } .db-crumbs a { font-weight: 600; } .db-crumbs b { font-family: var(--mono); }
.db-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.db-pager { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.db-pager .btn { min-width: 32px; justify-content: center; font-weight: 700; }
.btn.disabled { opacity: .35; pointer-events: none; }
.db-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: #fafbfd; }
.db-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.db-actions form { margin: 0; display: inline-flex; }
.db-actions .btn { font-weight: 600; }
.btn.act { background: #0f7b74; border-color: #0f7b74; color: #fff; }
.btn.act:hover { background: #0b625c; border-color: #0b625c; color: #fff; }
.db-steps { list-style: none; display: flex; margin: 0; padding: 0; flex-wrap: wrap; }
.db-steps li { position: relative; padding: 7px 14px 7px 22px; font-size: .82rem; font-weight: 600; color: var(--muted); background: var(--line-2);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-left: -6px; }
.db-steps li:first-child { padding-left: 14px; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); margin-left: 0; border-radius: 6px 0 0 6px; }
.db-steps li.done { background: #dfeee9; color: #1d5c47; }
.db-steps li.current { background: var(--navy); color: #fff; }
.db-steps li.off { background: var(--danger-soft); color: var(--danger); }
.db-smart { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line-2); }
.smart { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-right: 1px solid var(--line-2); color: var(--ink); text-decoration: none; cursor: pointer; list-style: none; }
.smart::-webkit-details-marker { display: none; }
.smart:hover { background: var(--info-soft); text-decoration: none; }
.smart .icon { width: 20px; height: 20px; color: var(--navy); }
.smart > span { display: grid; line-height: 1.15; } .smart b { font-size: .92rem; } .smart small { color: var(--muted); font-size: .74rem; }
.db-more, .smart-multi { position: relative; }
.db-more > summary, .smart-multi > summary { list-style: none; } .db-more > summary::-webkit-details-marker { display: none; }
.db-menu { position: absolute; z-index: 80; top: calc(100% + 4px); right: 0; min-width: 240px; padding: 6px; display: grid; gap: 2px; box-shadow: var(--shadow-lg); }
.smart-multi .db-menu { left: 0; right: auto; }
.db-menu > a, .db-menu > form > button, .db-menu .menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; background: none;
  border-radius: 6px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none; }
.db-menu > a:hover, .db-menu > form > button:hover { background: var(--info-soft); text-decoration: none; }
.db-menu form { margin: 0; }
.db-menu .menu-sep { border-top: 1px solid var(--line-2); margin: 4px 0; }
.db-menu .menu-form { display: grid; gap: 6px; padding: 6px 10px; }
.db-menu .danger-item { color: var(--danger); }
@media (max-width: 700px) { .db-steps li { padding: 6px 10px 6px 16px; font-size: .74rem; } .db-main { padding: 10px; } }
.doc-title { margin: 4px 0 14px; }
.doc-title h1 { font-family: var(--mono); font-size: 1.7rem; margin: 0; }
.doc-title .sub { margin: 4px 0 0; }
.doc-party { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px; margin: 2px 2px 2px 0; border-radius: 8px; background: var(--info-soft); }
.doc-party small { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.doc-party a { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
@media (max-width: 700px) { .db-steps { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; } .db-steps li { white-space: nowrap; } }

/* ───────────── Vue d'ensemble d'une affaire + aperçu au survol ───────────── */
.flow { display: grid; gap: 14px; margin-top: 16px; }
.flow-lane { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.flow-lane > h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-size: .95rem; }
.flow-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(190px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.flow-col { display: grid; gap: 8px; align-content: start; position: relative; }
.flow-col:not(:last-child)::after { content: "›"; position: absolute; right: -10px; top: 0; color: var(--muted); font-weight: 700; }
.flow-col-h { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fcard { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; }
a.fcard:hover { border-color: var(--navy); box-shadow: var(--shadow-lg); text-decoration: none; }
.fcard.is-current { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(232, 121, 30, .18); }
.fcard.empty-card { color: var(--muted); border-style: dashed; text-align: center; background: #fafbfd; }
.fc-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.fc-type { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; color: var(--muted); font-weight: 600; }
.fc-type .icon { width: 13px; height: 13px; }
.fc-num { font-family: var(--mono); font-weight: 700; font-size: .95rem; }
.fc-meta, .fc-extra { font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }
.fc-amt { font-weight: 700; font-size: .88rem; }
.prog .row-done td { background: #f4fbf6; }
.peek { position: fixed; z-index: 450; width: 340px; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px 14px; font-size: .84rem; display: grid; gap: 8px; }
.peek-head { display: flex; align-items: center; gap: 10px; } .peek-head .icon { width: 22px; height: 22px; color: var(--navy); flex: none; }
.peek-head > div { flex: 1; min-width: 0; } .peek-type { font-size: .7rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.peek-meta { display: grid; gap: 2px; } .peek-amt { font-weight: 700; }
.peek-lines { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line-2); display: grid; gap: 3px; }
.peek-lines li { display: flex; gap: 6px; align-items: baseline; } .peek-lines .pl-des { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.peek-foot { border-top: 1px solid var(--line-2); padding-top: 8px; font-size: .8rem; }
.col-links { min-width: 150px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-family: var(--mono); font-size: .7rem; font-weight: 600; color: var(--navy); text-decoration: none; white-space: nowrap; }
.lchip .icon { width: 11px; height: 11px; }
.lchip:hover { background: var(--navy); color: #fff; border-color: var(--navy); text-decoration: none; }
.lchip.flow-link { color: var(--muted); padding: 2px 5px; }
.lchip.more { font-family: inherit; color: var(--muted); }
.peek { overflow: hidden; }
.peek-lines li { min-width: 0; }
.peek-lines li .mono, .peek-lines li b { flex: none; }
/* Une seule « étape suivante » mise en avant ; les autres actions restent visibles mais secondaires */
.btn.next { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; padding: 9px 16px; box-shadow: 0 2px 6px rgba(232, 121, 30, .3); }
.btn.next:hover { background: #cf6810; border-color: #cf6810; color: #fff; }
.btn.act { background: #fff; border-color: #0f7b74; color: #0f7b74; }
.btn.act:hover { background: #e7f4f2; border-color: #0b625c; color: #0b625c; }
.btn .code-tag { font-family: var(--mono); font-size: .72rem; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .22); margin-left: 2px; }
.btn.act .code-tag, .btn:not(.next) .code-tag { background: var(--line-2); color: var(--ink-2); }
.db-hint { display: flex; gap: 8px; align-items: center; padding: 8px 14px; font-size: .84rem; color: #7a4a05; background: #fff6ea; border-top: 1px solid #f6dfbf; }
.db-hint .icon { width: 15px; height: 15px; color: var(--orange); flex: none; }
.todo-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.todo-title { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-right: 4px; }
.todo-title .icon { width: 14px; height: 14px; }
.todo-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 600; font-size: .84rem; text-decoration: none; }
.todo-chip b { min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--orange); color: #fff; font-size: .76rem; }
.todo-chip.zero { color: var(--muted); } .todo-chip.zero b { background: var(--line-2); color: var(--muted); }
.todo-chip:hover { border-color: var(--navy); text-decoration: none; }
.todo-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; } .todo-chip.on b { background: #fff; color: var(--navy); }
.todo-clear { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; }
.todo-clear .icon { width: 13px; height: 13px; }
details.new-doc > summary { font-weight: 700; color: var(--navy); }

/* ───────────── Parcours de l'affaire (12 étapes, dans l'ordre) ───────────── */
.proc { list-style: none; margin: 0; padding: 10px 10px 12px 30px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 22px; border-top: 1px solid var(--line-2); }
@media (min-width: 1900px) { .proc { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
@media (max-width: 600px) { .proc { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.proc-step { position: relative; min-width: 0; padding: 6px 6px 6px 8px; border-radius: 8px; }
/* Flèche avant chaque étape (dans l'espace entre deux étapes ; en début de rangée, elle marque la suite).
   Verte quand l'étape est faite, orange quand elle l'est en partie. */
.proc-step:not(:first-child)::before { content: "➜"; position: absolute; left: -19px; top: 7px; font-size: 15px; line-height: 1;
  color: #b9c3d1; pointer-events: none; }
.proc-step.done:not(:first-child)::before { color: #2f9e5b; }
.proc-step.part:not(:first-child)::before { color: var(--orange); }
.proc-h { display: flex; align-items: flex-start; gap: 6px; }
.proc-n { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .66rem; font-weight: 800;
  background: var(--line-2); color: var(--muted); }
.proc-l { font-size: .7rem; font-weight: 700; line-height: 1.2; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.proc-b { display: grid; gap: 2px; margin: 5px 0 0 24px; min-height: 16px; min-width: 0; }
.proc-doc { font-family: var(--mono); font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proc-info { font-size: .72rem; color: var(--muted); }
.proc-more { font-size: .72rem; cursor: pointer; color: var(--navy); list-style: none; }
.proc-step.done .proc-n { background: #2f9e5b; color: #fff; } .proc-step.done .proc-l { color: #1d5c47; }
.proc-step.part .proc-n { background: var(--orange); color: #fff; } .proc-step.part .proc-l { color: #7a4a05; }
.proc-step.skip { opacity: .4; }
.proc-step.here { background: var(--info-soft); box-shadow: inset 0 0 0 1px #c4d8f2; }
.proc-step.here .proc-l { color: var(--navy); }
.proc-step.here .proc-n { outline: 2px solid var(--navy); outline-offset: 1px; }
a.proc-h { text-decoration: none; border-radius: 6px; margin: -3px -4px; padding: 3px 4px; }
a.proc-h:hover { background: rgba(31, 58, 95, .08); text-decoration: none; }
a.proc-h:hover .proc-l { color: var(--navy); text-decoration: underline; }
.proc-todo { color: var(--navy); font-weight: 600; }

/* ───────────── Consultation fournisseurs (demande client) ───────────── */
#consultation > .chain-row { padding: 14px 16px; }
.rfq-new { display: grid; gap: 14px; padding: 18px 16px 0; border-top: 1px solid var(--line-2); }
.rfq-new-head h4 { margin: 0; font-size: 1rem; } .rfq-new-head p { margin: 2px 0 0; color: var(--muted); font-size: .84rem; }
.sup-list { display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.sup-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; cursor: pointer; border-top: 1px solid var(--line-2); transition: background .12s; }
.sup-row:first-child { border-top: 0; }
.sup-row[hidden] { display: none; }
.sup-row:hover { background: #f7f9fc; }
.sup-row input { position: absolute; opacity: 0; pointer-events: none; }
.sup-box { flex: none; width: 20px; height: 20px; border-radius: 6px; border: 2px solid #b9c3d1; display: grid; place-items: center; color: transparent; background: #fff; transition: all .12s; }
.sup-box .icon { width: 13px; height: 13px; }
.sup-row:has(input:checked) { background: #fffaf4; box-shadow: inset 3px 0 0 var(--orange); }
.sup-row:has(input:checked) .sup-box { background: var(--orange); border-color: var(--orange); color: #fff; }
.sup-row:has(input:focus-visible) { outline: 2px solid var(--navy); outline-offset: -2px; }
.sup-main { display: grid; min-width: 0; flex: 1; }
.sup-main b { font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-main small { color: var(--muted); font-size: .76rem; }
.sup-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.sup-pref { padding: 1px 8px; border-radius: 999px; background: #fdf0dc; color: #8a5a08; font-size: .74rem; font-weight: 700; }
.sup-lines { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; } .sup-lines b { color: var(--ink); font-size: .9rem; }
.sup-more > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; font-size: .86rem; font-weight: 600; color: var(--navy); padding: 4px 0; }
.sup-more > summary::-webkit-details-marker { display: none; }
.sup-more > summary .icon { width: 15px; height: 15px; transition: transform .15s; }
.sup-more[open] > summary .icon { transform: rotate(45deg); }
.sup-more[open] > summary { margin-bottom: 10px; }
.sup-filter { width: 100%; margin-bottom: 8px; }
.sup-list-more { max-height: 340px; overflow-y: auto; }
.rfq-new-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 4px -16px 0; padding: 14px 16px; border-top: 1px solid var(--line); background: #fafbfd;
  border-radius: 0 0 var(--radius) var(--radius); }
.sup-count { flex: 1; font-size: .88rem; color: var(--muted); } .sup-count b { color: var(--ink); font-size: 1rem; }
.rfq-due { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.rfq-due input { width: auto; }
@media (max-width: 600px) {
  .sup-row { gap: 10px; padding: 12px; flex-wrap: wrap; } .sup-meta { flex-basis: 100%; padding-left: 30px; }
  .sup-main b { white-space: normal; }
  .rfq-new-foot { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 5; }
  .sup-count { flex-basis: 100%; } .rfq-due { flex: 1; } .rfq-new-foot .btn { width: 100%; justify-content: center; }
}
.dc-checks .grow { flex: 1; min-width: 0; }

/* Retouches du parcours des marchés */
.flow-step.on { opacity: 1; }
.next-card.slim { padding: 8px 12px; gap: 10px; }
.next-card.slim .nc-text { flex-direction: row; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.next-card.slim .nc-text > .small { display: none; }
.next-card.slim .nc-text b { font-size: .92rem; }
.next-card.slim .btn.accent { font-size: .85rem; padding: 6px 12px; }
.memo-intro .memo-tools { border-top: 1px solid var(--line-2); border-bottom: 0; }

/* Codes couleur : à faire (ambre) ≠ bloquant (rouge) */
.dc-checks .todo { border-color: #f1dfb4; background: var(--warn-soft); }
.dc-checks .todo .dc-ico { background: var(--warn); color: #fff; }
/* Référencement par ligne (demande client) */
.ref-cell { white-space: nowrap; } .ref-cell .badge .icon { width: 12px; height: 12px; }
.ref-cell .btn { margin-left: 6px; } .ref-cell a.small { margin-left: 6px; }

/* Aide flottante « ? » */
.help-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--navy); color: #fff; font-size: 1.3rem; font-weight: 800; box-shadow: 0 8px 22px rgba(16, 24, 40, .25); transition: transform .12s, background .12s; }
.help-fab:hover { transform: translateY(-2px); background: var(--orange); }
.help-fab:focus-visible { outline: 3px solid rgba(232, 120, 30, .5); outline-offset: 2px; }
@media (max-width: 860px) { .help-fab { bottom: calc(78px + env(safe-area-inset-bottom)); right: 14px; width: 42px; height: 42px; } }
dialog.modal.help-dlg { width: min(820px, calc(100vw - 24px)); }
.help-body { display: grid; gap: 12px; font-size: .9rem; line-height: 1.5; overflow-y: auto; max-height: calc(100vh - 110px); }
.help-body p, .help-body h4 { margin: 0; } .help-body h4 { margin-top: 6px; font-size: .95rem; }
.help-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.help-prompt { border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.help-prompt > summary { cursor: pointer; padding: 9px 12px; font-weight: 600; font-size: .86rem; }
.help-prompt pre { margin: 0; padding: 12px; border-top: 1px solid var(--line-2); white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .76rem; max-height: 360px; overflow: auto; }

/* Parcours de l'affaire replié : barre de progression + étape suivante */
.proc-wrap { border-top: 1px solid var(--line-2); }
.proc-sum { display: flex; align-items: center; gap: 14px; padding: 9px 14px; cursor: pointer; list-style: none; font-size: .82rem; color: var(--muted); }
.proc-sum::-webkit-details-marker { display: none; }
.proc-sum:hover { background: #f7f9fc; }
.proc-bar { display: flex; gap: 3px; flex: none; }
.proc-bar i { width: 16px; height: 6px; border-radius: 3px; background: var(--line); }
.proc-bar i.done { background: #2f9e5b; } .proc-bar i.part { background: var(--orange); } .proc-bar i.skip { background: var(--line-2); }
.proc-bar i.here { outline: 2px solid var(--navy); outline-offset: 1px; }
.proc-sum-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .proc-sum-t b { color: var(--ink-2); }
.proc-sum-next { color: var(--navy); font-weight: 600; }
.proc-sum-cta { flex: none; font-weight: 600; color: var(--navy); }
.proc-sum-cta::after { content: " ▾"; } .proc-wrap[open] .proc-sum-cta::after { content: " ▴"; }
.proc-wrap > .proc { border-top: 1px solid var(--line-2); }
@media (max-width: 600px) { .proc-bar i { width: 9px; } .proc-sum { gap: 10px; padding: 9px 12px; } .proc-sum-cta { display: none; } }

.help-dot { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--line-2); color: var(--muted); font-size: .7rem; font-weight: 800; cursor: help; vertical-align: 1px; }
.restock-det > summary { cursor: pointer; font-size: .84rem; font-weight: 600; margin: 4px 0; }
.line-cost { font-size: .72rem; color: var(--muted); margin-top: 3px; white-space: nowrap; cursor: help; }

/* Accueil : indicateurs à surveiller (le menu complet reste dans la barre latérale) */
.watch { margin-top: 22px; }
.watch-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.watch-chip { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.watch-chip:hover { border-color: var(--navy); text-decoration: none; }
.watch-chip > .icon { flex: none; width: 18px; height: 18px; color: var(--navy); }
.watch-chip span { flex: 1; min-width: 0; display: grid; } .watch-chip b { font-size: .88rem; } .watch-chip small { font-size: .74rem; color: var(--muted); }
.watch-chip em { font-style: normal; font-weight: 800; font-size: .8rem; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: grid; place-items: center; background: var(--line-2); color: var(--ink-2); }
.watch-chip.danger em { background: var(--danger); color: #fff; } .watch-chip.danger small { color: var(--danger); }
.upload-more > summary { list-style: none; display: inline-flex; margin-top: 4px; } .upload-more > summary::-webkit-details-marker { display: none; }
.upload-more[open] > summary { margin-bottom: 10px; }

/* Informations d'un document figé : repliées (lecture seule) */
.doc-info > summary { list-style: none; } .doc-info > summary::-webkit-details-marker { display: none; }
.doc-info-sum { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; font-size: .88rem; }
.doc-info-sum .icon { width: 16px; height: 16px; color: var(--navy); flex: none; }
.doc-info-sum .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; }
.doc-info-cta { flex: none; font-weight: 600; color: var(--navy); font-size: .82rem; }
.doc-info[open] > .doc-info-sum { border-bottom: 1px solid var(--line-2); }
.doc-info[open] .doc-info-cta { visibility: hidden; }
.add-ref > summary { list-style: none; display: inline-flex; } .add-ref > summary::-webkit-details-marker { display: none; }
.add-ref[open] > summary { margin-bottom: 12px; }
