:root {
  --fond: #f4f6f9; --carte: #fff; --texte: #1f2937; --doux: #6b7280; --ligne: #e5e7eb;
  --bleu: #1e3a5f; --accent: #2563eb; --ok: #16a34a; --ko: #dc2626; --attention: #d97706; --pause: #9ca3af;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--fond); color: var(--texte); }
.entete { display: flex; align-items: center; gap: 24px; padding: 0 20px; height: 56px; background: var(--bleu); color: #fff; position: sticky; top: 0; z-index: 5; }
.marque { font-size: 16px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo { width: 22px; height: 22px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.3); }
#onglets { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
#onglets button { background: none; border: 0; color: #cbd5e1; padding: 8px 12px; border-radius: 6px; cursor: pointer; font: inherit; white-space: nowrap; }
#onglets button.actif, #onglets button:hover { background: rgba(255,255,255,.12); color: #fff; }
.compte { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #cbd5e1; white-space: nowrap; }
button.lien { background: none; border: 0; color: #93c5fd; cursor: pointer; font: inherit; text-decoration: underline; }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px; background: var(--carte); border-bottom: 1px solid var(--ligne); align-items: center; }
.filtres select, .filtres input, .formulaire input, .formulaire select { padding: 7px 10px; border: 1px solid var(--ligne); border-radius: 6px; font: inherit; background: #fff; }
.filtres input { min-width: 200px; }
.maj { margin-left: auto; color: var(--doux); font-size: 12px; }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }
.chargement, .vide { color: var(--doux); text-align: center; padding: 40px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--carte); border-radius: 10px; padding: 16px; border: 1px solid var(--ligne); }
.kpi .val { font-size: 26px; font-weight: 650; margin-top: 4px; }
.kpi .lib { color: var(--doux); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi .sous { color: var(--doux); font-size: 12px; margin-top: 2px; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.carte h2 { font-size: 15px; margin: 0 0 12px; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
th { font-size: 12px; color: var(--doux); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; user-select: none; white-space: nowrap; }
tr.cliquable { cursor: pointer; }
tr.cliquable:hover td { background: #f8fafc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pastille { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.OK, .running { background: var(--ok); } .KO, .impaired { background: var(--ko); } .PAUSE, .stopped, .\? { background: var(--pause); } .lent { background: var(--attention); }
.etiquette { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef2ff; color: #3730a3; }
.etiquette.preprod { background: #fef3c7; color: #92400e; }
.vert { color: var(--ok); } .rouge { color: var(--ko); } .orange { color: var(--attention); } .gris { color: var(--doux); }
.alerte { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ligne); }
.alerte:last-child { border: 0; }
.alerte .quoi { font-weight: 600; }
.alerte .detail { color: var(--doux); font-size: 13px; }
.barre { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; min-width: 80px; }
.barre span { display: block; height: 100%; }
#panneau { position: fixed; inset: 0; z-index: 10; }
.panneau-fond { position: absolute; inset: 0; background: rgba(15,23,42,.45); }
.panneau-corps { position: absolute; top: 0; right: 0; bottom: 0; width: min(1000px, 100%); background: var(--fond); overflow-y: auto; padding: 24px; box-shadow: -8px 0 24px rgba(0,0,0,.15); }
.fermer { position: absolute; top: 12px; right: 16px; border: 0; background: none; font-size: 28px; cursor: pointer; color: var(--doux); }
.titre-detail { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.titre-detail h1 { font-size: 20px; margin: 0; }
.periodes { display: inline-flex; border: 1px solid var(--ligne); border-radius: 8px; overflow: hidden; margin-bottom: 16px; background: #fff; }
.periodes button { border: 0; background: none; padding: 7px 14px; cursor: pointer; font: inherit; }
.periodes button.actif { background: var(--accent); color: #fff; }
.graphiques { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 16px; }
.graphique { background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px; padding: 12px; height: 260px; display: flex; flex-direction: column; }
.graphique h3 { font-size: 13px; margin: 0 0 6px; color: var(--doux); font-weight: 600; }
.graphique .zone { position: relative; flex: 1; min-height: 0; }
.calendrier { display: grid; grid-template-columns: repeat(auto-fill, 14px); gap: 3px; }
.calendrier span { width: 14px; height: 14px; border-radius: 3px; background: #e5e7eb; }
.legende { color: var(--doux); font-size: 12px; margin-top: 8px; }
.formulaire { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.formulaire input[type=url] { min-width: 280px; }
button.bouton { background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; font: inherit; }
button.bouton.secondaire { background: #fff; color: var(--texte); border: 1px solid var(--ligne); }
.message { margin-top: 8px; font-size: 13px; }
@media (max-width: 860px) {
  .grille2 { grid-template-columns: 1fr; }
  .graphiques { grid-template-columns: 1fr; }
  .compte span { display: none; }
  .masquable { display: none; }
}
