/* Atelier de suivi : bandeau marché pleine largeur, table de livrables dense, panneau latéral de détail. */
:root {
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-2: #e8f0f8;
  --line: #d3e0ec;
  --fg: #0f2740;
  --muted: #55687d;
  --accent: #005192;
  --accent-ink: #ffffff;
  --accent-soft: #e2eef8;
  --amber: #53af31;
  --ok: #2f8a17; --ok-soft: #e4f4dc;
  --warn: #c56a00; --warn-soft: #fff0d6;
  --bad: #d4313d; --bad-soft: #fde3e5;
  --info: #6a45d9; --info-soft: #ece6ff;
  --idle: #7a8796; --idle-soft: #edf0f4;
  --f-display: "Montserrat", "Segoe UI", Arial, sans-serif; --uemf-blue: #005192; --uemf-green: #53af31;
  --f-body: "Open Sans", "Segoe UI", Arial, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e1622; --surface: #152132; --surface-2: #1b2a3f; --line: #2a3b53; --fg: #e6eef8; --muted: #9aabc0;
  --accent: #5aa6e6; --accent-ink: #04182b; --accent-soft: #123a5e; --amber: #6cc84a;
  --ok: #7fd65c; --ok-soft: #173a12; --warn: #ffb24d; --warn-soft: #3a2a10; --bad: #ff6b74; --bad-soft: #3d1a1e;
  --info: #a993ff; --info-soft: #2a2250; --idle: #93a1b3; --idle-soft: #223044; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0e1622; --surface: #152132; --surface-2: #1b2a3f; --line: #2a3b53; --fg: #e6eef8; --muted: #9aabc0;
  --accent: #5aa6e6; --accent-ink: #04182b; --accent-soft: #123a5e; --amber: #6cc84a;
  --ok: #7fd65c; --ok-soft: #173a12; --warn: #ffb24d; --warn-soft: #3a2a10; --bad: #ff6b74; --bad-soft: #3d1a1e;
  --info: #a993ff; --info-soft: #2a2250; --idle: #93a1b3; --idle-soft: #223044; color-scheme: dark }

* { box-sizing: border-box }
html, body { height: 100% }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--f-body); }
button, input, select, textarea { font: inherit; color: inherit }
a { color: var(--accent) }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
.mono { font-family: var(--f-mono); font-size: .86em }
.muted { color: var(--muted) }
h1, h2, h3 { font-family: var(--f-display); margin: 0; text-wrap: balance; letter-spacing: -.01em }

/* Barre supérieure */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface) }
.top-in { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap; padding-block: 8px }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg) }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  font: 800 13px var(--f-display); letter-spacing: .02em; position: relative; overflow: hidden }
.brand-mark::after { content: ""; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: var(--amber) }
.brand b { font: 700 16px var(--f-display); display: block; line-height: 1.1 }
.brand small { color: var(--muted); font-size: 11.5px }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; min-width: 0 }
.nav a { text-decoration: none; color: var(--muted); padding: 7px 11px; border-radius: 8px; font-weight: 600; font-size: 13.5px; white-space: nowrap }
.nav a:hover { background: var(--surface-2); color: var(--fg) }
.nav a.on { background: var(--accent-soft); color: var(--accent) }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px }
.who .org { font-weight: 700 }
.role-chip { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-weight: 700 }

main { max-width: 1320px; margin: 0 auto; padding-block: 24px 60px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 22px }

/* Boutons et champs */
.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap }
.btn:hover { border-color: var(--accent) }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink) }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff }
.btn.small { padding: 5px 10px; font-size: 12.5px }
.btn:disabled { opacity: .5; cursor: not-allowed }
label.f { display: grid; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted) }
input.i, select.i, textarea.i { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0 }
textarea.i { min-height: 76px; resize: vertical }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end }
.row > * { min-width: 0 }

/* En-têtes de section */
.head { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap }
.head h1 { font-size: 26px; font-weight: 800 }
.eyebrow { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700 }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) }
.panel-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap }
.panel-h h2 { font-size: 16px }
.panel-b { padding: 16px 18px }

