/* ==========================================================================
   IBE — feuille de style commune (refonte)
   Principes : calme, lisible, une action principale par écran, gros boutons,
   aucune couleur « codée en dur » hors des jetons ci-dessous.
   Pas de style en ligne dans le HTML (CSP stricte) : tout passe par des classes.
   ========================================================================== */

:root {
  --fond: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --bord: #e3e7ec;
  --bord-fort: #cfd6de;
  --texte: #17202a;
  --texte-2: #4b5866;
  --texte-3: #5f6b78;           /* ≥ 4,5:1 sur --surface et --fond (texte secondaire lisible) */
  /* Vert : --primaire = FOND des boutons (texte blanc ≥ 4,5:1) ; --primaire-survol = fond au
     survol ; --primaire-fonce = TEXTE vert (sur --primaire-doux ou --surface), clair en sombre. */
  --primaire: #15803d;
  --primaire-survol: #166534;
  --primaire-fonce: #166534;
  --primaire-doux: #e8f5ec;
  --danger: #b42318;
  --danger-doux: #fdecea;
  --alerte: #a15c07;
  --alerte-doux: #fff4e0;
  --info: #1d4ed8;
  --info-doux: #e8efff;
  --signal: #ea7a12;           /* marqueur orange 🔶 des produits */
  --ombre: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --ombre-haute: 0 12px 32px rgba(16, 24, 40, .18);
  --rayon: 10px;
  --rayon-petit: 6px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --largeur-menu: 232px;
  --hauteur-barre: 56px;
  color-scheme: light;
}

/* Thème sombre : suit l'ordinateur, sauf choix du bouton « Pamje » (data-theme, core/theme.js).
   À l'ÉCRAN seulement : une impression reste toujours en encre foncée sur papier blanc. */
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0f1419; --surface: #171d24; --surface-2: #1d252e; --bord: #2a333d; --bord-fort: #3a4550;
    --texte: #e8edf2; --texte-2: #b3bec9; --texte-3: #8794a1;
    --primaire: #15803d; --primaire-survol: #166534; --primaire-fonce: #4ade80; --primaire-doux: #13301f;
    --danger: #f0605a; --danger-doux: #3a1a19; --alerte: #f0a53c; --alerte-doux: #3a2a12;
    --info: #6d9bff; --info-doux: #18243f;
    --ombre: 0 1px 2px rgba(0,0,0,.4); --ombre-haute: 0 12px 32px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}
@media screen {
  :root[data-theme="dark"] {
    --fond: #0f1419; --surface: #171d24; --surface-2: #1d252e; --bord: #2a333d; --bord-fort: #3a4550;
    --texte: #e8edf2; --texte-2: #b3bec9; --texte-3: #8794a1;
    --primaire: #15803d; --primaire-survol: #166534; --primaire-fonce: #4ade80; --primaire-doux: #13301f;
    --danger: #f0605a; --danger-doux: #3a1a19; --alerte: #f0a53c; --alerte-doux: #3a2a12;
    --info: #6d9bff; --info-doux: #18243f;
    --ombre: 0 1px 2px rgba(0,0,0,.4); --ombre-haute: 0 12px 32px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--police); font-size: 15px; line-height: 1.45;
  background: var(--fond); color: var(--texte);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.35rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .5rem; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muet { color: var(--texte-3); }
.petit { font-size: .86rem; }
.gras { font-weight: 650; }
.nombre { font-variant-numeric: tabular-nums; white-space: nowrap; }
.droite { text-align: right; }
.centre { text-align: center; }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pile > * + * { margin-top: .75rem; }
.ligne { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.ligne-entre { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.espace { flex: 1; }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.grille-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.grille-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primaire) 55%, transparent); outline-offset: 2px; }

