/* =====================================================================
   Registre des actionnaires — styles
   Couleur d'accent = couleur de la société active (--acc / --acc2)
   ===================================================================== */
@font-face { font-family: "Instrument Sans"; src: url(../fonts/instrument-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(../fonts/instrument-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(../fonts/instrument-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url(../fonts/instrument-sans-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --ink: #12232b;
  --ink-2: #1c333d;
  --bg: #eef1f0;
  --surface: #ffffff;
  --line: #dbe1df;
  --line-2: #e9edeb;
  --text: #16242a;
  --muted: #5d6c70;
  --faint: #8b989b;
  --acc: #1f4e5f;
  --acc2: #6fa8b8;
  --acc-soft: color-mix(in srgb, var(--acc) 9%, white);
  --ok: #2f7d4f;
  --warn: #b26a00;
  --bad: #b3342b;
  --info: #2f5f9e;
  --r: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgba(18, 35, 43, .06), 0 4px 16px rgba(18, 35, 43, .05);
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
.num, td.n, th.n, .kpi b { font-variant-numeric: tabular-nums; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
svg[aria-hidden="true"] { width: 16px; height: 16px; flex: none; vertical-align: -3px; }

/* ------------------------------------------------------------- Layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: var(--ink); color: #c9d6d9; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { padding: 20px 18px 6px; color: #fff; font-weight: 600; font-size: 15px; }
.side .brand small { display: block; color: #7f9499; font-weight: 400; font-size: 12px; }

/* Sélecteur de société : la société active "teinte" toute l'appli */
.soc-switch { display: flex; flex-direction: column; gap: 4px; padding: 14px 10px 10px; }
.soc-switch button {
  all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; color: #b8c7cb; font-weight: 600; font-size: 14px;
}
.soc-switch button i { display: block; flex: none; width: 10px; height: 26px; border-radius: 3px; background: var(--c); opacity: .55; transition: opacity .15s, height .15s; }
.soc-switch button span { flex: 1; }
.soc-switch button em { font-style: normal; font-weight: 400; font-size: 12px; color: #7f9499; }
.soc-switch button:hover { background: var(--ink-2); }
.soc-switch button[aria-pressed="true"] { background: var(--ink-2); color: #fff; }
.soc-switch button[aria-pressed="true"] i { opacity: 1; height: 30px; background: linear-gradient(var(--c), var(--c2, var(--c))); }

.nav { display: flex; flex-direction: column; padding: 6px 10px; gap: 1px; }
.nav .grp { color: #6e8388; font-size: 12px; padding: 14px 10px 4px; }
.nav a {
  color: #c9d6d9; padding: 7px 10px; border-radius: 7px; display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .75; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.on { background: var(--ink-2); color: #fff; box-shadow: inset 3px 0 0 var(--acc2); }
.nav a .count { margin-left: auto; background: var(--acc2); color: var(--ink); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 10px; }
.side .foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid #22394300; font-size: 12px; color: #8ea2a7; }
.online { display: flex; gap: 4px; margin: 6px 0 10px; flex-wrap: wrap; }
.online span {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: #2a4650; color: #e4eef0; box-shadow: 0 0 0 2px var(--ink), 0 0 0 3px #48b37c;
}
.side .foot button { all: unset; cursor: pointer; color: #b8c7cb; }
.side .foot button:hover { color: #fff; text-decoration: underline; }

main { min-width: 0; padding: 26px 34px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .t { flex: 1; min-width: 240px; }
.page-head .t p { margin: 4px 0 0; color: var(--muted); }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

/* ------------------------------------------------------------- Boutons & champs */
.btn {
  font: inherit; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 7px 13px; border-radius: 8px;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { border-color: #c4cdca; background: #f8faf9; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--acc-soft); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 6px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { all: unset; cursor: pointer; padding: 5px; border-radius: 6px; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--line-2); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; width: 100%;
}
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; padding: 0; border: 0; accent-color: var(--acc); flex: none; margin-top: 3px; }
input.err, textarea.err { border-color: var(--bad); }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label.f > span { display: flex; justify-content: space-between; }
label.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; }
.grid { display: grid; gap: 12px 14px; grid-template-columns: repeat(12, 1fr); }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; }
.c6 { grid-column: span 6; } .c8 { grid-column: span 8; } .c9 { grid-column: span 9; } .c12 { grid-column: span 12; }
.hint { font-size: 12px; color: var(--faint); }
.search { position: relative; }
.search input { padding-left: 32px; min-width: 260px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; color: var(--faint); }

/* ------------------------------------------------------------- Surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card > header { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.card > header h3 { flex: 1; }
.card .body { padding: 14px 18px 18px; }
.card.flush .body { padding: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 18px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cols-21 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.right { text-align: right; }
.sp { flex: 1; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .seg { display: inline-flex; background: #e3e8e6; border-radius: 8px; padding: 2px; }
.toolbar .seg button { all: unset; cursor: pointer; padding: 5px 11px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.toolbar .seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ------------------------------------------------------------- Tableau de bord */
.hero {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px 18px; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: linear-gradient(var(--acc), var(--acc2)); }
.hero-top { display: flex; gap: 30px; align-items: flex-end; flex-wrap: wrap; }
.hero .capital { font-size: 44px; font-weight: 600; letter-spacing: -.03em; line-height: 1; color: var(--acc); font-variant-numeric: tabular-nums; }
.hero .capital small { font-size: 18px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.hero .lbl { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.hero .facts { display: flex; gap: 28px; flex-wrap: wrap; margin-left: auto; }
.hero .facts div b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero .facts div span { font-size: 12.5px; color: var(--muted); }

/* La "bande du capital" : chaque segment = un actionnaire, largeur = % des parts */
.captable { margin-top: 20px; }
.captable .strip { display: flex; height: 34px; border-radius: 7px; overflow: hidden; background: var(--line-2); }
.captable .strip a { display: block; height: 100%; min-width: 2px; border-right: 1px solid rgba(255,255,255,.55); transition: filter .12s; }
.captable .strip a:hover { filter: brightness(1.15) saturate(1.1); }
.captable .legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.tip {
  position: fixed; pointer-events: none; z-index: 90; background: var(--ink); color: #fff; padding: 7px 10px; border-radius: 7px;
  font-size: 12.5px; box-shadow: var(--shadow); max-width: 280px;
}
.tip b { display: block; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi b { font-size: 22px; font-weight: 600; }
.kpi em { font-style: normal; font-size: 12.5px; color: var(--faint); }
.kpi.alert { border-color: color-mix(in srgb, var(--warn) 40%, white); background: color-mix(in srgb, var(--warn) 5%, white); }
.kpi.alert b { color: var(--warn); }
a.kpi { color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--acc); }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 220px; }

/* ------------------------------------------------------------- Tables */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 9px 12px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: #f7f9f8; position: sticky; top: 0; user-select: none;
}
table.t th.sort { cursor: pointer; }
table.t th.sort:hover { color: var(--text); }
table.t th .ar { font-size: 10px; margin-left: 3px; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--acc-soft); }
table.t td.n, table.t th.n { text-align: right; white-space: nowrap; }
table.t tfoot td { font-weight: 600; background: #f7f9f8; border-top: 1px solid var(--line); }
table.t .strong { font-weight: 600; }
table.t .sub { display: block; font-size: 12px; color: var(--faint); }
.bar-cell { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bar-cell i { display: block; height: 6px; background: var(--acc2); border-radius: 3px; min-width: 1px; }
.tbl-foot { padding: 10px 14px; color: var(--muted); font-size: 12.5px; display: flex; gap: 14px; }

/* ------------------------------------------------------------- Badges */
.bdg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; background: var(--line-2); color: var(--muted); }
.bdg::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bdg.actif { background: #e5f2ea; color: var(--ok); }
.bdg.engage { background: #fdf1de; color: var(--warn); }
.bdg.en_sortie { background: #fde9e5; color: #c2410c; }
.bdg.sorti { background: #eceeee; color: #6b7779; }
.bdg.prospect { background: #e8eef7; color: var(--info); }
.bdg.verse { background: #e5f2ea; color: var(--ok); }
.bdg.annule { background: #eceeee; color: #8b9597; text-decoration: line-through; }
.bdg.plain::before { display: none; }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 4px; background: var(--line-2); color: var(--muted); font-weight: 600; }
.tag.soc { background: color-mix(in srgb, var(--c) 14%, white); color: var(--c); }
.dot-todo { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); margin-left: 6px; vertical-align: middle; }
.sign-plus { color: var(--ok); } .sign-minus { color: var(--bad); }

/* ------------------------------------------------------------- Fiche actionnaire */
.fiche-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px; flex-wrap: wrap; }
.fiche-head .ident { flex: 1; min-width: 280px; }
.fiche-head .ident h1 { font-size: 28px; }
.fiche-head .ident .meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); margin-top: 6px; font-size: 13.5px; }
.holdings { display: flex; gap: 12px; flex-wrap: wrap; }
.holding {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; min-width: 190px;
  border-top: 3px solid var(--c);
}
.holding .h-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.holding b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; display: block; margin-top: 4px; }
.holding small { color: var(--muted); font-size: 12.5px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button {
  all: unset; cursor: pointer; padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--acc); font-weight: 600; }
.tabs button em { font-style: normal; color: var(--faint); font-size: 12px; margin-left: 4px; }
.dl { display: grid; grid-template-columns: 150px 1fr; gap: 7px 14px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 130px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.timeline li time { color: var(--muted); font-size: 12.5px; }
.timeline li .who { color: var(--faint); font-size: 12px; }
.timeline details { margin-top: 4px; font-size: 12px; color: var(--muted); }
.timeline details table { border-collapse: collapse; margin-top: 4px; }
.timeline details td { padding: 2px 8px 2px 0; vertical-align: top; }
.contact-card { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.contact-card .av { width: 36px; height: 36px; border-radius: 50%; background: var(--acc-soft); color: var(--acc); display: grid; place-items: center; font-weight: 700; flex: none; }
.contact-card .inf { flex: 1; font-size: 13.5px; }
.contact-card .inf b { display: block; }
.comment-box { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: #fff8e6; border: 1px solid #f1dfae; }
.comment-txt { flex: 1; font-size: 13.5px; white-space: pre-line; }
.comment-txt b { display: block; font-size: 12px; color: #8a6400; margin-bottom: 2px; }
.comment-cell { display: inline-block; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--muted); }
.check-list { display: flex; gap: 16px; flex-wrap: wrap; }
.iban { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; }

/* ------------------------------------------------------------- Modales, toasts */
.backdrop { position: fixed; inset: 0; background: rgba(18, 35, 43, .42); display: grid; place-items: start center; padding: 6vh 16px; z-index: 50; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 14px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .18s ease-out; }
.modal.wide { width: min(860px, 100%); }
.modal.xwide { width: min(1100px, 100%); }
.modal > header { display: flex; align-items: center; padding: 18px 22px 4px; gap: 10px; }
.modal > header h2 { flex: 1; }
.modal .m-body { padding: 14px 22px 18px; }
.modal > footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #fafbfb; border-radius: 0 0 14px 14px; }
.modal > footer .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: var(--shadow); max-width: 420px; font-size: 13.5px; animation: pop .18s; white-space: pre-line; }
.toast.err { background: var(--bad); }
.toast.ok { border-left: 4px solid #48b37c; }
.alert-box { padding: 10px 14px; border-radius: 8px; background: #fdf1de; color: #7a4a00; font-size: 13.5px; margin-bottom: 12px; white-space: pre-line; }
.alert-box.info { background: var(--acc-soft); color: var(--text); }
.alert-box.err { background: #fde9e5; color: #8e2a22; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.loading { padding: 40px; text-align: center; color: var(--faint); }
.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--acc); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------- Éditeur de mail */
.rte { border: 1px solid var(--line); border-radius: 8px; }
.rte .bar { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line-2); background: #fafbfb; border-radius: 8px 8px 0 0; }
.rte .bar button { all: unset; cursor: pointer; padding: 3px 8px; border-radius: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rte .bar button:hover { background: var(--line-2); color: var(--text); }
.rte .ed { min-height: 220px; max-height: 420px; overflow-y: auto; padding: 12px 14px; font-family: Calibri, Arial, sans-serif; font-size: 14.5px; outline: none; }
.rte .ed p { margin: 0 0 10px; }
.modal table.t label.chk { display: flex; align-items: flex-start; }
.modal table.t td { width: 40%; } .modal table.t td:first-child { width: 20%; }
.pj-list { display: flex; flex-direction: column; gap: 6px; }
.pj-list label { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; cursor: pointer; }
.pj-list label:has(input:checked) { border-color: var(--acc); background: var(--acc-soft); }
.vars { display: flex; flex-wrap: wrap; gap: 5px; }
.vars code { cursor: pointer; font-size: 11.5px; background: var(--line-2); padding: 2px 6px; border-radius: 4px; }
.vars code:hover { background: var(--acc-soft); color: var(--acc); }

/* ------------------------------------------------------------- Import */
.drop {
  border: 2px dashed var(--line); border-radius: 12px; padding: 40px; text-align: center; color: var(--muted); background: var(--surface);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.drop.over, .drop:hover { border-color: var(--acc); background: var(--acc-soft); }
.drop b { color: var(--text); display: block; font-size: 16px; margin-bottom: 4px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.map-grid label { background: #fafbfb; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; }
.map-grid label.set { border-color: color-mix(in srgb, var(--acc) 40%, white); background: var(--acc-soft); }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { padding: 5px 12px; border-radius: 20px; background: #e3e8e6; font-size: 13px; color: var(--muted); font-weight: 500; }
.steps span.on { background: var(--acc); color: #fff; }
.steps span.done { background: var(--acc-soft); color: var(--acc); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; border: 1px solid rgba(0,0,0,.15); }

/* ------------------------------------------------------------- Connexion */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: #f4f6f5; --g1: #A3C21A; --g2: #2CCFE0; }
.lg-art {
  position: relative; overflow: hidden; color: #dfe8ea; padding: 40px 56px 0; display: flex; flex-direction: column;
  background:
    radial-gradient(900px 520px at -10% -10%, color-mix(in srgb, var(--g1) 30%, transparent), transparent 60%),
    radial-gradient(800px 520px at 110% 105%, color-mix(in srgb, var(--g2) 26%, transparent), transparent 60%),
    var(--ink);
}
.lg-art::after { /* fines lignes de registre */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background: repeating-linear-gradient(to bottom, transparent 0 35px, #fff 35px 36px);
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.lg-top { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #8ea2a7; position: relative; z-index: 1; }
.lg-mark { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.lg-mark i { width: 4px; border-radius: 1px; background: var(--g1); }
.lg-mark i:nth-child(1) { height: 45%; } .lg-mark i:nth-child(2) { height: 75%; background: #fff; } .lg-mark i:nth-child(3) { height: 100%; background: var(--g2); }
.lg-main { margin: auto 0; position: relative; z-index: 1; padding: 30px 0; }
.lg-main h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; color: #fff; letter-spacing: -.025em; max-width: 520px; }
.lg-main p { color: #9fb2b7; max-width: 440px; font-size: 15px; margin: 14px 0 34px; line-height: 1.55; }
.lg-tiles { display: flex; gap: 16px; flex-wrap: wrap; }
.lg-tile {
  width: 220px; height: 120px; background: #fff; border-radius: 16px; display: grid; place-items: center; padding: 14px 22px 20px;
  position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.28);
  transition: transform .25s ease, box-shadow .25s ease; animation: lgIn .6s ease both;
}
.lg-tile:nth-child(2) { animation-delay: .08s; } .lg-tile:nth-child(3) { animation-delay: .16s; }
.lg-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--c), var(--c2)); }
.lg-tile:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0,0,0,.34); }
.lg-tile img { max-width: 100%; max-height: 82px; object-fit: contain; }
.lg-code { font-size: 30px; font-weight: 700; color: var(--c); letter-spacing: -.02em; }
.lg-bands { position: relative; z-index: 1; display: flex; gap: 4px; align-items: flex-end; height: 92px; margin: 0 -56px; padding: 0 56px; }
.lg-bands i { flex: var(--w); height: var(--h); background: var(--c); opacity: .8; border-radius: 4px 4px 0 0;
  transform-origin: bottom; animation: lgGrow .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--d); }
@keyframes lgGrow { from { transform: scaleY(0); } }
@keyframes lgIn { from { opacity: 0; transform: translateY(10px); } }

.lg-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px 20px; position: relative; }
.lg-form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.lg-head h2 { font-size: 26px; letter-spacing: -.02em; }
.lg-head p { margin: 6px 0 0; color: var(--muted); }
.lg-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.lg-field input { padding: 11px 13px; font-size: 15px; border-radius: 10px; background: #fff; border: 1px solid #d3dbd8; }
.lg-field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(18,35,43,.12); }
.lg-pass { position: relative; }
.lg-pass input { padding-right: 84px; }
.lg-eye { all: unset; cursor: pointer; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 12.5px; font-weight: 600;
  color: var(--muted); padding: 5px 8px; border-radius: 6px; }
.lg-eye:hover { background: var(--line-2); color: var(--text); }
.lg-eye:focus-visible { outline: 2px solid var(--ink); }
.lg-caps { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warn); margin-top: -8px; }
.lg-submit {
  all: unset; cursor: pointer; text-align: center; display: flex; justify-content: center; align-items: center; gap: 9px;
  padding: 13px; border-radius: 10px; font-weight: 600; font-size: 15px; color: #fff; margin-top: 4px;
  background: linear-gradient(135deg, var(--ink), #23414c); box-shadow: 0 6px 18px rgba(18,35,43,.25); transition: transform .12s, box-shadow .12s;
}
.lg-submit:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(18,35,43,.3); }
.lg-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--g2) 60%, white); outline-offset: 2px; }
.lg-submit[disabled] { opacity: .75; pointer-events: none; }
.lg-spin { width: 16px; height: 16px; border-color: rgba(255,255,255,.35); border-top-color: #fff; }
.lg-help { margin: 2px 0 0; font-size: 12.5px; color: var(--faint); text-align: center; }
.lg-foot { position: absolute; bottom: 16px; font-size: 12px; color: var(--faint); }
.lg-mobile-logos { display: none; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .cols-21, .cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .nav { flex-direction: row; flex-wrap: wrap; } .nav .grp { display: none; }
  main { padding: 18px 14px 40px; }
  .cols-2 { grid-template-columns: 1fr; }
  .grid > * { grid-column: span 12 !important; }
  .login { grid-template-columns: 1fr; } .lg-art { display: none; }
  .lg-mobile-logos { display: flex; gap: 10px; justify-content: center; }
  .lg-mobile-logos .lg-tile { width: 140px; height: 76px; padding: 12px 14px 16px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
  .lg-mobile-logos .lg-tile img { max-height: 42px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print {
  .side, .page-head .acts, .toolbar, .tabs { display: none !important; }
  .app { display: block; } main { padding: 0; } body { background: #fff; }
}

/* =====================================================================
   Outils PFM : sélecteur de module + module « Références clients »
   ===================================================================== */
.mod-switch { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 10px 0; }
.mod-switch:empty { display: none; }
.mod-switch button {
  all: unset; cursor: pointer; flex: 1 1 auto; text-align: center; padding: 6px 10px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600; color: #9fb2b6; border: 1px solid #27414b;
}
.mod-switch button:hover { color: #fff; border-color: #3b5a66; }
.mod-switch button[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: #fff; }
.mod-switch button:focus-visible { outline: 2px solid var(--acc2); outline-offset: 2px; }

.bdg.ref-a_envoyer { background: #eceeee; color: #5d6c70; }
.bdg.ref-envoyee { background: #fdf1de; color: var(--warn); }
.bdg.ref-recue { background: #e5f2ea; color: var(--ok); }
.bdg.ref-ignoree { background: #eceeee; color: #8b9597; }
.bdg.ref-absente { background: transparent; color: var(--faint); border: 1px dashed var(--line); }

.ref-jauge { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line-2); margin-top: 6px; }
.ref-jauge span.ref-recue { background: var(--ok); }
.ref-jauge span.ref-ignoree { background: #b9c1ca; }
.ref-jauge span.ref-envoyee { background: #e0a030; }
.ref-jauge span.ref-a_envoyer { background: #8a98a8; }

.kpi.ref-echeance { border-left: 5px solid var(--ok); }
.kpi.ref-echeance.proche { border-left-color: #e0a030; }
.kpi.ref-echeance.depassee { border-left-color: var(--bad); }
.kpi.ref-echeance.depassee b { color: var(--bad); }
.kpi.ref-echeance.close { border-left-color: #b9c1ca; }

.ref-alerte {
  display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 6px; border-radius: 50%;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; cursor: help; vertical-align: 1px;
}
@media (max-width: 1000px) { .ref-kpis { grid-template-columns: repeat(2, 1fr); } }
