/* Régie 360 — charte RMC BFM ADS appliquée à un outil de travail clair et dense.
   Couleurs de la marque : nuit #090013 (actions), blanc, dégradé cyan #45D7D4 → rose #D42A73 (filet de marque uniquement).
   Vert / orange / rouge sont réservés aux états (diffusé, à valider, non diffusé). Chiffres tabulaires ; mono pour les timecodes. */
:root {
  --bg: #f5f4f8; --bg2: #faf9fc; --surface: #ffffff; --surface2: #f1eff5; --raise: #ffffff;
  --line: #e5e2eb; --line2: #cfcad9; --ink: #150f24; --ink2: #3a344b; --muted: #676178;
  --night: #090013; --blue: #1b0d35; --blue-hi: #2d1a52; --blue-soft: #eeebf5; --cyan: #45d7d4; --cyan-soft: #e2f7f6; --pink: #d42a73;
  --brand-grad: linear-gradient(90deg, #45d7d4 0%, #8fb1c9 45%, #d42a73 100%);
  --red: #c8141c; --red-hi: #d2161e; --red-soft: #fdeceb;
  --ok: #1e7f4f; --ok-soft: #e6f4ec; --warn: #9a5600; --warn-soft: #fdf3e1;
  --bad: #c8141c; --bad-soft: #fdeceb;
  --shadow: 0 10px 30px rgb(21 15 36 / .16); --glow: 0 0 0 2px var(--pink);
  --f-head: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-body: var(--f-head);
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 8px; --r-sm: 6px;
  color-scheme: light;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
svg[aria-hidden] { width: 1.05em; height: 1.05em; vertical-align: -.16em; flex: none }
html, body { margin: 0; height: 100% }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--f-body); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased }
button, input, select, textarea { font: inherit; color: inherit }
a { color: var(--blue); text-decoration: underline; text-decoration-color: rgb(27 13 53 / .3); text-underline-offset: 2px }
a:hover { text-decoration-color: currentColor }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px }
::selection { background: var(--blue-soft) }
.mono { font-family: var(--f-mono); font-size: .95em }
.tc { font-family: var(--f-mono) }
.muted { color: var(--muted) }
.num { font-variant-numeric: tabular-nums }
b, strong { font-weight: 600 }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important } }

/* ---------- coque */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh }
.rail { background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; overflow-y: auto }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px }
.brand .chip { white-space: nowrap; background: var(--red); color: #fff; font: 700 12px/1 var(--f-head); padding: 6px 7px; border-radius: 4px }
.brand .chip.logo { background: none; padding: 0 } .brand .chip.logo img { height: 34px; display: block }
.brand .chip.marque { background: none; padding: 0; border-radius: 7px } .brand .chip.marque img { width: 34px; height: auto; display: block; border-radius: 7px }
.brand b { font: 600 16px/1.1 var(--f-head); display: block }
.brand small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px }
.nav-sec { font: 600 12px var(--f-body); color: var(--muted); padding: 14px 10px 4px }
.nav a, .kicker a, .todo a, .palette a, .menu a, .btn, .tag, .feed a { text-decoration: none }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--ink2); font-weight: 500; text-decoration: none }
.nav a svg { width: 17px; height: 17px; flex: none; color: var(--muted) }
.nav a:hover { background: var(--surface2); color: var(--ink) }
.nav a.on { background: var(--blue-soft); color: var(--night); font-weight: 600; box-shadow: inset 3px 0 0 var(--pink) }
.nav a.on svg { color: var(--night) }
.nav .badge { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--surface2); border-radius: 99px; padding: 0 7px; color: var(--ink2); min-width: 20px; text-align: center }
.nav .badge.hot { background: var(--red); color: #fff }
.rail .foot { margin-top: auto; padding: 12px 10px 4px; font-size: 12px; color: var(--muted); display: grid; gap: 4px; border-top: 1px solid var(--line) }
.secure { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); font-weight: 500 }
.secure i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok) }

