:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #15181c; --muted: #5d6671; --faint: #8a929b;
  --line: #e4e7eb; --soft: #f0f2f4;
  --ok: #16a05a; --ok2: #8fd4aa; --warn: #e39a0b; --ko: #d93b3b; --maint: #2e6be6; --unk: #9aa2ab;
  --none: #e0e4e8;
  --c1: #2e6be6; --c2: #16a05a; --c3: #a855c7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1014; --card: #151a20; --text: #e7eaee; --muted: #9ca5b0; --faint: #747d88;
    --line: #232a32; --soft: #1c222a;
    --ok: #2fbf71; --ok2: #2a7a4e; --warn: #f0a92a; --ko: #ef5a5a; --maint: #5b8ff2; --unk: #5b636d;
    --none: #262d36;
    --c1: #5b8ff2; --c2: #2fbf71; --c3: #c27ae0;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { max-width: 860px; margin: 0 auto; padding: 40px 16px 56px; }
[hidden] { display: none !important; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
h1 { font-size: 25px; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.015em; }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.contact {
  flex: none; font-size: 14px; font-weight: 560; color: var(--text); text-decoration: none;
  border: 1px solid var(--line); background: var(--card); padding: 7px 14px; border-radius: 999px;
}
.contact:hover { border-color: var(--faint); }

h2 {
  display: flex; align-items: baseline; gap: 8px; margin: 34px 0 10px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
h2 .sub { font-weight: 450; letter-spacing: 0; text-transform: none; color: var(--faint); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Bandeau global */
.overall { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius); color: #fff; }
.overall.ok { background: var(--ok); } .overall.warn { background: var(--warn); }
.overall.ko { background: var(--ko); } .overall.maint { background: var(--maint); }
.overall.unk { background: var(--unk); }
.overall-icon {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); display: grid; place-items: center;
}
.overall-icon svg { width: 22px; height: 22px; }
.overall-title { font-size: 18px; font-weight: 650; line-height: 1.3; }
.overall-sub { font-size: 13.5px; opacity: .92; }

/* Annonces */
.callout {
  margin-top: 12px; padding: 14px 18px; background: var(--card); border: 1px solid var(--line);
  border-left: 4px solid var(--maint); border-radius: 12px; box-shadow: var(--shadow);
}
.callout.info { border-left-color: var(--warn); }
.callout-title { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.callout-title svg { width: 16px; height: 16px; color: var(--maint); flex: none; }
.callout.info .callout-title svg { color: var(--warn); }
.callout-msg { margin-top: 2px; }
.callout-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Composants */
.comp { padding: 18px 20px 16px; border-top: 1px solid var(--line); }
.comp:first-child { border-top: 0; }
.comp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.comp-name { font-weight: 620; }
.comp-desc { color: var(--muted); font-size: 13px; }
.pill { flex: none; display: inline-flex; align-items: center; gap: 7px; padding-top: 2px; font-size: 13px; font-weight: 640; white-space: nowrap; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.ko { color: var(--ko); }
.pill.maint { color: var(--maint); } .pill.unk { color: var(--unk); }
.bars { display: flex; gap: 2px; height: 34px; margin-top: 12px; }
.bars .b { flex: 1; min-width: 2px; border-radius: 2px; cursor: pointer; transition: opacity .12s; }
.b { background: var(--none); }
.b.ok { background: var(--ok); } .b.ok2 { background: var(--ok2); } .b.warn { background: var(--warn); }
.b.ko { background: var(--ko); } .b.none { background: var(--none); }
@media (hover: hover) { .bars:hover .b { opacity: .55; } .bars .b:hover { opacity: 1; } }
.bars-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--faint); font-size: 12px; white-space: nowrap; }
.bars-foot .rule { flex: 1; height: 1px; background: var(--line); }
.bars-foot .up { color: var(--muted); font-weight: 560; }
.legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 14px; margin-top: 10px; color: var(--faint); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Délai de livraison */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.kpi { padding: 16px 20px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi b { display: block; font-size: 22px; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi span { color: var(--muted); font-size: 13px; }
.chart { position: relative; height: 190px; margin: 26px 20px 0; touch-action: pan-y; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.chart .axis { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .line { fill: none; stroke-width: 1.8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart .area { opacity: .1; }
.chart .cross { stroke: var(--faint); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ylab { position: absolute; left: 0; transform: translateY(-100%); padding-bottom: 2px; font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.xlabs { position: relative; height: 24px; margin: 0 20px; }
.xlab { position: absolute; top: 6px; transform: translateX(-50%); font-size: 11px; color: var(--faint); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 4px 20px 16px; font-size: 12.5px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 7px; vertical-align: 3px; }

/* Disponibilité */
table.uptime { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.uptime th, .uptime td { padding: 11px 20px; text-align: right; border-top: 1px solid var(--line); font-size: 14px; white-space: nowrap; }
.uptime thead th { border-top: 0; padding-top: 13px; padding-bottom: 9px; color: var(--faint); font-weight: 560; font-size: 12px; }
.uptime th:first-child, .uptime td:first-child { text-align: left; white-space: normal; }
.uptime td.low { color: var(--warn); font-weight: 620; }
.uptime td.bad { color: var(--ko); font-weight: 620; }

/* Incidents */
.inc { display: flex; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.inc:first-child { border-top: 0; }
.inc-mark { flex: none; width: 4px; border-radius: 2px; background: var(--ok); }
.inc.open .inc-mark { background: var(--ko); }
.inc-title { font-weight: 620; }
.inc-meta { color: var(--muted); font-size: 13px; }
.tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; vertical-align: 1px; background: var(--soft); color: var(--muted); }
.inc.open .tag { background: var(--ko); color: #fff; }
.empty { padding: 18px 20px; color: var(--muted); }
.more { display: block; width: 100%; padding: 12px; border: 0; border-top: 1px solid var(--line); background: none; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; border-radius: 0 0 var(--radius) var(--radius); }
.more:hover { color: var(--text); background: var(--soft); }

footer { margin-top: 36px; text-align: center; color: var(--faint); font-size: 12.5px; line-height: 1.7; }
footer a { color: inherit; }

/* Infobulle */
.tip {
  position: absolute; z-index: 10; max-width: 270px; padding: 10px 12px; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 12.5px; line-height: 1.45; pointer-events: none;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
}
.tip-date { font-weight: 650; margin-bottom: 2px; }
.tip-date::first-letter { text-transform: uppercase; }
.tip-muted { opacity: .72; }
.tip-row { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.tip-row i { width: 8px; height: 8px; border-radius: 50%; flex: none; }

@media (max-width: 640px) {
  main { padding: 24px 16px 40px; }
  h1 { font-size: 21px; }
  .top { flex-direction: column; align-items: flex-start; gap: 10px; }
  .overall { padding: 16px; }
  .overall-title { font-size: 16.5px; }
  .comp { padding: 16px 16px 14px; }
  .kpi { padding: 12px 14px; } .kpi b { font-size: 18px; } .kpi span { font-size: 12px; }
  .chart { margin: 24px 14px 0; height: 160px; } .xlabs { margin: 0 14px; }
  .chart-legend { padding: 4px 14px 14px; }
  .uptime th, .uptime td { padding: 10px 12px; font-size: 13px; }
  .uptime .wide { display: none; }
  .inc { padding: 13px 16px; }
  .legend { justify-content: flex-start; }
}
