/* Coque commune des tableaux de bord SMART AI – charte graphique SMART AI v1 (26/10/2026).
   Jetons de la charte (thème Clair, Sombre selon le système), polices, barre latérale, zone de travail. Le thème de
   l'instance (/theme.css, généré) remplace --marque (fond de la barre latérale) et --accent (couleur secondaire du
   client) ; le corail reste la couleur de la décision humaine. Les feuilles propres à chaque application (formulaires
   de l'Administration, blocs du tableau de bord) viennent après. */

@font-face { font-family: "Sora"; src: url("/static/coque/fonts/sora-latin-wght-normal.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("/static/coque/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  --marque: #0B294C;
  --bleu-nuit: #0B294C; --bleu-nuit-profond: #061A31; --bleu: #107896; --bleu-clair: #45A9CA; --corail: #FD6A55;
  --fond: #FFFFFF; --fond-doux: #F3F6F9; --surface: #FFFFFF; --surface-2: #E7EDF3;
  --filet: #DAE2EA; --filet-fort: #C2CEDA; --bordure-controle: #7A8DA3;
  --titre: #0B294C; --texte: #263B53; --texte-discret: #53677D;
  --accent: #107896; --accent-texte: #0C6681; --accent-doux: #E8F3F7;
  --action: #FD6A55; --action-survol: #FF8270; --sur-action: #061A31; --action-texte: #B23B29; --action-doux: #FFEEEB;
  --succes: #1E7A4D; --succes-doux: #E6F3EC; --attention: #8A5300; --attention-doux: #FDF1DE;
  --risque: #B42318; --risque-doux: #FDECEA; --focus: #107896;
  --rayon-xs: 4px; --rayon-bouton: 6px; --rayon: 10px; --rayon-carte: 14px; --rayon-pilule: 999px;
  --ombre: 0 1px 2px rgba(6, 26, 49, .06), 0 12px 32px -18px rgba(6, 26, 49, .28);
  --font-titre: Sora, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-texte: "Schibsted Grotesk", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  /* Barre latérale : toujours sombre, quel que soit le thème. */
  --lat-texte: #C5D2E0; --lat-discret: #8FA4BA; --lat-survol: rgba(255, 255, 255, .09); --lat-filet: rgba(255, 255, 255, .14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #061A31; --fond-doux: #061A31; --surface: #0B294C; --surface-2: #12355E;
    --filet: #263A50; --filet-fort: #3B5470; --bordure-controle: #7F95AE;
    --titre: #FFFFFF; --texte: #C5D2E0; --texte-discret: #8FA4BA;
    --accent: #45A9CA; --accent-texte: #45A9CA; --accent-doux: #12355E;
    --action-texte: #FF8270; --action-doux: #3A1E26;
    --succes: #4CC38A; --succes-doux: #123A2B; --attention: #F0B24A; --attention-doux: #3A2C12;
    --risque: #FF8A80; --risque-doux: #3D1A1A; --focus: #45A9CA;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond-doux); color: var(--texte); font: 400 15.5px/1.55 var(--font-texte); }
h1, h2, h3 { font-family: var(--font-titre); font-weight: 600; color: var(--titre); margin: 0; }
a { color: var(--accent-texte); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ic { flex: none; }

/* ---- coque : barre latérale + zone de travail */
.appli { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.principal { min-width: 0; display: flex; flex-direction: column; }

.laterale {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--marque); color: var(--lat-texte);
  padding: 22px 14px 16px; display: flex; flex-direction: column; gap: 20px;
}
.marque { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 2px 8px; text-decoration: none; }
.marque-mot { display: block; width: 132px; height: auto; }
.marque-logo { border-radius: 8px; background: #FFFFFF; flex: none; }
.marque-nom { font: 600 16px/1.25 var(--font-titre); color: #FFFFFF; letter-spacing: -0.01em; }
.marque-sous { flex-basis: 100%; font-size: 12.5px; font-weight: 640; color: var(--lat-discret); }
.groupe { display: flex; flex-direction: column; gap: 6px; }
.titre-groupe { font-size: 12.5px; font-weight: 640; color: var(--lat-discret); padding: 0 12px; }
.menu { display: flex; flex-direction: column; gap: 2px; }
.menu a {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--rayon-bouton);
  color: var(--lat-texte); text-decoration: none; font-weight: 640;
}
.menu a .ic { color: var(--bleu-clair); }
.menu a:hover { background: var(--lat-survol); color: #FFFFFF; }
.menu a[aria-current="page"] { background: var(--lat-survol); color: #FFFFFF; box-shadow: inset 3px 0 0 var(--bleu-clair); }
.laterale :focus-visible { outline-color: var(--bleu-clair); }
/* Pastille d'alertes (nombre), rouge pour un risque, orange pour une attention */
.pastille { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font: 700 12.5px/1 var(--font-texte); color: #FFFFFF; font-variant-numeric: tabular-nums; }
.pastille-rouge { background: #D93A2B; }
.pastille-orange { background: #B86E00; }
.pastille .lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 900px) { .pastille { margin-left: 6px; } }
/* Bas de la barre latérale : Administration (séparée des modules), utilisateur, mention SMART AI */
.pied-laterale { margin-top: auto; display: flex; flex-direction: column; gap: 16px; }
.pied-laterale > .groupe { padding-top: 14px; border-top: 1px solid var(--lat-filet); }
.bas { padding-top: 12px; border-top: 1px solid var(--lat-filet); }
.bas:empty { display: none; }
.propulse { display: block; width: 88px; height: auto; margin: 0 8px; opacity: .7; }

/* Bas de la barre latérale : la personne connectée et la déconnexion (application et administration) */
.utilisateur { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.utilisateur div { display: flex; flex-direction: column; min-width: 0; }
.avatar {
  width: 34px; height: 34px; flex: none; border-radius: 999px; background: var(--lat-survol); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; font-weight: 640; font-size: 12.5px;
}
.u-nom { font-weight: 640; color: #FFFFFF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-sous { font-size: 12.5px; color: var(--lat-discret); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deconnexion { margin: 8px 0 0; padding: 0 8px; }
.btn-lien { background: none; border: none; padding: 4px 0; font: inherit; font-size: 13.5px; color: var(--lat-discret); cursor: pointer; }
.btn-lien:hover { color: #FFFFFF; text-decoration: underline; }
.deconnexion { display: flex; gap: 14px; align-items: center; }
a.btn-lien { text-decoration: none; }

/* ---- téléphone et tablette : la barre latérale devient une barre du haut */
@media (max-width: 900px) {
  .appli { grid-template-columns: 1fr; }
  .laterale { position: sticky; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; }
  .marque { padding: 0; }
  .marque-mot { width: 100px; }
  .marque-logo { width: 30px; height: 30px; }
  .marque-sous, .titre-groupe, .propulse { display: none; }
  .groupe, .menu { flex-direction: row; }
  .menu { overflow-x: auto; }
  .menu a { min-height: 40px; padding: 0 10px; white-space: nowrap; font-size: 14.5px; }
  .menu a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--bleu-clair); }
  .pied-laterale { margin: 0 0 0 auto; flex-direction: row; align-items: center; gap: 6px 12px; }
  .pied-laterale > .groupe, .bas { padding: 0; border: 0; }
  .utilisateur .u-nom, .utilisateur .u-sous { display: none; }
  .deconnexion { margin: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