.main { min-width: 0; display: flex; flex-direction: column }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px 10px; background: var(--surface) var(--brand-grad) top / 100% 3px no-repeat; border-bottom: 1px solid var(--line) }
.search { flex: 1; min-width: 0; max-width: 520px; display: flex; align-items: center; gap: 9px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 6px; padding: 7px 11px; color: var(--muted); cursor: text }
.search:hover { border-color: var(--line2) }
.search svg { width: 16px; height: 16px; flex: none }
.search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0 }
.search kbd { white-space: nowrap; margin-left: auto; font: 500 11px var(--f-body); border: 1px solid var(--line2); border-radius: 4px; padding: 0 5px; color: var(--muted); background: var(--surface) }
.clock { font-size: 13px; color: var(--muted); white-space: nowrap }
.clock b { color: var(--ink2); font-weight: 500 }
.onair { display: none }
.userbtn { display: flex; align-items: center; gap: 9px; background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 8px 3px 3px; cursor: pointer }
.userbtn:hover { background: var(--surface2) }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--f-body); background: var(--blue-soft); color: var(--night); flex: none }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px }
.userbtn .who { text-align: left; line-height: 1.2 } .userbtn .who b { display: block; font-size: 13px } .userbtn .who small { color: var(--muted); font-size: 12px }
.page { padding: 24px 28px 64px; display: grid; gap: 20px; min-width: 0; max-width: 1480px; width: 100% }
.phead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px }
.kicker { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px }
.kicker a { color: var(--muted) } .kicker a:hover { color: var(--blue) }
h1 { margin: 2px 0 0; font: 600 24px/1.25 var(--f-head); letter-spacing: -.01em; text-wrap: balance }
h2 { margin: 0; font: 600 15px/1.3 var(--f-head); display: flex; align-items: center; gap: 8px }
h2 .n { font-size: 13px; font-weight: 500; color: var(--muted) }
h3 { margin: 0; font: 600 14px/1.3 var(--f-head) }
.lede { color: var(--muted); margin: 4px 0 0; max-width: 78ch }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.row.end { justify-content: flex-end } .row.between { justify-content: space-between }
.grow { flex: 1 }
.stack { display: grid; gap: 14px; min-width: 0 }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start }
.cols-2-1 { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start }
@media (max-width: 1100px) { .cols-2-1 { grid-template-columns: minmax(0, 1fr) } }

/* ---------- panneaux */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 12px; min-width: 0 }
.panel.flush { padding: 0; gap: 0; overflow: hidden } .panel.flush > .ph { padding: 12px 16px; border-bottom: 1px solid var(--line) }
.ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px }
.panel .hint, .hint { margin: 0; color: var(--muted); font-size: 13px }

/* Indicateurs : un seul bandeau découpé en cases, l'état en pastille */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden }
.kpi { padding: 14px 16px; display: grid; gap: 2px; align-content: start; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line) }
.kpi .k { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px }
.kpi .k::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--line2)); flex: none }
.kpi .v { font: 600 26px/1.2 var(--f-head); letter-spacing: -.02em }
.kpi .s { font-size: 12.5px; color: var(--muted) }
.kpi.click { cursor: pointer } .kpi.click:hover { background: var(--bg2) }
.panel .kpis { border-radius: var(--r-sm) }