/* Cartes marchés */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; text-decoration: none; color: var(--fg); transition: border-color .15s, transform .15s }
.mcard:hover { border-color: var(--accent); transform: translateY(-1px) }
.mcard-top { display: flex; justify-content: space-between; align-items: start; gap: 10px }
.mnum { font: 800 30px/1 var(--f-display); color: var(--accent) }
.mnum span { font-size: 13px; color: var(--muted); font-weight: 700; margin-right: 4px }
.mtitle { font-weight: 600; font-size: 13.5px; line-height: 1.35 }
.bar { height: 8px; border-radius: 99px; background: var(--idle-soft); display: flex; overflow: hidden }
.bar i { display: block; height: 100% }
.mstats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted) }
.mstats b { color: var(--fg); font-variant-numeric: tabular-nums }
.mstats .late b { color: var(--bad) }

/* Pastilles de statut */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50% ; background: currentColor }
.s-nd { background: var(--idle-soft); color: var(--idle) }
.s-dep { background: var(--accent-soft); color: var(--accent) }
.s-val-en { background: var(--info-soft); color: var(--info) }
.s-res { background: var(--warn-soft); color: var(--warn) }
.s-rej { background: var(--bad-soft); color: var(--bad) }
.s-ok { background: var(--ok-soft); color: var(--ok) }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); color: var(--muted) }
.tag.pv { background: #fff4d6; color: #8a5a00 }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag.pv { background: #3a2c0d; color: #ffcf6b } }
:root[data-theme="dark"] .tag.pv { background: #3a2c0d; color: #ffcf6b }
.late-flag { color: var(--bad); font-weight: 700; font-size: 12px }
.visa-dots { display: flex; gap: 4px; flex-wrap: wrap }
.vd { font: 700 10.5px var(--f-mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted) }
.vd.valide { background: var(--ok-soft); color: var(--ok); border-color: transparent }
.vd.reserves { background: var(--warn-soft); color: var(--warn); border-color: transparent }
.vd.rejete { background: var(--bad-soft); color: var(--bad); border-color: transparent }

/* Tableaux */
.tw { overflow-x: auto }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px }
.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface) }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top }
.t tr.click { cursor: pointer }
.t tr.click:hover td { background: var(--surface-2) }
.t tr.phase td { background: var(--surface-2); font: 700 12px var(--f-display); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 7px 12px }
.t .ttl { font-weight: 600 }
.t .src { font-size: 12px; color: var(--muted) }
.num { font-variant-numeric: tabular-nums; white-space: nowrap }

/* Bandeau marché */
.mhead { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 16px }
.mhead-top { display: flex; gap: 18px; align-items: start; flex-wrap: wrap }
.mhead .mnum { font-size: 46px }
.mhead h1 { font-size: 21px; font-weight: 700; flex: 1; min-width: 240px }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px }
.fact small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700 }
.fact b { font-weight: 600 }
.filters { display: flex; gap: 8px; flex-wrap: wrap }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 5px 11px; border-radius: 99px; cursor: pointer; font-size: 12.5px; font-weight: 600 }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg) }

/* Tableau de bord */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px }
.kpi b { display: block; font: 800 28px/1.1 var(--f-display); font-variant-numeric: tabular-nums }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 600 }
.kpi.alert b { color: var(--bad) }
.kpi.todo b { color: var(--accent) }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr) } }
.list { display: grid }
.li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); cursor: pointer }
.li:last-child { border-bottom: 0 }
.li:hover { background: var(--surface-2) }
.li .mk { font: 800 13px var(--f-display); background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 3px 7px; font-variant-numeric: tabular-nums }
.li .tx { min-width: 0 }
.li .tx b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.li .tx small { color: var(--muted) }
.empty { padding: 26px 18px; color: var(--muted); text-align: center }

/* Panneau latéral */
.scrim { position: fixed; inset: 0; background: rgba(10, 20, 35, .4); z-index: 40 }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--bg); z-index: 41; overflow-y: auto;
  box-shadow: -20px 0 40px rgba(0, 0, 0, .18); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); padding-right: env(safe-area-inset-right, 0px) }
