@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url(/static/fonts/figtree-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url(/static/fonts/figtree-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url(/static/fonts/figtree-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url(/static/fonts/figtree-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage"; font-weight: 700; font-display: swap; src: url(/static/fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Bricolage"; font-weight: 800; font-display: swap; src: url(/static/fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); }

/* Couleurs : bleu MIS du logo (#008ABF), encre bleu pétrole, ciel du connecteur ; modules : magenta, orange, sarcelle */
:root {
  --mis: #008abf; --mis-fonce: #006f9c; --encre: #08324a; --ciel: #84cfee;
  --bg: #f1f5f8; --surface: #fff; --surface-2: #f5f8fa; --line: #dde5eb; --text: #10222e; --muted: #5a6b78;
  --atelier: #c0007f; --facture: #c2410c; --compta: #0f766e;
  --rouge: #c62828; --orange: #b45309; --vert: #237a4b; --info: #006f9c;
  --rouge-bg: #fdecec; --orange-bg: #fdf3e3; --vert-bg: #e8f5ee; --info-bg: #e6f4fa;
  --ombre: 0 1px 2px rgba(8, 50, 74, .06), 0 10px 28px rgba(8, 50, 74, .07);
}
:root[data-theme="dark"] {
  --mis: #24a6db; --mis-fonce: #0b6f99; --encre: #e3eef5; --bg: #0a1620; --surface: #10202c; --surface-2: #152a38; --line: #23394a;
  --text: #e3eef5; --muted: #93a8b7; --atelier: #f472b6; --facture: #fb923c; --compta: #2dd4bf;
  --rouge: #f87171; --orange: #fbbf24; --vert: #4ade80; --info: #7dd3fc;
  --rouge-bg: #3a1a1d; --orange-bg: #3a2a12; --vert-bg: #11301f; --info-bg: #0f2c3b; --ombre: 0 1px 2px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 "Figtree", system-ui, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
h2 { font-family: "Bricolage", "Figtree", sans-serif; font-size: 20px; font-weight: 800; margin: 0 0 12px; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--ciel); outline-offset: 2px; }

#pgi-test { background: repeating-linear-gradient(135deg, #b91c1c 0 18px, #991b1b 18px 36px); color: #fff; font-weight: 800; font-size: 13px;
  letter-spacing: .03em; text-align: center; padding: 6px 12px; }

/* ---------- bandeau : le bleu MIS, le câble du logo en filigrane, la phrase du jour ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(160deg, #0096cf 0%, #008abf 45%, #006f9c 100%); }
:root[data-theme="dark"] .hero { background: linear-gradient(160deg, #0b5f84, #07435f); }
.cable { position: absolute; inset: auto 0 -20px 0; width: 100%; height: 260px; pointer-events: none; }
.cable path { fill: none; stroke: rgba(255, 255, 255, .13); stroke-width: 54; stroke-linecap: round; }
.hero-in { position: relative; width: min(1180px, 100% - 32px); margin: 0 auto; padding: 18px 0 30px; }
.hero-top { display: flex; align-items: center; gap: 14px; }
.marque img { display: block; height: 62px; width: auto; }
.sp { flex: 1; }
.maj { font-size: 13px; color: rgba(255, 255, 255, .82); }
.theme { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: grid; place-items: center; }
.theme svg { width: 19px; height: 19px; }
.date { margin: 18px 0 2px; font-size: 15px; color: rgba(255, 255, 255, .85); font-weight: 600; }
.date::first-letter { text-transform: uppercase; }
h1 { font-family: "Bricolage", "Figtree", sans-serif; font-size: clamp(34px, 5vw, 50px); line-height: 1.02; margin: 0; font-weight: 800; letter-spacing: -.02em; }
.verdict { margin: 10px 0 0; font-size: clamp(18px, 2.2vw, 23px); font-weight: 600; max-width: 46ch; line-height: 1.3; }
.verdict b { background: #fff; color: var(--rouge); padding: 0 .3em; border-radius: 6px; }
:root[data-theme="dark"] .verdict b { background: #fde2e2; color: #9b1c1c; }
.meteos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.meteo { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .26); font-size: 14px; }
.meteo .em { font-size: 24px; line-height: 1; }
.meteo b { display: block; font-size: 15px; }
.meteo small { display: block; color: rgba(255, 255, 255, .82); font-size: 12.5px; }
.meteo .jauge { width: 72px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.meteo .jauge i { display: block; height: 100%; border-radius: 3px; background: #fff; }

.page { width: min(1180px, 100% - 32px); margin: 0 auto; padding: 22px 0 40px; flex: 1; display: flex; flex-direction: column; gap: 22px; }

/* ---------- messages du chef ---------- */
.annonces { display: flex; flex-direction: column; gap: 8px; }
.annonces:empty { display: none; }
.annonce { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.annonce.imp { background: var(--encre); color: #fff; border-color: transparent; }
:root[data-theme="dark"] .annonce.imp { background: #e3eef5; color: #08324a; }
.annonce svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--info); margin-top: 1px; }
.annonce.imp svg { color: var(--ciel); }
.annonce p { margin: 0; font-size: 15.5px; font-weight: 600; }
.annonce small { display: block; font-weight: 500; opacity: .75; font-size: 12.5px; margin-top: 2px; }

/* ---------- à faire (alertes) + modules ---------- */
.haut { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.alerte { display: grid; grid-template-columns: 6px 36px minmax(0, 1fr) auto; align-items: center; gap: 0 14px; padding: 12px 14px 12px 0; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--ombre); overflow: hidden; }
.alerte .rail { align-self: stretch; margin: -12px 0; background: var(--k); }
.alerte .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--kb); color: var(--k); }
.alerte .ic svg { width: 20px; height: 20px; }
.alerte b { display: block; font-size: 15.5px; line-height: 1.3; }
.alerte small { display: block; color: var(--muted); font-size: 13.5px; margin-top: 1px; }
.alerte.rouge { --k: var(--rouge); --kb: var(--rouge-bg); }
.alerte.orange { --k: var(--orange); --kb: var(--orange-bg); }
.alerte.info { --k: var(--info); --kb: var(--info-bg); }
.alerte.rouge b { color: var(--rouge); }
.act { padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; background: var(--k); color: #fff; }
:root[data-theme="dark"] .act { color: #0a1620; }
.alerte.info .act, .alerte.orange .act { background: transparent; color: var(--k); border: 1.5px solid color-mix(in srgb, var(--k) 45%, var(--line)); }
.calme { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 14px; background: var(--vert-bg); color: var(--vert); font-weight: 700; font-size: 16px; }
.calme svg { width: 28px; height: 28px; }
.calme small { display: block; font-weight: 500; color: var(--muted); font-size: 13.5px; }

.mod { --k: var(--mis); display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--k); border-radius: 14px; box-shadow: var(--ombre); text-decoration: none; }
.mod:hover { border-color: color-mix(in srgb, var(--k) 40%, var(--line)); border-left-color: var(--k); }
.mod .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--k); background: color-mix(in srgb, var(--k) 11%, var(--surface)); }
.mod .ic svg { width: 23px; height: 23px; }
.mod b { display: block; font-family: "Bricolage", "Figtree", sans-serif; font-size: 18px; color: var(--k); line-height: 1.15; }
.mod small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.mod small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa9b5; }
.mod.on small::before { background: var(--vert); }
.mod.ko small::before { background: var(--rouge); }
.mod .go { font-weight: 700; font-size: 13.5px; color: var(--k); }