/* ---------- boutons & champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink);
  border-radius: 6px; padding: 7px 12px; font-weight: 500; font-size: 13.5px; cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.25 }
.btn:hover { background: var(--surface2); text-decoration: none }
.btn svg { width: 15px; height: 15px }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff }
.btn.primary:hover { background: var(--blue-hi); border-color: var(--blue-hi) }
.btn.danger { background: var(--surface); border-color: #ecb8b5; color: var(--bad) }
.btn.danger:hover { background: var(--bad-soft) }
.btn.red { background: var(--red); border-color: var(--red); color: #fff }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink2) }
.btn.ghost:hover { background: var(--surface2) }
.btn.sm { padding: 4px 9px; font-size: 13px; border-radius: 5px }
.btn.lg { padding: 10px 16px; font-size: 14.5px; font-weight: 600 }
.btn:disabled { opacity: .5; cursor: not-allowed }
.btn.on { background: var(--blue-soft); border-color: var(--blue); color: var(--night) }
.field { display: grid; gap: 5px; min-width: 0 }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink2) }
.field small { color: var(--muted); font-size: 12.5px }
.in { width: 100%; min-width: 0; background: var(--surface); border: 1px solid var(--line2); border-radius: 6px; padding: 7px 10px; font-size: 14px; color: var(--ink) }
.in:hover { border-color: #b4bcc7 }
.in:focus { outline: none; border-color: var(--blue-hi); box-shadow: 0 0 0 3px var(--blue-soft) }
textarea.in { resize: vertical; min-height: 80px; line-height: 1.5 }
select.in { cursor: pointer }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) }
.form .full { grid-column: 1 / -1 }
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer }
.check input { width: 15px; height: 15px; accent-color: var(--blue) }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; background: var(--surface) }
.seg button { border: 0; background: none; padding: 6px 12px; font-weight: 500; font-size: 13px; color: var(--ink2); cursor: pointer; border-right: 1px solid var(--line) }
.seg button:last-child { border-right: 0 }
.seg button.on { background: var(--blue-soft); color: var(--night); font-weight: 600 }
.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip-f { border: 1px solid var(--line2); background: var(--surface); border-radius: 99px; padding: 4px 11px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--ink2) }
.chip-f:hover { border-color: var(--blue) } .chip-f.on { background: var(--night); border-color: var(--night); color: #fff }
.chip-f .c { font-size: 12px; opacity: .75; margin-left: 4px }

/* ---------- pastilles d'état */
.pill { display: inline-flex; align-items: center; gap: 6px; font: 500 12px/1 var(--f-body); padding: 4px 8px; border-radius: 4px; white-space: nowrap; background: var(--surface2); color: var(--ink2) }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none }
.pill.ok { background: var(--ok-soft); color: var(--ok) } .pill.warn { background: var(--warn-soft); color: var(--warn) }
.pill.bad { background: var(--bad-soft); color: var(--bad) } .pill.info { background: var(--blue-soft); color: var(--blue) }
.pill.live { background: var(--night); color: #fff } .pill.nodot::before { display: none }
.tag { display: inline-block; font: 500 12px/1 var(--f-body); padding: 4px 6px; border-radius: 4px; background: var(--surface2); color: var(--ink2) }
.bb { display: inline-flex; font: 600 12px/1 var(--f-body); padding: 4px 7px; border-radius: 4px; white-space: nowrap }
.bb.in { background: var(--blue-soft); color: var(--night) } .bb.out { background: var(--cyan-soft); color: #0b6461 }

/* ---------- tableaux */
.tw { overflow-x: auto; min-width: 0 }
table.t { border-collapse: collapse; width: 100%; font-size: 13.5px }
.t th { font: 500 12.5px var(--f-body); color: var(--muted); text-align: left; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg2); white-space: nowrap; position: sticky; top: 0 }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle }
.t tr:last-child td { border-bottom: 0 }
.t tr.click { cursor: pointer } .t tr.click:hover td { background: var(--bg2) }
.t td.nowrap, .t .nowrap { white-space: nowrap }
.t td.file { min-width: 220px; overflow-wrap: anywhere }
.t th.num, .t td.num { text-align: right }
.t .row { flex-wrap: nowrap }
.t .strong { font-weight: 600 } .t .sub { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 1px }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center }
.empty b { color: var(--ink); font-size: 15px }

/* ---------- barres de réalisation */
.prog { display: grid; gap: 4px; min-width: 120px }
.prog .bar { height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden }
.prog .bar i { display: block; height: 100%; background: var(--c, var(--ok)); border-radius: 99px }
.prog .lab { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted) }
.prog .lab b { color: var(--ink) }

/* ---------- actions à traiter */
.todo { display: grid; gap: 0 }
.todo a { display: grid; grid-template-columns: 3px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 4px 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none }
.todo a:last-child { border-bottom: 0 }
.todo a:hover { background: var(--bg2) }
.todo a::before { content: ""; align-self: stretch; border-radius: 2px; background: var(--c, var(--warn)) }
.todo a.bad { --c: var(--bad) } .todo a.warn { --c: var(--warn) } .todo a.info { --c: var(--cyan) }
.todo .t1 { font-weight: 500 } .todo .t2 { font-size: 12.5px; color: var(--muted) }
.todo .ty { font-size: 12px; color: var(--muted) }

/* ---------- graphique */
.chart { width: 100%; height: auto; display: block }
.chart text { fill: var(--muted); font: 11px var(--f-body) }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted) }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px }

/* ---------- fil d'activité */
.feed { display: grid; gap: 0; margin: 0; padding: 0; list-style: none }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px }
.feed li:last-child { border-bottom: 0 }
.feed .when { font-size: 12.5px; color: var(--muted); white-space: nowrap; min-width: 74px }
.feed .what { overflow-wrap: anywhere }

