/* LaFabrikTools — composants du design system (direction « Back-office »).
   Copie de components/bundle.css du design system publié ; lit les variables de tokens.css.
   Classes préfixées lf- : elles ne se mélangent pas aux anciennes feuilles (catalogue.css…). */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-interface); color: var(--encre); background: var(--fond); }
/* Taille et interligne du texte courant : sur les pages réécrites seulement (les anciennes pages,
   dont l'aperçu des étiquettes, gardent les leurs). */
.lf-page, .lf-fenetre { font-size: 15px; line-height: 22px; }
[class^="lf-"][hidden], [class*=" lf-"][hidden] { display: none !important; }
:where([class^="lf-"]):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Bouton : la matière fait le relief ; il s'enfonce à l'appui. */
.lf-bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--espace-2);
  min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--arrondi-bouton);
  font: 500 14px/20px var(--font-interface); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--duree-appui), box-shadow var(--duree-appui), background var(--duree-rapide);
}
.lf-bouton:active:not(:disabled) { transform: translateY(1px); box-shadow: var(--ombre-enfonce); }
.lf-bouton:disabled { cursor: default; opacity: .55; }
.lf-bouton--plein { color: #fff; background: linear-gradient(180deg, var(--rouge-haut), var(--rouge)); box-shadow: var(--ombre-bouton-plein); }
.lf-bouton--plein:hover:not(:disabled) { background: linear-gradient(180deg, var(--rouge), var(--rouge-fonce)); }
.lf-bouton--second { color: var(--encre); background: linear-gradient(180deg, var(--surface), var(--surface-douce)); box-shadow: var(--ombre-bouton-second); }
.lf-bouton--second:hover:not(:disabled) { background: var(--surface-douce); }
.lf-bouton--discret { color: var(--rouge); background: none; padding: 0 8px; }
.lf-bouton--discret:hover:not(:disabled) { background: var(--rouge-clair); color: var(--rouge-fonce); }
.lf-bouton--petit { min-height: 36px; padding: 0 14px; }
/* action destructrice (supprimer) : même relief que le bouton plein, teinte d'erreur */
.lf-bouton--danger { color: #fff; background: linear-gradient(180deg, var(--erreur), var(--erreur-fonce)); box-shadow: var(--ombre-bouton-plein); }
.lf-bouton--danger:hover:not(:disabled) { background: var(--erreur-fonce); }
.lf-bouton[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: lf-tourne 700ms linear infinite; }

/* Barres de défilement : coque.css (« Barres de défilement »), pour toutes les pages.
   Jamais sur une navigation : des onglets passent à la ligne (lf-onglets). */

/* Carte */
.lf-carte { background: var(--surface); border-radius: var(--arrondi-carte); box-shadow: var(--ombre-carte); overflow: hidden; }
.lf-carte__tete { display: flex; flex-direction: column; gap: 2px; padding: 16px var(--espace-5) 12px; }
.lf-carte__titre { margin: 0; font-size: 16px; line-height: 22px; font-weight: 600; }
.lf-carte__sous-titre { font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.lf-carte__section { padding: 14px var(--espace-5); border-top: 1px solid var(--ligne); }
a.lf-carte, button.lf-carte { display: flex; flex-direction: column; gap: var(--espace-2); padding: var(--espace-5); text-align: left; color: inherit; text-decoration: none; border: 0; font: inherit; cursor: pointer; transition: box-shadow var(--duree-rapide) var(--courbe-sortie), transform var(--duree-rapide) var(--courbe-sortie); }
a.lf-carte:hover, button.lf-carte:hover { box-shadow: var(--ombre-carte-survol); transform: translateY(-1px); }

/* Chiffre clé + barre de progression */
.lf-chiffre { display: flex; flex-direction: column; gap: var(--espace-2); padding: var(--espace-4) 18px; }
a.lf-chiffre, button.lf-chiffre { padding: var(--espace-4) 18px; } /* chiffre cliquable : mêmes marges */
.lf-chiffre__titre { font-size: 13px; font-weight: 500; color: var(--encre-douce); }
.lf-chiffre__ligne { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--espace-2); }
.lf-chiffre__valeur { font-size: 30px; line-height: 34px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lf-chiffre__note { font-size: 13px; color: var(--encre-douce); }
.lf-chiffre__note--alerte { color: var(--erreur-fonce); font-weight: 500; }
.lf-barre { height: 6px; border-radius: var(--arrondi-pastille); background: var(--piste); box-shadow: var(--ombre-piste); overflow: hidden; }
.lf-barre__plein { height: 100%; border-radius: inherit; background: var(--rouge); transition: width var(--duree-barre) var(--courbe-ressort); }
.lf-barre--succes .lf-barre__plein { background: var(--succes); }
.lf-barre--neutre .lf-barre__plein { background: var(--encre-douce); }

/* Onglets */
.lf-onglets { display: flex; flex-wrap: wrap; gap: var(--espace-6); padding: 0 var(--espace-5); border-bottom: 1px solid var(--ligne); }
.lf-onglet { padding: 12px 4px; margin-bottom: -1px; font: 500 14px/20px var(--font-interface); color: var(--encre-douce); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; transition: color var(--duree-rapide); }
.lf-onglet:hover { color: var(--encre); }
.lf-onglet[aria-selected="true"] { color: var(--encre); border-bottom-color: var(--rouge); }
/* Onglets de page : la barre dans une carte (.lf-vues), un panneau par onglet (.lf-panneau) */
.lf-vues { overflow: visible; }
.lf-vues .lf-onglets { border-bottom: 0; }
.lf-panneau > * + * { margin-top: var(--espace-4); }
.lf-panneau[hidden] { display: none; }
/* Pagination d'une liste (/lafabrik/pagination.js) : sous le tableau, le compte, le nombre par page, les pages */
.lf-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--espace-3); padding: 12px var(--espace-5); border-top: 1px solid var(--ligne); font-size: 14px; color: var(--encre-douce); }
.lf-pagination__compte { margin-right: auto; font-variant-numeric: tabular-nums; }
.lf-pagination .lf-pagination__taille { width: auto; flex: none; padding: 6px 10px; font-size: 14px; }
.lf-pagination__pages { display: inline-flex; align-items: center; gap: var(--espace-2); }
.lf-pagination__page { min-width: 6.5em; text-align: center; color: var(--encre); font-variant-numeric: tabular-nums; }
.lf-compte { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: var(--arrondi-pastille); background: var(--piste); color: var(--encre); font-size: 12px; line-height: 18px; font-variant-numeric: tabular-nums; }
.lf-compte--alerte { background: var(--erreur-clair); color: var(--erreur-fonce); }
.lf-compte--marque { background: var(--rouge); color: #fff; }

/* Badge */
.lf-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--arrondi-pastille); font-size: 13px; line-height: 18px; white-space: nowrap; background: var(--piste); color: #44403c; }
.lf-badge--relais { background: var(--rouge-clair); color: var(--rouge-encre); }
.lf-badge--succes { background: var(--succes-clair); color: var(--succes-fonce); }
.lf-badge--alerte { background: var(--alerte-clair); color: var(--alerte-fonce); }
.lf-badge--erreur { background: var(--erreur-clair); color: var(--erreur-fonce); }
.lf-badge--barre { background: none; box-shadow: inset 0 0 0 1px var(--ligne-forte); color: var(--encre-douce); text-decoration: line-through; }
.lf-badge--tierce { background: var(--tierce-clair); color: var(--tierce); box-shadow: inset 0 0 0 1px var(--tierce); border: 0; outline: 1px dashed var(--tierce); outline-offset: -1px; box-shadow: none; }

/* Point : un colis d'un dépôt */
.lf-points { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-point { width: 12px; height: 12px; border-radius: 50%; background: var(--eteint); box-shadow: var(--ombre-piste); flex: none; }
.lf-point--ok { background: var(--succes); box-shadow: inset 0 -1px 0 #00000033; }
.lf-point--alerte { background: var(--erreur); box-shadow: inset 0 -1px 0 #00000033; }
.lf-point-legende { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--encre-douce); }
.lf-point-legende .lf-point { width: 10px; height: 10px; }

/* Bandeau */
.lf-bandeau { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: var(--arrondi-carte); background: var(--surface); box-shadow: var(--ombre-carte); }
.lf-bandeau__texte { display: flex; flex-direction: column; gap: 1px; }
.lf-bandeau__titre { font-weight: 500; }
.lf-bandeau__detail { font-size: 13px; line-height: 18px; }
.lf-bandeau__fin { margin-left: auto; }
.lf-bandeau--succes { background: var(--succes-clair); color: var(--succes-fonce); box-shadow: 0 0 0 1px var(--succes-bord), 0 1px 0 #1c19170d; }
.lf-bandeau--erreur { background: var(--erreur-clair); color: var(--erreur-fonce); box-shadow: 0 0 0 1px var(--erreur-bord); }
.lf-bandeau--simulation { background: repeating-linear-gradient(-45deg, var(--alerte-clair) 0 14px, #fdefd2 14px 28px); color: var(--alerte-fonce); box-shadow: 0 0 0 1px var(--alerte-bord); }
.lf-bandeau--tierce { background: var(--tierce-clair); color: var(--tierce); box-shadow: none; outline: 1px dashed var(--tierce); outline-offset: -1px; }
.lf-bandeau--info { color: var(--encre); }

/* Champ */
.lf-champ { display: grid; gap: 6px; min-width: 220px; }
.lf-champ__libelle { font-size: 14px; line-height: 20px; font-weight: 500; }
.lf-champ__saisie { font: 400 16px/22px var(--font-interface); padding: 9px 12px; border: 0; border-radius: var(--arrondi-bouton); background: var(--surface); color: var(--encre); box-shadow: inset 0 0 0 1px var(--contour-champ), inset 0 1px 2px #1c191714; width: 100%; box-sizing: border-box; transition: box-shadow var(--duree-rapide); }
.lf-champ__saisie:focus { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.lf-champ__saisie[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--erreur); }
.lf-champ__aide { font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.lf-champ__erreur { font-size: 13px; line-height: 18px; color: var(--erreur-fonce); font-weight: 500; }

/* Tableau */
.lf-tableau { width: 100%; border-collapse: collapse; }
.lf-tableau th { text-align: left; padding: 10px 12px; font-size: 13px; font-weight: 500; color: var(--encre-douce); background: var(--surface-douce); }
.lf-tableau td { padding: 14px 12px; border-top: 1px solid var(--ligne); vertical-align: middle; }
.lf-tableau th:first-child, .lf-tableau td:first-child { padding-left: var(--espace-5); }
.lf-tableau th:last-child, .lf-tableau td:last-child { padding-right: var(--espace-5); }
.lf-tableau tbody tr { transition: background var(--duree-rapide); }
.lf-tableau tbody tr:hover td { background: var(--surface-douce); }
.lf-tableau .lf-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lf-tableau .lf-sous { display: block; font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.lf-tableau .lf-fort { display: block; font-weight: 500; }

/* Menu latéral */
.lf-menu { display: flex; flex-direction: column; gap: 22px; width: 232px; box-sizing: border-box; padding: 20px 14px; background: var(--comptoir); color: var(--sur-comptoir); }
.lf-menu__marque { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.lf-menu__logo { flex: none; width: 32px; height: 32px; border-radius: var(--arrondi-bouton); display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, var(--rouge-haut), var(--rouge)); box-shadow: inset 0 1px 0 #ffffff40; color: #fff; font: 500 15px var(--font-marque); }
/* logo de LaFabrikTools (fabrique dont la cheminée est une clé plate), tracé dans coque.js */
.lf-menu__logo-dessin { width: 32px; height: 32px; }
.lf-menu__nom { font: 500 17px/20px var(--font-marque); letter-spacing: .04em; color: #fff; }
.lf-menu__lieu { font-size: 12px; line-height: 16px; color: var(--sur-comptoir-doux); }
.lf-menu__liens { display: flex; flex-direction: column; gap: 2px; }
.lf-menu__lien { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: var(--arrondi-bouton); color: var(--sur-comptoir); text-decoration: none; font-size: 14px; transition: background var(--duree-rapide); }
.lf-menu__lien:hover { background: var(--comptoir-survol); color: #fff; }
.lf-menu__lien[aria-current="page"] { background: #ffffff1a; color: #fff; box-shadow: inset 0 1px 0 #ffffff0f; }
.lf-menu__lien .lf-compte { margin-left: auto; }

/* Fiche produit (planche d'étiquettes, héritage Figma) */
.lf-fiche { position: relative; display: flex; flex-direction: column; gap: 4px; width: 200px; padding: 14px; border-radius: var(--arrondi-bouton); background: var(--sable); color: var(--brun); font-size: 13px; line-height: 18px; box-shadow: var(--ombre-carte); }
.lf-fiche__type { font-size: 13px; }
.lf-fiche__nom { font-size: 15px; font-weight: 600; margin-top: 4px; }
.lf-fiche__detail { font-size: 13px; }
.lf-fiche__pied { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 10px; }
.lf-fiche__auteur { font-size: 11px; line-height: 14px; font-style: italic; }
.lf-fiche__prix { font-size: 17px; font-weight: 600; color: var(--rouge-encre); font-variant-numeric: tabular-nums; }
.lf-fiche__favori { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: linear-gradient(180deg, var(--rouge-haut), var(--rouge)); color: #fff; font-size: 13px; cursor: pointer; box-shadow: var(--ombre-bouton-plein); }

/* Fenêtre */
.lf-fenetre { width: min(640px, 100%); box-sizing: border-box; padding: 24px; border: 0; border-radius: var(--arrondi-carte); background: var(--surface); color: var(--encre); box-shadow: var(--ombre-fenetre); }
.lf-fenetre::backdrop { background: #1c191773; }
.lf-fenetre__titre { margin: 0 0 2px; font-size: 20px; line-height: 26px; font-weight: 600; }
.lf-fenetre__boite { margin-top: 16px; padding: 14px 16px; border-radius: var(--arrondi-bouton); background: var(--surface-douce); box-shadow: inset 0 0 0 1px var(--ligne); }
.lf-fenetre__boite h3 { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--encre-douce); }
.lf-fenetre__boite p { margin: 0; }
/* Puce de filtre (choix parmi quelques valeurs : boutique, état…) : aria-pressed="true" = choisie */
.lf-puces { display: flex; flex-wrap: wrap; gap: var(--espace-2); }
.lf-puce { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 0; border-radius: var(--arrondi-pastille); font: inherit; font-size: 14px;
    color: var(--encre); background: var(--surface); box-shadow: inset 0 0 0 1px var(--ligne-forte); cursor: pointer; transition: background var(--duree-rapide), box-shadow var(--duree-rapide); }
.lf-puce:hover { background: var(--surface-douce); }
.lf-puce[aria-pressed="true"] { color: #fff; background: var(--comptoir); box-shadow: none; }
.lf-puce[aria-pressed="true"] .lf-compte { background: #ffffff2e; color: #fff; }
/* Fenêtre de confirmation (outils.js : confirmer) */
.lf-confirmation { width: min(460px, 100%); }
.lf-confirmation__texte { margin: 8px 0 0; color: var(--encre-douce); }
.lf-confirmation__texte:empty { display: none; }
.lf-confirmation__details { margin-bottom: 0; padding-left: 34px; }
.lf-confirmation__details li + li { margin-top: 4px; }
.lf-demande__champs { display: grid; gap: var(--espace-3); margin-top: 16px; }
.lf-fenetre__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--espace-2); margin-top: 20px; }

/* Réussite (coche + numéro) */
.lf-coche { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--succes); color: #fff; box-shadow: inset 0 1px 0 #ffffff40; }
.lf-numero { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: .06em; font-variant-numeric: tabular-nums; }

/* Animations de retour (voir bundle.js) */
@keyframes lf-rebond { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes lf-secousse { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
@keyframes lf-allume { 0% { transform: scale(.7); filter: saturate(0); } 70% { transform: scale(1.2); } 100% { transform: scale(1); filter: none; } }
@keyframes lf-tourne { to { transform: rotate(360deg); } }
.lf-anime-rebond { animation: lf-rebond var(--duree-celebration) var(--courbe-ressort); }
.lf-anime-secousse { animation: lf-secousse 320ms ease-out; }
.lf-anime-allume { animation: lf-allume 420ms var(--courbe-ressort); }
@media (prefers-reduced-motion: reduce) {
  .lf-anime-rebond, .lf-anime-secousse, .lf-anime-allume { animation: none; }
  .lf-bouton, .lf-barre__plein, a.lf-carte, button.lf-carte { transition: none; }
}
