/* ==========================================================================
   Administration IKAM — outil de travail : lisible, dense, sans décor.
   ========================================================================== */
:root {
  --nuit: #000d30;
  --nuit-2: #0b1f5c;
  --ambre: #f9a31f;
  --acier: #c9cedb;
  --acier-clair: #e6e9f0;
  --fond: #f1f3f8;
  --papier: #fff;
  --encre: #0d1633;
  --encre-2: #4a5470;
  --ligne: #d8dce7;
  --focus: #2a55d6;
  --vert: #17683d;
  --vert-fond: #dff3e7;
  --orange: #7a4b00;
  --orange-fond: #fff0d1;
  --rouge: #a8231b;
  --rouge-fond: #fbe3e0;
  --bleu-fond: #dfe7fb;
  --bleu: #1c3f9e;
  --titre: "Barlow Condensed", "Arial Narrow", "Bahnschrift", sans-serif;
  --texte: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
}
/* Arabe : police adaptée, et pas d'espacement entre lettres (il casse la liaison des lettres arabes). */
:root:lang(ar) {
  --titre: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --texte: "Cairo", "Segoe UI", Tahoma, sans-serif;
}
:lang(ar) * { letter-spacing: 0 !important; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 16px/1.5 var(--texte); }
img, svg { display: block; max-width: 100%; }
h1, h2 { font-family: var(--titre); font-weight: 600; line-height: 1.1; margin: 0; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.4rem; }
p { margin: 0 0 .7em; }
a { color: var(--bleu); text-underline-offset: 3px; }
small { color: var(--encre-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saut { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ambre); color: var(--nuit); padding: 10px 16px; font-weight: 600; z-index: 100; border-radius: 4px; }
.saut:focus { top: 12px; }

/* ---------- coque ---------- */
.coque { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.barre { background: var(--nuit); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; border-inline-end: 3px solid var(--ambre); }
.barre :focus-visible { outline-color: var(--ambre); }
.barre__logo { display: block; padding: 0 6px 22px; }
.barre__logo img { height: 40px; width: auto; }
.barre__nav { display: flex; flex-direction: column; gap: 2px; }
.barre__nav a, .barre__bas a, .barre__sortie { display: block; padding: 10px 12px; border-radius: 4px; color: var(--acier-clair); text-decoration: none; font-weight: 500; }
.barre__nav a:hover, .barre__bas a:hover, .barre__sortie:hover { background: rgba(255,255,255,.1); color: #fff; }
.barre__nav a[aria-current="page"] { background: var(--ambre); color: var(--nuit); font-weight: 600; }
.barre__bas { margin-top: auto; border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; }
.barre__sortie { width: 100%; background: none; border: 0; text-align: start; font: inherit; font-weight: 500; cursor: pointer; }
.barre__pastille { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-inline-start: 4px; border-radius: 11px; background: var(--ambre); color: var(--nuit); font-size: .8rem; font-weight: 700; }
.barre__nav a[aria-current="page"] .barre__pastille { background: var(--nuit); color: #fff; }
.barre__espace { margin: -10px 6px 16px; font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ambre); }
.barre__qui { margin: 0 12px 8px; color: #fff; font-weight: 600; line-height: 1.3; }
.barre__qui small { color: var(--acier); font-weight: 400; }
.principal { padding: 28px 32px 60px; max-width: 1280px; width: 100%; }

.entete-page { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.entete-page h1 { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.entete-page__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- boutons ---------- */
.bouton { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 2px solid transparent; border-radius: 4px; font: 600 .95rem/1 var(--texte); text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.bouton--ambre { background: var(--ambre); color: var(--nuit); }
.bouton--ambre:hover { background: #ffb840; }
.bouton--plein { background: var(--nuit); color: #fff; }
.bouton--plein:hover { background: var(--nuit-2); }
.bouton--secondaire { background: var(--papier); color: var(--nuit); border-color: #98a1b8; }
.bouton--secondaire:hover { border-color: var(--nuit); background: var(--acier-clair); }
.bouton--bloc { width: 100%; }
.bouton--grand { min-height: 52px; font-size: 1.05rem; }
.bouton--petit { min-height: 36px; padding: 0 12px; font-size: .88rem; }
.bouton--danger { background: var(--papier); color: var(--rouge); border-color: var(--rouge); }
.bouton--danger:hover { background: var(--rouge-fond); }
.bouton:disabled { cursor: not-allowed; opacity: .5; }
.lien-danger { background: none; border: 0; padding: 4px 6px; font: inherit; color: var(--rouge); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- messages ---------- */
.message { margin: 0 0 10px; padding: 12px 16px; border-radius: 4px; border-inline-start: 4px solid; font-weight: 500; }
.message--ok { background: var(--vert-fond); border-color: var(--vert); color: #0f4a2b; }
.message--erreur { background: var(--rouge-fond); border-color: var(--rouge); color: #7d1a14; }
.messages { margin-bottom: 14px; }
.vide { background: var(--papier); border: 1px dashed var(--acier); border-radius: 6px; padding: 22px; color: var(--encre-2); margin: 0; }

/* ---------- indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 20px; }
@media (min-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { background: var(--papier); border: 1px solid var(--ligne); border-inline-start: 4px solid var(--nuit); border-radius: 6px; padding: 14px 16px; }
.kpi--magasin { border-inline-start-color: var(--bleu); }
.kpi--alerte { border-inline-start-color: var(--ambre); background: #fffaf0; }
@media (min-width: 1100px) { .kpis--trois { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis--quatre { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi p { margin: 0; }
.kpi__valeur { font: 700 1.9rem/1.1 var(--titre); color: var(--nuit); overflow-wrap: anywhere; }
.kpi__nom { font-weight: 600; margin-top: 4px; }
.kpi__aide { font-size: .88rem; color: var(--encre-2); margin-top: 2px; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.carte-admin { background: var(--papier); border: 1px solid var(--ligne); border-radius: 6px; padding: 18px 20px; margin-bottom: 18px; }
.duo .carte-admin { margin-bottom: 0; }
.carte-admin h2 { margin-bottom: 14px; }
.carte-admin__tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.carte-admin__tete h2 { margin: 0; }

/* graphiques */
.barres { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.barres li { display: grid; grid-template-columns: 112px minmax(0, 1fr) 54px; align-items: center; gap: 10px; font-size: .92rem; }
.barres a { font-weight: 600; text-decoration: none; color: var(--encre); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barres a:hover { text-decoration: underline; }
.barres svg { width: 100%; height: 12px; }
.barres span { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }
.barres__piste { fill: var(--acier-clair); }
.barres__valeur { fill: var(--nuit); }
.barres__valeur--bas { fill: var(--ambre); }
.legende { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: .88rem; color: var(--encre-2); }
.legende__pastille { width: 14px; height: 10px; border-radius: 2px; background: var(--ambre); }
.barres--larges li { grid-template-columns: 130px minmax(0, 1fr) 128px; }
.barres__nom { text-align: start !important; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barres small { color: var(--encre-2); font-weight: 400; }
.histo { width: 100%; height: auto; }
.histo__barre { fill: var(--nuit); }
.histo__axe { stroke: var(--acier); stroke-width: 1; }
.histo__n { font: 600 10px var(--texte); fill: var(--encre); }
.histo__jour { font: 500 10px var(--texte); fill: var(--encre-2); }

/* ---------- tableaux ---------- */
.defilement { overflow-x: auto; background: var(--papier); border: 1px solid var(--ligne); border-radius: 6px; }
.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; }
.carte-admin .tableau { margin: 0; }
.tableau th { text-align: start; font-size: .85rem; font-weight: 600; color: var(--encre-2); padding: 10px 12px; background: var(--acier-clair); white-space: nowrap; }
.tableau td { padding: 10px 12px; border-top: 1px solid var(--ligne); vertical-align: middle; }
.tableau .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau tfoot th, .tableau tfoot td { border-top: 2px solid var(--ligne); background: none; font-size: 1rem; color: var(--encre); }
.tableau tr.masque td { background: #f6f7fa; color: var(--encre-2); }
.tableau .actions { white-space: nowrap; text-align: end; }
.tableau .actions form { display: inline; }
.tableau .actions > * { margin-inline-start: 8px; }
.tableau--produits { min-width: 820px; }
.produit-cellule { display: flex; align-items: center; gap: 12px; }
.miniature { width: 64px; height: 44px; border-radius: 4px; object-fit: cover; background: var(--acier-clair); flex: none; }
.miniature--generique { object-fit: contain; padding: 3px; }
.produit-cellule__ref { font-weight: 700; }
.produit-cellule__des { margin: 0; font-size: .85rem; color: var(--encre-2); max-width: 46ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.produit-cellule__cat { display: inline-block; margin: 4px 0 0; padding: 1px 8px; border-radius: 10px; background: var(--fond); border: 1px solid var(--ligne); font-size: .78rem; font-weight: 600; color: var(--encre-2); }
.produit-cellule__cat--manque { border-style: dashed; background: none; font-weight: 500; }

.etat { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.etat--attente { background: var(--orange-fond); color: var(--orange); }
.etat--confirmee { background: var(--bleu-fond); color: var(--bleu); }
.etat--expediee { background: #e7e0f7; color: #4a2b9a; }
.etat--livree { background: var(--vert-fond); color: var(--vert); }
.etat--annulee { background: var(--rouge-fond); color: var(--rouge); }
.etat--nouveau { background: var(--ambre); color: var(--nuit); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.tableau tr.non-lu td { background: #fffaf0; }
.tableau tr.non-lu td:first-child { box-shadow: inset 3px 0 0 var(--ambre); }
[dir="rtl"] .tableau tr.non-lu td:first-child { box-shadow: inset -3px 0 0 var(--ambre); }

/* ---------- les trois prix ---------- */
.trois-prix { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.trois-prix small, .palier { white-space: nowrap; font-size: .8rem; font-weight: 500; color: var(--encre-2); }
.palier { display: block; }
.tarif { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--acier-clair); color: var(--encre); font-size: .78rem; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.tarif--gros { background: var(--bleu-fond); color: var(--bleu); }
.tarif--super { background: #e7e0f7; color: #4a2b9a; }
.tarifs-autorises .tarif { margin: 1px 0; }
.vente-lignes__astuce { color: var(--orange); font-weight: 600; }
.paliers-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.palier-form { padding-top: 10px; border-top: 3px solid var(--acier-clair); }
.palier-form__titre { margin: 0 0 8px; font-weight: 600; }
.groupe__intro { max-width: 80ch; margin: 4px 0 12px; }
.alerte-config { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 18px; padding: 14px 18px; background: var(--orange-fond); border: 1px solid #f0c674; border-inline-start: 4px solid var(--ambre); border-radius: 6px; }
.alerte-config p { margin: 0; max-width: 80ch; color: var(--orange); }
.groupe--sauvegarde { border-inline-start: 4px solid var(--ambre); }
.groupe--restauration { border-inline-start: 4px solid var(--rouge); }
.groupe--restauration .bouton { margin-top: 4px; }
.sauvegarde-etat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; }
.alerte-config strong { color: var(--encre); }
.defilement--nu { border: 0; }
.intro { max-width: 82ch; margin-bottom: 16px; }
.facultatif { font-weight: 400; color: var(--encre-2); }

/* ---------- caisse (espace vendeur) ---------- */
.caisse { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 20px; align-items: start; }
.caisse__saisie { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 10px; }
.caisse__scan, .caisse__recherche { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; background: var(--papier); border: 1px solid var(--ligne); border-radius: 6px; padding: 12px 14px; }
.caisse__scan { border-inline-start: 4px solid var(--ambre); }
.caisse__scan .champ, .caisse__recherche .champ { flex: 1 1 180px; margin: 0; }
.caisse__scan input { font-size: 1.1rem; font-weight: 600; letter-spacing: .02em; }
.caisse__effacer { align-self: center; }
.caisse__compte { margin-bottom: 10px; }
.tableau--caisse { min-width: 640px; }
.produit-cellule__ref .etat { margin-inline-start: 6px; }
.produit-cellule__code { margin: 2px 0 0; font-size: .8rem; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.caisse__ajout { display: flex; gap: 6px; justify-content: flex-end; }
.quantite { width: 72px !important; text-align: center; }
.caisse__vente { position: sticky; top: 16px; margin: 0; border-top: 4px solid var(--nuit); max-height: calc(100vh - 32px); overflow-y: auto; }
.caisse__vente .vide { margin-bottom: 14px; }
.vente-lignes { list-style: none; margin: 0 0 10px; padding: 0; }
.vente-lignes li { display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; grid-template-areas: "produit quantite montant" "produit retirer retirer"; align-items: center; gap: 2px 10px; padding: 9px 0; border-bottom: 1px solid var(--ligne); }
.vente-lignes__produit { grid-area: produit; display: flex; flex-direction: column; min-width: 0; }
.vente-lignes__produit strong { overflow-wrap: anywhere; }
.vente-lignes .quantite { grid-area: quantite; min-height: 38px; }
.vente-lignes__montant { grid-area: montant; text-align: end; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vente-lignes .lien-danger { grid-area: retirer; justify-self: end; font-size: .85rem; }
.vente-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 14px 0 4px; padding-top: 12px; border-top: 2px solid var(--nuit); font-weight: 600; }
.vente-total strong { font: 700 2rem/1 var(--titre); color: var(--nuit); }
.vente-client { margin-top: 16px; }
.vente-client .groupe { padding: 6px 14px 4px; }
.vente-client .bouton { margin-bottom: 8px; }
.vente-vendeur { margin: 0 0 12px; color: var(--encre-2); }
.vente-vendeur strong { color: var(--encre); }
/* Caisse : position du client sur la carte (même bloc que la page de commande de la boutique) */
.carte-livraison[hidden], .carte-livraison [hidden] { display: none; }
.carte-livraison__titre { font-weight: 600; font-size: .93rem; }
.carte-livraison__carte { height: 260px; border: 1px solid var(--ligne); border-radius: 4px; z-index: 0; }
.carte-livraison__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.vente-client .carte-livraison__actions .bouton { margin-bottom: 0; }
.carte-livraison__etat:empty { display: none; }

.duo--recus { margin-bottom: 18px; }
.recu-choix { display: flex; flex-direction: column; align-items: flex-start; }
.recu-choix p { color: var(--encre-2); flex: 1; }
.recu-choix__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.apercu-ticket { background: #d9dde6; border-radius: 6px; padding: 24px 12px; overflow-x: auto; }
.annulation { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--ligne); }
.annulation .aide { margin-top: 8px; }

.interrupteur { border: 1px solid #98a1b8; background: #fff; border-radius: 999px; padding: 3px 12px; font: 600 .85rem var(--texte); cursor: pointer; color: var(--encre-2); }
.interrupteur[aria-checked="true"] { background: var(--vert-fond); border-color: var(--vert); color: var(--vert); }
.interrupteur:hover { border-color: var(--nuit); }

/* ---------- filtres ---------- */
.barre-filtre { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.barre-filtre .champ { margin: 0; flex: 1 1 280px; max-width: 420px; }
.barre-filtre .champ--filtre { flex: 0 1 190px; }
.barre-filtre .coche { margin: 0; min-height: 42px; }
.onglets { display: flex; gap: 0; border: 1px solid #98a1b8; border-radius: 4px; overflow: hidden; background: #fff; }
.onglets button, .onglets a { padding: 10px 16px; border: 0; background: none; font: 500 .92rem var(--texte); color: var(--encre); cursor: pointer; text-decoration: none; border-inline-end: 1px solid var(--ligne); }
.onglets button:last-child, .onglets a:last-child { border-inline-end: 0; }
.onglets button:hover, .onglets a:hover { background: var(--acier-clair); }
.onglets [aria-pressed="true"], .onglets [aria-current="page"] { background: var(--nuit); color: #fff; font-weight: 600; }
.onglets--liens { display: inline-flex; flex-wrap: wrap; margin-bottom: 16px; }
.onglets__n { opacity: .7; font-size: .85em; margin-inline-start: 2px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 18px; color: var(--encre-2); }

.import { background: var(--papier); border: 1px solid var(--ligne); border-radius: 6px; padding: 12px 16px; margin-bottom: 16px; }
.import summary { cursor: pointer; font-weight: 600; }
.import__form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.import__form .champ { margin: 0; }

/* ---------- formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.champ label { font-weight: 600; font-size: .93rem; }
.champ--court { max-width: 240px; }
.aide { font-size: .86rem; color: var(--encre-2); margin: 0; }
.champ__erreur { color: var(--rouge); font-weight: 500; font-size: .9rem; margin: 0; }
input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; font: inherit; color: var(--encre); background: #fff; border: 1px solid #98a1b8; border-radius: 4px;
}
textarea { resize: vertical; }
input[type="file"] { font: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.champ--erreur input, .champ--erreur textarea, .champ--erreur select { border-color: var(--rouge); border-width: 2px; }
.coche { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; margin-bottom: 10px; }
.coche input { width: 19px; height: 19px; accent-color: var(--nuit); }
.formulaire-admin { max-width: 860px; margin-bottom: 28px; }
.groupe { background: var(--papier); border: 1px solid var(--ligne); border-radius: 6px; padding: 8px 20px 12px; margin: 0 0 16px; }
.groupe legend { font: 600 1.25rem var(--titre); padding: 0 8px; margin-inline-start: -8px; }
.deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.trois { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.formulaire-admin__actions { display: flex; gap: 10px; }
.image-bloc { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-top: 8px; }
.image-bloc__apercu { width: 160px; height: 110px; object-fit: cover; border: 1px solid var(--ligne); border-radius: 4px; background: var(--acier-clair); }
.image-bloc__apercu--generique { object-fit: contain; padding: 8px; }
.groupe__titre { margin: 18px 0 8px; font: 600 1rem var(--texte); }
.groupe__titre small { font-weight: 400; }
.photos-sup { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 0 0 14px; padding: 0; }
.photo-sup { padding: 8px; border: 1px solid var(--ligne); border-radius: 6px; background: var(--fond); }
.photo-sup img { width: 100%; height: auto; aspect-ratio: 16 / 11; object-fit: cover; border-radius: 4px; margin-bottom: 8px; background: var(--acier-clair); }
.photo-sup .coche { margin-bottom: 4px; font-size: .9rem; }
.cases-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 16px; }
.case-photo { margin: 0; padding: 10px 12px; border: 1px dashed #98a1b8; border-radius: 6px; background: var(--fond); }
.case-photo input[type="file"] { max-width: 100%; }

.infos { margin: 0; }
.infos div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.infos dt { color: var(--encre-2); }
.infos dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.carte-client { display: block; width: 100%; height: 300px; margin-top: 14px; border: 1px solid var(--ligne); border-radius: 6px; }
.carte-client__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 0; }
p.aide.carte-client__actions { display: block; }

/* ---------- connexion ---------- */
.connexion { background: var(--nuit); min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.connexion__boite { width: min(100%, 400px); }
.connexion__logo { width: 260px; height: auto; margin: 0 auto 22px; }
.connexion__form { background: var(--papier); border-radius: 6px; padding: 28px; border-top: 4px solid var(--ambre); }
.connexion__form h1 { font-size: 1.9rem; margin-bottom: 18px; }
.connexion__retour { text-align: center; margin: 16px 0 0; }
.connexion__tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.connexion__form .connexion__tete h1 { margin: 0; }

/* ---------- choix de la langue ---------- */
.langue-lien { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border: 1px solid #98a1b8; border-radius: 999px; color: var(--nuit); font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; }
.langue-lien:hover { border-color: var(--nuit); background: var(--acier-clair); }
.barre__bas a.barre__langue { color: var(--ambre); font-weight: 600; }
.langue-lien:lang(ar), .barre__langue:lang(ar) { font-family: "Cairo", "Segoe UI", Tahoma, sans-serif; }
.langue-code { display: none; }
.connexion__tete { flex-wrap: wrap; }
.connexion__langues { display: flex; gap: 6px; }
.connexion__aide { margin: -8px 0 16px; }
.connexion__souvenir { margin-bottom: 4px; }
.connexion__souvenir + .connexion__aide { margin: 0 0 16px 29px; }
[dir="rtl"] .connexion__souvenir + .connexion__aide { margin: 0 29px 16px 0; }
.connexion__form .bouton + .connexion__aide { margin: 14px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) { .duo { grid-template-columns: 1fr; } .trois { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1180px) {
  .caisse { grid-template-columns: minmax(0, 1fr); }  /* minmax(0…) : un tableau large défile dans son cadre */
  .caisse__vente { position: static; max-height: none; }
}
@media (max-width: 700px) { .caisse__saisie { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .coque { grid-template-columns: minmax(0, 1fr); }
  .barre { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-inline-end: 0; border-bottom: 3px solid var(--ambre); gap: 8px 16px; }
  .barre__logo { padding: 0; }
  .barre__nav { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; }
  .barre__bas { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  .barre__espace { margin: 0; }
  .barre__qui { margin: 0 8px 0 0; }
  .barre__qui small { display: none; }
  .barres--larges li { grid-template-columns: 90px minmax(0, 1fr) 100px; }
  .principal { padding: 20px 16px 48px; }
  .deux, .trois, .paliers-form { grid-template-columns: 1fr; }
  .barres li { grid-template-columns: 90px minmax(0, 1fr) 46px; }
}

/* ---------- impression (bon de commande) ---------- */
@media print {
  .barre, .sans-impression, .entete-page__actions, .saut, .messages { display: none !important; }
  .coque { display: block; }
  body { background: #fff; }
  .principal { padding: 0; max-width: none; }
  .carte-admin { border: 1px solid #999; break-inside: avoid; }
  .duo { grid-template-columns: 1fr; }
}