/* ---------- fiche campagne */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 12px }
.hero .meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 12px }
.hero .meta span { display: grid; gap: 1px; align-content: start } .hero .meta b { color: var(--ink); font-size: 14px; font-weight: 500 }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap;
  font-size: 14px; display: inline-flex; gap: 7px; align-items: center; margin-bottom: -1px }
.tabs button:hover { color: var(--ink) } .tabs button.on { color: var(--night); font-weight: 600; border-image: var(--brand-grad) 1 }
.tabs .n { font-size: 12px; background: var(--surface2); color: var(--ink2); border-radius: 99px; padding: 0 7px }
.timeline { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 6px; max-height: 460px; overflow-y: auto; padding-right: 4px }
.slot { border: 1px solid var(--line); border-left: 3px solid var(--c, var(--line2)); border-radius: 5px; padding: 6px 8px; display: grid; gap: 1px; background: var(--surface); font-size: 12px; cursor: default }
.slot b { font: 500 12px var(--f-mono) } .slot span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.slot.diffuse { --c: var(--ok) } .slot.a_valider { --c: var(--warn); background: var(--warn-soft) } .slot.non_diffuse { --c: var(--bad); background: var(--bad-soft) }
.slot.a_piger { --c: var(--line2); background: var(--bg2) } .slot.a_venir { --c: var(--cyan); border-style: dashed; border-left-style: solid; color: var(--muted) }
.slot.click { cursor: pointer } .slot.click:hover { border-color: var(--line2) }

/* ---------- cartes de passage : le timecode est la donnée de référence */
.passages { display: grid; gap: 10px }
.pass { display: grid; grid-template-columns: 156px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden }
.pass.sel { box-shadow: var(--glow) } .pass.rejete { opacity: .55 }
.pass .when { background: var(--bg2); border-right: 1px solid var(--line); padding: 14px; display: grid; align-content: start; gap: 6px }
.pass .when .tc { font-size: 17px; font-weight: 500; letter-spacing: -.01em; color: var(--ink) }
.pass .when .d { font-size: 12.5px; color: var(--muted) }
.pass .when .bb { justify-self: start }
.pass .body { padding: 12px 16px; display: grid; gap: 10px; min-width: 0 }
.pass .ttl { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px }
.pass .ttl h3 { font-size: 16px }
.caps { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px }
.cap { flex: none; width: 168px; max-width: 100%; display: grid; gap: 3px; cursor: pointer }
.cap img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); display: block; background: #000 }
.cap span { font: 12px var(--f-mono); color: var(--muted) } .cap span b { font-family: var(--f-body); font-weight: 500; color: var(--ink2); margin-right: 6px }
.pass .metrics, .carte-v .metrics { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); align-items: center }
.pass .metrics b, .carte-v .metrics b { color: var(--ink); font-weight: 500 }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px }
.alerts li { background: var(--warn-soft); color: var(--warn); border-radius: 5px; padding: 6px 10px; font-size: 13px }
.alerts li.bad { background: var(--bad-soft); color: var(--bad) }
.pass .acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px }
@media (max-width: 720px) { .pass { grid-template-columns: minmax(0, 1fr) } .pass .when { border-right: 0; border-bottom: 1px solid var(--line); grid-auto-flow: column; justify-content: start; align-items: center } }

/* ---------- dépôt de fichiers */
.drop { border: 1.5px dashed var(--line2); border-radius: var(--r); padding: 20px; text-align: center; color: var(--muted); cursor: pointer; display: grid; gap: 3px; background: var(--bg2) }
.drop b { color: var(--ink); font-size: 14.5px; font-weight: 600 }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--blue-soft); color: var(--ink2) }
.up { display: grid; gap: 6px; font-size: 13px }
.up .bar { height: 5px; background: var(--surface2); border-radius: 99px; overflow: hidden } .up .bar i { display: block; height: 100%; background: var(--blue); width: 0; transition: width .2s }

/* ---------- traitement de pige */
.job { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface) }
.job .live, .job .done, .job .err { width: 9px; height: 9px; border-radius: 50% }
.job .live { background: var(--blue); animation: pulse 1.4s ease-in-out infinite } .job .done { background: var(--ok) } .job .err { background: var(--bad) }
@keyframes pulse { 50% { opacity: .35 } }
.job .bar { height: 5px; background: var(--surface2); border-radius: 99px; overflow: hidden; margin-top: 6px } .job .bar i { display: block; height: 100%; background: var(--blue); transition: width .4s }

