/* hbtroc · manager */
:root {
  --marine: #141a1d; --marine-2: #2b3337; --bleu: #e00000; --bleu-fonce: #b30000;
  --glacier: #f2f3f5; --fond: #f6f7f8; --blanc: #fff; --trait: #e2e4e8; --texte: #1f2529; --doux: #5d656c;
  --vert: #1f8a4c; --orange: #b26a00; --rouge: #c22a20; --ambre: #ffb53d;
  --titre: "Outfit", system-ui, sans-serif; --corps: "Atkinson Hyperlegible", system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.5 var(--corps); }
a { color: var(--bleu); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--titre); color: var(--marine); line-height: 1.12; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.015em; word-spacing: .1em; }
h1 { font-size: 2rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.08rem; font-weight: 700; }
.cadre { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: linear-gradient(90deg, #fff 236px, var(--fond) 236px); }
.cote { background: #fff; color: var(--doux); border-right: 1px solid var(--trait); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.cote .marque { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; }
.cote .marque img { height: 34px; }
.cote .marque span { font-family: var(--titre); font-size: 1.3rem; font-weight: 800; color: var(--marine); letter-spacing: -.02em; }
.cote nav a { display: flex; justify-content: space-between; align-items: center; color: var(--texte); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 700; }
.cote nav a:hover { background: var(--glacier); }
.cote nav a[aria-current="page"] { background: var(--bleu); color: #fff; }
.cote nav .groupe { font-size: .78rem; color: var(--doux); padding: 16px 10px 4px; }
.cote .nb { background: var(--bleu); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 8px; line-height: 20px; }
.cote .pied-cote { margin-top: 18px; padding: 10px; font-size: .85rem; color: var(--doux); border-top: 1px solid var(--trait); }
.cote .pied-cote button { background: none; border: 0; color: var(--texte); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
.contenu { padding: 26px 32px 60px; min-width: 0; }
.tete { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.tete h1 { margin: 0; }
.burger-m { display: none; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: 700 .92rem var(--corps); padding: 8px 14px; border-radius: 8px; border: 1.5px solid transparent; background: var(--bleu); color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--bleu-fonce); color: #fff; }
.btn-clair { background: #fff; color: var(--marine); border-color: var(--trait); }
.btn-clair:hover { background: var(--glacier); color: var(--marine); }
.btn-vert { background: var(--vert); } .btn-vert:hover { background: #176d3c; }
.btn-rouge { background: #fff; color: var(--rouge); border-color: #efc4c0; } .btn-rouge:hover { background: #fdf0ef; color: var(--rouge); }
.btn-petit { padding: 5px 10px; font-size: .85rem; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

.grille-k { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: #fff; border: 1px solid var(--trait); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--doux); display: block; }
.kpi b { display: block; font-family: var(--titre); font-size: 1.9rem; letter-spacing: -.02em; color: var(--marine); line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--doux); }
.kpi.alerte-k { border-color: #f2d08a; background: #fffaf0; }
.kpi.alerte-k b { color: var(--orange); }

.panneau { background: #fff; border: 1px solid var(--trait); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.panneau > h2:first-child, .panneau > h3:first-child { margin-top: 0; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.trois { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.deux > .panneau, .trois > .panneau { margin-bottom: 0; }
.espace { margin-bottom: 18px; }

table { width: 100%; border-collapse: collapse; }
.tableau { background: #fff; border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; }
.tableau th, .tableau td { text-align: left; padding: 9px 12px; border-bottom: 1px solid #edf2f8; vertical-align: middle; }
.tableau th { background: #f7f9fc; font-size: .82rem; color: var(--doux); font-weight: 700; white-space: nowrap; }
.tableau tr:last-child td { border-bottom: 0; }
.tableau tr:hover td { background: #fafcff; }
.tableau img { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; display: block; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.defile { overflow-x: auto; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .82rem; }
pre.journal { background: #15191c; color: #dfe3e6; padding: 14px; border-radius: 10px; overflow: auto; max-height: 420px; font-size: .8rem; line-height: 1.45; white-space: pre-wrap; word-break: break-all; }

.puce { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--glacier); color: var(--marine); white-space: nowrap; }
.p-vert { background: #e3f4ea; color: #175f36; } .p-orange { background: #fff1d6; color: #8a5a00; } .p-rouge { background: #fdecea; color: #8e2a22; } .p-marine { background: var(--marine); color: #fff; } .p-gris { background: #eef1f5; color: #5b6f88; }
.etat-svc { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.etat-svc::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--vert); }
.etat-svc.ko::before { background: var(--rouge); }
.etat-svc.ko { color: var(--rouge); }

.onglets { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--trait); }
.onglets a { padding: 8px 14px; text-decoration: none; color: var(--doux); font-weight: 700; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.onglets a[aria-current="page"] { color: var(--marine); border-bottom-color: var(--bleu); }
.onglets a span { color: var(--doux); font-weight: 400; }

label { font-weight: 700; color: var(--marine); display: block; margin-bottom: 4px; font-size: .92rem; }
.aide { font-weight: 400; color: var(--doux); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], select, textarea { width: 100%; font: inherit; color: var(--texte); background: #fff; border: 1.5px solid var(--trait); border-radius: 8px; padding: 8px 10px; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(224, 0, 0, .14); }
.champ { margin-bottom: 14px; }
.ligne { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.case { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--texte); }
.case input { margin-top: 3px; accent-color: var(--bleu); }
.filtres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filtres input, .filtres select { width: auto; min-width: 180px; }

.alerte { border-radius: 10px; padding: 11px 14px; margin-bottom: 14px; border: 1px solid; }
.alerte-ok { background: #eaf7ef; border-color: #b9e2c8; color: #175f36; }
.alerte-err { background: #fdf0ef; border-color: #f0c6c2; color: #8e2a22; }
.alerte-info { background: var(--glacier); border-color: #dcdfe3; color: var(--marine); }
.alerte-attention { background: #fffaf0; border-color: #f2d08a; color: #6b4600; }
.liste-alertes { list-style: none; padding: 0; margin: 0 0 18px; }
.liste-alertes li { margin-bottom: 8px; }

/* Graphiques : une série par graphique, barres bleues, survol avec infobulle */
.graph { position: relative; }
.graph svg { display: block; width: 100%; height: auto; overflow: visible; }
.graph .barre { fill: var(--bleu); }
.graph .barre-fond { fill: transparent; }
.graph g.pt:hover .barre { fill: var(--marine); }
.graph .axe { stroke: #d7e0eb; stroke-width: 1; }
.graph .grille { stroke: #eef2f7; stroke-width: 1; }
.graph text { font: 11px var(--corps); fill: var(--doux); }
.graph .ligne-trace { fill: none; stroke: var(--bleu); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graph .aire { fill: rgba(224, 0, 0, .08); }
.graph .seuil { stroke: var(--rouge); stroke-dasharray: 4 4; stroke-width: 1; }
.infobulle { position: absolute; pointer-events: none; background: var(--marine); color: #fff; font-size: .82rem; padding: 5px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, -110%); display: none; z-index: 5; }
.graph-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.graph-tete b { font-family: var(--titre); font-size: 1.4rem; color: var(--marine); }
.jauge { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.jauge span { display: block; height: 100%; background: var(--bleu); border-radius: 999px; }
.jauge.haute span { background: var(--orange); } .jauge.critique span { background: var(--rouge); }

.mod-carte { display: grid; grid-template-columns: 260px 1fr; gap: 18px; background: #fff; border: 1px solid var(--trait); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.mod-carte .photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: start; }
.mod-carte .photos a:first-child { grid-column: 1 / -1; }
.mod-carte .photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; background: #f7f9fc; border-radius: 8px; padding: 10px 12px; font-size: .92rem; }
details.refus summary { cursor: pointer; display: inline-flex; }
details.refus[open] summary { margin-bottom: 8px; }
dl.fiche { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.fiche dt { color: var(--doux); } dl.fiche dd { margin: 0; font-weight: 700; color: var(--marine); overflow-wrap: anywhere; }
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--glacier); }
.connexion form { background: #fff; border-radius: 16px; padding: 30px; width: min(400px, 100%); box-shadow: 0 20px 50px rgba(20, 26, 29, .12); border-top: 4px solid var(--bleu); }
.connexion img { width: 200px; display: block; margin: 0 auto 14px; }
.connexion h1 { text-align: center; }

@media (max-width: 1100px) { .trois { grid-template-columns: 1fr; } .deux { grid-template-columns: 1fr; } .mod-carte { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .cadre { grid-template-columns: 1fr; background: var(--fond); }
  .cote { position: static; height: auto; padding: 10px 12px; }
  .cote nav { display: none; }
  .cote.ouvert nav { display: block; }
  .cote .entete-m { display: flex; justify-content: space-between; align-items: center; }
  .cote .marque { padding-bottom: 6px; }
  .burger-m { display: block; background: none; border: 1px solid var(--trait); color: var(--marine); border-radius: 8px; padding: 6px 12px; font: 700 .9rem var(--corps); }
  .contenu { padding: 18px 16px 50px; }
  .filtres input, .filtres select { min-width: 0; width: 100%; }
}
