/* Cockpit : une seule feuille de style, sans dépendance, aux couleurs de db-apps (fond presque noir ou clair,
   rouge de la marque pour ce qui compte, barre du haut toujours sombre comme sur db-apps.ch).
   Le thème suit le système, sauf choix fait dans la barre : <html data-theme="clair"> ou "sombre". */
:root {
  --fond: #f3f5f7;
  --fond-2: #e8ecf0;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --texte: #0b0f13;
  --discret: #55606b;
  --trait: #d6dce3;
  --accent: #d3222a;
  --accent-texte: #ffffff;
  --lien: #c41d24;
  --ok: #17663a;
  --ok-fond: #e3f3e9;
  --alerte: #7a4b00;
  --alerte-fond: #fff0d2;
  --danger: #b91c22;
  --lueur: rgba(239, 45, 52, .07);
  --ombre: 0 1px 2px rgba(11, 15, 19, .06);
  color-scheme: light;
}
/* Les mêmes valeurs deux fois : une pour « selon le système », une pour le choix « sombre ». */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) {
    --fond: #07090c;
    --fond-2: #0b0f13;
    --surface: #10161c;
    --surface-2: #141b22;
    --texte: #f4f6f8;
    --discret: #a8b1ba;
    --trait: #27313b;
    --accent: #e3252b;
    --accent-texte: #ffffff;
    --lien: #ff6d72;
    --ok: #7ad9a2;
    --ok-fond: #10291c;
    --alerte: #ffc766;
    --alerte-fond: #2f2510;
    --danger: #ff6d72;
    --lueur: rgba(239, 45, 52, .12);
    --ombre: none;
    color-scheme: dark;
  }
}
:root[data-theme="sombre"] {
  --fond: #07090c;
  --fond-2: #0b0f13;
  --surface: #10161c;
  --surface-2: #141b22;
  --texte: #f4f6f8;
  --discret: #a8b1ba;
  --trait: #27313b;
  --accent: #e3252b;
  --accent-texte: #ffffff;
  --lien: #ff6d72;
  --ok: #7ad9a2;
  --ok-fond: #10291c;
  --alerte: #ffc766;
  --alerte-fond: #2f2510;
  --danger: #ff6d72;
  --lueur: rgba(239, 45, 52, .12);
  --ombre: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: radial-gradient(900px 450px at 85% -120px, var(--lueur), transparent 60%) no-repeat, var(--fond);
  color: var(--texte);
  font: 1rem/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
/* Les liens gardent la couleur du texte, comme sur db-apps.ch : le soulignement les désigne, le rouge reste rare. */
a { color: inherit; text-decoration-color: var(--discret); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--lien); text-decoration-color: currentColor; }
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; margin: 0 0 1rem; line-height: 1.15; }
h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.015em; margin: 0 0 .75rem; line-height: 1.3; }
p { margin: 0 0 .75rem; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .875rem; }
pre { background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; padding: .75rem; overflow-x: auto; }
:focus-visible { outline: 2px solid var(--lien); outline-offset: 2px; }