/* ---------- fenêtres */
#overlay:empty { display: none }
.backdrop { position: fixed; inset: 0; background: rgb(26 34 48 / .38); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .12s }
@keyframes fade { from { opacity: 0 } }
.modal { background: var(--surface); border-radius: 10px; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow); display: grid }
.modal.wide { width: min(1080px, 100%) }
:is(.modal, .drawer) .mh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1 }
:is(.modal, .drawer) .mh h2 { font-size: 16px }
:is(.modal, .drawer) .mb { padding: 18px; display: grid; gap: 16px } :is(.modal, .drawer) .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface) }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100%); background: var(--surface); border-left: 1px solid var(--line); z-index: 51; display: grid; grid-template-rows: auto 1fr auto; box-shadow: var(--shadow); animation: slide .16s }
@keyframes slide { from { transform: translateX(24px); opacity: 0 } }
.drawer .mb { overflow: auto; align-content: start }
.x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 2px 8px; border-radius: 6px; cursor: pointer }
.x:hover { background: var(--surface2); color: var(--ink) }
video.player { width: 100%; max-height: 62vh; background: #000; border-radius: 6px; display: block }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: grid; gap: 8px; justify-items: end }
.toast { background: var(--night); color: #fff; padding: 10px 14px; border-radius: 6px; box-shadow: var(--shadow); font-size: 13.5px; max-width: 420px; animation: fade .2s; border-left: 3px solid #5fc58f }
.toast.err { border-left-color: #ff8a84 }
.palette { width: min(640px, 100%); align-self: start; margin-top: 10vh }
.palette input { border: 0; background: none; font-size: 16px; padding: 15px 18px; width: 100%; outline: none; border-bottom: 1px solid var(--line) }
.palette .res { max-height: 50vh; overflow: auto; padding: 6px }
.palette a { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; align-items: center }
.palette a:hover, .palette a.sel { background: var(--blue-soft) }
.palette a span { font-size: 12px; color: var(--muted) }
.palette a small { display: block; color: var(--muted) }
.menu { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; min-width: 220px; display: grid }
.menu button, .menu a { text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 5px; cursor: pointer; color: var(--ink); text-decoration: none }
.menu button:hover, .menu a:hover { background: var(--surface2) }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0 }

/* ---------- connexion : une carte centrée, rien d'autre */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg) }
.auth > div { width: min(420px, 100%) }
.auth .box { width: 100%; background: var(--surface) var(--brand-grad) top / 100% 4px no-repeat; border: 1px solid var(--line); border-radius: 10px; padding: 30px 28px 28px; display: grid; gap: 16px }
.auth .box .brand .chip.marque img { width: 46px; border-radius: 9px }
.auth .box .brand { border-bottom: 1px solid var(--line); padding: 0 0 16px; margin: 0 }
.auth .box h2 { font-size: 20px }
.auth .box .steps { display: flex; gap: 6px } .auth .box .steps i { flex: 1; height: 3px; border-radius: 99px; background: var(--line) } .auth .box .steps i.on { background: var(--night) }
.auth .note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center }
.otp { font: 500 26px var(--f-mono); letter-spacing: .45em; text-align: center; padding: 10px }
.err-box { background: var(--bad-soft); color: var(--bad); border-radius: 6px; padding: 10px 12px; font-size: 13.5px }
.info-box { background: var(--blue-soft); color: var(--ink2); border-radius: 6px; padding: 10px 12px; font-size: 13.5px }
.warn-box { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 10px 12px; font-size: 13.5px }