.dr-h { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px 20px; display: grid; gap: 8px; z-index: 2 }
.dr-h h2 { font-size: 19px }
.dr-close { position: absolute; right: 14px; top: 12px }
.dr-b { padding: 18px 20px; display: grid; gap: 16px }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 10px }
.box h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted) }
.drop { border: 2px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer }
.drop.over { border-color: var(--accent); background: var(--accent-soft) }
.ver { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line) }
.ver:last-child { border-bottom: 0 }
.vnum { font: 700 12px var(--f-mono); background: var(--surface-2); padding: 3px 7px; border-radius: 6px }
.ver .fn { font-weight: 600; overflow-wrap: anywhere }
.ver small { color: var(--muted); display: block }
.evt { display: grid; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px }
.evt:last-child { border-bottom: 0 }
.evt small { color: var(--muted) }
.circuit { display: flex; gap: 8px; flex-wrap: wrap }
.step { flex: 1; min-width: 140px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; display: grid; gap: 3px; font-size: 12.5px }
.step b { font-size: 13px }

/* Connexion */
.login { min-height: 100%; display: grid; place-items: center; padding-block: 30px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 16px }
.login-card h1 { font-size: 24px }
.err { background: var(--bad-soft); color: var(--bad); padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 13px }
.note { background: var(--accent-soft); color: var(--fg); padding: 10px 12px; border-radius: 8px; font-size: 13px }
.toast { position: fixed; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg);
  padding: 10px 18px; border-radius: 99px; font-weight: 600; z-index: 60; box-shadow: 0 8px 24px rgba(0, 0, 0, .2) }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding-bottom: 20px }
.demo-bar { background: #e4f4dc; color: #1d4a10; border-bottom: 2px solid var(--uemf-green); font-weight: 600; font-size: 13px; padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)) }
.demo-bar .in { max-width: 1320px; margin: 0 auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap }
.demo-bar select { background: #fff8e6; color: #1c1300; border: 1px solid #c98600; border-radius: 6px; padding: 4px 8px }
@media (max-width: 640px) { .head h1 { font-size: 22px } .mhead .mnum { font-size: 36px } .hide-sm { display: none } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important } }
main > * { min-width: 0 }
.eyebrow.mono { overflow-wrap: anywhere }
.fact b.num { white-space: normal }
.t td.mono { white-space: nowrap }
@media (max-width: 640px) { .mhead h1 { min-width: 0 } .mhead-top > div { min-width: 0 !important; flex-basis: 100% !important } #qIn { width: 100% !important } .who { width: 100%; justify-content: space-between } }
.t select.i { min-width: 140px }


.tag.new { background: var(--info-soft); color: var(--info) }
.tag.offer { background: var(--accent-soft); color: var(--accent) }
.kpi.new b { color: var(--info) }
.mstats .newc b { color: var(--info) }
.newbox { border-color: var(--info); background: var(--info-soft) }

.stg { font-size: 11.5px; font-weight: 600; margin-top: 4px; line-height: 1.3 }
.stg.rev { color: var(--info) }
.stg.fix { color: var(--warn) }
.stg.late { color: var(--bad) }
.stg.ok { color: var(--ok) }
.cycle { display: grid; gap: 4px; padding: 10px 12px; background: var(--surface-2); border-radius: 8px }
.bell { position: relative }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center }
.notif { display: grid; gap: 2px; padding: 10px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px }
.notif:last-child { border-bottom: 0 }
.notif.unread { font-weight: 600 }
.notif { position: relative; padding-left: 18px }
.notif.unread::before { content: ""; position: absolute; left: 4px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent) }
.notif:hover { background: var(--surface-2) }
.s-bo { background: var(--warn-soft); color: var(--warn) }
.vd.fin { box-shadow: inset 0 -2px 0 var(--accent) }
.step.final { border-color: var(--accent); background: var(--accent-soft) }
.att { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 7px; background: var(--bg) }
.att .fn { font-weight: 600; overflow-wrap: anywhere; flex: 1 1 140px }
.att-ic { font: 700 10px var(--f-mono); text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 6px; border-radius: 4px }

