/* APIOI Dashboard — feuille de style unique.
   Ecrite a la main, sans framework : pas de chaine de build npm a maintenir,
   pas de CDN (la CSP servie par Caddy n'autorise que 'self'). */

:root {
  color-scheme: dark;
  --bg: #111312;
  --surface: #191c1a;
  --surface-2: #151816;
  --border: #2c302d;
  --text: #f1f3f1;
  --muted: #a0a9a3;
  --accent: #66dda5;
  --ok: #66dda5;
  --warn: #e6bc77;
  --ko: #ef9393;
  --critical: #ffaaaa;
  --radius: 8px;
  --shadow: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }
.muted { color: var(--muted); }
.block { display: block; font-size: .85em; margin-top: 2px; }
.ok { color: var(--ok); font-weight: 600; }
.ko { color: var(--ko); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }

/* --- Barre superieure ---------------------------------------------------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand { font-weight: 700; text-decoration: none; color: var(--text); letter-spacing: -.01em; }

.nav { display: flex; gap: 16px; margin-right: auto; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); border-bottom-color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.tenant-switch { display: flex; gap: 6px; }
.tenant-name { font-weight: 600; }

select, input[type=text], input[type=email], input[type=password] {
  font: inherit;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
}

button { font: inherit; cursor: pointer; border-radius: 8px; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 11px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #10251a;
  padding: 10px 14px;
  width: 100%;
  font-weight: 600;
}

/* --- Page ---------------------------------------------------------------- */

.page { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }
.page-title { font-size: 22px; margin: 0 0 18px; letter-spacing: -.01em; }

.banner {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid;
  font-size: 14px;
}
.banner-warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.banner-error { border-color: var(--ko); background: color-mix(in srgb, var(--ko) 10%, transparent); }

/* --- Indicateurs --------------------------------------------------------- */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 215px), 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label { color: var(--muted); font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.kpi-trend { font-size: 12px; color: var(--muted); }
.trend-up { color: var(--ok); }
.trend-down { color: var(--ko); }

/* Largeurs par paliers de 10 % : une largeur en ligne serait bloquee par la
   CSP, et un palier suffit a la lecture. */
.bar { display: block; height: 4px; background: var(--border); border-radius: 3px; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bar-0 i { width: 0; }
.bar-10 i { width: 10%; }
.bar-20 i { width: 20%; }
.bar-30 i { width: 30%; }
.bar-40 i { width: 40%; }
.bar-50 i { width: 50%; }
.bar-60 i { width: 60%; }
.bar-70 i { width: 70%; }
.bar-80 i { width: 80%; }
.bar-90 i { width: 90%; }
.bar-100 i { width: 100%; }

.kpi.kpi-alert { border-left: 3px solid var(--warn); }
.kpi.kpi-critical { border-left: 3px solid var(--ko); }
.kpi.kpi-ok { border-left: 3px solid var(--ok); }

/* --- Cartes composées et Deck de domaine (Redesign UI) ------------------ */

/* Grille de cartes composées (2 à 3 colonnes flexibles) */
.compound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* Carte composée : regroupe un hero KPI et des sous-indicateurs contextuels */
.compound-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.compound-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));

}

.compound-card.card-alert { border-left: 1px solid var(--border); }
.compound-card.card-critical { border-left: 1px solid var(--border); }
.compound-card.card-ok { border-left: 1px solid var(--border); }

.compound-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 18px 11px;
  border-bottom: 1px solid var(--border);
}
.compound-title {
  font-size: 14px;
  font-weight: 650;
  margin: 0;
  letter-spacing: -.01em;
}