/* ---------- divers */
.qr { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px; width: 190px; max-width: 100% } .qr svg { width: 100%; height: auto; display: block }
.secret { font: 500 14px var(--f-mono); letter-spacing: .06em; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere }
iframe.bilan { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 6px; background: #fff }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px }
.st { border: 1px solid var(--line); border-radius: 6px; padding: 11px 13px; display: flex; gap: 10px; align-items: flex-start; background: var(--surface) }
.st i { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--c, var(--muted)) }
.st.ok i { --c: var(--ok) } .st.warn i { --c: var(--warn) } .st.bad i { --c: var(--bad) }
.st b { display: block; font-weight: 600 } .st small { color: var(--muted); font-size: 12.5px }
.comment { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line) }
.comment:last-child { border-bottom: 0 }
.comment .txt { white-space: pre-wrap; overflow-wrap: anywhere }
.mail { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; display: grid; gap: 4px; background: var(--surface) }
.mail pre { white-space: pre-wrap; font: 13px/1.5 var(--f-body); margin: 6px 0 0; color: var(--ink2); max-height: 220px; overflow: auto }
.day { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line) }
.day:last-child { border-bottom: 0 }
.day .dh { font-weight: 600; text-transform: capitalize } .day .dh small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400 }
.progs { display: grid; gap: 4px }
.progline { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 10px; border-radius: 5px; background: var(--bg2) }
.progline .tc, .progline .mono { font-size: 13px }
.progline.sp { box-shadow: inset 3px 0 0 var(--pink) }
.progline > * { min-width: 0 }
@media (max-width: 700px) { .progline { grid-template-columns: minmax(0, 1fr) } .day { grid-template-columns: minmax(0, 1fr); gap: 8px } .progline .row { flex-wrap: wrap } }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)) }
.marks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px } @media (max-width: 700px) { .cmp { grid-template-columns: 1fr } }
.cmp > div { border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: var(--bg2) } .cmp .lbl { font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 6px }
mark.miss { background: var(--bad-soft); color: var(--bad); border-radius: 3px; padding: 0 2px } mark.extra { background: var(--warn-soft); color: var(--warn); border-radius: 3px; padding: 0 2px }
.skeleton { height: 120px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 0, var(--surface2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border: 1px solid var(--line) }
@keyframes sk { to { background-position: -200% 0 } }

/* ---------- assistant IA */
.assist-btn { white-space: nowrap }
.assist { display: grid; grid-template-rows: 1fr auto; min-height: 0; height: 100% }
.assist .msgs { overflow: auto; padding: 18px; display: grid; gap: 12px; align-content: start }
.assist .m { max-width: 92%; padding: 10px 12px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55 }
.assist .m.u { justify-self: end; background: var(--night); color: #fff }
.assist .note-ia { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink2); background: var(--cyan-soft); border-radius: 6px; padding: 8px 10px }
.assist .m.a { justify-self: start; background: var(--surface2); color: var(--ink) }
.assist .m.a a { color: var(--blue); text-decoration: underline }
.assist .m.wait { color: var(--muted); font-style: italic }
.assist .sugg { display: flex; flex-wrap: wrap; gap: 6px }
.assist form { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface) }
.assist form textarea { min-height: 42px; max-height: 160px; resize: none }

@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr) }
  .rail { position: fixed; z-index: 40; width: 264px; transform: translateX(-100%); transition: transform .2s }
  .rail.open { transform: none; box-shadow: var(--shadow) }
  .burger { display: inline-flex !important }
  .topbar { padding: 8px 16px; gap: 8px } .assist-btn span { display: none } .page { padding: 18px 16px 72px } .userbtn .who, .clock, .search kbd { display: none }
  .hero .prog { min-width: 0 } .phead > .row { width: 100% }
}
.burger { display: none }

/* contrôle MXPLORER : tableau en cartes sur mobile */
@media (max-width: 760px) {
  .t.ctrl thead { display: none }
  .t.ctrl tr { display: grid; grid-template-columns: 112px 1fr; gap: 6px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line) }
  .t.ctrl td { display: block; padding: 0; border: 0; text-align: left; white-space: normal }
  .t.ctrl td:first-child { grid-row: span 5 }
  .t.ctrl td:first-child .cap { width: 112px !important }
  .t.ctrl td[colspan] { grid-column: 1 / -1 }
  .t.ctrl td[data-l]::before { content: attr(data-l) " : "; color: var(--muted); font-size: 12px }
  .t.ctrl td[data-l] .sub, .t.ctrl td[data-l] .strong { display: inline; margin-left: 4px }
  .t.ctrl td:last-child { grid-column: 1 / -1 }
}