/* Charte UEMF : logo, bandeau bleu et liseré vert */
.uemf-word { display: block; width: 125px; height: 24px; background: #fff var(--logo-word) left center / contain no-repeat; flex: none }
.brand { gap: 12px }
.brand .sep { width: 1px; align-self: stretch; background: var(--line); margin: 2px 0 }
.brand b { color: var(--uemf-blue) }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand b { color: var(--fg) } :root:not([data-theme="light"]) .uemf-word { border-radius: 4px; box-shadow: 0 0 0 4px #fff } }
:root[data-theme="dark"] .brand b { color: var(--fg) }
:root[data-theme="dark"] .uemf-word { border-radius: 4px; box-shadow: 0 0 0 4px #fff }
.top { border-bottom: 0; box-shadow: inset 0 -3px 0 var(--uemf-green) }
.login { background: linear-gradient(160deg, #005192 0%, #005192 42%, var(--bg) 42%) }
.login-card { border-top: 5px solid var(--uemf-green); box-shadow: 0 18px 40px rgba(0, 40, 80, .18) }
.uemf-full { width: 220px; height: 109px; background: var(--logo-full) left center / contain no-repeat; margin-bottom: 4px }
.btn.primary { background: var(--uemf-blue) }
h1, h2 { color: var(--uemf-blue) }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) h1, :root:not([data-theme="light"]) h2 { color: var(--fg) } :root:not([data-theme="light"]) .btn.primary { background: var(--accent) } :root:not([data-theme="light"]) .uemf-full { background-color: #fff; border-radius: 8px; box-shadow: 0 0 0 8px #fff } }
@media (max-width: 640px) { .brand .sep, .brand small { display: none } .uemf-word { width: 100px } }

/* Refonte visuelle : portail clair, hiérarchie plus nette et composants mieux respirés. */
:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --line: #dce5ee;
  --fg: #1b2b3c;
  --muted: #65778a;
  --accent: #075994;
  --accent-ink: #ffffff;
  --accent-soft: #e7f1fa;
  --amber: #53af31;
  --ok: #258454; --ok-soft: #e3f4eb;
  --warn: #a95d00; --warn-soft: #fff1dc;
  --bad: #bf3946; --bad-soft: #fce9eb;
  --info: #6554b6; --info-soft: #eeeafd;
  --idle: #748397; --idle-soft: #edf1f5;
  --uemf-blue: #005192; --uemf-green: #53af31;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0c1521; --surface: #121f2f; --surface-2: #1a2b3e; --line: #2a3d52; --fg: #edf3fa; --muted: #a0b1c3;
  --accent: #72b8ed; --accent-ink: #08233b; --accent-soft: #183750; --amber: #72c84c;
  --ok: #6fc794; --ok-soft: #19372b; --warn: #efb35f; --warn-soft: #3a2c18; --bad: #f17b84; --bad-soft: #3c2025;
  --info: #b0a3f4; --info-soft: #2a2546; --idle: #a0adbc; --idle-soft: #253344;
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #0c1521; --surface: #121f2f; --surface-2: #1a2b3e; --line: #2a3d52; --fg: #edf3fa; --muted: #a0b1c3;
  --accent: #72b8ed; --accent-ink: #08233b; --accent-soft: #183750; --amber: #72c84c;
  --ok: #6fc794; --ok-soft: #19372b; --warn: #efb35f; --warn-soft: #3a2c18; --bad: #f17b84; --bad-soft: #3c2025;
  --info: #b0a3f4; --info-soft: #2a2546; --idle: #a0adbc; --idle-soft: #253344;
  color-scheme: dark;
}

html { scroll-behavior: smooth }
body { background: var(--bg); color: var(--fg); font-size: 14px; }
button, input, select, textarea { accent-color: var(--accent) }
button, a, .mcard { -webkit-tap-highlight-color: transparent }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 3px }
h1, h2, h3 { color: var(--fg) }
#app { min-height: 100%; }

/* En-tête et navigation */
.top { background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 1px 0 var(--line), 0 8px 24px rgba(20, 42, 67, .045); backdrop-filter: blur(16px); }
.top-in { max-width: 1440px; min-height: 72px; gap: 18px; padding-block: 10px; }
.brand { gap: 12px; }
.brand .sep { background: var(--line); }
.brand b { font-size: 15px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 4px; line-height: 1.2; }
.uemf-word { width: 118px; height: 28px; border-radius: 4px; }
.nav { gap: 5px; }
.nav a { padding: 8px 11px; border-radius: 9px; transition: background .16s ease, color .16s ease; }
.nav a.on { box-shadow: inset 0 -2px 0 var(--uemf-green); }
.who { gap: 8px; }
.who .org { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip { border: 1px solid var(--line); }

main { max-width: 1440px; padding-block: 30px 64px; gap: 22px; }
.head { align-items: center; }
.head h1 { color: var(--fg); font-size: clamp(23px, 2vw, 30px); letter-spacing: -.035em; }
.eyebrow { color: var(--accent); font-size: 10.5px; letter-spacing: .12em; }
.head .eyebrow { margin-bottom: 6px; }
.panel, .mcard, .kpi, .mhead, .box { border-color: var(--line); box-shadow: 0 4px 16px rgba(30, 56, 82, .035); }
.panel { overflow: hidden; }
.panel-h { min-height: 58px; padding: 14px 18px; }
.panel-h h2 { color: var(--fg); font-size: 15px; letter-spacing: -.015em; }

/* Boutons, champs et filtres */
.btn { min-height: 38px; border-radius: 9px; padding: 8px 13px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--uemf-blue); border-color: var(--uemf-blue); box-shadow: 0 4px 10px rgba(0, 81, 146, .16); color: #fff; }
.btn.primary:hover { background: #063f70; border-color: #063f70; }
.btn.ok { color: #fff; }
input.i, select.i, textarea.i { min-height: 40px; border-radius: 9px; border-color: var(--line); transition: border-color .15s ease, box-shadow .15s ease; }
input.i:focus, select.i:focus, textarea.i:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.chip { border-radius: 8px; padding: 7px 11px; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Indicateurs et cartes des marchés */
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 13px; }
.kpi { min-height: 106px; position: relative; overflow: hidden; display: grid; align-content: center; gap: 8px; padding: 16px 17px 16px 19px; border-radius: 13px; transition: transform .16s ease, box-shadow .16s ease; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.kpi:nth-child(2)::before { background: var(--ok); }
.kpi.alert::before { background: var(--bad); }
.kpi.new::before { background: var(--info); }
.kpi b { font-size: 29px; letter-spacing: -.045em; }
.kpi span { line-height: 1.4; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(30, 56, 82, .08); }
.mgrid { gap: 15px; }
.mcard { position: relative; overflow: hidden; padding: 18px; border-radius: 13px; gap: 13px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.mcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--uemf-blue), var(--uemf-green)); opacity: .8; }
.mcard:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(30, 56, 82, .1); }
.mnum { letter-spacing: -.045em; }
.mcard .mtitle { min-height: 36px; line-height: 1.45; }
.bar { height: 7px; background: var(--idle-soft); }
.mstats { gap: 8px 14px; }
.mstats span { white-space: nowrap; }
.cols { gap: 18px; }
.li { padding-block: 13px; }
.li .mk { min-width: 42px; text-align: center; border-radius: 8px; }
.li:hover { background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }

/* Fiche de marché et tableau dense */
.mhead { position: relative; overflow: hidden; border: 0; border-radius: 16px; padding: 22px; color: #fff; background: linear-gradient(130deg, #063f70 0%, #005192 66%, #1678a7 100%); box-shadow: 0 12px 30px rgba(0, 65, 115, .16); }
.mhead::after { content: ""; position: absolute; width: 280px; height: 280px; right: -90px; top: -150px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.035), 0 0 0 72px rgba(255,255,255,.025); pointer-events: none; }
.mhead > * { position: relative; z-index: 1; }
.mhead h1, .mhead .mnum { color: #fff; }
.mhead .eyebrow, .mhead .fact small, .mhead .mstats { color: rgba(255,255,255,.76); }
.mhead .fact b, .mhead .mstats b { color: #fff; }
.mhead .bar { background: rgba(255,255,255,.18); }
.mhead .tag { background: rgba(255,255,255,.14); color: #fff; }
.facts { gap: 15px 22px; }
.fact small { margin-bottom: 3px; }
.fact b { line-height: 1.45; }
.t th { position: sticky; top: 0; z-index: 1; padding-block: 12px; background: var(--surface-2); font-size: 10px; }
.t td { padding: 12px; }
.t tbody tr.click:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 34%, var(--surface)); }
.t tr.click:hover td { background: var(--accent-soft); }
.t tr.phase td { color: var(--accent); background: var(--accent-soft); border-bottom-color: var(--line); padding-block: 9px; }
.t .ttl { line-height: 1.45; }
.pill { padding: 4px 9px; }
.tag { border-radius: 6px; }

/* Détail, notifications et pied de page */
.drawer { background: var(--bg); box-shadow: -24px 0 54px rgba(3, 19, 34, .22); }
.dr-h { padding: 20px 22px; box-shadow: 0 2px 10px rgba(22, 42, 63, .035); }
.dr-b { padding: 20px 22px; }
.box { border-radius: 12px; padding: 16px; }
.step { border-radius: 10px; padding: 11px 12px; }
.toast { border-radius: 10px; box-shadow: 0 12px 32px rgba(12, 28, 46, .22); }
.foot { padding: 0 16px 24px; font-size: 11.5px; }

/* Écran de connexion */
.login { min-height: 100dvh; grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr); place-items: stretch; gap: 0; padding: 0; background: var(--surface); }
.login-hero { min-height: 100dvh; position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(34px, 5vw, 76px); color: #fff; background: radial-gradient(ellipse at 14% 84%, rgba(83,175,49,.18), transparent 37%), linear-gradient(137deg, #073b68 0%, #005192 62%, #096da1 100%); }
.login-hero::before { content: ""; position: absolute; z-index: -1; width: min(44vw, 570px); aspect-ratio: 1; right: -18%; top: 14%; border-radius: 50%; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 0 0 42px rgba(255,255,255,.035), 0 0 0 90px rgba(255,255,255,.025), 0 0 0 150px rgba(255,255,255,.018); }
.login-hero::after { content: "4.0"; position: absolute; z-index: -1; right: -.02em; bottom: -.2em; color: rgba(255,255,255,.055); font: 800 clamp(250px, 36vw, 540px)/.8 var(--f-display); letter-spacing: -.12em; pointer-events: none; }
.login-hero-brand { display: flex; align-items: center; gap: 18px; }
.login-hero-brand .uemf-word { width: 155px; height: 34px; }
.login-portal { padding-left: 17px; border-left: 1px solid rgba(255,255,255,.32); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.login-hero-copy { max-width: 620px; margin-block: auto; padding-block: 56px; }
.login-hero-copy .eyebrow { margin-bottom: 16px; color: #a6db8b; }
.login-hero-copy h2 { color: #fff; font-size: clamp(39px, 5.1vw, 67px); line-height: 1.08; letter-spacing: -.055em; }
.login-hero-copy p { max-width: 470px; margin: 20px 0 0; color: rgba(255,255,255,.78); font-size: 16px; line-height: 1.7; }
.login-benefits { display: grid; gap: 12px; margin-top: 36px; color: rgba(255,255,255,.9); font-size: 13px; font-weight: 600; }
.login-benefits span { display: flex; align-items: center; gap: 12px; }
.login-benefits i { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #b3e398; font: 700 10px var(--f-mono); font-style: normal; }
.login-hero-foot { color: rgba(255,255,255,.6); font-size: 11.5px; letter-spacing: .025em; }
.login-hero-foot span { margin-inline: 6px; color: #a6db8b; }
.login-card { width: min(440px, calc(100% - 56px)); justify-self: center; align-self: center; gap: 25px; padding: 34px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.login-form-brand { display: grid; justify-items: start; gap: 17px; }
.login-form-brand .uemf-full { width: 182px; height: 90px; border-radius: 7px; }
.login-form-brand .brand b { font-size: 16px; }
.login-form-brand .brand small { font-size: 11.5px; }
.login-form-heading .eyebrow { margin-bottom: 7px; }
.login-form-heading h1 { color: var(--fg); font-size: 29px; letter-spacing: -.04em; }
.login-form-heading p { margin: 8px 0 0; line-height: 1.6; }
.login-card .f { gap: 7px; color: var(--fg); font-size: 12px; }
.login-card input.i { min-height: 48px; padding: 11px 13px; background: var(--surface); }
.login-card .btn.primary { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding-inline: 17px; }
.login-card .btn.primary span { font-size: 18px; line-height: 1; transition: transform .15s ease; }
.login-card .btn.primary:hover span { transform: translateX(3px); }
.login-secure { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.login-secure-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--uemf-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--uemf-green) 15%, transparent); }

@media (max-width: 1050px) {
  .top-in { gap: 12px; }
  .nav a { padding-inline: 8px; font-size: 12.5px; }
  .who .org { max-width: 145px; }
}
@media (max-width: 820px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .login-hero { min-height: 300px; padding: 28px 28px 24px; }
  .login-hero-copy { max-width: 640px; padding-block: 34px 28px; }
  .login-hero-copy h2 { font-size: clamp(34px, 8vw, 49px); }
  .login-hero-copy p { margin-top: 12px; font-size: 14px; }
  .login-benefits { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 20px; font-size: 11px; }
  .login-benefits span { align-items: flex-start; gap: 7px; }
  .login-benefits i { width: 24px; height: 24px; flex: none; }
  .login-hero-foot { display: none; }
  .login-hero::after { font-size: 300px; bottom: -.3em; }
  .login-card { padding-block: 34px 44px; }
  .top-in { min-height: auto; }
  .brand { flex: 1 0 auto; }
  .nav { flex: 1 0 100%; order: 3; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .nav a { flex: none; }
  .who { margin-left: auto; }
}
@media (max-width: 560px) {
  main { padding-top: 20px; gap: 16px; }
  .top { padding-inline: 12px; }
  .top-in { gap: 9px; }
  .uemf-word { width: 94px; height: 24px; }
  .brand { gap: 8px; }
  .brand b { font-size: 13px; }
  .brand small, .brand .sep { display: none; }
  .who { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .who .org { max-width: 100%; margin-right: auto; }
  .who .btn { min-height: 34px; }
  .nav { gap: 2px; }
  .nav a { padding: 7px 9px; font-size: 12px; }
  .head { align-items: flex-start; }
  .head .btn { width: 100%; justify-content: center; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi { min-height: 93px; padding: 13px 12px 13px 15px; }
  .kpi b { font-size: 25px; }
  .kpi span { font-size: 11px; }
  .mgrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .cols { gap: 14px; }
  .mhead { padding: 17px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .panel-h, .panel-b { padding-inline: 13px; }
  .filters { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 3px; }
  .filters .chip { flex: none; }
  .panel-h > .row { width: 100%; }
  .panel-h > .row > * { flex: 1 1 100%; width: 100% !important; }
  .t { min-width: 760px; }
  .login-hero { min-height: 280px; padding: 23px 22px 20px; }
  .login-hero-brand .uemf-word { width: 125px; }
  .login-portal { font-size: 9px; }
  .login-hero-copy { padding-block: 28px 20px; }
  .login-hero-copy h2 { font-size: 37px; }
  .login-benefits { grid-template-columns: minmax(0, 1fr); gap: 7px; margin-top: 16px; }
  .login-benefits span { align-items: center; }
  .login-card { width: calc(100% - 44px); padding-block: 27px 36px; gap: 21px; }
  .login-form-brand .uemf-full { width: 154px; height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Garde un contraste suffisant pour le bouton principal en mode sombre. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.primary { background: #005192; border-color: #005192; color: #fff; }
  :root:not([data-theme="light"]) .btn.primary:hover { background: #063f70; border-color: #063f70; }
}
:root[data-theme="dark"] .btn.primary { background: #005192; border-color: #005192; color: #fff; }
:root[data-theme="dark"] .btn.primary:hover { background: #063f70; border-color: #063f70; }