/* ---------- aujourd'hui ---------- */
.jour { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.jour:empty { display: none; }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--ombre); padding: 18px 20px; }
.carte h2 { display: flex; align-items: baseline; gap: 10px; }
.carte h2 small { font-family: "Figtree", sans-serif; font-size: 13px; color: var(--muted); font-weight: 500; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda li { display: grid; grid-template-columns: 62px 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 9px 0; }
.agenda li + li { border-top: 1px dashed var(--line); }
.agenda .h { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.agenda .pt { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--k); }
.agenda b { display: block; font-size: 15px; }
.agenda small { display: block; color: var(--muted); font-size: 13px; }
.agenda .tag { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; color: var(--k); background: color-mix(in srgb, var(--k) 11%, var(--surface)); white-space: nowrap; }
.vide { color: var(--muted); padding: 4px 0; }
.fin .ligne { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.fin .ligne + .ligne { border-top: 1px solid var(--line); }
.fin .coche { width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; }
.fin .coche.ok { background: var(--vert); border-color: var(--vert); }
.fin .coche svg { width: 14px; height: 14px; }
.fin .lib { flex: 1; font-size: 14.5px; font-weight: 600; }
.fin .ok + .lib { color: var(--muted); font-weight: 500; }
.btn { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--mis); color: var(--mis); }
.progres { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 0 0 6px; }
.progres i { display: block; height: 100%; background: var(--vert); border-radius: 4px; }

/* ---------- indicateurs ---------- */
.kpis { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.kpis:empty { display: none; }
.kpis > h2 { grid-column: 1 / -1; margin: 6px 0 -8px; }
.kg { --k: var(--mis); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--ombre); padding: 18px 20px 20px; }
.kg.large { grid-column: 1 / -1; }
.kg h3 { margin: 0 0 12px; font-size: 16px; color: var(--k); display: flex; align-items: center; gap: 8px; }
.kg h3 svg { width: 18px; height: 18px; }
.vedette { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.grand { font-family: "Bricolage", "Figtree", sans-serif; font-size: clamp(40px, 5vw, 56px); font-weight: 800; line-height: .95; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.grand-lib { color: var(--muted); font-size: 14px; margin-top: 6px; }
.tend { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; padding: 3px 9px; border-radius: 9px; }
.tend.up { color: var(--vert); background: var(--vert-bg); }
.tend.down { color: var(--rouge); background: var(--rouge-bg); }
.tend.neutre { color: var(--muted); background: var(--surface-2); }
.objectif { margin-top: 16px; }
.objectif .barre { position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.objectif .barre i { position: absolute; inset: 0 auto 0 0; background: var(--k); border-radius: 6px; }
.objectif .barre .rythme { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .5; }
.objectif .leg { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; gap: 10px; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0; margin-top: 16px; border-top: 1px solid var(--line); }
.ch { padding: 12px 12px 0 0; }
.ch + .ch { padding-left: 12px; border-left: 1px solid var(--line); }
.ch .v { font-family: "Bricolage", "Figtree", sans-serif; font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ch .v small { font-family: "Figtree", sans-serif; font-size: 13px; font-weight: 600; color: var(--muted); }
.ch .l { font-size: 13px; color: var(--muted); }
.ch .l.rouge { color: var(--rouge); font-weight: 600; }
.mini { margin: 18px 0 0; }
.mini svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.mini .b { fill: color-mix(in srgb, var(--k) 38%, var(--surface)); }
.mini .b.cur { fill: var(--k); }
.mini .b.plein { fill: var(--rouge); }
.mini .hit { fill: transparent; }
.mini .fond { fill: var(--surface-2); }
.mini g:hover .b { fill: var(--k); }
.mini g:hover .b.plein { fill: var(--rouge); }
.mini .ax { display: grid; font-size: 11.5px; color: var(--muted); margin-top: 4px; text-align: center; }
.mini figcaption { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.tech { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tm { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; }
.tm span { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.pt { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.pt.ok { background: var(--vert); } .pt.warn { background: var(--orange); } .pt.err { background: var(--rouge); }

.pied { text-align: right; padding: 14px 28px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }

@media (max-width: 980px) {
  .haut, .jour, .kpis, .tech { grid-template-columns: 1fr; }
  .pied { padding: 14px 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .alerte.rouge .rail { animation: pouls 2.4s ease-in-out 3; }
  @keyframes pouls { 50% { opacity: .35; } }
}
