/* LU STUDIO — Préparation des commandes. Même style que l'outil Support (IBM Plex, en-tête sombre, bleu, cartes arrondies). */

:root {
  --ground: #EEF0F3; --panel: #FFFFFF; --lane: #E3E6EB; --ink: #16181D; --muted: #4A505C; --soft: #5B6270;
  --line: #D5DAE1; --line2: #E3E6EB; --field: #C9CFD8;
  --accent: #1F4FD8; --accent-ink: #163A9F; --accent-bg: #F5F8FF; --accent-line: #C7D5FB;
  --warn-bg: #FFF1DC; --warn: #D97706; --warn-ink: #B45309;
  --crit-bg: #FDE8E8; --crit: #DC2626; --crit-ink: #B91C1C;
  --ok: #16A34A; --ok-bg: #ECFDF3; --ok-line: #A7E3BF;
  --note-bg: #FFF8DB; --note-line: #E6CF6E;
  --ai-bg: #F3F0FF; --ai-line: #D6CCFA; --ai-ink: #3B2A8F;
  --head: #16181D; --head2: #2A2D35; --head-muted: #B8BEC9;
  --police: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--ground); color: var(--ink); font-family: var(--police); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
[hidden] { display: none !important; }

/* --- En-tête --------------------------------------------------------------- */
.entete {
  background: var(--head); color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 10px 20px; position: sticky; top: 0; z-index: 20;
}
.entete .marque { font-weight: 700; font-size: 16px; white-space: nowrap; }
/* Même en-tête que l'outil Support : titre, onglets, initiales, « Se déconnecter » à droite. */
.onglets-entete { display: flex; gap: 4px; flex-wrap: wrap; }
.onglets-entete a { color: #fff; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 13px; }
.onglets-entete a:hover { background: var(--head2); }
.onglets-entete a.on { background: var(--head2); font-weight: 600; }
.entete .qui { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-left: auto; }
.avatar { width: 30px; height: 30px; border-radius: 15px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.entete button.secondaire { background: transparent; color: #fff; border-color: #4A505C; }
.entete button.secondaire:hover { background: var(--head2); }


/* --- Contenu ------------------------------------------------------------------ */
main { padding: 18px 20px 28px; max-width: 1280px; margin: 0 auto; }
h1 { margin: 0; font-size: 21px; font-weight: 600; }
h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }

.barre { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.barre .infos { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* --- Boutons et champs ------------------------------------------------------- */
button, .bouton {
  font: inherit; font-size: 13px; font-weight: 600;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background-color .12s, transform .08s, filter .12s;
}
button:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
button:active { transform: scale(.97); filter: brightness(.9); }
button.secondaire { background: #fff; color: var(--ink); border-color: var(--field); font-weight: 400; }
button.secondaire:hover { background: #fff; border-color: #9AA2AF; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

label { display: block; font-size: 12px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], select {
  width: 100%; font: inherit; font-size: 15px; padding: 9px 12px;
  border: 1px solid var(--field); border-radius: 8px; background: #fff; color: var(--ink);
}
.champ { margin-bottom: 16px; }
.aide { font-size: 12px; color: var(--soft); margin-top: 4px; }

/* --- Carte de connexion ------------------------------------------------------ */
.carte-connexion {
  max-width: 400px; margin: 10vh auto 0; padding: 28px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.carte-connexion h1 { margin-bottom: 4px; }
.carte-connexion .sous-titre { margin: 0 0 22px; color: var(--muted); }
.carte-connexion button { width: 100%; height: 42px; font-size: 14px; }
.lien-bas { margin: 16px 0 0; text-align: center; font-size: 13px; }

.message { padding: 10px 14px; margin-bottom: 16px; border-radius: 8px; font-size: 13px; font-weight: 500; border: 1px solid var(--accent-line); background: var(--accent-bg); color: var(--accent-ink); }
.message.erreur { background: var(--crit-bg); border-color: #F3B4B4; color: var(--crit-ink); }
.message.info { background: var(--accent-bg); border-color: var(--accent-line); color: var(--accent-ink); }

/* --- Tableau des commandes --------------------------------------------------- */
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
thead th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--soft);
  text-transform: uppercase; letter-spacing: .5px;
  background: #F6F7F9; border-bottom: 1px solid var(--line); padding: 10px 12px;
}
tbody td { padding: 11px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #F6F8FB; }
td.numero { font-weight: 600; font-size: 15px; white-space: nowrap; }
td.articles { text-align: center; }
th.articles { text-align: center; }
.petit { font-size: 12px; color: var(--soft); }
.vide { padding: 40px 0; text-align: center; color: var(--soft); }
tr.cliquable { cursor: pointer; }
td.numero a { text-decoration: none; }
td.numero a:hover { text-decoration: underline; }

/* Pastilles (repères) */
.reperes { display: flex; flex-wrap: wrap; gap: 5px; }
.repere {
  display: inline-block; font-size: 12px; font-weight: 500; line-height: 1.5;
  padding: 1px 8px; border-radius: 10px; white-space: nowrap;
  background: #EEF0F3; color: var(--muted);
}
.repere.test { background: var(--ink); color: #fff; }
.repere.partielle { background: #DBEAFE; color: #1E3A8A; }
.repere.precommande { background: var(--ai-bg); color: var(--ai-ink); }
.repere.rupture { background: var(--crit-bg); color: var(--crit-ink); font-weight: 600; }
.repere.note { background: var(--note-bg); color: #7A5B00; box-shadow: inset 0 0 0 1px var(--note-line); font-weight: 600; }
.repere.comm { background: var(--accent-bg); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line); }
.repere.attente { background: #EEF0F3; color: var(--muted); }
.repere.perdu { background: #FCE7F3; color: #9D174D; font-weight: 600; }
.repere.en-cours { background: var(--ok-bg); color: #14532D; box-shadow: inset 0 0 0 1px var(--ok-line); font-weight: 600; }
.repere.retard { background: #FFEDD5; color: #7C2D12; font-weight: 600; }
.repere.alerte-note { cursor: help; }

/* --- Comptes ------------------------------------------------------------------ */
.ajout { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 22px; }
.ligne-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 16px; margin-top: 14px; }
td.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
tr.inactif td { color: var(--soft); }

/* --- Liste : aperçu rapide sous la ligne ---------------------------------- */
.bouton-apercu {
  background: #fff; color: var(--ink); border: 1px solid var(--field);
  height: 30px; font-size: 15px; font-weight: 600; padding: 0 10px;
}
.bouton-apercu:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-ink); }
.bouton-apercu[aria-expanded="true"] { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-ink); }
.bouton-apercu .chevron { font-size: 11px; transition: transform .15s; }
.bouton-apercu[aria-expanded="true"] .chevron { transform: rotate(180deg); }
tr.ligne-apercu td { background: #F6F7F9; padding: 10px 16px 14px; }
tr.ligne-apercu:hover { background: none; }
.apercu-note { margin-bottom: 8px; white-space: pre-wrap; background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 8px; padding: 8px 12px; }
.apercu-articles { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.apercu-articles li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.apercu-articles img, .apercu-sans-photo { width: 44px; height: 44px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: block; }
.apercu-titre { display: flex; flex-direction: column; font-weight: 600; }
.apercu-titre .petit { font-weight: 400; }
.apercu-qte { font-size: 16px; }
.apercu-ouvrir { font-size: 13px; font-weight: 600; }

/* --- Écran « Préparer » : tout sur une page, comme la commande dans Shopify -- */
.retour { margin: 0 0 12px; font-size: 13px; }
.retour a { text-decoration: none; }
.progression {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  background: #DDE1E7; padding: 5px 10px; border-radius: 6px; white-space: nowrap;
}
.page-commande { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; align-items: flex-start; }
.colonne-principale { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.cote { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.bloc { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.bloc h2 { font-size: 12px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.bloc p { margin: 0; }
.bloc address { font-style: normal; margin-top: 6px; line-height: 1.5; }
.fort { font-weight: 600; }
.note-cliente { background: var(--note-bg); border-color: var(--note-line); }
.note-cliente h2 { color: #7A5B00; }
.note-cliente p { font-size: 15px; white-space: pre-wrap; }
.bloc.articles { padding-bottom: 4px; }
.bloc.articles .message { margin: 12px 0; }
.entete-articles { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.entete-articles h2 { margin: 0; }

.ligne-article {
  display: grid; grid-template-columns: 88px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line2);
}
.ligne-article.prepare { opacity: .55; }
.ligne-article.prepare .case-prepare { background: var(--ok-bg); border-color: var(--ok-line); color: #14532D; }
.vignette-article {
  position: relative; width: 88px; height: 88px; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: #F6F7F9; cursor: zoom-in; overflow: hidden; font-weight: 400;
}
.vignette-article:hover { background: #F6F7F9; border-color: var(--accent); }
.vignette-article img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vignette-article.sans-photo { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--soft); cursor: default; }
.nb-photos {
  position: absolute; left: 0; right: 0; bottom: 0; background: rgba(22, 24, 29, .75); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 0; text-align: center;
}
.infos-article { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.titre-article { font-weight: 600; font-size: 15px; }
.options { display: flex; flex-wrap: wrap; gap: 6px; }
.option { background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 8px; padding: 1px 9px; font-size: 15px; }
.option .nom { font-size: 12px; color: var(--soft); }
.sku { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.proprietes { margin: 0; font-size: 13px; display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; }
.proprietes dt { color: var(--soft); }
.proprietes dd { margin: 0; font-weight: 600; }
.quantite { font-size: 15px; text-align: center; white-space: nowrap; }
.quantite strong { font-size: 24px; }
.case-prepare {
  display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0;
  background: #fff; border: 1px solid var(--field); border-radius: 8px; padding: 8px 12px;
  font-size: 14px; font-weight: 600; color: var(--ink); text-transform: none; letter-spacing: 0; white-space: nowrap;
}
.case-prepare:hover { border-color: #9AA2AF; }
.case-prepare input { width: 20px; height: 20px; accent-color: var(--ok); margin: 0; }
.case-prepare.tout { padding: 6px 10px; font-size: 13px; }

/* Commentaires internes */
.commentaires { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.commentaires li p { margin: 2px 0 0; white-space: pre-wrap; }
.commentaires li + li { border-top: 1px solid var(--line2); padding-top: 8px; }
.ajout-commentaire { display: flex; flex-direction: column; gap: 6px; }
.ajout-commentaire textarea {
  width: 100%; font: inherit; font-size: 14px; padding: 9px 12px; line-height: 1.5;
  border: 1px solid var(--note-line); border-radius: 8px; resize: vertical; background: #FFFDF2; color: var(--ink);
}
.ajout-commentaire button { align-self: flex-end; }
.erreur-commentaire { color: var(--crit-ink); font-weight: 500; margin: 6px 0 0; }

/* Visionneuse (photo agrandie) */
.visionneuse { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; overflow: visible; }
.visionneuse::backdrop { background: rgba(22, 24, 29, .88); }
.visionneuse img { display: block; max-width: 92vw; max-height: 88vh; object-fit: contain; background: #fff; border-radius: 8px; cursor: pointer; }
.visionneuse .fermer, .visionneuse .fleche {
  position: fixed; background: #fff; color: var(--ink); border: 1px solid var(--field); border-radius: 24px;
  width: 48px; height: 48px; padding: 0; font-size: 28px; font-weight: 400; line-height: 1;
}
.visionneuse .fermer:hover, .visionneuse .fleche:hover { background: var(--accent-bg); }
.visionneuse .fermer { top: 16px; right: 16px; }
.visionneuse .fleche { top: 50%; transform: translateY(-50%); }
.visionneuse .precedente { left: 16px; }
.visionneuse .suivante { right: 16px; }
.visionneuse .compteur { position: fixed; bottom: 16px; left: 0; right: 0; text-align: center; color: #fff; margin: 0; font-weight: 600; }

/* --- Téléphone (dépannage) --------------------------------------------------- */
@media (max-width: 900px) {
  .cote { order: -1; }
}
@media (max-width: 760px) {
  /* Téléphone : comme l'outil Support (onglets à la ligne, nom masqué, initiales seules). */
  .entete { padding: 8px 12px; gap: 8px; position: static; }
  .entete .marque { font-size: 15px; }
  .onglets-entete a { padding: 6px 10px; }
  .entete .qui > span[data-nom] { display: none; }
  .entete .qui button { padding: 6px 10px; font-size: 12px; }

  /* « Préparer » sur téléphone (surtout pour aller chercher le stock) : note de la cliente,
     puis les articles et l'expédition ; commentaires, livraison et montants en dessous. */
  .page-commande { flex-direction: column; align-items: stretch; }
  .colonne-principale, .cote { display: contents; }
  .page-commande > * > * { order: 1; }
  .colonne-principale > * { order: 0; }
  .cote > .note-cliente { order: -1; }
  main { padding: 12px; }
  .carte-connexion { margin-top: 24px; padding: 20px; }

  table, thead, tbody, tr, td { display: block; }
  table { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  thead { display: none; }
  tbody tr { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 10px 12px; }
  tbody td { border: 0; padding: 3px 0; }
  td.articles { text-align: left; }
  td[data-titre]::before { content: attr(data-titre) " : "; color: var(--soft); font-size: 12px; }

  .ligne-article { grid-template-columns: 72px minmax(0, 1fr); }
  .vignette-article { width: 72px; height: 72px; }
  .quantite { text-align: left; }
  .ligne-article .quantite, .ligne-article .case-prepare { grid-column: 2; justify-self: start; }
}

/* Prix */
td.total, th.total { text-align: right; white-space: nowrap; }
td.total { font-weight: 600; }
.prix-unitaire { font-size: 13px; color: var(--muted); }
.montants { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.montants dd { margin: 0; text-align: right; }
.montants dt.fort, .montants dd.fort { border-top: 1px solid var(--line2); padding-top: 6px; font-size: 15px; }
.apercu-qte { white-space: nowrap; color: var(--muted); }
.apercu-qte strong { font-size: 16px; color: var(--ink); }

/* Photos envoyées par la cliente (ongle perdu…) */
.photos-cliente { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.vignettes-cliente { display: flex; flex-wrap: wrap; gap: 8px; }
.vignette-cliente {
  width: 120px; height: 120px; padding: 0; border: 2px solid #F9A8D4; border-radius: 8px;
  background: #fff; overflow: hidden; cursor: zoom-in;
}
.vignette-cliente:hover { background: #fff; border-color: #9D174D; }
.vignette-cliente img { width: 100%; height: 100%; object-fit: cover; display: block; }
.apercu-photos-cliente { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; }
.apercu-photos-cliente img { width: 64px; height: 64px; object-fit: cover; border: 2px solid #F9A8D4; border-radius: 6px; display: block; }

/* Liste : choix « Toutes » / « Sans précommande » (comme les puces de Support) */
.barre h1 { margin-right: auto; }
.filtres { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--field); background: #fff; color: var(--ink); font-size: 13px; font-weight: 400; }
.chip:hover { background: #fff; border-color: #9AA2AF; }
.chip.on, .chip.on:hover { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.chip .nb { opacity: .8; font-weight: 400; }

/* --- Expédition ---------------------------------------------------------------- */
.filtres.onglets .chip { font-weight: 600; }
.expedier h2 { margin-bottom: 10px; }
details.expedier > summary { cursor: pointer; list-style: none; }
details.expedier > summary::-webkit-details-marker { display: none; }
details.expedier > summary h2 { display: inline; }
details.expedier > summary::before { content: "▸ "; color: var(--soft); }
details.expedier[open] > summary::before { content: "▾ "; }
details.expedier[open] > summary { margin-bottom: 10px; }
.etapes { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.etapes li { line-height: 1.6; }
.transporteur-attendu { margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: #F6F7F9; border: 1px solid var(--line); font-weight: 600; font-size: 1.05rem; }
.transporteur-attendu .petit { font-weight: 400; margin-top: 4px; }
.numero-gros { font-family: var(--mono); font-size: 20px; background: #F6F7F9; border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; }
.actions-expedier { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.etat-en-cours { font-weight: 600; color: #14532D; background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px !important; }
.grille-expedier { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); gap: 0 14px; }
.grille-expedier select, .grille-expedier input, .correction select, .correction input[type=text] { width: 100%; }
.champ-suivi { font-family: var(--mono); font-size: 16px; letter-spacing: .5px; }
.aide.ok { color: #14532D; }
.aide.alerte { color: var(--warn-ink); }
.choix-mode { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 10px; }
.case-prepare input[type=radio] { accent-color: var(--accent); }
.case-prepare.prevenir { display: inline-flex; margin-top: 4px; }
.case-prepare.prevenir input { accent-color: var(--accent); }
.liste-partielle { border: 1px solid var(--line2); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.ligne-partielle {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0;
  text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--ink);
}
.qte-partielle { white-space: nowrap; font-weight: 400; }
input.champ-quantite { width: 76px; text-align: center; padding: 6px 8px; }
.expeditions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.expeditions li + li { border-top: 1px solid var(--line2); padding-top: 10px; }
.petit-bouton { height: 30px; padding: 0 10px; font-size: 13px; margin-top: 6px; }
.correction { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
@media (max-width: 760px) {
  .grille-expedier { grid-template-columns: 1fr; }
}

/* --- Pastille transporteur ------------------------------------------------------ */
.livraison { display: inline-flex; align-items: flex-start; gap: 8px; }
.pastille-transporteur {
  flex: none; display: inline-block; min-width: 92px; text-align: center; border-radius: 6px;
  padding: 2px 8px; font-size: 12px; font-weight: 700; line-height: 1.5; color: #fff; white-space: nowrap;
}
.pastille-transporteur.mr { background: #96164B; }
.pastille-transporteur.chrono { background: #1F5FA8; }
.pastille-transporteur.colissimo { background: #F2A900; color: #3A2A00; }
.pastille-transporteur.lettre-verte { background: #2E8B57; }
.pastille-transporteur.laposte { background: #FFCD00; color: #3A3000; }
.pastille-transporteur.retrait { background: #6B7280; }
.pastille-transporteur.inconnu { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn); }

/* Note de la cliente dans la liste, sous le mode de livraison */
.note-liste {
  margin-top: 6px; font-size: 13px; background: var(--note-bg); border: 1px solid var(--note-line); border-radius: 6px;
  padding: 3px 8px; color: #5C4500; white-space: pre-wrap;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* Dernier commentaire de l'équipe dans la liste (bleu, pour le distinguer de la note de la cliente) */
.comm-liste {
  margin-top: 6px; font-size: 13px; background: var(--accent-bg); border: 1px solid var(--accent-line); border-left: 4px solid var(--accent);
  border-radius: 6px; padding: 3px 8px; color: var(--accent-ink); white-space: pre-wrap;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.comm-autres { color: var(--soft); font-weight: 600; }

/* Commentaires de l'équipe en haut de « Préparer » : impossible à manquer */
.bandeau-commentaires {
  margin-top: 12px; background: var(--accent-bg); border: 1px solid var(--accent-line); border-left: 6px solid var(--accent);
  border-radius: 12px; padding: 10px 16px;
}
.bandeau-commentaires h2 { font-size: 12px; font-weight: 700; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .5px; margin: 0 0 6px; }
.bandeau-commentaires .commentaires { margin: 0; }
.bandeau-commentaires .commentaires li p { font-size: 15px; font-weight: 500; color: var(--ink, #111); }

/* --- Journal et Réglages -------------------------------------------------------- */
.filtres-journal { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.champ-ligne { display: inline-flex; align-items: center; gap: 6px; margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; }
.champ-ligne input { width: auto; padding: 6px 10px; font-size: 14px; }
tr.ligne-importante td { background: var(--accent-bg); }
.liste-transporteurs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
.liste-transporteurs .case-prepare input { accent-color: var(--accent); }
.ajout h2 + .petit { margin-top: 2px; }

/* Ruban de chargement (même que l'outil Support) */
#ruban-chargement { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; opacity: 0; transition: opacity .15s; background: linear-gradient(90deg, transparent 0, #EC4D8B 30%, var(--accent) 60%, transparent 100%); background-size: 50% 100%; background-repeat: no-repeat; }
#ruban-chargement.actif { opacity: 1; animation: ruban 1s linear infinite; }
@keyframes ruban { from { background-position: -50% 0; } to { background-position: 150% 0; } }
body.attente, body.attente * { cursor: progress !important; }
@media (prefers-reduced-motion: reduce) { #ruban-chargement.actif { animation-duration: 2.5s; } }

/* Caisses (stocks Shopify Rose / Vert / Jaune, mêmes couleurs que l'application RFID) */
.pastille-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; vertical-align: 2px; }
.pastille-stock::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.pastille-stock.rose { background: #FDE2EE; border-color: #F5A3C7; color: #9D174D; }
.pastille-stock.vert { background: #DCFCE7; border-color: #86D9A5; color: #166534; }
.pastille-stock.jaune { background: #FEF3C7; border-color: #F0CF63; color: #854D0E; }
.pastille-stock.autre { background: var(--lane); border-color: var(--line); color: var(--soft); }
.titre-article .pastille-stock { margin-right: 10px; }
.titre-caisse { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-weight: 600; color: var(--muted); }
.reperes .pastille-stock { font-size: 12px; padding: 2px 8px; }

/* Changer de caisse (avant l'étiquette) */
.changer-caisse { margin-top: 4px; }
.lien-caisse { background: none; border: 0; padding: 0; height: auto; color: var(--accent); font-weight: 400; font-size: 13px; text-decoration: underline; cursor: pointer; }
.lien-caisse:hover { background: none; }
.choix-caisse { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.choix-caisse .petit-bouton { margin-top: 0; display: inline-flex; align-items: center; gap: 4px; }
.choix-caisse button:disabled { opacity: .5; cursor: not-allowed; }
.regrouper { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }

.case-note-shopify { margin-top: 8px; font-size: 13px; }


/* Stock disponible par caisse, sous le SKU */
.stocks-caisses { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.stocks-caisses .nom { color: var(--muted); }
.stocks-caisses.indispo { color: var(--muted); font-style: italic; }
.stock-caisse { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.stock-caisse.rose { background: #FDE2EE; border-color: #F5A3C7; color: #9D174D; }
.stock-caisse.vert { background: #DCFCE7; border-color: #86D9A5; color: #166534; }
.stock-caisse.jaune { background: #FEF3C7; border-color: #F0CF63; color: #854D0E; }
.stock-caisse.vide { background: transparent; border-style: dashed; opacity: .7; font-weight: 400; }
.stock-caisse.ici { box-shadow: 0 0 0 2px currentColor inset; }

/* --- Liste des commandes sur téléphone : cartes compactes ------------------------
   Ligne 1 : n°, cliente, date ; ligne 2 : livraison, total ; ligne 3 : articles et repères. */
@media (max-width: 760px) {
  .barre { gap: 8px; margin-bottom: 10px; }
  .barre:has(#ordre) h1 { display: none; } /* liste : déjà dit par l'onglet « Commandes » */
  .titre-commande { font-size: 18px; line-height: 1.25; }
  .titre-commande .numero-commande { display: block; font-size: 30px; font-weight: 700; letter-spacing: .5px; }
  .titre-commande .separateur { display: none; }
  .chip { height: 30px; padding: 0 9px; }
  .barre .infos { gap: 8px; width: 100%; }
  .barre .infos #resume { margin-right: auto; }
  .barre .infos button { height: 30px; padding: 0 10px; font-size: 12px; }

  #lignes tr.cliquable {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
    grid-template-areas: "num cli date" "liv liv total" "art rep rep";
    gap: 4px 10px; padding: 8px 12px; margin-bottom: 8px;
  }
  #lignes tr.cliquable td { padding: 0; min-width: 0; }
  #lignes tr.cliquable td[data-titre]::before { content: none; }
  #lignes td.numero { grid-area: num; font-size: 16px; }
  #lignes td.cliente { grid-area: cli; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #lignes td.date { grid-area: date; font-size: 12px; color: var(--soft); white-space: nowrap; }
  #lignes td.col-livraison { grid-area: liv; font-size: 13px; }
  #lignes td.col-livraison .livraison { display: flex; align-items: center; min-width: 0; }
  #lignes td.col-livraison .livraison > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--muted); }
  #lignes td.col-livraison .pastille-transporteur { min-width: 0; }
  #lignes td.col-livraison .note-liste, #lignes td.col-livraison .comm-liste { margin-top: 4px; -webkit-line-clamp: 2; }
  #lignes td.total { grid-area: total; align-self: start; font-size: 14px; }
  #lignes td.articles { grid-area: art; }
  #lignes td.col-reperes { grid-area: rep; }
  #lignes .bouton-apercu { height: 28px; font-size: 14px; padding: 0 8px; }
  #lignes tr.ligne-apercu { margin: -6px 0 8px; border-radius: 0 0 10px 10px; padding: 0; overflow: hidden; }
  #lignes tr.ligne-apercu td { padding: 8px 12px 10px; }
}

/* « Préparer » sur téléphone : prix, quantité et « Préparé » sur une seule ligne sous les infos. */
@media (max-width: 760px) {
  .ligne-article { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 8px 12px; align-items: start; padding: 10px 0; }
  .ligne-article .vignette-article { grid-row: span 2; }
  .ligne-article .infos-article { grid-column: 2 / -1; }
  .ligne-article .quantite { grid-column: 2; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; align-self: center; }
  .ligne-article .quantite .prix-unitaire { margin-right: 4px; }
  .ligne-article .case-prepare { grid-column: 3; justify-self: end; align-self: center; }
}

/* En-tête sur téléphone : marque + initiales + « Se déconnecter » sur une ligne, onglets en dessous. */
@media (max-width: 760px) {
  .entete {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "marque qui" "nav nav";
    align-items: center; gap: 6px 8px; padding: 8px 12px 6px;
  }
  .entete .marque { grid-area: marque; overflow: hidden; text-overflow: ellipsis; }
  .entete .qui { grid-area: qui; gap: 6px; margin: 0; }
  .entete .onglets-entete { grid-area: nav; gap: 2px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .entete .onglets-entete a { padding: 5px 10px; white-space: nowrap; }
  .entete .avatar { width: 26px; height: 26px; font-size: 10px; }
  .entete .qui button { height: 28px; padding: 0 9px; font-size: 12px; }
  .retour { margin-bottom: 6px; }
}

/* Écrire à la cliente (lien vers l'outil Support) */
.bouton-lien {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border-radius: 8px;
  background: #fff; border: 1px solid var(--field); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none;
}
.bouton-lien:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-bg); }
.ecrire-cliente .petit { margin-top: 6px; }