/* ---------- Coquille : menu latéral + contenu ---------- */
.app { display: grid; grid-template-columns: var(--largeur-menu) minmax(0, 1fr); min-height: 100vh; }
.menu {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface);
  border-right: 1px solid var(--bord); display: flex; flex-direction: column; padding: 14px 10px;
}
.menu-logo { display: flex; align-items: baseline; gap: .4rem; padding: 4px 10px 16px; }
.menu-logo strong { letter-spacing: .14em; font-size: 1.05rem; }
.menu-logo span { color: var(--texte-3); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.menu-groupe { margin-top: 12px; }
.menu-groupe-titre { padding: 0 10px 4px; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-3); }
.menu-lien {
  display: flex; align-items: center; gap: .65rem; padding: 9px 10px; border-radius: var(--rayon-petit);
  color: var(--texte-2); text-decoration: none; font-weight: 550;
}
.menu-lien:hover { background: var(--surface-2); color: var(--texte); }
.menu-lien[aria-current="page"] { background: var(--primaire-doux); color: var(--primaire-fonce); }
.menu-lien svg { width: 20px; height: 20px; flex: none; }
.menu-lien .pastille { margin-left: auto; }
.menu-pied { margin-top: auto; border-top: 1px solid var(--bord); padding-top: 10px; }
.menu-utilisateur { padding: 6px 10px; font-size: .86rem; color: var(--texte-2); }
.menu-utilisateur strong { display: block; color: var(--texte); }

.contenu { min-width: 0; padding: 22px 28px 60px; }
.page { max-width: 1280px; margin: 0 auto; }
.page-entete { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; margin-bottom: 16px; }
.page-entete > :first-child { margin-right: auto; min-width: 0; }  /* titre à gauche, action principale à droite */
/* Actions d'en-tête : toujours à DROITE (même passées à la ligne sur téléphone), dans le même
   ordre partout : [⋯ actions rares] [action principale verte] tout au bord. */
.page-entete > .menu-plus, .page-entete > .ligne > .menu-plus { order: 1; }
.page-entete > .btn-principal, .page-entete > .ligne > .btn-principal { order: 2; }
.page-entete > .ligne { justify-content: flex-end; }
.page-sous-titre { color: var(--texte-3); font-size: .9rem; margin-top: 2px; }

/* Barre du bas (téléphone) */
.barre-bas { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu { display: none; }
  .contenu { padding: 14px 14px 88px; }
  .barre-bas {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 30; background: var(--surface); border-top: 1px solid var(--bord);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .barre-bas a, .barre-bas button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    font-size: .7rem; color: var(--texte-2); text-decoration: none; background: none; border: 0; cursor: pointer;
  }
  .barre-bas svg { width: 22px; height: 22px; }
  .barre-bas [aria-current="page"] { color: var(--primaire-fonce); }
  .barre-bas button { position: relative; }
  .point-signal {
    position: absolute; top: 4px; left: calc(50% + 6px); width: 10px; height: 10px; border-radius: 50%;
    background: var(--danger); border: 2px solid var(--surface);
  }
  .grille-3, .grille-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input, select, textarea { font-size: 16px; } /* iPhone : pas de zoom à la saisie */
}
@media (max-width: 560px) {
  .grille-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: 0 16px; border-radius: var(--rayon-petit); border: 1px solid var(--bord-fort);
  background: var(--surface); color: var(--texte); font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-principal { background: var(--primaire); border-color: var(--primaire); color: #fff; }
.btn-principal:hover { background: var(--primaire-survol); border-color: var(--primaire-survol); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.95); background: var(--danger); }
.btn-discret { border-color: transparent; background: transparent; color: var(--texte-2); }
.btn-discret:hover { background: var(--surface-2); color: var(--texte); }
.btn-grand { min-height: 52px; font-size: 1.05rem; padding: 0 22px; }
.btn-icone { width: 40px; padding: 0; }
.btn-plein { width: 100%; }
.btn kbd, .kbd {
  font-family: var(--mono); font-size: .72rem; padding: 1px 5px; border-radius: 4px;
  border: 1px solid currentColor; opacity: .7; font-weight: 500;
}
.btn.occupe { position: relative; color: transparent !important; }
.btn.occupe::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6); border-top-color: transparent; animation: tourne .7s linear infinite;
}
.btn:not(.btn-principal):not(.btn-danger).occupe::after { border-color: var(--texte-3); border-top-color: transparent; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: 4px; }
.champ > label, .etiquette, .libelle-champ { font-size: .84rem; font-weight: 600; color: var(--texte-2); }
.champ .aide { font-size: .8rem; color: var(--texte-3); }
/* Une erreur se voit (règle d'or 7), dans un champ comme dans une fenêtre ou un écran. */
.erreur-champ { color: var(--danger); font-weight: 600; font-size: .9rem; }
.champ .erreur-champ { font-size: .8rem; }
.saisie, .champ input:not([type="checkbox"]):not([type="radio"]), .champ select, .champ textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--bord-fort); border-radius: var(--rayon-petit);
  background: var(--surface); color: var(--texte);
}
.champ textarea { min-height: 76px; resize: vertical; }
.saisie:focus, .champ input:focus, .champ select:focus, .champ textarea:focus {
  outline: none; border-color: var(--primaire); box-shadow: 0 0 0 3px var(--primaire-doux);
}
.champ.invalide input, .champ.invalide select { border-color: var(--danger); }
.saisie-grande { min-height: 52px !important; font-size: 1.15rem !important; }
.saisie-courte { width: 7.5rem; text-align: right; }
.case { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }
.case input { width: 18px; height: 18px; accent-color: var(--primaire); }
.segment { display: inline-flex; border: 1px solid var(--bord-fort); border-radius: var(--rayon-petit); overflow: hidden; }
.segment button {
  border: 0; background: var(--surface); padding: 8px 14px; cursor: pointer; font-weight: 600; color: var(--texte-2);
  min-height: 40px;
}
.segment button + button { border-left: 1px solid var(--bord-fort); }
.segment button[aria-pressed="true"] { background: var(--primaire); color: #fff; }
.recherche { position: relative; }
.recherche > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--texte-3); }
.recherche input { padding-left: 36px !important; }