/* Barre du haut : sombre dans les deux thèmes, c'est la signature de db-apps. */
.barre {
  position: sticky; top: 0; z-index: 20; color-scheme: dark; min-height: var(--barre-h);
  display: flex; align-items: center; gap: .375rem .75rem;
  padding: .375rem 1rem; background: rgba(7, 9, 12, .94); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .08); color: #d7dce1;
}
.marque { font-weight: 800; font-size: 1.1875rem; color: #f4f6f8; text-decoration: none; letter-spacing: .01em; white-space: nowrap; }
.marque:hover { color: #f4f6f8; }
.marque b { color: #ef2d34; }
.marque span {
  margin-left: .625rem; padding-left: .625rem; border-left: 1px solid rgba(255, 255, 255, .2);
  font-weight: 600; font-size: .9375rem; color: #a8b1ba;
}
.onglets a { padding: .375rem .625rem; border-radius: 8px; text-decoration: none; white-space: nowrap; color: var(--discret); }
.onglets a:hover { color: var(--texte); background: var(--fond-2); }
.onglets a[aria-current] { color: var(--texte); font-weight: 600; border-radius: 8px 8px 0 0; box-shadow: inset 0 -3px 0 var(--accent); }
.sortie, .theme { margin: 0; }
.theme { margin-left: auto; }
.barre button, .bouton-menu {
  min-height: 2.125rem; padding: .25rem .75rem; background: transparent; color: #d7dce1;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; font-weight: 600; white-space: nowrap;
}
.barre button:hover, .bouton-menu:hover { color: #ffffff; border-color: rgba(255, 255, 255, .45); }

/* Arborescence à gauche : une branche par entité, dépliée là où l'on se trouve. Sombre comme la barre. */
:root { --barre-h: 3.25rem; --arbre-l: 16.5rem; }
body.avec-arbre { display: grid; grid-template-columns: var(--arbre-l) minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
body.avec-arbre > .barre { grid-column: 1 / -1; }
.arbre {
  grid-column: 1; grid-row: 2; position: sticky; top: var(--barre-h); align-self: start;
  height: calc(100vh - var(--barre-h)); overflow-y: auto; padding: .5rem .5rem 2rem;
  background: #0b0f13; color: #c3cad1; border-right: 1px solid rgba(255, 255, 255, .08);
  color-scheme: dark; font-size: .9375rem;
}
body.avec-arbre > main { grid-column: 2; grid-row: 2; margin: 0 auto; width: 100%; }
.arbre a { display: block; padding: .3125rem .625rem; border-radius: 8px; color: #c3cad1; text-decoration: none; }
.arbre a:hover { color: #ffffff; background: rgba(255, 255, 255, .08); }
.arbre a[aria-current] { color: #ffffff; font-weight: 600; background: rgba(255, 255, 255, .09); box-shadow: inset 3px 0 0 #ef2d34; }
.arbre details { margin: 0; }
.arbre summary {
  display: flex; align-items: center; gap: .5rem; list-style: none; cursor: pointer;
  padding: .3125rem .625rem; border-radius: 8px; color: #e6eaee; font-weight: 600;
}
.arbre summary::-webkit-details-marker { display: none; }
.arbre summary::before {
  content: ""; flex: none; width: .4375rem; height: .4375rem; margin: 0 .125rem 0 .0625rem;
  border-right: 2px solid #8f9aa4; border-bottom: 2px solid #8f9aa4; transform: rotate(-45deg); transition: transform .12s;
}
.arbre details[open] > summary::before { transform: rotate(45deg); }
.arbre summary:hover { color: #ffffff; background: rgba(255, 255, 255, .08); }
.arbre .branche { margin: 0 0 .25rem 1rem; padding-left: .375rem; border-left: 1px solid rgba(255, 255, 255, .12); }
.arbre .branche summary { font-weight: 500; color: #c3cad1; }
.arbre .titre { margin: 0; padding: .875rem .625rem .25rem; font-size: .6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #77838d; }
.arbre .pastille { background: transparent; color: #a8b1ba; border-color: rgba(255, 255, 255, .2); font-weight: 500; }
/* Sur un écran étroit, l'arbre se range derrière le bouton « Menu » (une case à cocher, sans script). */
.bascule { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bouton-menu { display: none; align-items: center; cursor: pointer; }
.bascule:focus-visible ~ .barre .bouton-menu { outline: 2px solid #ff6d72; outline-offset: 2px; }
@media (max-width: 900px) {
  body.avec-arbre { display: block; }
  .bouton-menu { display: inline-flex; }
  .arbre { display: none; position: static; height: auto; max-height: none; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .08); padding-bottom: 1rem; }
  .bascule:checked ~ .arbre { display: block; }
  .marque span { display: none; }
}
/* Ce qu'un invité ne peut pas faire ne lui est pas proposé. Le serveur refuse de toute façon (droits.py). */
body.invite main form[action$="/ia"], body.invite main form[action$="/lire-facture"] { display: none !important; }
body.niveau-lecture main form[method="post"],
body.niveau-lecture main details:has(> form[method="post"]),
body.niveau-lecture main a[href$="/nouveau"], body.niveau-lecture main a[href$="/nouvelle"],
body.niveau-lecture main a[href*="/nouveau?"], body.niveau-lecture main a[href$="/modifier"] { display: none !important; }
body.niveau-saisie main form[action$="/comptes"], body.niveau-saisie main form[action$="/exercices"],
body.niveau-saisie main form[action$="/boucler"], body.niveau-saisie main form[action$="/coordonnees"],
body.niveau-saisie main form[action*="/banque/regles/"], body.niveau-saisie main form[action$="/achats/ordre"],
body.niveau-saisie main form[action*="/achats/ordres/"], body.niveau-saisie main form[action$="/budget"],
body.niveau-saisie main form[action$="/budget/copier"], body.niveau-saisie main form[action$="/patrimoine/valeur"],
body.niveau-saisie main form[action$="/envoyer"], body.niveau-saisie main form[action$="/rappeler"] { display: none !important; }

main { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.etroit { max-width: 30rem; margin: 3rem auto; }

.entete { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.entete h1 { margin: 0; }
.onglets {
  display: flex; flex-wrap: wrap; gap: .125rem .25rem; margin: .75rem 0 1.25rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--trait);
}

/* Boutons et champs */
button, .bouton, input, select {
  font: inherit; color: inherit; border: 1px solid var(--trait); border-radius: 10px;
  background: var(--surface); padding: .5rem .75rem; min-height: 2.5rem;
}
button, .bouton { cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; font-weight: 600; }
button:hover, .bouton:hover { border-color: var(--discret); color: inherit; }
.principal { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); font-weight: 700; }
.principal:hover { filter: brightness(1.1); border-color: var(--accent); color: var(--accent-texte); }
.discret { background: transparent; }
.danger { color: var(--danger); }
input[type="file"] { padding: .375rem; max-width: 100%; }
input.court { width: 6rem; }
input.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .05em; width: 100%; }
label { display: inline-flex; flex-direction: column; gap: .25rem; font-size: .875rem; color: var(--discret); }
label input, label select { color: var(--texte); font-size: 1rem; }
.rangee { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin: 0 0 .75rem; }
.rangee form { margin: 0; }
.champs { display: grid; grid-template-columns: 10rem 1fr 12rem; gap: .75rem; margin-bottom: 1rem; }
.champs label input { width: 100%; }
.periode { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem; margin: 0 0 1rem; }

/* Cadres et cartes */
.cadre, .carte {
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--trait);
  border-radius: 14px; padding: 1.125rem; box-shadow: var(--ombre);
}
.cadre { margin: 0 0 1rem; }
.cadre.important { border-color: var(--alerte); }
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.carte header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.carte h2 { margin: 0; }
.carte h2 a { color: var(--texte); text-decoration: none; }
.carte h2 a:hover { text-decoration: underline; }
.carte.inactive { opacity: .75; }
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0 0 .75rem; }
.chiffres.large { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin-bottom: 1.25rem; }
.chiffres.large > div {
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--trait);
  border-radius: 14px; padding: .75rem 1rem; box-shadow: var(--ombre);
}
.chiffres dt { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); }
.chiffres dd { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; text-align: left; font-variant-numeric: tabular-nums; }
.faits { list-style: none; margin: 0 0 1rem; padding: 0; font-size: .875rem; color: var(--discret); }
.faits li { padding: .125rem 0; }
.fiche { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: 0 0 .75rem; }
.fiche dt { font-size: .8125rem; color: var(--discret); }
.fiche dd { margin: 0; }
.libelle { font-size: 1.0625rem; font-weight: 600; }
.empreinte { font-size: .8125rem; color: var(--discret); overflow-wrap: anywhere; margin: .75rem 0 0; }
.pieces, .codes { margin: 0 0 .75rem; padding-left: 1.25rem; }
.codes { font-family: ui-monospace, Consolas, monospace; font-size: 1.0625rem; line-height: 1.9; columns: 2; }

/* Tableaux */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--trait); margin: 0 0 1rem; }
.cadre table { border: 0; margin-bottom: .75rem; background: transparent; }
th, td { padding: .5rem .625rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--trait); }
thead th, tr.titre th {
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--discret); white-space: nowrap;
}
tbody:last-of-type tr:last-child td, tfoot tr:last-child td { border-bottom: 0; }
tfoot td, tr.sous-total td { font-weight: 600; border-top: 1px solid var(--trait); }
tr.report td { color: var(--discret); }
.droite { text-align: right; }
.montant { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.negatif { color: var(--danger); }
.vide { color: var(--discret); text-align: center; padding: 1.25rem; }
.actions { text-align: right; white-space: nowrap; }
.actions form { margin: 0; display: inline; }
.actions button { min-height: 2rem; padding: .25rem .625rem; }
table.journal tr.tete td { font-weight: 600; border-bottom: 0; padding-bottom: .125rem; }
table.journal tr.ligne td { border-bottom: 0; padding-top: .125rem; padding-bottom: .125rem; color: var(--discret); }
table.journal tbody tr:last-child td { border-bottom: 1px solid var(--trait); padding-bottom: .625rem; }
table.saisie td { padding: .25rem; border-bottom: 0; }
table.saisie input { width: 100%; }
table.saisie input.montant { min-width: 7rem; }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }

/* Messages */
.alerte, .succes { border-radius: 10px; padding: .625rem .75rem; }
.alerte a:hover, .succes a:hover { color: inherit; }
.alerte { background: var(--alerte-fond); color: var(--alerte); }
.succes { background: var(--ok-fond); color: var(--ok); }
.note { font-size: .875rem; color: var(--discret); }
.pastille {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: .0625rem .5rem; border-radius: 999px;
  background: var(--fond); color: var(--discret); border: 1px solid var(--trait); white-space: nowrap;
}
.pastille.attente { background: var(--alerte-fond); color: var(--alerte); border-color: transparent; }
[hidden] { display: none !important; }

@media (max-width: 720px) {
  .barre { padding: .375rem .75rem; }
  .onglets { flex-wrap: nowrap; overflow-x: auto; }
  main { padding: 1rem .75rem 3rem; }
  .champs, .deux-colonnes { grid-template-columns: 1fr; }
  .codes { columns: 1; }
  table { display: block; overflow-x: auto; }
  .cadre table { display: block; }
}

/* ---------------------------------------------------------------- Ventes : formulaires */
textarea {
  font: inherit; color: inherit; border: 1px solid var(--trait); border-radius: 10px;
  background: var(--surface); padding: .5rem .75rem; width: 100%; resize: vertical;
}
label textarea { color: var(--texte); font-size: 1rem; }
label.plein { display: flex; }
label.plein input { width: 100%; }
.champs.quatre { grid-template-columns: 1fr 11rem 11rem; }
.champs select, .grille select, .grille input { width: 100%; }
.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: .75rem; }
.grille .deux { grid-column: span 2; }
.grille .trois { grid-column: span 3; }
.filtres { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin: 0 0 1rem; }
.filtres a { padding: .375rem .75rem; border-radius: 999px; border: 1px solid var(--trait); text-decoration: none; color: var(--discret); }
.filtres a:hover { color: var(--texte); border-color: var(--discret); }
.filtres a[aria-current] { background: var(--texte); color: var(--fond); font-weight: 600; border-color: var(--texte); }
.filtres .pousse { flex: 1; }
table.saisie select { width: 100%; min-width: 8rem; }
table.saisie input.court { width: 5rem; min-width: 0; }
.actions-document { align-items: center; }

/* ---------------------------------------------------------------- La feuille : toujours du papier blanc */
.feuille-cadre { overflow-x: auto; padding-bottom: 1rem; }
.feuille {
  position: relative; width: 210mm; min-height: 297mm; margin: 1rem auto 0; padding: 18mm 20mm 20mm 25mm;
  background: #fff; color: #000; border: 1px solid var(--trait); color-scheme: light;
  font: 10pt/1.4 Arial, "Liberation Sans", Helvetica, sans-serif;
}
.feuille:has(.qr-facture) { padding-bottom: 118mm; }
.feuille a { color: #000; }
.f-tete { display: flex; justify-content: space-between; gap: 10mm; }
.f-emetteur { font-size: 9pt; line-height: 1.35; }
.f-destinataire { width: 80mm; margin-top: 27mm; font-style: normal; font-size: 11pt; line-height: 1.35; }
.f-titre { font-size: 16pt; margin: 14mm 0 4mm; }
.f-infos { display: flex; flex-wrap: wrap; gap: 2mm 12mm; margin: 0 0 6mm; }
.f-infos dt { font-size: 8pt; color: #444; }
.f-infos dd { margin: 0; }
.f-objet { font-weight: bold; margin: 0 0 3mm; }
.f-texte { margin: 0 0 4mm; white-space: pre-line; }
.f-mention { font-size: 8pt; color: #444; margin: 6mm 0 0; }
.feuille table.f-lignes { display: table; background: #fff; border: 0; border-radius: 0; margin: 4mm 0 6mm; }
.feuille .f-lignes th, .feuille .f-lignes td { color: #000; border-bottom: .5pt solid #bbb; padding: 1.5mm 0 1.5mm 3mm; }
.feuille .f-lignes th:first-child, .feuille .f-lignes td:first-child { padding-left: 0; }
.feuille .f-lignes thead th { font-size: 8pt; border-bottom: .75pt solid #000; }
.feuille .f-lignes tfoot td { border-top: .75pt solid #000; border-bottom: 0; font-weight: bold; }

/* Section paiement de la QR-facture : 210 × 105 mm au bas de la feuille, récépissé de 62 mm à gauche. */
.qr-facture {
  position: absolute; left: 0; bottom: 0; width: 210mm; height: 105mm; display: flex;
  border-top: .5pt dashed #000; font-family: Arial, "Liberation Sans", Helvetica, sans-serif; color: #000;
}
.qr-detacher { position: absolute; top: -4.5mm; left: 0; right: 0; margin: 0; text-align: center; font-size: 7pt; }
.qr-recepisse { width: 62mm; height: 105mm; padding: 5mm; border-right: .5pt dashed #000; display: flex; flex-direction: column; }
.qr-paiement { width: 148mm; height: 105mm; padding: 5mm; display: flex; gap: 5mm; }
.qr-gauche { width: 51mm; display: flex; flex-direction: column; }
.qr-droite { flex: 1; min-width: 0; }
.qr-facture h2 { font-size: 11pt; font-weight: bold; margin: 0 0 2mm; line-height: 11pt; }
.qr-facture p { margin: 0; overflow-wrap: anywhere; }
.qr-recepisse h3 { font-size: 6pt; font-weight: bold; margin: 2.5mm 0 0; line-height: 9pt; }
.qr-recepisse p { font-size: 8pt; line-height: 9pt; }
.qr-paiement h3 { font-size: 8pt; font-weight: bold; margin: 3mm 0 0; line-height: 11pt; }
.qr-droite h3:first-child { margin-top: 0; }
.qr-paiement p { font-size: 10pt; line-height: 11pt; }
.qr-code { width: 46mm; height: 46mm; margin: 3mm 0 5mm; }
.qr-code svg { display: block; }
.qr-somme { display: flex; gap: 5mm; margin-top: auto; }
.qr-gauche .qr-somme { margin-top: 0; }
.qr-somme h3 { margin-top: 0; }
.qr-depot { text-align: right; margin-top: 5mm !important; }

@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .barre, .arbre, .bascule, .hors-impression { display: none !important; }
  body.avec-arbre { display: block; }
  main { max-width: none; margin: 0; padding: 0; }
  .feuille-cadre { overflow: visible; padding: 0; }
  .feuille { margin: 0; border: 0; height: 297mm; min-height: 0; overflow: hidden; }
}
@media (max-width: 720px) {
  .grille, .champs.quatre { grid-template-columns: 1fr; }
  .grille .deux, .grille .trois { grid-column: auto; }
}

/* ---------------------------------------------------------------- Banque */
.mouvement { border-top: 1px solid var(--trait); padding: .75rem 0; }
.mouvement:first-of-type { border-top: 0; }
.mouvement header { display: flex; align-items: baseline; gap: .75rem; margin-bottom: .25rem; }
.mouvement header strong { flex: 1; }
.mouvement header .montant { font-weight: 600; font-size: 1.0625rem; }
.mouvement .note { margin: 0 0 .25rem; }
.mouvement .rangee { margin: .5rem 0 0; }
.proposition { font-size: .875rem; color: var(--ok); margin: 0 0 .25rem; }
label.case { flex-direction: row; align-items: center; gap: .375rem; min-height: 2.5rem; color: var(--texte); }
label.case input { min-height: 0; width: 1.125rem; height: 1.125rem; padding: 0; }
details { margin-top: .5rem; }
summary { cursor: pointer; color: var(--lien); font-weight: 600; padding: .375rem 0; }
details .rangee { margin-top: .5rem; }
.liens { gap: 1.25rem; margin-top: 1rem; font-size: .875rem; }

/* Accueil : points d'attention */
.gravite { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--discret); margin: .875rem 0 .25rem; }
.gravite:first-of-type { margin-top: 0; }
.gravite.urgent { color: var(--danger); }
.points { list-style: none; margin: 0; padding: 0; }
.points li { border-top: 1px solid var(--trait); }
.points li:first-child { border-top: 0; }
.points a { display: block; padding: .5rem 0; text-decoration: none; color: var(--texte); }
.points a:hover { text-decoration: underline; }

/* Vie privée */
.pastille.retard { background: var(--danger); color: var(--surface); border-color: transparent; }
.entete .note { margin-left: auto; }

/* Finances : budget et patrimoine */
.chiffres dd.note { font-size: .8125rem; font-weight: 400; margin-top: .125rem; }
progress { width: 7rem; height: .5rem; accent-color: var(--accent); vertical-align: middle; }
.courbe { display: block; width: 100%; height: auto; max-height: 13rem; }
.courbe polyline { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.courbe .axe { stroke: var(--trait); stroke-width: 1; stroke-dasharray: 4 4; }

/* Parc : serveurs et noms de domaine */
.pastille.bon { background: var(--ok-fond); color: var(--ok); border-color: transparent; }
.constats { list-style: none; margin: 0 0 .75rem; padding: 0; }
.constats li { position: relative; padding: .25rem 0 .25rem 1.125rem; }
.constats li::before {
  content: ""; position: absolute; left: 0; top: .75rem; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--discret);
}
.constats li.urgent::before { background: var(--danger); }
.constats li.a_faire::before { background: var(--alerte); }
.cadre h3 { font-size: 1rem; margin: 1rem 0 .375rem; }
.cadre h2 + h3 { margin-top: 0; }
pre.compte-rendu { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: .8125rem; }
button:disabled { opacity: .5; cursor: default; }

/* ---------------------------------------------------------------- Vue d'ensemble : graphiques
   Deux séries au plus, bleu puis orange, validées sur les deux fonds (contraste et daltonisme). Le rouge de la
   marque et les couleurs d'état n'y servent pas : ils gardent leur sens ailleurs. Le texte reste en couleur de texte. */
:root { --serie-1: #2a78d6; --serie-2: #eb6834; --grille: #e3e7ec; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) { --serie-1: #3987e5; --serie-2: #d95926; --grille: #222b34; }
}
:root[data-theme="sombre"] { --serie-1: #3987e5; --serie-2: #d95926; --grille: #222b34; }
.tableau-de-bord { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.tableau-de-bord .cadre { margin: 0; }
.graphique { display: block; width: 100%; height: auto; }
.graphique .grille { stroke: var(--grille); stroke-width: 1; }
.graphique .base { stroke: var(--trait); stroke-width: 1; }
.graphique .axe { fill: var(--discret); font-size: 11px; font-variant-numeric: tabular-nums; }
.graphique .zone { fill: transparent; }
.graphique .mois:hover .zone { fill: var(--fond-2); }
.graphique .serie-1, .pastille-serie.serie-1 { fill: var(--serie-1); background: var(--serie-1); }
.graphique .serie-2, .pastille-serie.serie-2 { fill: var(--serie-2); background: var(--serie-2); }
.legende { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; margin: 0 0 .5rem; padding: 0; font-size: .875rem; color: var(--discret); }
.legende strong { color: var(--texte); font-variant-numeric: tabular-nums; margin-left: .25rem; }
.pastille-serie { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; margin-right: .375rem; vertical-align: -1px; }
.chiffres-graphique summary { font-size: .875rem; font-weight: 500; }
table.parts td { vertical-align: middle; }
table.parts td.part { width: 34%; }
table.parts progress { width: 100%; height: .5rem; accent-color: var(--serie-1); }
h2.suite { margin-top: 1.25rem; }
@media (max-width: 1150px) { .tableau-de-bord { grid-template-columns: 1fr; } }

/* Sécurité des serveurs */
.mouvement header .note { margin: 0; white-space: nowrap; }
.cadre .mouvement .constats { margin: .25rem 0 .5rem; }
