/* Thèmes des tableaux de bord, mode présentation et volet des thèmes (J6, L2 bis, maquette 27, D186) : feuille à part,
   comme les jetons (jetons.css), car les thèmes définissent leurs propres couleurs. */
/* Thèmes des tableaux de bord (J6, L2 bis, maquette 27, D186) : appliqués à la zone des visuels seule (et au mode
   présentation) ; navigation et menus restent sobres. Les jetons sont redéfinis dans la zone : graphiques, tableaux et
   mise en forme les lisent sur leur élément. Contraste mesuré par l'API (services/contraste.py) sur ces mêmes couleurs. */
.zone-theme { border-radius: 6px; }
.zone-theme > .dash, .zone-theme > .grille-presentation { padding: 0; }
.bandeau-theme { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); }
/* Sobre clair et sobre sombre : imposés à tous les lecteurs, quel que soit leur réglage */
.theme-sobre_clair {
  --navy: #0F1A2B; --navy-2: #1F5AA6; --navy-3: #4F79B5; --navy-4: #C9D8EE; --bleu-pale: #EAF1FB;
  --ink: #1B2433; --muted: #566174; --line: #DCE2EA; --line-2: #EBEFF4; --bg: #F4F6F9; --surface: #FFFFFF;
  --orange: #C4620F; --orange-2: #A4510C; --green: #2F7D4F; --red: #B42318; --amber: #946006; --on-accent: #FFFFFF;
  background: var(--bg); color: var(--ink); padding: 12px; color-scheme: light;
}
.theme-sobre_sombre {
  --navy: #DCE6F4; --navy-2: #8FB3E8; --navy-3: #6E93C9; --navy-4: #2E4468; --bleu-pale: #1B2B44;
  --ink: #E3E8EF; --muted: #A0ADBF; --line: #2A3A52; --line-2: #1F2E45; --bg: #0C1524; --surface: #132036;
  --orange: #E8893A; --orange-2: #F09A50; --green: #6BB585; --red: #E07A70; --amber: #D9A640; --on-accent: #0C1524;
  background: var(--bg); color: var(--ink); padding: 12px; color-scheme: dark;
}
.theme-sobre_clair article.widget, .theme-sobre_sombre article.widget { background: var(--surface); border-color: var(--line); color: var(--ink); }
/* Effet verre : panneaux blancs à 12 %, flou, sur un dégradé bleu marine ou une image sous un voile ; états pleins */
.theme-verre {
  --navy: #F4F7FB; --navy-2: #E6EEFA; --navy-3: #B9CDEA; --navy-4: #8FB3E8; --bleu-pale: rgba(255, 255, 255, .10);
  --ink: #F4F7FB; --muted: #DBE5F3; --line: rgba(255, 255, 255, .28); --line-2: rgba(255, 255, 255, .18);
  --bg: #0F1A2B; --surface: #1D3558; --on-accent: #0F1A2B;
  --orange: #E8893A; --orange-2: #F09A50; --green: #6BB585; --red: #E07A70; --amber: #D9A640;
  color: var(--ink); padding: 14px; color-scheme: dark;
}
.theme-verre article.widget { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); color: var(--ink);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.theme-verre article.widget h3, .theme-verre .muted { color: var(--muted); }
.theme-verre .tbl th, .theme-verre .tbl td { border-color: var(--line-2); }
/* Verre opaque : repli (machine lente, réduction des effets) ; mêmes couleurs, sans flou ni transparence */
.theme-verre.theme-opaque { background: #0F1A2B; }
.theme-verre.theme-opaque article.widget { background: #1D3558; border-color: #2E4468; -webkit-backdrop-filter: none; backdrop-filter: none; }
/* Relief doux : panneaux de la couleur du fond, détachés par des ombres douces */
.theme-relief {
  --bg: #E9EDF2; --surface: #E9EDF2; --ink: #1B2433; --muted: #4F5A6C; --line: #D3DAE3; --line-2: #DCE2EA;
  --navy-2: #1F5AA6; color-scheme: light; background: var(--bg); color: var(--ink); padding: 14px;
}
.theme-relief article.widget { background: var(--surface); border: 1px solid transparent; box-shadow: 5px 5px 12px #C9D0DA, -5px -5px 12px #FFFFFF; }
@media (forced-colors: active) { .theme-relief article.widget, .theme-verre article.widget { border: 1px solid CanvasText; box-shadow: none; } }
@media (prefers-reduced-transparency: reduce) {
  .theme-verre article.widget { background: #1D3558; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Impression et export : rendu opaque, lisible sur papier et sur un projecteur */
@media print {
  .zone-theme.theme-verre { background: #0F1A2B !important; }
  .theme-verre article.widget { background: #1D3558 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .theme-relief article.widget { box-shadow: none; border: 1px solid #C9D0DA; }
  .bandeau-theme { display: none; }
}

/* Mode présentation plein écran (maquette 27, écran 6) : sans menus ni barre de Lagune */
.ecran-presentation { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr auto; overflow: auto;
  background: var(--bg); color: var(--ink); }
.ecran-presentation .zone-theme { border-radius: 0; min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; padding: 22px 26px 16px; }
.tete-presentation { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.tete-presentation h1 { font-size: 1.6rem; margin: 0; }
.tete-presentation .droite { margin-left: auto; font-family: var(--mono); }
.grille-presentation { font-size: 1.15rem; }
.grille-presentation .kpi { font-size: 2.6rem; }
.commandes-presentation { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); transition: opacity .3s; }
.commandes-presentation.masquees { opacity: 0; }
.commandes-presentation .points { display: flex; gap: 5px; margin: 0 auto; }
.commandes-presentation .points i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; }
.commandes-presentation .points i.actif { background: var(--ink); }
@media (prefers-reduced-motion: reduce) { .commandes-presentation { transition: none; } }
/* Volet des thèmes (maquette 27, écran 1) */
.vignettes-theme { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
.vignettes-theme legend { font-weight: 600; margin-bottom: 4px; }
.vignette-theme { border: 1px solid var(--line); border-radius: 6px; padding: 6px; display: grid; gap: 4px; cursor: pointer; font-size: .92em; }
.vignette-theme.choisie { border: 2px solid var(--navy-2); padding: 5px; }
.vignette-theme input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vignette-theme:focus-within { outline: 2px solid var(--navy-3); outline-offset: 2px; }
.apercu-theme { height: 40px; border-radius: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 5px; }
.apercu-theme i { border-radius: 3px; display: block; }
.apercu-sobre { background: #F4F6F9; } .apercu-sobre i { background: #FFFFFF; border: 1px solid #DCE2EA; }
.apercu-sobre_clair { background: #F4F6F9; } .apercu-sobre_clair i { background: #FFFFFF; border: 1px solid #DCE2EA; }
.apercu-sobre_sombre { background: #0C1524; } .apercu-sobre_sombre i { background: #132036; }
.apercu-verre i { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3); }
.apercu-relief { background: #E9EDF2; } .apercu-relief i { background: #E9EDF2; box-shadow: 2px 2px 4px #C9D0DA, -2px -2px 4px #FFFFFF; }
.fonds-verre { border: 0; padding: 0; margin: 8px 0 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fonds-verre legend { font-weight: 600; margin-bottom: 4px; }
.fond-verre { display: inline-flex; align-items: center; gap: 6px; }
.pastille-fond { width: 44px; height: 26px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }
.filtres-presentation { margin: 0; }
.choix-variante { border: 0; padding: 0; margin: 8px 0 0; display: flex; gap: 12px; flex-wrap: wrap; }
.choix-variante legend { font-weight: 600; margin-bottom: 4px; }