/* ---------- Cartes, chiffres clés ---------- */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
.carte-corps { padding: 16px; }
.carte-entete { display: flex; align-items: center; gap: .5rem; padding: 12px 16px; border-bottom: 1px solid var(--bord); flex-wrap: wrap; }
.carte-entete h2, .carte-entete h3 { margin-right: auto; }
.chiffre { padding: 14px 16px; }
.chiffre .libelle { font-size: .8rem; color: var(--texte-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.chiffre .valeur { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.chiffre .detail { font-size: .82rem; color: var(--texte-3); }

/* ---------- Pastilles / statuts ---------- */
.pastille {
  display: inline-flex; align-items: center; gap: .3rem; padding: 2px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 650; background: var(--surface-2); color: var(--texte-2); white-space: nowrap;
}
.pastille-ok { background: var(--primaire-doux); color: var(--primaire-fonce); }
.pastille-alerte { background: var(--alerte-doux); color: var(--alerte); }
.pastille-danger { background: var(--danger-doux); color: var(--danger); }
.pastille-info { background: var(--info-doux); color: var(--info); }
.compteur { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.signal { color: var(--signal); }

/* ---------- Bandeaux ---------- */
.bandeau { display: flex; gap: .6rem; align-items: flex-start; padding: 10px 14px; border-radius: var(--rayon-petit); font-size: .92rem; }
.bandeau svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.bandeau-info { background: var(--info-doux); color: var(--info); }
.bandeau-alerte { background: var(--alerte-doux); color: var(--alerte); }
.bandeau-danger { background: var(--danger-doux); color: var(--danger); }
.bandeau-ok { background: var(--primaire-doux); color: var(--primaire-fonce); }

/* ---------- Tableaux (deviennent des cartes sur téléphone) ---------- */
.tableau-conteneur { overflow-x: auto; }
table.tableau { width: 100%; border-collapse: collapse; }
.tableau th {
  text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-3);
  font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--bord); white-space: nowrap; background: var(--surface);
}
.tableau th.droite, .tableau td.droite { text-align: right; }
.tableau td { padding: 10px 12px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: var(--surface-2); }
.tableau tr.attenue td { color: var(--texte-3); }
.tableau tr.selection td { background: var(--primaire-doux); }
.tableau .actions { text-align: right; white-space: nowrap; width: 1%; }
@media (max-width: 720px) {
  table.tableau.empilable thead { display: none; }
  table.tableau.empilable, .tableau.empilable tbody, .tableau.empilable tr, .tableau.empilable td { display: block; width: 100%; }
  .tableau.empilable tr { border-bottom: 1px solid var(--bord); padding: 8px 4px; }
  .tableau.empilable td { border: 0; padding: 3px 8px; display: flex; justify-content: space-between; gap: 1rem; }
  .tableau.empilable td[data-titre]::before {
    content: attr(data-titre); color: var(--texte-3); font-size: .8rem;
    font-family: var(--police); font-weight: 400; font-style: normal; letter-spacing: normal; /* pas celle de la cellule (.mono, .gras) */
  }
  .tableau.empilable td.actions { justify-content: flex-end; }
}

/* ---------- Listes simples ---------- */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { padding: 10px 14px; border-bottom: 1px solid var(--bord); }
.liste > li:last-child { border-bottom: 0; }
.vide { text-align: center; padding: 36px 16px; color: var(--texte-3); }
.vide svg { width: 36px; height: 36px; margin-bottom: 6px; }
.vide strong { display: block; color: var(--texte-2); margin-bottom: 4px; }

/* ---------- Onglets ---------- */
.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--bord); margin-bottom: 14px; overflow-x: auto; }
.onglets button {
  border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--texte-2); cursor: pointer;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.onglets button[aria-selected="true"] { color: var(--primaire-fonce); border-bottom-color: var(--primaire); }