/* ---------- paramètres : rubriques à gauche, contenu à droite */
.reglages { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start }
.reglages-nav { display: grid; gap: 2px; position: sticky; top: 76px }
.reglages-nav button { text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 6px; font-weight: 500; color: var(--ink2); cursor: pointer }
.reglages-nav button:hover { background: var(--surface2) }
.reglages-nav button.on { background: var(--blue-soft); color: var(--night); font-weight: 600; box-shadow: inset 3px 0 0 var(--pink) }
@media (max-width: 860px) { .reglages { grid-template-columns: minmax(0, 1fr) } .reglages-nav { position: static; grid-auto-flow: column; overflow-x: auto } .reglages-nav button { white-space: nowrap } }
.etapes { list-style: none; margin: 0; padding: 0; display: grid }
.etapes li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line) }
.etapes li:last-child { border-bottom: 0 }
.etapes .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: var(--surface2); color: var(--ink2) }
.etapes li.fait .num { background: var(--ok-soft); color: var(--ok) }
.etapes li.fait b { color: var(--muted); font-weight: 500 }
.etapes small { display: block; color: var(--muted); font-size: 12.5px }
.source { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px }
.source small { display: block; margin-top: 4px; line-height: 1.5 }

/* ---------- cycle de vie d'une campagne : où en est-on, que faire ensuite */
.cycle { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; border-top: 1px solid var(--line); padding-top: 12px }
.cycle .et { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 0 }
.cycle .et i { height: 4px; border-radius: 99px; background: var(--line) }
.cycle .et.fait i { background: var(--ok) } .cycle .et.fait { color: var(--ink2) }
.cycle .et.actuel i { background: var(--brand-grad) } .cycle .et.actuel { color: var(--night); font-weight: 600 }
.cycle .et span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.suite { display: flex; gap: 12px; align-items: center; background: var(--blue-soft); border-radius: 6px; padding: 10px 12px; font-size: 13.5px }
.suite b { color: var(--night) }
@media (max-width: 760px) { .cycle { grid-template-columns: repeat(4, minmax(0, 1fr)) } }

/* ---------- graphiques */
.chart .grille { stroke: var(--line); stroke-width: 1 }
.chart .ax, .chart text { fill: var(--muted); font: 11px var(--f-body) }
.chart .col { cursor: default; outline: none } .chart .col:hover path, .chart .col:hover rect[fill]:not([fill="transparent"]), .chart .col:focus path { filter: brightness(1.12) }
.bulle { position: fixed; z-index: 90; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 8px 10px; font-size: 12.5px; pointer-events: none; display: grid; gap: 3px; min-width: 120px }
.bulle .bl { display: flex; align-items: center; gap: 7px } .bulle .bl i { width: 12px; height: 3px; border-radius: 2px; flex: none } .bulle b { font-weight: 600; color: var(--ink) } .bulle span { color: var(--muted) }
.anneau { display: flex; gap: 20px; align-items: center; flex-wrap: wrap }
.anneau svg { flex: none } .anneau .arc { cursor: default; outline: none; transition: stroke-width .15s } .anneau .arc:hover, .anneau .arc:focus { stroke-width: 22 }
.anneau .av { font: 600 28px var(--f-head); fill: var(--ink) } .anneau .al { font: 12px var(--f-body); fill: var(--muted) }
.leg { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; min-width: 170px; flex: 1 }
.leg li { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: center; font-size: 13px; color: var(--ink2) }
.leg i { width: 10px; height: 10px; border-radius: 3px } .leg b { font-weight: 600; color: var(--ink) }
.spark { display: block; margin-top: 6px }
.jauge { display: block; max-width: 260px; margin: 0 auto } .jauge .jv { font: 600 34px var(--f-head); fill: var(--ink) } p.jl { margin: -4px 0 0; text-align: center; font-size: 13px; color: var(--muted) }
.jauge-v { transition: stroke-dasharray .8s ease-out }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 280px }
.cal span { aspect-ratio: 1; border-radius: 4px; outline: none } .cal span:hover, .cal span:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--line2) }
.bague text { font: 600 10px var(--f-body); fill: var(--ink) }