.compound-body {
  padding: 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Section héroïque de la carte */
.compound-hero {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.compound-hero-value {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.compound-hero-label {
  font-size: 13px;
  color: var(--muted);
}
.compound-hero-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

/* Liste des sous-indicateurs condensés */
.submetric-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.submetric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}
.submetric-label {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.submetric-value {
  font-weight: 600;
  white-space: nowrap;
}

/* Pied de carte avec lien d'action */
.compound-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
}
.compound-foot a {
  text-decoration: none;
  font-weight: 600;
}
.compound-foot a:hover {
  text-decoration: underline;
}

/* --- Deck de Synthèse (Accueil) ------------------------------------------ */

.summary-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

.domain-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color .15s ease;
}
.domain-card:hover {
  border-color: #48524b;
}

.domain-card-cloud { border-top: 1px solid var(--border); }
.domain-card-parc { border-top: 1px solid var(--border); }
.domain-card-support { border-top: 1px solid var(--border); }

.domain-card-head {
  padding: 16px 18px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.domain-card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 2px;
}
.domain-card-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.domain-card-body {
  padding: 12px 18px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.domain-card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.domain-card-foot a {
  font-weight: 600;
  text-decoration: none;
}
.domain-card-foot a:hover {
  text-decoration: underline;
}

/* --- Barre de statut d'inventaire horizontal (Postes) --------------------- */

.fleet-status-bar {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.fleet-status-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fleet-status-item .stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.fleet-status-item .stat-value {
  font-size: 14px;
  font-weight: 650;
}
.fleet-status-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* --- Badges et pastilles de statut --------------------------------------- */

.panel-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.badge-status-ok {
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  border-color: var(--ok);
  color: var(--ok);
}
.badge-status-warn {
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border-color: var(--warn);
  color: var(--warn);
}
.badge-status-ko {
  background: color-mix(in srgb, var(--ko) 10%, transparent);
  border-color: var(--ko);
  color: var(--ko);
}
.badge-status-muted {
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  border-color: var(--border);
  color: var(--muted);
}

.tag-cloud {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  color: var(--accent);
}
.tag-parc {
  border-color: color-mix(in srgb, var(--ok) 35%, var(--border));
  color: var(--ok);
}

/* --- Domaines : tenant Microsoft 365 / postes / support ------------------- */

/* La separation visuelle n'est pas de la decoration : c'est elle qui porte
   l'information « ce sont deux perimetres distincts, tenus separement ». Un
   simple titre ne suffisait pas — les grilles d'indicateurs se rejoignaient a
   l'oeil et le lecteur relisait une seule liste melangee. */
.domain { margin: 0 0 40px; }
.domain + .domain { border-top: 1px solid var(--border); padding-top: 26px; }

.domain-head { margin: 0 0 16px; border-left: 3px solid var(--accent); padding-left: 12px; }
.domain-title { font-size: 17px; margin: 0 0 4px; letter-spacing: -.01em; }
.domain-hint { margin: 0; color: var(--muted); font-size: 13px; max-width: 78ch; }

/* Une couleur par perimetre, tenue sur toutes les pages : le lecteur reconnait
   le bloc avant d'en lire le titre. */
.domain-parc .domain-head { border-left-color: var(--ok); }
.domain-support .domain-head { border-left-color: var(--muted); }
.domain-autre .domain-head { border-left-color: var(--warn); }

.lead { max-width: 78ch; margin: 0 0 24px; font-size: 14px; }
.sub-title { font-size: 15px; margin: 26px 0 10px; }
.domain-foot { margin: 0; font-size: 14px; }

/* --- Panneaux et tableaux ------------------------------------------------ */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 15px; margin: 0; }
.panel-foot { padding: 12px 16px; margin: 0; font-size: 14px; }
.panel-note { padding: 14px 16px 0; margin: 0; font-size: 13px; }
.panel + .panel { margin-top: 24px; }
/* Les pastilles de gravite vivent aussi dans un en-tete de panneau, ou la
   marge basse prevue pour l'usage autonome desaxerait la ligne. */
.panel-head .sev-summary { margin-bottom: 0; }

.sev-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.row-warn { background: color-mix(in srgb, var(--warn) 7%, transparent); }

.table details { margin-top: 6px; }
.table summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.table pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  overflow-x: auto;
  font-size: 12px;
  max-height: 260px;
}

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.pill-critical { color: var(--critical); border-color: var(--critical); }
.pill-high { color: var(--ko); border-color: var(--ko); }
.pill-medium { color: var(--warn); border-color: var(--warn); }
.pill-low, .pill-info { color: var(--muted); border-color: var(--border); }

.tag {
  display: inline-block;
  padding: 1px 7px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.empty { padding: 24px 16px; color: var(--muted); text-align: center; }

.footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 20px 40px;
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* --- Connexion ----------------------------------------------------------- */

body.centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 28px;
  width: 100%;
  max-width: 380px;
}
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card p { margin: 0 0 20px; font-size: 13px; }
.login-card label {
  display: block;
  margin: 14px 0 5px;
  font-size: 13px;
  font-weight: 600;
}
.login-card input { width: 100%; }
.login-card button { margin-top: 22px; }

/* --- Histogramme de volume ------------------------------------------------
   Hauteurs en classes et non en style inline : la CSP servie par Caddy
   n'autorise pas les attributs `style`. Pas de canvas ni de librairie de
   graphes non plus — une douzaine de barres ne justifie pas une dependance. */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 16px;
  min-height: 160px;
}
.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.chart-count { font-size: 12px; color: var(--muted); }
.chart-bar {
  display: flex;
  align-items: flex-end;
  width: 100%;
  max-width: 46px;
  height: 96px;
}
.chart-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
}
.chart-h0 i { height: 0%; }
.chart-h5 i { height: 5%; }
.chart-h10 i { height: 10%; }
.chart-h15 i { height: 15%; }
.chart-h20 i { height: 20%; }
.chart-h25 i { height: 25%; }
.chart-h30 i { height: 30%; }
.chart-h35 i { height: 35%; }
.chart-h40 i { height: 40%; }
.chart-h45 i { height: 45%; }
.chart-h50 i { height: 50%; }
.chart-h55 i { height: 55%; }
.chart-h60 i { height: 60%; }
.chart-h65 i { height: 65%; }
.chart-h70 i { height: 70%; }
.chart-h75 i { height: 75%; }
.chart-h80 i { height: 80%; }
.chart-h85 i { height: 85%; }
.chart-h90 i { height: 90%; }
.chart-h95 i { height: 95%; }
.chart-h100 i { height: 100%; }
.chart-label { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* --- Note de bas de page d'un tableau ------------------------------------- */

.note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* --- Vue patron (2026-09-06) ----------------------------------------------- */

/* Bandeau de note : sous la barre, sur toutes les pages. La couleur du bord
   gauche suit le verdict ; le chiffre reste sobre, c'est la note de Microsoft
   et non un feu tricolore d'API-OI. */
.score-band {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.score-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-left: 4px solid var(--accent);
}
.verdict-bon .score-inner { border-left-color: var(--ok); }
.verdict-moyen .score-inner { border-left-color: var(--warn); }
.verdict-faible .score-inner { border-left-color: var(--ko); }
.score-note { white-space: nowrap; }
.score-value { font-size: 34px; font-weight: 700; letter-spacing: -.02em; }
.score-denominator { font-size: 16px; color: var(--muted); }
.score-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.score-head { font-size: 14px; }
.score-body .bar { margin-top: 2px; max-width: 420px; }
.score-foot { font-size: 12px; }
.direction-score { padding: 4px 0; margin-bottom: 24px; }
.direction-score .score-inner { padding: 12px 16px; }

/* Filtre « voir uniquement ce qui ne va pas » : un lien, pas un bouton. */
.view-filter { display: flex; gap: 10px; align-items: center; font-size: 13px; margin: -6px 0 18px; }
.tag-on { color: var(--warn); border-color: var(--warn); }
.btn-link { text-decoration: none; display: inline-block; }

.plain { margin: 0; padding-left: 16px; }
.plain li { margin: 0; }

/* Trente colonnes tiennent si les etiquettes ne sont posees qu'un jour sur
   cinq (fait dans le gabarit) et si l'ecart se resserre. */
.chart-dense { gap: 4px; }
.chart-dense .chart-bar { max-width: 24px; }
.chart-dense .chart-label { font-size: 10px; }

/* Carte des connexions : un SVG en ligne dont le fond est une image
   same-origin (img-src 'self') et dont la geometrie passe par des attributs,
   jamais par style=. Les couleurs des points sont ici. */
.map-wrap { padding: 12px 16px 0; }
.map { width: 100%; height: auto; display: block; background: var(--surface-2); border-radius: 8px; }
.dot { fill: var(--accent); fill-opacity: .75; stroke: var(--surface); stroke-width: .6; }
.dot-fail { fill: var(--warn); }
.dot-new { fill: var(--ko); fill-opacity: .9; }
.dot-inline {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin: 0 4px 0 6px;
  vertical-align: middle;
}
.dot-inline.dot-fail { background: var(--warn); }
.dot-inline.dot-new { background: var(--ko); }

.direction-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.direction-head .page-title { margin-bottom: 4px; }
.direction-head p { margin: 0; font-size: 13px; }

/* Navigation et surfaces : une ossature sobre, commune a toutes les vues. */
body:not(.centered) { padding-left: 224px; }
.topbar { position: fixed; inset: 0 auto 0 0; width: 224px; border-right: 1px solid var(--border); border-bottom: 0; background: #0c0f0d; }
.topbar-inner { height: 100%; padding: 32px 18px 20px; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; letter-spacing: -.04em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; background: var(--accent); color: #10251a; border-radius: 6px; font-size: 18px; font-weight: 800; }
.nav-label, .eyebrow { margin: 0 0 12px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.nav { flex-direction: column; gap: 4px; margin-right: 0; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid transparent; border-radius: 5px; font-size: 13px; }
.nav-icon { width: 16px; height: 16px; flex-shrink: 0; }
.nav a:hover { background: #1b211d; }
.nav a.active { color: var(--accent); background: #17281f; border-color: #254333; }
.topbar-right { margin-top: auto; align-items: stretch; flex-direction: column; gap: 12px; font-size: 12px; }
.topbar-right .tenant-name { padding: 16px 0 0; border-top: 1px solid var(--border); }
.topbar-right .btn-ghost { text-align: center; }
.tenant-switch { flex-wrap: wrap; }
.tenant-switch select { width: 100%; min-width: 0; }
.page { max-width: 1480px; padding: 30px 40px 64px; }
.page-title { font-size: 30px; font-weight: 600; letter-spacing: -.04em; margin-bottom: 8px; }
.page-heading { margin: 12px 0 30px; }
.page-heading .lead { margin: 0; max-width: 90ch; }
.score-inner { max-width: 1480px; padding: 20px 40px; border-left: 0; gap: 24px; }
.score-band { background: var(--surface-2); }
.score-value { font-weight: 500; font-variant-numeric: tabular-nums; }
.score-head { font-size: 13px; }
.score-foot { margin-top: 4px; }
.score-body .bar { max-width: 260px; }
.view-filter { justify-content: flex-end; margin: 0 0 22px; font-size: 12px; }
.view-filter a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--muted); }
.summary-deck { gap: 16px; margin-bottom: 32px; }
.domain-card-head { padding: 22px 22px 0; flex-wrap: wrap; }
.domain-card-title { font-size: 15px; font-weight: 600; }
.domain-card-hint { margin-top: 5px; }
.domain-card-body { padding: 24px 22px 20px; gap: 18px; }
.compound-hero { gap: 8px; }
.compound-hero-value { font-size: 42px; font-weight: 500; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.compound-hero-label { font-size: 12px; }
.compound-head { border-bottom: 0; padding: 20px 22px 0; flex-wrap: wrap; }
.compound-body { padding: 24px 22px; }
.submetric-list { gap: 0; padding-top: 6px; }
.submetric-row { padding: 7px 0; align-items: baseline; font-size: 12px; }
.submetric-label { min-width: 0; }
.submetric-value { text-align: right; white-space: normal; font-variant-numeric: tabular-nums; }
.submetric-value .sev-summary { justify-content: flex-end; margin-bottom: 0; }
.domain-card-foot, .compound-foot { padding: 14px 22px; background: transparent; }
.domain-card-foot a, .compound-foot a { width: 100%; font-size: 12px; font-weight: 500; }
.bar { height: 3px; border-radius: 1px; }
.bar i { border-radius: 1px; }
.badge-status, .pill { font-size: 11px; font-weight: 500; border-radius: 4px; padding: 2px 6px; border-color: transparent; }
.badge-status { background: transparent; padding: 0; }
.badge-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-critical, .pill-high { background: color-mix(in srgb, var(--ko) 9%, transparent); }
.pill-medium { background: color-mix(in srgb, var(--warn) 9%, transparent); }
.kpi { padding: 20px; gap: 10px; }
.kpi-value { font-weight: 500; font-size: 34px; font-variant-numeric: tabular-nums; }
.domain-head { border-left: 0; padding-left: 0; }
.panel-head { padding: 20px 22px; }
.panel-head .muted { font-size: 12px; }
.table { font-size: 13px; }
.table th { font-size: 10px; font-weight: 500; padding: 12px 22px; }
.table td { padding: 16px 22px; }
.table td strong { font-weight: 500; }
.table tbody tr:hover { background: #1e2420; }
.table code { overflow-wrap: anywhere; }
.panel-foot { padding: 16px 22px; font-size: 12px; }
.footer { max-width: 1400px; margin: 0 40px; padding: 20px 0 28px; flex-wrap: wrap; }
.footer span:last-child { margin-left: auto; }
a { text-underline-offset: 4px; }
a, button, select, input { transition: border-color .15s ease, background-color .15s ease; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 30; background: var(--accent); color: #10251a; padding: 12px; }
.skip-link:focus { top: 12px; }
.login-card { padding: 36px; border-radius: 8px; }
.login-card h1 { font-size: 26px; letter-spacing: -.04em; }
@media (min-width: 1400px) { .summary-deck { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  body:not(.centered) { padding-left: 190px; }
  .topbar { width: 190px; }
  .topbar-inner { padding-inline: 14px; }
  .page { padding-inline: 24px; }
  .score-inner { padding-inline: 24px; }
  .footer { margin-inline: 24px; }
}
@media (max-width: 760px) {
  body:not(.centered) { padding-left: 0; }
  .topbar { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .topbar-inner { padding: 18px 20px; gap: 18px; }
  .nav-label { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .nav a { white-space: nowrap; padding: 9px 10px; }
  .nav-icon { display: none; }
  .topbar-right { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .topbar-right .tenant-name { border: 0; padding: 0; }
  .tenant-switch { flex: 1; }
  .tenant-switch select { width: auto; flex: 1; }
  .score-inner { align-items: flex-start; padding: 20px; gap: 16px; }
  .score-value { font-size: 28px; }
  .score-head .muted { display: block; margin-top: 4px; }
  .page { padding: 24px 20px 40px; }
  .page-title { font-size: 26px; }
  .view-filter { justify-content: flex-start; }
  .direction-head { flex-wrap: wrap; }
  .footer { margin-inline: 20px; }
  .fleet-status-divider { display: none; }
  .table { min-width: 760px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* --- Impression --------------------------------------------------------------
   Une vue direction se donne en main propre. Fond blanc, texte noir, rien qui
   depende d'un aplat de couleur : une imprimante par defaut ne les sort pas,
   les pastilles de gravite se lisent donc par leur bordure et leur texte. */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --border: #999;
    --text: #000; --muted: #444; --accent: #000; --ok: #000; --warn: #000;
    --ko: #000; --critical: #000; --shadow: none;
  }
  body:not(.centered) { padding-left: 0; }
  .skip-link { display: none; }
  body { font-size: 12px; background: #fff; color: #000; }
  .topbar, .nav, .footer, .banner, .view-filter, .print-hint, .score-band { display: none !important; }
  .page { max-width: none; padding: 0; }
  .panel, .kpi, .compound-card, .domain-card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .panel + .panel, .domain, .compound-card + .compound-card { break-inside: avoid; }
  .kpi-grid, .compound-grid, .summary-deck { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .kpi-value, .compound-hero-value { font-size: 18px; }
  .fleet-status-bar { border: 1px solid #999; background: none; }
  .pill, .badge-status { border: 1px solid #000; color: #000; background: none; }
  .pill-critical::before { content: "!! "; }
  .pill-high::before { content: "! "; }
  .badge-status-ko::before { content: "[!] "; }
  .badge-status-warn::before { content: "[?] "; }
  .row-warn { background: none; }
  .bar { background: #ddd; }
  .bar i { background: #000; }
  .direction-score .score-inner { border-left: 4px solid #000; }
  a { color: #000; text-decoration: none; }
  .table th { background: #eee; color: #000; }
  details { display: none; }
}

/* Assistant Microsoft */
.assistant-connections, .assistant-actions { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 1.5rem 0; }
.assistant-connections > div { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.assistant-conversation { max-width: 70rem; }
.assistant-exchange { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.assistant-exchange h2 { font-size: 1rem; margin: .6rem 0; }
.assistant-exchange p, .assistant-exchange pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.assistant-exchange pre { max-height: 20rem; overflow: auto; }
#question-form { display: grid; gap: .7rem; max-width: 70rem; margin-top: 1.5rem; }
#question-form textarea { width: 100%; padding: .8rem; font: inherit; resize: vertical; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; }
#question-form button { justify-self: start; }
#assistant-status { min-height: 1.5em; }
#assistant button:disabled { opacity: .6; cursor: not-allowed; }