/* Téléphone : tous les onglets visibles (à la ligne), aucun caché hors de l'écran. */
@media (max-width: 720px) {
  .onglets { flex-wrap: wrap; overflow-x: visible; }
}

/* ---------- Fenêtres (dialog natif) et panneau latéral ---------- */
dialog.fenetre {
  border: 0; padding: 0; border-radius: 14px; background: var(--surface); color: var(--texte);
  box-shadow: var(--ombre-haute); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
}
dialog.fenetre.large { width: min(860px, calc(100vw - 24px)); }
dialog.fenetre::backdrop { background: rgba(15, 20, 25, .45); }
.fenetre-entete { display: flex; align-items: center; gap: .5rem; padding: 16px 18px 10px; }
.fenetre-entete h2 { margin-right: auto; }
.fenetre-corps { padding: 6px 18px 16px; overflow-y: auto; max-height: calc(100vh - 170px); }
.fenetre-pied { display: flex; justify-content: flex-end; gap: .5rem; padding: 12px 18px 16px; border-top: 1px solid var(--bord); flex-wrap: wrap; }
.fenetre-pied .gauche { margin-right: auto; }
dialog.panneau {
  max-width: 100vw;
  margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(520px, 100vw); border: 0; padding: 0;
  background: var(--surface); color: var(--texte); box-shadow: var(--ombre-haute); display: none; flex-direction: column;
}
dialog.panneau[open] { display: flex; }
dialog.panneau::backdrop { background: rgba(15, 20, 25, .35); }
dialog.panneau .fenetre-corps { flex: 1; max-height: none; }
@media (max-width: 720px) {
  dialog.fenetre, dialog.fenetre.large { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; margin: 0; }
  .fenetre-corps { max-height: none; flex: 1; }
  dialog.fenetre[open] { display: flex; flex-direction: column; }
}

/* ---------- Menu « ⋯ » ---------- */
.menu-plus { position: relative; display: inline-block; }
.menu-plus-liste {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 220px; background: var(--surface);
  border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-haute); padding: 6px;
  max-width: calc(100vw - 16px);
}
/* Bouton près du bord gauche : la liste s'ouvre vers la droite (posé par ui.js). */
.menu-plus-liste.vers-droite { left: 0; right: auto; }
/* Téléphone : le « ⋯ » d'un en-tête d'écran ouvre sa liste sur TOUTE la largeur de l'en-tête,
   juste dessous : aucun libellé coupé, quel que soit l'endroit où le bouton est passé. */
.page-entete { position: relative; }
@media (max-width: 720px) {
  .page-entete .menu-plus { position: static; }
  .page-entete .menu-plus-liste, .page-entete .menu-plus-liste.vers-droite { left: 0; right: 0; min-width: 0; max-width: none; }
}
.menu-plus-liste button, .menu-plus-liste a {
  display: flex; width: 100%; align-items: center; gap: .55rem; padding: 9px 10px; border: 0; background: none;
  text-align: left; border-radius: var(--rayon-petit); cursor: pointer; color: var(--texte); text-decoration: none; font-weight: 500;
}
.menu-plus-liste button:hover, .menu-plus-liste a:hover { background: var(--surface-2); }
.menu-plus-liste .danger { color: var(--danger); }
.menu-plus-liste hr { border: 0; border-top: 1px solid var(--bord); margin: 4px 0; }
.menu-plus-liste svg { width: 18px; height: 18px; color: var(--texte-3); }