/* ---------- tableau de bord : bandeau héros + défis */
.heros { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 16px }
@media (max-width: 1000px) { .heros { grid-template-columns: minmax(0, 1fr) } }
.heros .score { background: var(--night) var(--brand-grad) top / 100% 4px no-repeat; color: #fff; border-radius: var(--r); padding: 18px 20px; display: grid; gap: 10px; align-content: start }
.heros .score .jauge .jv { fill: #fff } .heros .score p.jl { color: #d9d4e6 } .heros .score .jauge path:first-child { stroke: rgb(255 255 255 / .12) }
.heros .score h2 { color: #fff } .heros .score .sous { color: #b9b2cc; font-size: 13px }
.badges { display: flex; flex-wrap: wrap; gap: 6px }
.badge-r { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 5px 10px; border-radius: 99px; background: rgb(255 255 255 / .1); color: #fff }
.badge-r svg { width: 14px; height: 14px; color: var(--cyan) }
.badge-r.clair { background: var(--blue-soft); color: var(--night) } .badge-r.clair svg { color: #6a4fd6 }
.kpi .spark { width: 100%; height: 30px }
.defi { display: grid; gap: 6px }
.defi .row { font-size: 13px }
.classement { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px }
.classement li { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px solid var(--line) }
.classement li:last-child { border-bottom: 0 }
.classement .rang { font-weight: 600; color: var(--muted); text-align: center } .classement li:first-child .rang { color: var(--pink) }
.classement small { display: block; color: var(--muted); font-size: 12px }
.classement .pts { font-weight: 600; font-size: 15px } .classement .pts small { text-align: right }

/* ---------- tableaux kanban (glisser-déposer) */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start }
.kcol { background: var(--surface2); border-radius: var(--r); padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 200px; transition: background .15s, box-shadow .15s }
.kcol.cible { background: var(--blue-soft); box-shadow: inset 0 0 0 2px var(--pink) }
.kcol > header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-weight: 600; font-size: 13.5px }
.kcol > header i { width: 8px; height: 8px; border-radius: 50% } .kcol > header .n { margin-left: auto; color: var(--muted); font-weight: 500 }
.kcol > header small { display: block; font-weight: 400; color: var(--muted); font-size: 12px }
.kcarte { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; cursor: grab; box-shadow: 0 1px 2px rgb(21 15 36 / .04); transition: box-shadow .15s, transform .15s }
.kcarte:hover { box-shadow: 0 4px 14px rgb(21 15 36 / .10) } .kcarte:focus-visible { outline: 2px solid var(--pink) }
.kcarte.glisse { opacity: .45; transform: rotate(1.5deg) } .kcarte .tete { display: flex; gap: 10px; align-items: flex-start }
.kcarte .tete div { min-width: 0; flex: 1 } .kcarte b { display: block; font-size: 13.5px } .kcarte small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.kcarte .pied { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted) }
.kcarte .pied .grow { flex: 1 }
.kvide { border: 1.5px dashed var(--line2); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); font-size: 12.5px }

/* ---------- validation rapide */
.rapide { display: grid; gap: 14px; max-width: 920px; margin: 0 auto; width: 100% }
.rapide .carte-v { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid }
.rapide .carte-v img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #000; display: block }
.rapide .carte-v .corps { padding: 14px 16px; display: grid; gap: 8px }
.rapide .choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px } .rapide .choix .btn { padding: 14px; font-size: 15px }
.rapide kbd { font: 500 11px var(--f-body); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; opacity: .7; margin-left: 6px }
.bravo { text-align: center; display: grid; gap: 8px; justify-items: center; padding: 40px 20px }
.bravo .rond { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); animation: pop .4s ease-out }
.bravo .rond svg { width: 30px; height: 30px }
@keyframes pop { from { transform: scale(.6); opacity: 0 } }

.heros .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)) }
@media (max-width: 640px) { .heros .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
.kcarte { position: relative } .kcarte .tete { padding-right: 22px }
.kcarte .kdep { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font: 600 16px/1 var(--f-body); opacity: .55 }
.kcarte:hover .kdep, .kcarte:focus-within .kdep, .kcarte .kdep:focus-visible { opacity: 1 } .kcarte .kdep:hover { background: var(--surface2); color: var(--ink) }
@media (hover: none) { .kcarte .kdep { opacity: 1 } }
.rapide .carte-v > img { max-height: 48vh; object-fit: contain }
.rapide .avance { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden }
.rapide .avance i { display: block; height: 100%; background: linear-gradient(90deg, #6a4fd6, var(--pink)); border-radius: 99px; transition: width .3s }
.avancement { display: grid; gap: 16px }
.avancement .leg { flex: 0 1 300px }
