/* OPEX Tracker — feuille de style */
:root {
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --border: #e2e5ec;
  --border-strong: #cdd2dc;
  --text: #1b2130;
  --text-2: #4a5468;
  --muted: #7c8598;
  --accent: #3552d4;
  --accent-soft: #e9edfd;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16);
  --radius: 10px;
  --c-new: #16a34a;
  --c-mod: #d97706;
  --c-del: #dc2626;
  --c-same: #94a3b8;
  --c-merge: #7c3aed;
  --c-split: #ea580c;
  --c-move: #2563eb;
  --c-rename: #0d9488;
  --av: #64748b;
  --ap: #3552d4;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14.5px; font-weight: 600; }
h4 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 0 0 .5em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.up { color: var(--c-new); }
.down { color: var(--c-del); }
.num { text-align: right; white-space: nowrap; }
.clickable { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- Coquille ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; height: 100vh; }
.sidebar { background: #161b2e; color: #c8cede; display: flex; flex-direction: column; padding: 16px 10px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand strong { color: #fff; display: block; font-size: 15px; letter-spacing: .02em; }
.brand small { color: #8b93a8; font-size: 11.5px; }
.logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6b7389; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: #c8cede; font-size: 13.5px; }
.nav-item:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav-item.active { background: rgba(255, 255, 255, .11); color: #fff; font-weight: 550; }
.nav-ic { width: 18px; text-align: center; opacity: .8; }
.nav-foot { margin-top: auto; padding: 16px 10px 0; font-size: 11px; color: #6b7389; }
.content { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.scope { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: 8px; border: 1px solid transparent; color: var(--text-2); }
.scope.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.scope-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.scope select { max-width: 280px; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 12.5px; text-decoration: underline; }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.presence i { width: 8px; height: 8px; border-radius: 50%; background: var(--c-same); }
.presence.on i { background: var(--c-new); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-new) 20%, transparent); }
.user { display: inline-flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--border); padding: 3px 10px 3px 3px; border-radius: 99px; cursor: pointer; font: inherit; color: var(--text); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-size: 11px; font-weight: 650; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; background: #5b6478; }
main { flex: 1; overflow: auto; }
.page { padding: 22px 28px 60px; max-width: 1640px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 900px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Contrôles ---------- */
select, input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], input:not([type]), textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 9px; width: 100%;
}
select { padding-right: 26px; }
.topbar select { width: auto; padding: 5px 26px 5px 8px; font-size: 13px; }
textarea { resize: vertical; min-height: 38px; line-height: 1.4; }
select:focus, input:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 520; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-danger { background: var(--c-del); border-color: var(--c-del); color: #fff; }
.btn-danger-ghost { border-color: transparent; background: transparent; color: var(--c-del); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--c-del) 8%, transparent); }
.btn-sm { padding: 4px 8px; font-size: 12.5px; }
.icon { display: inline-flex; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 560; box-shadow: var(--shadow); }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tb-group { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-2); cursor: pointer; }
.search { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; padding: 0 8px; color: var(--muted); min-width: 240px; }
.search input { border: 0; padding: 6px 0; outline: none; }
.search:focus-within { border-color: var(--accent); }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.ring { background: transparent; border: 2px solid var(--text); }
.badge { --b: var(--c-same); display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 560; color: color-mix(in srgb, var(--b) 80%, #000); background: color-mix(in srgb, var(--b) 13%, transparent); border: 1px solid color-mix(in srgb, var(--b) 28%, transparent); white-space: nowrap; margin-right: 3px; }
.level { display: inline-flex; gap: 3px; }
.level i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.level i.on { background: var(--c-merge); }
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; min-width: 60px; }
.progress > div { height: 100%; border-radius: 99px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.chip.small { padding: 1px 8px; font-size: 11.5px; }
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 3px; }
.cchip { display: inline-block; padding: 0 6px; border-radius: 4px; background: #1b2130; color: #fff !important; font-size: 10.5px; font-weight: 650; letter-spacing: .03em; margin-right: 3px; text-decoration: none !important; }
.code { display: inline-block; padding: 1px 7px; border-radius: 5px; background: #1b2130; color: #fff; font-size: 11px; font-weight: 650; letter-spacing: .04em; margin-right: 8px; vertical-align: 2px; }
.code.big { font-size: 13px; padding: 3px 9px; vertical-align: 3px; }
.meteo { font-size: 17px; color: var(--c-mod); }
.meteo.big { font-size: 26px; }
.reflink { color: var(--text); border-bottom: 1px dotted var(--muted); }
.reflink:hover { color: var(--accent); text-decoration: none; }
.lines div { position: relative; }
.empty { padding: 36px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.callout { margin-top: 10px; padding: 9px 12px; border-left: 3px solid var(--c-mod); background: color-mix(in srgb, var(--c-mod) 7%, transparent); border-radius: 4px; font-size: 13px; }

/* ---------- Cartes & grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card > header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px 0; }
.card > header small { display: block; margin-top: 2px; font-size: 12px; }
.card-body { padding: 13px 16px 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); gap: 16px; }
.align-start { align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpis-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.kpi.clickable:hover { border-color: var(--accent); }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi strong { font-size: 22px; font-weight: 650; letter-spacing: -.01em; }
.kpi-sub { font-size: 12px; color: var(--text-2); }
.kpi-wide { grid-column: span 2; }
.stack-v { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.card .table-wrap { border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--text); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable:hover td { background: #f7f8fc; }
.table.compact td { padding: 6px 10px; }
.fromto { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.arr { color: var(--muted); }
.pchips { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.pchip { font-size: 10.5px; padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--c-merge) 10%, transparent); color: color-mix(in srgb, var(--c-merge) 80%, #000); border: 1px solid color-mix(in srgb, var(--c-merge) 22%, transparent); white-space: nowrap; }
.etpcell b { font-weight: 600; }

/* ---------- Formulaires (panneau latéral) ---------- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .2s ease; z-index: 50; border-left: 1px solid var(--border); }
.drawer.open { transform: none; }
.drawer > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.drawer > header small { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.drawer > header h2 { margin-top: 2px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.drawer > footer { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.drawer-meta { margin-top: 18px; font-size: 11.5px; color: var(--muted); }
.kbd-hint { margin-right: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.req { color: var(--c-del); }
.help { color: var(--muted); font-size: 11.5px; }
.field-section { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; color: var(--muted); padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pair-av { padding-left: 8px; border-left: 3px solid var(--av); }
.pair-ap { padding-left: 8px; border-left: 3px solid var(--ap); }
.pair-head { grid-column: 1 / -1; position: sticky; top: -16px; background: var(--surface); z-index: 2; padding: 8px 0 4px; margin-bottom: -8px; border-bottom: 1px solid var(--border); }
.pair-head .pair span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding-left: 11px; }
.tag-av { color: var(--av); }
.tag-ap { color: var(--ap); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; }
.switch span::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: transform .15s; box-shadow: var(--shadow); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch em { font-style: normal; font-size: 12.5px; color: var(--text-2); }
.range { display: flex; align-items: center; gap: 10px; }
.range input { flex: 1; accent-color: var(--accent); }
.range output { width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.multi { display: flex; flex-direction: column; gap: 6px; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 10; left: 0; right: 0; top: calc(100% + 2px); max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.picker-item { padding: 5px 8px; border-radius: 5px; cursor: pointer; font-size: 13px; display: flex; flex-direction: column; }
.picker-item small { color: var(--muted); font-size: 10.5px; }
.picker-item.active, .picker-item:hover { background: var(--accent-soft); }
.picker-empty { padding: 8px; color: var(--muted); font-size: 12.5px; }
.seg-level button.on { background: var(--c-merge); color: #fff; }

/* ---------- Dialogues & toasts ---------- */
.dialog { border: 0; border-radius: 12px; padding: 20px 22px; width: min(460px, 92vw); box-shadow: var(--shadow-lg); }
.dialog-wide { width: min(620px, 94vw); }
.dialog::backdrop { background: rgba(16, 22, 38, .4); }
.dialog h3 { font-size: 16px; margin-bottom: 10px; }
.dialog-body { color: var(--text-2); margin-bottom: 14px; }
.dialog .form-grid { margin-bottom: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; }
.toast { background: #1b2130; color: #fff; padding: 9px 16px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; opacity: 0; transform: translateY(8px); transition: all .25s; max-width: 640px; }
.toast.in { opacity: 1; transform: none; }
.toast-success { background: #126b37; }
.toast-error { background: #a3221d; }
.toast-remote { background: #2c3a8c; }

/* ---------- Synthèse ---------- */
.chlist { display: flex; flex-direction: column; }
.chrow { display: flex; justify-content: space-between; gap: 14px; padding: 10px 6px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 6px; }
.chrow:last-child { border-bottom: 0; }
.chrow:hover { background: var(--surface-2); }
.chrow-main { min-width: 0; }
.chrow-side { display: flex; align-items: center; gap: 10px; flex: none; }
.chrow-prog { display: flex; align-items: center; gap: 8px; width: 140px; }
.chrow-prog small { width: 34px; text-align: right; color: var(--muted); }
.mvt-list { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; }
.mvt { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.mvt:hover { background: var(--surface-2); }
.mvt i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.mvt small { margin-left: auto; text-align: right; }
.more { display: inline-block; margin-top: 8px; font-size: 13px; }
.stack-bar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; background: var(--surface-2); margin-bottom: 8px; }
.stack-bar > div { height: 100%; border-right: 1px solid var(--surface); }
.heat { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 13px; }
.heat th { font-weight: 600; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 4px 8px; }
.heat tbody th { text-align: left; text-transform: none; font-size: 13px; color: var(--text); letter-spacing: 0; white-space: nowrap; }
.heat td { text-align: center; padding: 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 560; }
.heat td.clickable:hover { outline: 2px solid var(--text); }
.ovlist { display: flex; flex-direction: column; }
.ov { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ov:last-child { border-bottom: 0; }
.ov[onclick], .ov:hover { cursor: pointer; }
.ov:hover { background: var(--surface-2); }
.ov-name { flex: 1; min-width: 0; }
.ov-ch { flex: none; }

/* ---------- Organigramme ---------- */
.org { display: flex; flex-direction: column; gap: 28px; padding: 8px 4px 16px; min-width: max-content; }
.otree { display: flex; flex-direction: column; align-items: center; }
.oroot { position: relative; padding-bottom: 18px; }
.oroot::after { content: ''; position: absolute; left: 50%; bottom: 0; height: 18px; border-left: 1.5px solid var(--border-strong); }
.ocols { display: flex; gap: 14px; position: relative; padding-top: 18px; align-items: flex-start; }
.ocols::before { content: ''; position: absolute; top: 0; left: 120px; right: 120px; border-top: 1.5px solid var(--border-strong); }
.ocol { position: relative; width: 240px; flex: none; }
.ocol::before { content: ''; position: absolute; top: -18px; left: 50%; height: 18px; border-left: 1.5px solid var(--border-strong); }
.ocol > .onode > .ucard { border-top: 3px solid var(--dc); }
.onode { display: flex; flex-direction: column; }
.olist { margin-left: 12px; padding-left: 12px; border-left: 1.5px solid var(--border-strong); display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }
.olist > .onode { position: relative; }
.olist > .onode::before { content: ''; position: absolute; left: -12px; top: 18px; width: 12px; border-top: 1.5px solid var(--border-strong); }
.ohidden { margin: 4px 0 0 24px; font-size: 11.5px; color: var(--muted); }
.ucard { --k: var(--border-strong); position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px 8px; cursor: pointer; transition: box-shadow .15s, opacity .15s, transform .15s; box-shadow: var(--shadow); }
.ucard:hover { box-shadow: 0 0 0 2px var(--accent); }
.ucard.changed { border-left: 4px solid var(--k); background: color-mix(in srgb, var(--k) 5%, var(--surface)); }
.ucard.lvl-0 { min-width: 280px; text-align: center; padding: 10px 16px; background: #1b2130; color: #fff; border-color: #1b2130; }
.ucard.lvl-0 .nature, .ucard.lvl-0 .etp, .ucard.lvl-0 .ucard-total, .ucard.lvl-0 .ucard-resp { color: #aeb5c6; }
.ucard.lvl-0 .ucard-top { justify-content: center; gap: 10px; }
.ucard.lvl-0 .ucard-name { font-size: 15px; }
.ucard.lvl-1 .ucard-name { font-size: 13.5px; }
.ucard-top { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; }
.ucard .nature { text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.ucard .etp { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ucard-name { font-weight: 600; font-size: 13px; line-height: 1.3; margin-top: 1px; }
.ucard-resp { font-size: 11.5px; color: var(--muted); }
.ucard-total { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ucard-diff { margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.kchip { --k: var(--c-same); align-self: flex-start; font-size: 10.5px; font-weight: 650; color: color-mix(in srgb, var(--k) 85%, #000); background: color-mix(in srgb, var(--k) 14%, transparent); border-radius: 4px; padding: 0 5px; margin-right: 3px; display: inline-block; }
.ucard-diff { flex-direction: row; flex-wrap: wrap; }
.ucard-diff .note { width: 100%; font-size: 11.5px; color: var(--text-2); line-height: 1.3; }
.hovering .ucard { opacity: .35; }
.hovering .ucard.hl { opacity: 1; box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); transform: translateY(-1px); }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.compare-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-width: 0; box-shadow: var(--shadow); }
.pane-title { padding: 8px 14px; font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--border); }
.pane-title.av { color: var(--av); border-top: 3px solid var(--av); }
.pane-title.ap { color: var(--ap); border-top: 3px solid var(--ap); }
.pane-scroll { overflow: auto; max-height: calc(100vh - 290px); padding: 12px; }
.pane-scroll.full { max-height: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.pane-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.ghosts { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 10px 14px; }
.ghosts > small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.ghost-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ghost { --k: var(--c-del); border: 1px dashed var(--k); border-radius: 7px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; background: color-mix(in srgb, var(--k) 5%, transparent); }
.ghost em { font-style: normal; font-size: 11px; color: color-mix(in srgb, var(--k) 85%, #000); font-weight: 600; }

/* ---------- Sankey ---------- */
.chart-scroll { overflow-x: auto; }
.sankey { width: 100%; min-width: 900px; height: auto; display: block; font-size: 12px; }
.sk-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; fill: var(--muted); }
.sk-link { opacity: .35; transition: opacity .15s; cursor: pointer; }
.sk-link:hover { opacity: .7; }
.sankey.focus .sk-link { opacity: .07; }
.sankey.focus .sk-link.hl { opacity: .65; }
.sk-node { cursor: pointer; }
.sk-label { font-size: 12.5px; font-weight: 560; fill: var(--text); }
.sk-sub { font-size: 10.5px; fill: var(--muted); }

/* ---------- Carte des interfaces ---------- */
.imap-wrap { display: flex; justify-content: center; }
.imap { width: 100%; max-width: 900px; max-height: 78vh; height: auto; font-size: 12.5px; }
.imap-arc { fill: none; stroke-width: 5; stroke-linecap: round; opacity: .55; }
.imap-link { fill: none; stroke-width: 2; opacity: .75; cursor: pointer; transition: opacity .15s, stroke-width .15s; }
.imap-link.del { stroke-dasharray: 5 4; }
.imap-link:hover { stroke-width: 4; opacity: 1; }
.imap.focus .imap-link { opacity: .08; }
.imap.focus .imap-link.hl { opacity: 1; stroke-width: 3; }
.imap-node { cursor: pointer; }
.imap-node text { fill: var(--text); font-weight: 520; }
.imap.focus .imap-node:not(.hl) { opacity: .3; }
.imap-node:hover text { font-weight: 700; }

/* ---------- Barres ---------- */
.dbars { display: flex; flex-direction: column; gap: 4px; }
.dbar { display: grid; grid-template-columns: minmax(140px, 1.3fr) 1fr minmax(150px, auto); gap: 10px; align-items: center; font-size: 12.5px; padding: 3px 4px; border-radius: 5px; }
.dbar.clickable:hover { background: var(--surface-2); }
.dbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dbar-track { position: relative; height: 12px; }
.dbar-axis { position: absolute; left: 50%; top: -3px; bottom: -3px; border-left: 1px solid var(--border-strong); }
.dbar-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.dbar-fill.pos { background: var(--c-new); }
.dbar-fill.neg { background: var(--c-del); }
.dbar-val { font-variant-numeric: tabular-nums; color: var(--text-2); white-space: nowrap; text-align: right; }

/* ---------- Mandats, instances ---------- */
.mandates { display: flex; flex-direction: column; gap: 12px; }
.mandate { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow); }
.card .mandate { box-shadow: none; }
.mandate:hover { border-color: var(--accent); }
.mandate > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.ba { display: grid; grid-template-columns: 1fr 28px 1fr; gap: 6px; align-items: stretch; }
.ba-av, .ba-ap { padding: 8px 12px; border-radius: 7px; font-size: 13px; }
.ba-av { background: var(--surface-2); border-left: 3px solid var(--av); color: var(--text-2); }
.ba-ap { background: var(--accent-soft); border-left: 3px solid var(--ap); }
.ba-arrow { display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.ba-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; color: var(--muted); }
.ba-ap .ba-tag { color: var(--ap); }
.ba p { margin: 0 0 6px; }
.ba .lines { font-size: 12.5px; }
.mfoot { display: grid; grid-template-columns: 110px 1fr; gap: 3px 10px; margin: 10px 0 0; font-size: 12.5px; }
.mfoot dt { color: var(--muted); font-weight: 600; }
.mfoot dd { margin: 0; }
.icards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.icard { --k: var(--c-same); background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--k); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.icard:hover { border-color: var(--accent); border-top-color: var(--k); }
.icard.gone { opacity: .65; background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 8px, var(--surface-2) 8px, var(--surface-2) 16px); }
.icard header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.icard p { font-size: 13px; margin: 0; }
.icard footer { margin-top: auto; }

/* ---------- Chantiers ---------- */
.group { display: flex; flex-direction: column; gap: 10px; }
.group-title { font-size: 15px; }
.group-title small { color: var(--muted); font-weight: 400; font-size: 13px; }
.ccards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ccard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); }
.ccard:hover { border-color: var(--accent); }
.ccard header { display: flex; align-items: center; gap: 8px; }
.ccard header .badge { margin-left: auto; }
.ccard h3 { font-size: 15.5px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); font-size: 13px; margin: 0; }
.ccard-prog { display: flex; align-items: center; gap: 8px; }
.ccard-prog small { color: var(--muted); width: 34px; text-align: right; }
.counters { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-2); padding-top: 8px; border-top: 1px solid var(--border); }
.counters .zero { color: var(--border-strong); }
.chead { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.chead-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.back { font-size: 12.5px; }
.chead-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--text-2); font-size: 13px; }
.chead-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.chead-status { display: flex; align-items: center; gap: 12px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab { padding: 9px 14px; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.count { font-size: 11px; background: var(--surface-2); border-radius: 99px; padding: 0 7px; color: var(--muted); font-weight: 600; }
.tab.on .count { background: var(--accent-soft); color: var(--accent); }
.tab-body { display: flex; flex-direction: column; gap: 14px; }
.tab-body > div { display: flex; flex-direction: column; gap: 14px; }
.fiche { display: flex; flex-direction: column; gap: 14px; }
.iflist { display: flex; flex-direction: column; gap: 2px; max-height: 620px; overflow-y: auto; }
.ifrow { display: flex; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.ifrow:hover { background: var(--surface-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 5px; }

/* ---------- Activités ---------- */
.vol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.vol { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; position: relative; box-shadow: var(--shadow); }
.vol:hover { border-color: var(--accent); }
.vol header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.vol-bars { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.vol-bars > div { display: grid; grid-template-columns: 42px 1fr 60px; align-items: center; gap: 8px; font-size: 12px; }
.vol-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.vbar { height: 12px; border-radius: 3px; min-width: 2px; }
.vbar.av { background: var(--av); }
.vbar.ap { background: var(--ap); }
.vol-pct { position: absolute; right: 14px; bottom: -2px; font-size: 20px; font-weight: 700; opacity: .16; }

/* ---------- Interfaces ---------- */
.matrix { border-collapse: collapse; font-size: 12.5px; }
.matrix th, .matrix td { border: 1px solid var(--border); padding: 4px 6px; }
.matrix tbody th { text-align: left; font-weight: 560; white-space: nowrap; border-left: 4px solid var(--border); background: var(--surface); position: sticky; left: 0; z-index: 1; }
.matrix th.corner { font-size: 11px; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.matrix th.vert { height: 170px; vertical-align: bottom; padding: 6px 2px; min-width: 30px; background: var(--surface-2); }
.matrix th.vert span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 560; display: inline-block; max-height: 165px; overflow: hidden; text-overflow: ellipsis; border-right: 3px solid transparent; padding-right: 2px; }
.mcell { text-align: center; min-width: 30px; }
.mdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin: 1px; cursor: pointer; }
.mdot:hover { outline: 2px solid var(--text); }
.cadence { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.cad-col small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.cad-item { --k: var(--c-same); padding: 6px 10px; margin-bottom: 6px; border-radius: 6px; background: var(--surface-2); border-left: 3px solid var(--k); font-size: 13px; cursor: pointer; }
.cad-item:hover { background: var(--accent-soft); }

/* ---------- Processus ---------- */
.pwrap { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.pwrap.with-detail { grid-template-columns: minmax(0, 1fr) 380px; }
.pmap { display: flex; flex-direction: column; gap: 20px; }
.pref { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.pdom { margin-top: 12px; }
.pdom h4 { margin-bottom: 6px; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ptile { text-align: left; border: 1px solid var(--border); border-radius: 7px; padding: 6px 8px; font: inherit; font-size: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-height: 58px; color: var(--muted); transition: transform .1s; }
.ptile:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.ptile small { font-size: 10px; font-weight: 650; letter-spacing: .04em; opacity: .8; }
.ptile span { line-height: 1.25; }
.ptile.hit { color: var(--text); border-color: color-mix(in srgb, var(--c-merge) 35%, transparent); }
.ptile.dark { color: #fff; }
.ptile.multi { box-shadow: inset 0 0 0 2px var(--text); }
.ptile.sel { outline: 3px solid var(--accent); outline-offset: 1px; }
.ptile-foot { margin-top: auto; display: flex; gap: 4px; }
.ptile-foot em { font-style: normal; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: rgba(0, 0, 0, .18); color: #fff; border-radius: 3px; padding: 0 4px; }
.ptile:not(.dark) .ptile-foot em { background: rgba(27, 33, 48, .1); color: var(--text); }
.pdetail { position: sticky; top: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 120px); overflow-y: auto; box-shadow: var(--shadow); }
.pdetail header { display: flex; justify-content: space-between; gap: 8px; }
.pdetail header small { color: var(--muted); font-size: 11.5px; }
.pd-sec { display: flex; flex-direction: column; gap: 6px; }
.pd-item { padding: 8px 10px; border-radius: 7px; background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.pd-item:hover { background: var(--accent-soft); }
.pd-item .row { display: flex; align-items: center; gap: 6px; }

/* ---------- Outils ---------- */
.tcat h4 { margin-bottom: 6px; }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tcard { --k: var(--c-same); background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--k); border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.tcard:hover { border-color: var(--accent); border-left-color: var(--k); }
.tcard header { display: flex; justify-content: space-between; gap: 6px; align-items: flex-start; }
.timps { display: flex; flex-direction: column; gap: 2px; }
.tools-compare .pane-body { max-height: none; }

/* ---------- Données & journal ---------- */
.csvlist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.csvbtn { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: 13px; text-align: left; color: var(--text); }
.csvbtn:hover { border-color: var(--accent); }
.csvbtn small { margin-left: auto; color: var(--muted); }
.journal { display: flex; flex-direction: column; }
.jday { margin: 14px 0 6px; text-transform: capitalize; }
.jday:first-child { margin-top: 0; }
.jrow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-bottom: 1px solid var(--border); font-size: 13px; border-radius: 6px; }
.jrow.clickable:hover { background: var(--surface-2); }
.jtime { color: var(--muted); font-variant-numeric: tabular-nums; width: 42px; flex: none; padding-top: 3px; font-size: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .grid-2, .compare { grid-template-columns: 1fr; }
  .pwrap.with-detail { grid-template-columns: 1fr; }
  .pdetail { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .sidebar { flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; }
  .nav-group, .nav-foot, .brand small { display: none; }
  .brand { padding: 0 8px 0 0; }
  .nav-item { white-space: nowrap; }
  .content { height: auto; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .page { padding: 16px 16px 48px; }
  .form-grid { grid-template-columns: 1fr; }
  .kpi-wide { grid-column: auto; }
  .dbar { grid-template-columns: 1fr; }
  .ba { grid-template-columns: 1fr; }
  .ba-arrow { transform: rotate(90deg); }
  .search { min-width: 0; width: 100%; }
}

/* ---------- Impression ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .sidebar, .topbar, .actions, .toolbar, .tabs, .drawer, #toasts, .back, .btn { display: none !important; }
  .app, .content { display: block; height: auto; }
  main { overflow: visible; }
  .page { padding: 0; max-width: none; }
  .card, .kpi, .mandate, .icard, .compare-pane, .ccard, .chead { box-shadow: none; break-inside: avoid; }
  .pane-scroll { max-height: none; overflow: visible; }
  .compare { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Import Excel ---------- */
.xl-card { display: flex; flex-direction: column; gap: 12px; }
.xl-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-2); }
.xl-dialog { width: min(760px, 94vw); }
.xl-dialog .table { margin: 12px 0; }
.xl-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.xl-totals > div { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; }
.xl-totals strong { font-size: 22px; }
.xl-totals small { color: var(--muted); }
.xl-totals .new strong { color: var(--c-new); }
.xl-totals .upd strong { color: var(--c-mod); }
.xl-totals .err strong { color: var(--c-del); }
.xl-issues { margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 12.5px; }
.xl-issues summary { cursor: pointer; font-weight: 600; }
.xl-issues.err summary { color: var(--c-del); }
.xl-issues.warn summary { color: var(--c-mod); }
.xl-issues ul { margin: 6px 0 4px; padding-left: 18px; max-height: 200px; overflow-y: auto; }

.xl-top { margin-right: 4px; }
.xl-steps-big { display: flex; flex-direction: column; gap: 12px; }
.xl-step { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.xl-step h3 { font-size: 15px; margin-bottom: 4px; }
.xl-step .actions { margin-top: 10px; }
.xl-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.xl-pointer { border-left-color: var(--accent); background: var(--accent-soft); }
.outdated { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 200; background: #1b2130; color: #fff; padding: 8px 10px 8px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; font-size: 13px; }
.xl-danger { margin: 12px 0 4px; padding: 10px 14px; border-radius: 8px; border-left: 4px solid var(--c-del); background: color-mix(in srgb, var(--c-del) 8%, transparent); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Vue unifiée avant / après ---------- */
.ucard-u.st-new { --k: var(--c-new); border: 2px solid var(--c-new); background: color-mix(in srgb, var(--c-new) 7%, var(--surface)); }
.ucard-u.st-del { --k: var(--c-del); border: 1.5px dashed var(--c-del); background: repeating-linear-gradient(-45deg, var(--surface), var(--surface) 6px, color-mix(in srgb, var(--c-del) 6%, var(--surface)) 6px, color-mix(in srgb, var(--c-del) 6%, var(--surface)) 12px); box-shadow: none; }
.ucard-u.st-del .ucard-name { text-decoration: line-through; color: var(--text-2); }
.ucard-u.st-evo { --k: var(--c-mod); border: 2px solid var(--c-mod); }
.ucard-u.st-same { --k: var(--c-same); }
.ucard-u.st-ghost { border: 1.5px dashed var(--border-strong); background: transparent; box-shadow: none; opacity: .7; }
.ucard-u.st-ghost .ucard-name { font-style: italic; color: var(--text-2); }
.ucard-u .kchip { --k: inherit; }
.ucard-u.st-new .kchip { --k: var(--c-new); }
.ucard-u.st-del .kchip { --k: var(--c-del); }
.ucard-u.st-evo .kchip { --k: var(--c-mod); }
.ucard-u .kchip.k-rename { --k: var(--c-rename); }
.ucard-old { font-size: 11px; color: var(--muted); text-decoration: line-through; margin-top: 2px; }
.ucard.lvl-0.ucard-u .ucard-old { color: #aeb5c6; }
.legend-u .lg { width: 16px; height: 11px; border-radius: 3px; display: inline-block; }
.lg.st-new { border: 2px solid var(--c-new); background: color-mix(in srgb, var(--c-new) 12%, transparent); }
.lg.st-del { border: 1.5px dashed var(--c-del); }
.lg.st-evo { border: 2px solid var(--c-mod); }
.lg.st-same { border: 1px solid var(--border-strong); }
.lg.st-ghost { border: 1.5px dashed var(--border-strong); opacity: .7; }
/* ---------- Arbre des activités ---------- */
.atree td { vertical-align: middle; }
.atree-name { min-width: 360px; }
.atree-row { display: flex; align-items: flex-start; gap: 4px; }
.atree-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.caret, .caret-sp { flex: none; margin-top: 1px; }
.caret { border: 0; background: none; cursor: pointer; width: 18px; color: var(--text-2); font-size: 12px; padding: 0; }
.caret-sp { display: inline-block; width: 18px; }
.aname { font-weight: 560; }
.atr.st-new .aname { color: color-mix(in srgb, var(--c-new) 85%, #000); }
.atr.st-del .aname { text-decoration: line-through; color: var(--text-2); }
.atr.st-del td { background: color-mix(in srgb, var(--c-del) 4%, transparent); }
.atr.st-ghost td { opacity: .6; }
.atr.st-ghost .aname { font-style: italic; font-weight: 400; }
.atr.st-ghost td:first-child { border-left: 3px dashed var(--border-strong); }
.atr.st-new td:first-child { border-left: 3px solid var(--c-new); }
.atr.st-del td:first-child { border-left: 3px dashed var(--c-del); }
.atr.st-evo td:first-child { border-left: 3px solid var(--c-mod); }
.atr.st-same td:first-child { border-left: 3px solid transparent; }
.stchip { font-size: 10.5px; font-weight: 650; border-radius: 4px; padding: 0 5px; }
.stchip.st-new { color: color-mix(in srgb, var(--c-new) 85%, #000); background: color-mix(in srgb, var(--c-new) 14%, transparent); }
.stchip.st-del { color: color-mix(in srgb, var(--c-del) 85%, #000); background: color-mix(in srgb, var(--c-del) 14%, transparent); }
.stchip.st-evo { color: color-mix(in srgb, var(--c-mod) 85%, #000); background: color-mix(in srgb, var(--c-mod) 14%, transparent); }
.mv { font-size: 12px; font-weight: 560; }
.mv-in { color: var(--c-move); }
.mv-out { color: var(--muted); font-style: italic; }
.etpcell.sum { font-weight: 600; }
.apath { font-size: 11px; color: var(--muted); }

/* ---------- Sélecteur avec recherche et filtres ---------- */
.pick { position: relative; }
.pick-head { display: flex; align-items: stretch; gap: 4px; }
.pick-btn { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 9px; cursor: pointer; min-width: 0; }
.pick-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn:hover { border-color: var(--accent); }
.pick-caret { color: var(--muted); font-size: 11px; }
.pick-clear { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 7px; width: 30px; cursor: pointer; color: var(--muted); font-size: 16px; }
.pick-panel { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; box-shadow: var(--shadow-lg); padding: 8px; min-width: 320px; }
.pick-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.pick-tools .pick-search { flex: 1; min-width: 140px; }
.pick-tools .pick-grp { width: auto; max-width: 180px; font-size: 12.5px; padding: 4px 24px 4px 6px; }
.seg-sm button { padding: 3px 8px; font-size: 12px; }
.pick-panel .pick-list { position: static; max-height: 280px; box-shadow: none; border: 0; padding: 0; overflow-y: auto; }
.pick-item { flex-direction: column; }
.pick-item small { color: var(--muted); font-size: 11px; }
.pick-item.disabled { opacity: .45; cursor: not-allowed; }
.pick-item.disabled:hover { background: transparent; }
.pick-item.current span { font-weight: 650; }
.pick-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 8px 3px; border-top: 1px solid var(--border); }
.pick-group:first-child { border-top: 0; }
.pick-foot { font-size: 11px; padding: 6px 4px 0; border-top: 1px solid var(--border); margin-top: 4px; }
.pair-av .pick-panel { left: 0; right: auto; width: calc(200% + 10px); min-width: 0; }
.pair-ap .pick-panel { right: 0; left: auto; width: calc(200% + 10px); min-width: 0; }

/* ---------- Connexion & comptes ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 20% 0%, #e9edfd, transparent), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 28px 28px 24px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-brand strong { display: block; font-size: 16px; }
.login-brand small { color: var(--muted); }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card p { font-size: 13px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin: 14px 0 4px; }
.login-card input { font-size: 15px; padding: 9px 11px; }
.login-code { letter-spacing: .35em; font-variant-numeric: tabular-nums; font-size: 20px !important; text-align: center; }
.login-main { width: 100%; justify-content: center; margin-top: 16px; padding: 10px; }
.login-alt { width: 100%; justify-content: center; margin-top: 8px; }
.login-error { margin-top: 10px; color: var(--c-del); font-size: 13px; }
.login-links { display: flex; justify-content: space-between; margin-top: 12px; }
.login-note { margin-top: 14px; font-size: 11.5px !important; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }
.ro-badge { font-size: 11.5px; font-weight: 600; color: var(--c-mod); border: 1px solid color-mix(in srgb, var(--c-mod) 40%, transparent); border-radius: 99px; padding: 2px 8px; }
.totp-setup { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.totp-qr svg { display: block; width: 180px; height: 180px; border: 1px solid var(--border); border-radius: 8px; }
.totp-setup ol { margin: 0 0 8px; padding-left: 18px; }
.totp-confirm { margin-top: 8px; max-width: 260px; }
.users-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.users-add input[type=email] { flex: 2; min-width: 220px; }
.users-add input[type=text] { flex: 1.4; min-width: 180px; }
.users-add select { width: auto; }