/* ---------- Notifications éphémères ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  background: var(--texte); color: var(--surface); padding: 11px 14px; border-radius: var(--rayon-petit);
  box-shadow: var(--ombre-haute); display: flex; gap: .6rem; align-items: flex-start; animation: entre .18s ease-out;
}
.toast.erreur { background: var(--danger); color: #fff; }
.toast.ok { background: var(--primaire-survol); color: #fff; }
@keyframes entre { from { transform: translateY(8px); opacity: 0; } }
@media (max-width: 900px) { .toasts { bottom: 78px; left: 16px; right: 16px; } }

/* ---------- Connexion ---------- */
.ecran-connexion { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.ecran-connexion .carte { width: min(400px, 100%); }
.ecran-connexion .logo { text-align: center; padding: 26px 0 6px; }
.ecran-connexion .logo strong { display: block; font-size: 1.6rem; letter-spacing: .2em; }
.ecran-connexion .logo span { font-size: .75rem; letter-spacing: .18em; color: var(--texte-3); text-transform: uppercase; }

/* ---------- Feu vert d'un admin : ce qui est autorisé ---------- */
.portee-autorisation { padding: 10px 12px; border: 1px solid var(--bord-fort); border-radius: var(--rayon-petit); background: var(--surface-2); }
.portee-autorisation strong { display: block; margin-top: 2px; }
.menu-utilisateur-mobile { padding: 0 0 4px; }

/* ---------- Chargement ---------- */
.chargement { display: flex; justify-content: center; padding: 40px; color: var(--texte-3); }
.chargement::before {
  content: ""; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--bord-fort);
  border-top-color: var(--primaire); animation: tourne .8s linear infinite;
}

/* ---------- Graphiques SVG maison ---------- */
.graphique { width: 100%; height: auto; display: block; }
.graphique .barre { fill: var(--primaire); }
.graphique .barre.secondaire { fill: var(--bord-fort); }
.graphique .axe { stroke: var(--bord); }
.graphique text { fill: var(--texte-3); font-size: 11px; }
.jauge { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.jauge > span { display: block; height: 100%; background: var(--primaire); }

/* ---------- Impression ---------- */
@media print {
  .menu, .barre-bas, .page-entete .btn, .toasts { display: none !important; }
  .app { display: block; }
  .contenu { padding: 0; }
  .carte { box-shadow: none; }
}

/* ---------- Sélecteurs (composants/choix.js) ---------- */
.choix { position: relative; }
.choix-liste {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 45; list-style: none; margin: 0; padding: 4px;
  max-height: 340px; overflow-y: auto; box-shadow: var(--ombre-haute);
}
.choix-liste li { display: flex; align-items: center; gap: .5rem; padding: 8px 10px; border-radius: var(--rayon-petit); cursor: pointer; }
/* Dans une fenêtre, la liste prend sa place dans le corps (qui défile) au lieu de flotter
   dedans : on voit plusieurs résultats et l'aide, pas une ligne derrière un ascenseur. */
dialog .fenetre-corps .choix-liste { position: static; margin-top: 4px; max-height: 50vh; box-shadow: none; }
.choix-liste li.actif, .choix-liste li:hover { background: var(--primaire-doux); }
/* Liste déroulante à saisie libre (composants/listes_produit.js) : flèche ▾ dans le champ. */
.choix-deroulant input { padding-right: 30px; }
.choix-deroulant::after {
  content: "▾"; position: absolute; right: 10px; top: 9px; color: var(--texte-3); pointer-events: none;
}
.choix-deroulant .choix-liste li .muet { margin-left: auto; }
dialog .fenetre-corps .choix-deroulant .choix-liste { max-height: 260px; }

/* ---------- Tailles d'icônes par défaut dans les petits éléments ---------- */
.toast svg, .pastille svg, .choix-liste li svg, .bandeau svg { width: 18px; height: 18px; flex: none; }
.toast svg { margin-top: 2px; }
.pastille svg { width: 14px; height: 14px; }
