/* ==========================================================================
   Standard d'interface V2 – Variante 3 « Enterprise Contrast » – déclinaison charte POVATAJ 2025
   Cœur : tokens, base, sidebar, en-tête, cartes, tableaux de base, utilitaires.
   Composants V2 : css/components.css · graphiques : css/charts.css · impression : css/print.css
   Thèmes : auto (système) / clair / sombre, pilotés par html[data-theme].
   Identité : html[data-entite] = groupe (défaut) | cobat | corem | 10fers | povimmo | tlp
              | armatures | premurs | povarent | ccp | appel
   Zones personnalisables par application : data-entite (donc --brand / --on-brand), puis le logo et le fond d'écran
   (css/components.css, « Personnalisation par application » : variables posées par le CSSOM, jamais par style=).
   Couleurs : light-dark() => color-scheme obligatoire sur :root. Aucune couleur en dur
   hors des blocs :root (vérifié par tools/verifier.py).
   ========================================================================== */

:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light dark;                         /* auto */

  /* Dimensions et densité (figées) */
  --sb-w: 240px;
  --radius: 4px;
  --pad: 10px;
  --gap: 8px;
  --cell-y: 5px;
  --fs: 13px;
  --ctl-h: 30px;                                    /* hauteur des contrôles (44 px sur écran tactile) */

  /* Polices charte : Georgia = titres / mises en évidence ; Franklin Gothic = texte.
     Aucune police distante (CSP) : Libre Franklin n'est utilisée que si installée localement. */
  --font-titre: Georgia, "Georgia Pro", "Times New Roman", serif;
  --font-texte: "Franklin Gothic Book", "Franklin Gothic Medium", "Libre Franklin", "Segoe UI", system-ui, sans-serif;

  /* Palette Groupe POVATAJ */
  --povataj-noir:  #120C0D;
  --povataj-gris:  #838283;
  --povataj-trame: #E6EFF6;

  /* Identité courante (Groupe par défaut) */
  --brand:        #120C0D;
  --on-brand:     #ffffff;
  --brand-dark:   #E6EFF6;                          /* variante sur fond sombre */
  --on-brand-dark:#120C0D;
  --sb-accent:    #E6EFF6;                          /* repère actif dans la sidebar (toujours sombre) */
  --logo-plate:   #ffffff;                          /* plaque claire sous un logo importé par l'application (son fond est inconnu) */

  /* Couleurs : light-dark(clair, sombre) */
  --bg:          light-dark(#F3F7FB, #120C0D);
  --surface:     light-dark(#ffffff, #1D1718);
  --text:        light-dark(#120C0D, #F1EFEF);
  --muted:       light-dark(#5E5C5D, #A9A8A8);
  --border:      light-dark(#D3DDE7, #3A3334);
  --border-strong: light-dark(#76828E, #8A8384);    /* contour des champs de saisie (3:1 minimum) */
  --accent:      light-dark(var(--brand), var(--brand-dark));
  --on-accent:   light-dark(var(--on-brand), var(--on-brand-dark));
  --accent-strong: color-mix(in srgb, var(--accent) 55%, var(--text));   /* accent renforcé (≥ 3:1) pour les éléments qui portent une information : remplissage, interrupteur */
  --focus:       light-dark(#005F9F, #8CC4F5);      /* anneau de focus, identique pour toutes les identités */
  --header-bg:   var(--bg);                         /* fond de l'en-tête (l'identité Groupe le passe en blanc/surface) */

  /* États (fonctionnels, hors identité) */
  --ok:          light-dark(#15803d, #4ade80);
  --warn:        light-dark(#b45309, #fbbf24);
  --ko:          light-dark(#b91c1c, #f87171);
  --info:        light-dark(#0b5a96, #7cb8f0);
  --on-ok:       light-dark(#ffffff, #120C0D);
  --on-ko:       light-dark(#ffffff, #120C0D);
  --ok-bg:       light-dark(#e8f5ec, #12301e);
  --warn-bg:     light-dark(#fcf1e0, #3a2a0d);
  --ko-bg:       light-dark(#fbeaea, #3d1717);
  --info-bg:     light-dark(#e6f0f9, #10283d);

  /* Séries de graphiques : couleurs de la charte (Groupe + sociétés), variantes claires en thème sombre.
     Ne jamais coder une information par la seule couleur : légende et valeurs obligatoires. */
  --s1: light-dark(#005F9F, color-mix(in srgb, #005F9F 45%, white));
  --s2: light-dark(#DA2128, color-mix(in srgb, #DA2128 60%, white));
  --s3: light-dark(#0C6578, color-mix(in srgb, #0C6578 45%, white));
  --s4: light-dark(#838283, #A9A8A8);
  --s5: light-dark(#7E1527, color-mix(in srgb, #7E1527 45%, white));
  --s6: light-dark(#193C6A, color-mix(in srgb, #193C6A 40%, white));
  --s7: light-dark(#A81945, color-mix(in srgb, #A81945 55%, white));
  --s8: light-dark(#120C0D, #F1EFEF);

  /* Échelle de risque (heatmap) : du plus favorable au plus défavorable */
  --risk-1: var(--ok-bg);
  --risk-2: color-mix(in srgb, var(--ok) 35%, var(--surface));
  --risk-3: color-mix(in srgb, var(--warn) 40%, var(--surface));
  --risk-4: color-mix(in srgb, var(--ko) 40%, var(--surface));
  --risk-5: color-mix(in srgb, var(--ko) 60%, var(--surface));

  /* Ombres, voile, plan d'empilement */
  --overlay:     rgb(0 0 0 / .5);
  --shadow-1:    0 1px 2px rgb(0 0 0 / .12);
  --shadow-2:    0 6px 24px rgb(0 0 0 / .28);
  --z-header: 20;
  --z-overlay: 25;
  --z-sidebar: 30;
  --z-menu: 40;
  --z-modal: 50;
  --z-toast: 60;

  /* Sidebar : noir Groupe dans les deux thèmes */
  --sb-bg:          #120C0D;
  --sb-text:        #D9D8D8;
  --sb-muted:       #838283;
  --sb-active-bg:   #2A2324;
  --sb-active-text: #ffffff;
  --sb-border:      #3A3334;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }
@media (pointer: coarse) { :root { --ctl-h: 44px; } }

/* ---------- Identités des sociétés (couleurs de la charte p.5) ---------- */
:root[data-entite="cobat"]     { --brand:#7E1527; --brand-dark:color-mix(in srgb,#7E1527 55%,white); --sb-accent:color-mix(in srgb,#7E1527 55%,white); }
:root[data-entite="premurs"]   { --brand:#7E1527; --brand-dark:color-mix(in srgb,#7E1527 55%,white); --sb-accent:color-mix(in srgb,#7E1527 55%,white); }
:root[data-entite="povarent"]  { --brand:#7E1527; --brand-dark:color-mix(in srgb,#7E1527 55%,white); --sb-accent:color-mix(in srgb,#7E1527 55%,white); }
:root[data-entite="corem"]     { --brand:#A81945; --brand-dark:color-mix(in srgb,#A81945 60%,white); --sb-accent:color-mix(in srgb,#A81945 60%,white); }
:root[data-entite="10fers"]    { --brand:#FFC91C; --on-brand:#120C0D; --brand-dark:#FFC91C; --sb-accent:#FFC91C; }
:root[data-entite="povimmo"]   { --brand:#0C6578; --brand-dark:color-mix(in srgb,#0C6578 55%,white); --sb-accent:color-mix(in srgb,#0C6578 55%,white); }
:root[data-entite="tlp"]       { --brand:#0E65A1; --brand-dark:color-mix(in srgb,#0E65A1 55%,white); --sb-accent:color-mix(in srgb,#0E65A1 55%,white); }
:root[data-entite="armatures"] { --brand:#0E65A1; --brand-dark:color-mix(in srgb,#0E65A1 55%,white); --sb-accent:color-mix(in srgb,#0E65A1 55%,white); }
:root[data-entite="ccp"]       { --brand:#4CB857; --on-brand:#120C0D; --brand-dark:#B0D239; --sb-accent:#B0D239; }
:root[data-entite="appel"]     { --brand:#193C6A; --brand-dark:color-mix(in srgb,#193C6A 55%,white); --sb-accent:color-mix(in srgb,#193C6A 55%,white); }

/* ---------- Identité Groupe (défaut) : habillage « tableau de bord » ----------
   Menu latéral indigo très sombre, fond de page gris-violet clair, cartes et en-tête blancs, accent violet, séries violet/bleu/vert/ocre.
   Réservé à l'identité Groupe : les 10 sociétés gardent la palette neutre de la charte (bloc :root ci-dessus).
   Contrastes WCAG vérifiés par tools/verifier.py (l'ocre de la série s4 est plus sombre que le jaune d'un tableau de bord : 3:1 minimum sur carte blanche). */
:root[data-entite="groupe"] {
  --brand:         #6D3AEA;
  --on-brand:      #ffffff;
  --brand-dark:    #A98BFF;                         /* variante sur fond sombre */
  --on-brand-dark: #0A0029;
  --sb-accent:     #A98BFF;

  --bg:            light-dark(#F7F7FB, #0F0A26);
  --surface:       light-dark(#ffffff, #1A1440);
  --text:          light-dark(#1B1840, #EEEDF8);
  --muted:         light-dark(#60648A, #A09CC8);
  --border:        light-dark(#E3E4EE, #2D2660);
  --border-strong: light-dark(#80849F, #8780B8);
  --header-bg:     var(--surface);

  --s1: light-dark(#6D3AEA, #A98BFF);               /* violet */
  --s2: light-dark(#2F7DF0, #6FA8FF);               /* bleu */
  --s3: light-dark(#17A06A, #4FD1A0);               /* vert */
  --s4: light-dark(#B88200, #F5C542);               /* ocre / jaune */
  --s5: light-dark(#E5484D, #FF7A7F);               /* rouge */
  --s6: light-dark(#3B3F9E, #8F94F0);               /* indigo */
  --s7: light-dark(#C026D3, #E07BF0);               /* magenta */
  --s8: light-dark(#1B1840, #EEEDF8);

  --shadow-1:      0 1px 3px rgb(24 16 80 / .10);

  --sb-bg:          #0A0029;
  --sb-text:        #D6D3E8;
  --sb-muted:       #9690BC;
  --sb-active-bg:   #1B1245;
  --sb-active-text: #ffffff;
  --sb-border:      #1F1650;
}

*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  font-family: var(--font-texte);
  font-size: var(--fs);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--bg);
  z-index: var(--z-header);
}
h1, h2, h3, .metric .value, .brand .name { font-family: var(--font-titre); font-weight: 700; }
h3 { font-size: 1em; margin: 0 0 6px; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
html:has(dialog[open]) { overflow: hidden; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor;
     stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 14px; height: 14px; }
.i-lg { width: 24px; height: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
           clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--gap); top: -48px; z-index: var(--z-toast); padding: 6px 12px;
             background: var(--surface); color: var(--text); border: 2px solid var(--focus); border-radius: var(--radius); }
.skip-link:focus { top: var(--gap); }

/* Logos : variante noire sur fond clair, blanche sur fond sombre (déclinaisons officielles) */
.logo-sombre { display: none; }
:root[data-theme="dark"] .logo-clair { display: none; }
:root[data-theme="dark"] .logo-sombre { display: block; }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] .logo-clair { display: none; }
  :root[data-theme="auto"] .logo-sombre { display: block; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0;
  width: var(--sb-w);
  display: flex; flex-direction: column;
  padding: 12px 8px;
  background: var(--sb-bg); color: var(--sb-text);
  border-right: 1px solid var(--sb-border);
  overflow-y: auto; z-index: var(--z-sidebar);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px;
         color: var(--sb-active-text); }
.brand img { width: 26px; height: 26px; flex: none; }
.nav-title { margin: 12px 8px 4px; font-size: .72em; letter-spacing: .08em;
             text-transform: uppercase; color: var(--sb-muted); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%;
            padding: 6px 8px; border-radius: var(--radius);
            color: inherit; text-decoration: none; font-weight: 500; }
.nav-item:hover, .nav-item[aria-current="page"] {
  background: var(--sb-active-bg); color: var(--sb-active-text); }
.nav-item[aria-current="page"] { box-shadow: inset 3px 0 0 var(--sb-accent); }
.nav-badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; text-align: center;
             font-size: .8em; font-weight: 700; background: var(--sb-accent); color: var(--sb-bg); }
.nav-item:focus-visible, .burger:focus-visible, .seg button:focus-visible, .entite select:focus-visible {
  outline: 2px solid var(--sb-accent); outline-offset: 2px; }
.app-container .burger:focus-visible, .app-container .seg button:focus-visible { outline-color: var(--focus); }

/* Pied de sidebar : nid d'abeilles (règle 2), « une société de » + logo Groupe (règle 5), claim (règle 4) */
.sb-foot { margin-top: auto; position: relative; padding: 70px 8px 0; font-size: .8em; color: var(--sb-muted); }
.sb-foot::before { content: ""; position: absolute; inset: 0 0 auto auto; width: 150px; height: 70px;
                   background: url("assets/nid-abeilles-blanc.svg") right top / contain no-repeat; opacity: .35; }
.entite { display: grid; gap: 4px; margin-bottom: 12px; position: relative; }
.entite select { width: 100%; padding: 4px 6px; border-radius: var(--radius);
                 background: var(--sb-active-bg); border: 1px solid var(--sb-border); color: var(--sb-active-text); }
.sb-foot .une-societe { font-style: italic; margin: 0 0 4px; }
.sb-foot .logo-groupe { display: block; width: 120px; height: auto; margin-bottom: 8px; }
.sb-foot .claim { margin: 0 0 6px; font-family: var(--font-titre); color: var(--sb-text); }
.sb-foot .adresse { margin: 0; line-height: 1.35; }
.sidebar-overlay { display: none; }

/* ---------- Conteneur ---------- */
.app-container { margin-left: var(--sb-w); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }  /* colonne : le contenu occupe toute la hauteur (fond d'écran sans zone morte en bas) */
.app-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: var(--z-header);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px var(--gap) 8px calc(var(--gap) + 4px);
  background: var(--header-bg); border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -3px 0 var(--accent);          /* filet d'identité */
}
.app-header h1 { margin: 0; font-size: 1.15em; text-transform: uppercase; letter-spacing: .02em; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.burger { display: none; border: 1px solid var(--border); background: var(--surface);
          border-radius: var(--radius); padding: 6px; }
.search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong);
          background: var(--surface); border-radius: var(--radius); padding: 4px 8px;
          color: var(--muted); }
.search input { border: 0; background: transparent; color: var(--text);
                outline: 0; width: 140px; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.seg { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius);
       overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 4px 10px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.app-content { flex: 1 0 auto; padding: var(--gap); display: grid; gap: var(--gap); align-content: start; }  /* remplit la hauteur sans étirer les rangées */
.page-head { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 1.1em; }
.page-head .actions { margin-left: auto; display: flex; gap: var(--gap); flex-wrap: wrap; }

/* ---------- Cartes, métriques, tableaux ---------- */
.card { background: var(--surface); border: 1px solid var(--border);
        border-radius: var(--radius); padding: var(--pad); min-width: 0; }
.card h2 { margin: 0 0 8px; font-size: 1em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--gap); }
.metric { border-top: 3px solid var(--accent); }
.metric .label { color: var(--muted); font-size: .85em; }
.metric .value { font-size: 1.35em; margin: 2px 0; }
.delta { font-size: .82em; font-weight: 600; }
.up { color: var(--ok); } .down { color: var(--ko); }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--gap); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { border: 1px solid var(--border-strong); border-radius: 99px; padding: 1px 10px;
        font-size: .82em; background: var(--surface); color: var(--muted); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: var(--cell-y) 8px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: .78em; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:nth-child(even) { background: color-mix(in srgb, var(--border) 35%, transparent); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 0 8px; border-radius: 99px; font-size: .8em;
         font-weight: 600; border: 1px solid currentColor; }
.b-ok { color: var(--ok); } .b-warn { color: var(--warn); } .b-ko { color: var(--ko); }
.b-info { color: var(--info); } .b-neutral { color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px;
           padding: var(--cell-y) 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list small { color: var(--muted); }

/* ---------- Utilitaires (aucun attribut style= : la CSP l'interdit) ---------- */
.row { display: flex; align-items: center; gap: var(--gap); flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.stack { display: grid; gap: var(--gap); }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.nowrap { white-space: nowrap; }
.w-full { width: 100%; }
.mt-1 { margin-top: var(--gap); } .mt-2 { margin-top: calc(var(--gap) * 2); }
.mb-0 { margin-bottom: 0; } .m-0 { margin: 0; }
.titre { font-family: var(--font-titre); font-weight: 700; }
.print-only, .print-foot { display: none; }          /* affichés par css/print.css */

/* ---------- Responsive : menu burger à 1024 px et moins ---------- */
@media (max-width: 1024px) {
  .app-container { margin-left: 0; }
  .sidebar {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-100%); visibility: hidden;
    transition: transform .25s ease, visibility .25s;
  }
  .sidebar.open { transform: translateX(0); visibility: visible; }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0; background: var(--overlay);
    opacity: 0; pointer-events: none; transition: opacity .25s; z-index: var(--z-overlay);
  }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  .burger { display: inline-flex; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .header-tools { flex: 1 1 100%; flex-wrap: nowrap; margin-left: 0; }
  .search { flex: 1 1 0; min-width: 0; }
  .search input { width: 100%; min-width: 0; }
  .seg button { padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar, .sidebar-overlay { transition: none; } }
@media (forced-colors: active) {
  .nav-item[aria-current="page"] { outline: 2px solid CanvasText; }
  .metric { border-top-color: CanvasText; }
}

/* ---------- Complément portail : menu, avatar, logo/fond personnalisés ---------- */
/* ---------- Menu déroulant ---------- */
.menu { position: relative; display: inline-block; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: var(--z-menu); min-width: 180px; margin: 0; padding: 4px;
             list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-2); }
.menu-list.left { right: auto; left: 0; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius);
             background: transparent; color: var(--text); text-align: left; text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: color-mix(in srgb, var(--text) 8%, var(--surface)); outline: 0; }
.menu-item.danger { color: var(--ko); }
.menu-sep { height: 1px; margin: 4px 0; background: var(--border); }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
          background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: .85em; }
[data-fond] {
  --fond-teinte: color-mix(in srgb, var(--bg) calc(var(--fond-voile, 0.5) * 100%), transparent);
  background-image: linear-gradient(var(--fond-teinte), var(--fond-teinte)), var(--fond-image);
  background-size: auto, cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll, fixed;
}
[data-fond="mosaique"] { background-size: auto, auto; background-repeat: repeat; background-attachment: scroll, scroll; }
/* Texte posé directement sur l'image (titre de page, titres de rubrique, notes) : plaque quasi opaque aux couleurs du thème, pour garder le contraste lisible
   quel que soit le voile réglé par l'administrateur. S'applique seulement quand un fond est actif ; `.sur-fond` l'étend à un autre élément. */
[data-fond] :is(.sur-fond, .page-head > :not(.actions), .app-content > p) { width: fit-content; max-width: 100%; padding: 4px 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); border-radius: var(--radius); }
.app-logo { display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 3px 6px;
            background: var(--logo-plate); border-radius: var(--radius); }
.app-logo img { display: block; width: auto; height: auto; max-width: 150px; max-height: 28px; object-fit: contain; }
.brand .app-logo img { width: auto; height: auto; }
.auth-card .app-logo img { max-width: 220px; max-height: 56px; }

/* ---------- Suivis : le contenu des pages garde ses couleurs en ligne (claires) → papier toujours clair, quel que soit le thème ---------- */
.sv-papier { color-scheme: light; background: #f3f4f6; color: #111827; border-radius: var(--radius); padding: 16px 20px; min-width: 0; }
.sv-papier a { color: #1e40af; }
.app-header .titre-app { margin: 0; font-size: 1.15em; text-transform: uppercase; letter-spacing: .02em; font-family: var(--font-titre); font-weight: 700; }
.sidebar .nav-item .ico { display: inline-block; width: 1.25em; text-align: center; flex: none; }
button.nav-item { width: 100%; background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; }
.sb-user { padding: 0 var(--gap); margin-bottom: 6px; font-size: .85em; opacity: .85; }
.sb-user small { display: block; opacity: .75; }
@media print { .sv-papier { background: #fff; padding: 0; } }
@media print {
  .sidebar, .sidebar-overlay, .app-header, .skip-link { display: none !important; }
  .app-container { margin-left: 0 !important; }
}
