/* =============================================================================
   mc.css - LA PEAU DU PORTAIL, PARTAGEE ENTRE LES DEUX SITES   (21/08)
   Sorti de index.html quand stock.mrchour.com est devenu un site a part.
   Deux feuilles de style qui derivent, c'est deux produits differents au
   bout de trois semaines. Il n'y en a qu'une.
   ============================================================================= */

  :root{
    color-scheme: light;
    --surface-1:#fcfcfb; --plane:#f4f4f1; --line:#e3e2dd;
    --text-primary:#0b0b0b; --text-secondary:#52514e; --text-muted:#77756f;
    --brand:#151E3F;
    --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100; --s5:#e87ba4; --s6:#008300;
    --seq:#2a78d6; --seq-soft:#cde2fb;
    --good:#0ca30c; --warning:#fab219; --critical:#d03b3b;
  }
  /* Le sélecteur ci-dessous est dupliqué pour data-theme="dark" : le mode
     sombre doit pouvoir être CHOISI, pas seulement hérité du téléphone. */
  :root[data-theme="dark"]{
    color-scheme: dark;
    --surface-1:#1a1a19; --plane:#0d0d0d; --line:#333331;
    --text-primary:#ffffff; --text-secondary:#c3c2b7; --text-muted:#98968d;
    /* 20/08 : le bandeau et le menu gardent le BLEU DENIM de la caisse, meme
       en mode sombre. Il valait #0d0d0d ici, soit un bandeau noir en haut et
       un menu bleu a gauche : deux surfaces voisines, deux couleurs, aucune
       raison. Une seule variable pour les deux, et c'est celle de
       l'application (#151E3F) - le portail et la caisse doivent se
       reconnaitre du premier coup d'oeil. */
    --brand:#151E3F;
    --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500; --s5:#d55181; --s6:#008300;
    --seq:#3987e5; --seq-soft:#184f95;
  }
  @media (prefers-color-scheme: dark){
    :root:where(:not([data-theme="light"])):where(:not([data-theme="dark"])){
      color-scheme: dark;
      --surface-1:#1a1a19; --plane:#0d0d0d; --line:#333331;
      --text-primary:#ffffff; --text-secondary:#c3c2b7; --text-muted:#98968d;
      --brand:#151E3F;   /* voir le commentaire du bloc data-theme="dark" */
      --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500; --s5:#d55181; --s6:#008300;
      --seq:#3987e5; --seq-soft:#184f95;
    }
  }
  *{box-sizing:border-box}
  html,body{max-width:100%;overflow-x:hidden}
  /* 23/08 - overflow-x:hidden fait de html et body des CONTENEURS DE
     DEFILEMENT, et une position:sticky ne colle alors plus a l'ecran : la
     barre de saisie repartait vers le haut des qu'on faisait defiler.
     overflow-x:clip coupe exactement pareil SANS creer de conteneur. On le
     pose derriere @supports : un navigateur qui ne connait pas 'clip' garde
     'hidden' (pas de barre collante, mais pas de defilement lateral non plus). */
  @supports (overflow-x: clip){ html,body{ overflow-x:clip } }
  body{margin:0;background:var(--plane);color:var(--text-primary);
    font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
    padding-bottom:env(safe-area-inset-bottom)}
  header{background:var(--brand);color:#fff;padding:14px 16px;
    padding-top:calc(14px + env(safe-area-inset-top))}
  header h1{margin:0;font-size:16px;letter-spacing:.06em;font-weight:600}
  header .sub{font-size:12px;opacity:.75;margin-top:2px}
  /* Ligne 1 : raccourcis, defilement horizontal (jamais de debordement de page).
     Ligne 2 : dates + magasin. Les melanger faisait deborder la page entiere. */
  .frow{background:var(--surface-1);display:flex;gap:8px;align-items:center;padding:10px 12px}
  .frow.presets{overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch;padding-bottom:8px}
  .frow.presets::-webkit-scrollbar{display:none}
  .frow.dates{display:grid;grid-template-columns:1fr;gap:8px;border-bottom:1px solid var(--line);padding-top:0}
  .frow.dates.plage{grid-template-columns:1fr 1fr}
  .frow.dates select{grid-column:1 / -1}
  .datelab{display:flex;align-items:center;gap:8px;min-width:0}
  /* [hidden] pose display:none dans la feuille du navigateur, mais une règle
     de CLASSE la bat. Sans cette ligne, le champ "Au" reste visible alors que
     le code le masque — et l'écran ment sur la période. */
  .datelab[hidden]{display:none}
  .datelab>span{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);flex:0 0 auto}
  /* Le champ occupe toute la largeur : sur ecran tactile, on ouvre le calendrier
     en tapant n'importe ou dessus, pas seulement sur la petite icone. */
  .datelab input[type=date]{width:100%;cursor:pointer}
  /* Bandeau de couleur en tete de tuile : la couleur porte le sens, jamais
     seule (le libelle et le chiffre restent lisibles en noir et blanc). */
  .tile{position:relative;overflow:hidden}
  .tile::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--tc,transparent)}
  .tile.t-valide{--tc:var(--s3)} .tile.t-encours{--tc:var(--s4)}
  .tile.t-depense{--tc:var(--s2)} .tile.t-panier{--tc:var(--s1)}
  .tile.t-ecart{--tc:var(--s5)}   .tile.t-coffre{--tc:var(--s6)}
  .sechead{background:var(--plane);font-weight:600;font-size:12px;letter-spacing:.04em;
    text-transform:uppercase;color:var(--text-secondary)}
  .sechead td{border-top:1px solid var(--line)}
  .chip{border:1px solid var(--line);background:var(--surface-1);color:var(--text-secondary);
    border-radius:999px;padding:7px 13px;font-size:13px;cursor:pointer;white-space:nowrap;flex:0 0 auto}
  .chip[aria-pressed="true"]{background:var(--s1);border-color:var(--s1);color:#fff;font-weight:600}
  /* 20/08 - le filtre actif des fournisseurs. Meme apparence que aria-pressed :
     un filtre qui ne se voit pas selectionne fait croire qu'il n'a rien fait. */
  .chip.actif{background:var(--s1);border-color:var(--s1);color:#fff;font-weight:600}
  input[type=date],select{border:1px solid var(--line);background:var(--surface-1);color:var(--text-primary);
    border-radius:8px;padding:6px 8px;font-size:13px;min-height:36px;max-width:100%;flex:1 1 130px;min-width:0}
  /* ------------------------------------------------------------------------
     LE MENU EST PASSE A GAUCHE (20/08, demande directe). Il etait une bande
     d'onglets qui defilait horizontalement : sur telephone, la moitie des
     entrees vivaient hors de l'ecran et ne se decouvraient qu'en faisant
     glisser une barre dont rien n'annoncait qu'elle glissait. Les quatre
     entrees d'administration, ajoutees en dernier, etaient exactement celles
     qu'on ne voyait jamais.

     Une colonne montre TOUT d'un coup, et un menu se lit de haut en bas plus
     vite qu'il ne se fait defiler. Il prend var(--brand) - LA MEME variable que
     le bandeau du haut, jamais une copie du code couleur : deux surfaces qui se
     touchent doivent etre incapables de diverger. C'est le bleu denim de la
     caisse (#151E3F), dans les deux themes.

     UN SEUL ETAT, DEUX COMPORTEMENTS : la classe .ouvert sur <body>. Grand
     ecran, le menu pousse le contenu et reste ouvert ; petit ecran, il glisse
     par-dessus avec un voile qui le referme au toucher. Pas deux mecanismes a
     tenir d'accord - un seul, dont la largeur d'ecran change l'effet.
     ------------------------------------------------------------------------ */
  nav{position:fixed;top:0;left:0;bottom:0;width:230px;z-index:30;
    background:var(--brand);color:#fff;padding:10px 0;overflow-y:auto;
    display:flex;flex-direction:column;gap:2px;
    transform:translateX(-100%);transition:transform .18s ease;
    -webkit-overflow-scrolling:touch}
  body.ouvert nav{transform:translateX(0)}
  nav .titre{font-size:11px;letter-spacing:.08em;text-transform:uppercase;
    color:rgba(255,255,255,.5);padding:12px 18px 6px}
  nav button{border:0;background:none;color:rgba(255,255,255,.82);
    padding:13px 18px;font-size:15px;text-align:left;cursor:pointer;
    border-left:3px solid transparent;white-space:nowrap;width:100%}
  nav button:hover{background:rgba(255,255,255,.06);color:#fff}
  nav button[aria-selected="true"]{color:#fff;font-weight:600;
    background:rgba(255,255,255,.10);border-left-color:var(--s1)}
  /* Le voile : petit ecran seulement. Il n'existe pas au-dessus de 900 px,
     ou le menu ne recouvre rien. */
  #voile{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:20;
    opacity:0;pointer-events:none;transition:opacity .18s ease}
  body.ouvert #voile{opacity:1;pointer-events:auto}
  #menubtn{background:none;border:0;color:#fff;font-size:22px;line-height:1;
    padding:6px 10px 6px 0;cursor:pointer;flex:0 0 auto}
  header{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
  header .titres{flex:1;min-width:0}
  @media(min-width:900px){
    #voile{display:none}
    body.ouvert header, body.ouvert .frow, body.ouvert #banner,
    body.ouvert main, body.ouvert footer{margin-left:230px}
  }
  main{padding:12px}
  .card{background:var(--surface-1);border:1px solid var(--line);border-radius:12px;padding:14px;margin-bottom:12px}
  .card h2{margin:0 0 10px;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--text-secondary);font-weight:600}
  .tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  @media(min-width:640px){.tiles{grid-template-columns:repeat(4,minmax(0,1fr))}}
  .tile{background:var(--surface-1);border:1px solid var(--line);border-radius:12px;padding:12px}
  .tile .lab{font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:var(--text-muted)}
  .tile .val{font-size:22px;overflow-wrap:anywhere;font-weight:650;margin-top:4px;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
  .tile .note{font-size:12px;color:var(--text-secondary);margin-top:3px}
  .ok{color:var(--good)} .bad{color:var(--critical)} .warn{color:var(--warning)}
  table{width:100%;max-width:100%;border-collapse:collapse;font-size:14px;table-layout:fixed}
  td:first-child,th:first-child{overflow-wrap:anywhere}
  th{text-align:left;font-size:11px;letter-spacing:.05em;text-transform:uppercase;color:var(--text-muted);
    font-weight:600;padding:6px 6px;border-bottom:1px solid var(--line)}
  td{padding:8px 6px;border-bottom:1px solid var(--line);vertical-align:middle}
  td.n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
  tr:last-child td{border-bottom:0}
  .sw{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:7px;vertical-align:baseline;flex:0 0 auto}
  /* Dans un tableau étroit, le navigateur coupait la ligne JUSTE APRÈS la
     pastille : la couleur se retrouvait seule au-dessus de son libellé. */
  .lbl{display:inline-flex;align-items:flex-start;gap:0}
  /* table-layout:fixed découpe les colonnes en parts égales : sur trois
     colonnes, le libellé n'obtient qu'un tiers et se casse au milieu d'un mot
     (« BOULANGERI / E »). Les tableaux « libellé + chiffres » donnent donc la
     moitié de la largeur au libellé, explicitement. */
  table.rep th:first-child, table.rep td:first-child{width:50%}
  /* Tableau croisé : autant de colonnes que d'heures, donc largeur libre et
     défilement horizontal. table-layout:auto ici, contrairement au reste :
     une colonne d'heure doit tenir son chiffre, pas une part d'écran. */
  .scrollx{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -4px}
  table.croise{table-layout:auto;width:auto;min-width:100%;white-space:nowrap;font-size:13px}
  table.croise th,table.croise td{padding:6px 8px}
  table.croise thead th{position:sticky;top:0;background:var(--surface-1)}
  table.croise tbody td:first-child,table.croise thead th:first-child{
    position:sticky;left:0;background:var(--surface-1);z-index:1}
  table.croise tr.sechead td{font-weight:600;background:var(--plane)}
  .barcell{position:relative}
  .barcell .fill{position:absolute;left:0;top:50%;transform:translateY(-50%);height:18px;
    background:var(--seq-soft);border-radius:0 4px 4px 0;z-index:0}
  .barcell span{position:relative;z-index:1}
  .hours{display:flex;align-items:flex-end;gap:2px;height:190px;padding-top:22px}
  .hbar{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;height:100%;position:relative;cursor:default}
  .hbar .b{width:100%;background:var(--seq);border-radius:4px 4px 0 0;min-height:2px}
  .hbar .hl{font-size:10px;color:var(--text-muted);margin-top:4px;font-variant-numeric:tabular-nums}
  .hbar .dl{position:absolute;top:-20px;font-size:10px;color:var(--text-secondary);
    font-variant-numeric:tabular-nums;white-space:nowrap}
  .hbar:hover .b{filter:brightness(1.12);outline:2px solid var(--surface-1)}
  /* Barre EMPILEE : chaque segment est separe du suivant par 2px de surface,
     sinon deux teintes voisines se lisent comme une seule. Seul le segment du
     haut est arrondi ; les autres restent droits pour que l'empilement se voie. */
  .hbar .stack{width:100%;display:flex;flex-direction:column-reverse;justify-content:flex-start;min-height:2px}
  .hbar .seg{width:100%;min-height:2px;border-bottom:2px solid var(--surface-1)}
  .hbar .seg:first-child{border-bottom:0}
  .hbar .seg.top{border-radius:4px 4px 0 0}
  .legend{display:flex;flex-wrap:wrap;gap:10px 16px;margin:10px 0 2px;font-size:12px;color:var(--text-secondary)}
  .legend span.i{display:inline-flex;align-items:center;gap:6px}
  .tip{position:fixed;pointer-events:none;background:var(--text-primary);color:var(--surface-1);
    padding:6px 9px;border-radius:7px;font-size:12px;z-index:99;opacity:0;transition:opacity .1s;
    font-variant-numeric:tabular-nums;max-width:70vw}
  .muted{color:var(--text-muted);font-size:13px;text-align:center;padding:18px 0}
  .err{color:var(--critical);font-size:13px;padding:10px 0}
  .badge{display:inline-block;font-size:11px;padding:2px 7px;border-radius:999px;border:1px solid currentColor;font-weight:600}
  /* Tickets ouverts : une ligne cliquable qui deplie son detail. */
  .tk{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;
    padding:10px 4px;border-bottom:1px solid var(--line);cursor:pointer}
  .tk:last-of-type{border-bottom:0}
  .tk .who{font-size:12px;color:var(--text-muted);margin-top:2px}
  .tk .amt{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:600}
  .tk .arw{color:var(--text-muted);font-size:12px}
  .tkdet{display:none;background:var(--plane);border-radius:8px;padding:8px 10px;margin:0 0 8px}
  .tkdet.on{display:block}
  .void{text-decoration:line-through;color:var(--text-muted)}
  .ln{padding:8px 0;border-bottom:1px solid var(--line)}
  .ln:last-child{border-bottom:0}
  .lnrow{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
  /* Boutons d'action : deux temps. Le premier clic ARME, le second envoie.
     Sur telephone, un bouton "annuler" qui part au premier contact est une
     erreur qui se produira. */
  .act{border:1px solid var(--line);background:var(--surface-1);color:var(--text-secondary);
    border-radius:8px;padding:5px 10px;font-size:12px;cursor:pointer;margin:6px 6px 0 0}
  .act.armed{background:var(--critical);border-color:var(--critical);color:#fff;font-weight:600}
  .act:disabled{opacity:.5;cursor:default}
  .lb{display:block;font-size:11px;text-transform:uppercase;letter-spacing:.05em;
    color:var(--text-muted);margin:12px 0 5px}
  .mono{font-family:ui-monospace,Menlo,Consolas,monospace}
  input[type=text],input[type=password],input:not([type]){width:100%;border:1px solid var(--line);
    background:var(--plane);color:var(--text-primary);border-radius:8px;padding:9px 10px;font-size:15px}
  .card select{width:100%}
  .toast{position:fixed;left:50%;transform:translateX(-50%);bottom:18px;z-index:100;
    background:var(--text-primary);color:var(--surface-1);padding:10px 14px;border-radius:10px;
    font-size:13px;max-width:88vw;box-shadow:0 6px 20px rgba(0,0,0,.25);display:none}
  .toast.on{display:block}
  .toast.bad{background:var(--critical);color:#fff}
  #banner{margin:0;padding:10px 14px;font-size:13px;display:none}
  #banner.cache{display:block;background:#fff6e5;color:#7a5200;border-bottom:1px solid #f0d9a8}
  @media (prefers-color-scheme: dark){:root:where(:not([data-theme="light"])) #banner.cache{background:#2b2313;color:#f3d08a;border-bottom-color:#4a3c1d}}
  footer{padding:14px;text-align:center;color:var(--text-muted);font-size:12px}

/* =============================================================================
   L'ECRAN DE RECEPTION / SORTIE   (21/08)
   « reception and sortie work, make it smoother, better looking. »

   Une regle gouverne tout ce bloc : LE SENS DU MOUVEMENT DOIT SE VOIR SANS
   LIRE. Vert = ce qui entre, orange = ce qui sort. Confondre les deux est la
   seule erreur de cet ecran qui ne se rattrape pas toute seule : elle ajoute
   du stock la ou il fallait en retirer, et le double au lieu de le vider.
   ============================================================================= */

.sm-bascule{ display:flex; gap:6px; margin-bottom:12px; }
.sm-onglet{
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:10px 8px; border-radius:10px; cursor:pointer;
  border:2px solid var(--line); background:var(--plane);
  color:var(--text-secondary); font-size:13px; font-weight:600; line-height:1.2;
  text-align:center; font-family:inherit;
}
.sm-onglet small{ font-weight:400; font-size:11px; opacity:.8; }
.sm-onglet .sm-fleche{ font-size:17px; line-height:1; }
.sm-onglet.actif{ color:#fff; }
/* Cibles tactiles : on saisit debout, avec un carton dans les bras. */
@media (max-width:520px){ .sm-onglet{ padding:12px 6px; } }

.sm-sens{ border-left:5px solid var(--line); transition:border-color .15s; }
.sm-reception{ border-left-color:var(--good); }
.sm-sortie{    border-left-color:var(--warning); }
.sm-reception .sm-onglet.actif{ background:var(--good);    border-color:var(--good); }
.sm-sortie    .sm-onglet.actif{ background:var(--warning); border-color:var(--warning); color:#231a00; }

/* Le champ de scan ne doit jamais partir hors de l'ecran : le ticket
   s'allonge, lui reste. */
.sm-collant{
  position:sticky; top:0; z-index:5;
  background:var(--surface-1); padding:10px 0 6px;
  border-bottom:1px solid var(--line);
}

.sm-ligne{
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  border-top:1px solid var(--line); padding:9px 0;
}
.sm-ligne .sm-nom{ flex:1; min-width:130px; display:flex; flex-direction:column; }
.sm-ligne .sm-nom .muted{ font-size:11px; }
.sm-qte{ display:flex; align-items:center; gap:4px; }
.sm-qte .smQte{ width:64px; text-align:center; padding:8px 4px; }
.sm-pas{
  width:38px; height:38px; border-radius:9px; border:1px solid var(--line);
  background:var(--plane); color:var(--text-primary);
  font-size:19px; line-height:1; cursor:pointer; font-family:inherit;
}
.sm-pas:active{ background:var(--line); }
.sm-unite{
  font-size:12px; color:var(--text-secondary); background:var(--plane);
  border:1px solid var(--line); border-radius:6px; padding:6px 8px; white-space:nowrap;
}
.sm-extra{ display:flex; gap:6px; }
.sm-extra input{ width:96px; padding:7px 6px; font-size:13px; }

/* La ligne qui vient d'etre scannee clignote une fois. Sans ce signal, on
   scanne deux fois par doute - et deux scans, c'est deux cartons. */
@keyframes sm-flash{ from{ background:var(--seq-soft); } to{ background:transparent; } }
.sm-flash{ animation:sm-flash 1.1s ease-out 1; }

.sm-vide{
  text-align:center; color:var(--text-muted); font-size:13px;
  padding:20px 10px; border:1px dashed var(--line); border-radius:10px; margin-top:8px;
}

/* Le bouton final porte la phrase entiere : « Enregistrer 4 ligne(s) — SORTIE,
   de STOCK vers PATISSERIE ». Il peut donc etre long. */
.sm-valider{ width:100%; text-align:center; line-height:1.35; padding:13px 12px; }
.sm-valider[disabled]{ opacity:.5; cursor:default; }

/* ===========================================================================
   23/08 - RECEPTION / SORTIE : la saisie, revue                (8 points)
   =========================================================================== */

/* [hidden] EST BATTU PAR N'IMPORTE QUELLE REGLE DE CLASSE. La feuille du
   navigateur pose display:none, mais elle a la priorite la plus faible qui
   soit : une seule regle de classe la neutralise, et l'element reste a
   l'ecran alors que le code le croit cache. C'est deja arrive deux fois ici
   (.datelab plus haut, et le bloc camera) - et une troisieme avec le bloc
   d'identification, qui restait affiche apres s'etre identifie.
   Une bonne fois pour toutes, pour TOUTE la feuille. */
[hidden]{ display:none !important; }

/* Le bandeau « ✔ Identifié », dont le style etait en ligne (voir mc-commun.js). */
.mc-identifie{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* --- La ligne du ticket, façon panier ------------------------------------
   Une ligne = une carte. Le nom en haut a gauche, le compteur a droite, les
   details en dessous. On lit d'un coup d'oeil CE QU'ON A MIS et COMBIEN,
   sans que les champs de coût viennent s'intercaler entre les deux. */
.sm-carte{
  display:grid; grid-template-columns:1fr auto; gap:10px 12px;
  align-items:start; padding:12px; margin-bottom:8px;
  border:1px solid var(--line); border-radius:12px; background:var(--surface-1);
}
.sm-carte .sm-titre{ min-width:0; }
.sm-carte .sm-titre strong{ display:block; font-size:15px; line-height:1.25; }
.sm-carte .sm-sous{ font-size:11px; color:var(--text-muted); margin-top:2px;
  text-transform:uppercase; letter-spacing:.04em; }
.sm-carte .sm-total{ font-size:13px; margin-top:6px; color:var(--text-secondary); }
.sm-carte .sm-total b{ font-weight:600; color:var(--text-primary); }

/* Le compteur : − [ 2 ] +  dans une pilule, comme sur les applis de commande.
   A 1, le − devient une CORBEILLE : descendre sous 1 n'a pas de sens, et
   supprimer est ce qu'on voulait faire. */
.sm-pilule{
  display:inline-flex; align-items:center; gap:2px;
  background:var(--plane); border:1px solid var(--line); border-radius:999px; padding:3px;
}
.sm-pilule button{
  width:38px; height:38px; margin:0; padding:0; border:0; border-radius:999px;
  background:transparent; color:var(--text-primary); font-size:19px; line-height:1;
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.sm-pilule button:active{ background:var(--line); }
.sm-pilule .smOte{ color:var(--critical); font-size:17px; }
.sm-pilule input{
  width:56px; text-align:center; border:0; background:transparent; padding:6px 2px;
  font-size:16px; font-weight:600; color:var(--text-primary);
}
.sm-pilule input:focus{ outline:2px solid var(--s1); outline-offset:1px; border-radius:8px; }
/* 23/08 - LE LIBELLE DU CONDITIONNEMENT, ALIGNE.
   Il y avait deux formes pour une meme information : une PASTILLE quand
   l'unite est imposee, une LISTE DEROULANTE quand il y a un choix. Deux
   hauteurs, deux largeurs, deux bords - les cartes ne s'alignaient plus entre
   elles, et l'oeil ne savait plus ou regarder pour lire l'unite.
   Meme boite pour les deux, sous le compteur, calee a droite. Ce qui distingue
   « choix possible » de « unite imposee » n'est plus la forme mais le chevron
   et le fond : la difference se voit sans casser l'alignement. */
.sm-carte .sm-unite,
.sm-carte select.smUnite{
  display:block; width:118px; margin:6px 0 0 auto; box-sizing:border-box;
  height:34px; line-height:22px; padding:5px 10px;
  font-size:12px; font-weight:600; letter-spacing:.03em; text-align:center;
  text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  border:1px solid var(--line); border-radius:9px;
}
.sm-carte .sm-unite{ background:var(--plane); color:var(--text-secondary); }
.sm-carte select.smUnite{
  background:var(--surface-1); color:var(--text-primary);
  text-align:left; padding-right:24px;
}

/* --- La marque, le code, et la barre du bas  (23/08) ---------------------- */

/* La MARQUE se lit avant le nom quand on cherche « la farine de chez X ».
   Petite, en couleur d'accent : presente sans voler la vedette au nom. */
.sm-marque{
  display:inline-block; margin-right:6px; padding:1px 6px;
  background:var(--plane); border:1px solid var(--line); border-radius:5px;
  font-size:10px; font-weight:700; letter-spacing:.04em; color:var(--text-secondary);
  text-transform:uppercase; vertical-align:1px;
}
.sm-tuile .sm-marque{ display:block; margin:0 0 4px; }

/* LE CODE DE L'UNITE CHOISIE. En chiffres a chasse fixe : un code-barres se
   compare chiffre a chiffre, pas d'un coup d'oeil. */
.sm-code{
  margin-top:6px; font-size:12px; letter-spacing:.06em;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  color:var(--text-secondary);
}
.sm-code-non{ font-family:inherit; letter-spacing:0; font-style:italic; color:var(--text-muted); }

/* =========================================================================
   LA BARRE DE SAISIE : EN HAUT, ET COLLANTE                    (23/08)

   Elle etait en bas, en position:fixed. Sur iPhone, un element fixe se cale
   sur la fenetre DE MISE EN PAGE, que la barre d'outils de Safari recouvre en
   apparaissant : il fallait la repositionner en JavaScript a chaque
   changement, et ce rattrapage se voyait - elle suivait le doigt avec un
   temps de retard.

   En haut et en position:sticky, c'est le NAVIGATEUR qui la tient. Aucun
   JavaScript, donc aucun retard possible : il n'y a plus personne pour courir
   apres. Et le haut de l'ecran n'a pas d'equivalent de la barre d'outils.
   ========================================================================= */
.sm-barre{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; gap:10px;
  margin:-12px -12px 12px;              /* mange le padding de main */
  padding:10px 14px;
  background:var(--surface-1); border-bottom:1px solid var(--line);
  box-shadow:0 4px 14px rgba(0,0,0,.10);
}
.sm-barre-gauche{ flex:1; min-width:0; line-height:1.2; }
.sm-barre-gauche b{ display:block; font-size:16px; font-weight:700; }
.sm-barre-gauche small{ display:block; font-size:11px; color:var(--text-muted);
  text-transform:uppercase; letter-spacing:.04em; margin-top:2px; }

/* Les deux raccourcis. Petits a dessein : ils rendent service sans disputer
   la place au bouton qui compte. */
.sm-barre-sauts{ display:flex; flex-direction:column; gap:3px; flex:0 0 auto; }
.sm-saut{
  /* 23/08 : « make button ticket and list wider ». Ils etaient calibres sur le
     texte ; sur un ecran tactile on vise une SURFACE, pas des mots. Largeur
     minimale fixe et identique pour les deux : la cible ne bouge pas selon
     l'etiquette, et le pouce retrouve toujours le meme endroit. */
  width:auto; min-width:92px; margin:0; padding:7px 12px;
  font-size:12px; font-weight:600; text-align:center;
  background:var(--plane); color:var(--text-secondary);
  border:1px solid var(--line); border-radius:999px; white-space:nowrap; cursor:pointer;
}
.sm-saut:active{ background:var(--line); }

.sm-piedbtn{
  width:auto; margin:0; flex:0 0 auto; min-width:124px;
  padding:13px 20px; border:0; border-radius:999px;
  font-size:15px; font-weight:700; color:#fff; cursor:pointer;
}
.sm-piedbtn-recep{  background:var(--good); }
.sm-piedbtn-sortie{ background:var(--warning); color:#231a00; }
.sm-piedbtn:disabled{ opacity:.5; }

/* La barre etant collante EN HAUT, un saut vers une section la poserait
   dessous. Cette marge reserve sa hauteur. */
#smTicket, #smParcourir{ scroll-margin-top:78px; }

/* La confirmation d'ajout : une pastille, pas du texte qui flotte. */
.sm-confirme{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--plane); border:1px solid var(--line); border-radius:999px;
  padding:5px 12px; font-size:13px; color:var(--text-secondary);
}
.sm-confirme b{ color:var(--text-primary); font-weight:600; }
.sm-carte .sm-bas{ grid-column:1 / -1; display:flex; gap:6px; flex-wrap:wrap; }
.sm-carte .sm-bas input{ flex:1; min-width:120px; padding:8px; font-size:13px; }

/* --- Parcourir par categorie --------------------------------------------- */
.sm-parcourir{ margin-top:8px; }
.sm-fil{ display:flex; gap:6px; align-items:center; flex-wrap:wrap;
  font-size:13px; margin-bottom:8px; }
.sm-fil button{ width:auto; margin:0; padding:6px 10px; font-size:13px;
  background:var(--plane); color:var(--text-secondary);
  border:1px solid var(--line); border-radius:999px; }
.sm-grille{ display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:8px; }

/* --- 23/08 : LA PORTEE DU CATALOGUE --------------------------------------
   « sortie matiere premiere list fixe par departement », « fournisseur
   shouldnt have all products ». Le bouton dit CE QU'ON VOIT, la ligne en
   dessous dit ce qui se passerait en le touchant : personne ne doit avoir a
   deviner pourquoi la liste est courte. */
.sm-portee{ display:flex; align-items:center; gap:8px; flex-wrap:wrap;
  margin:0 0 8px; }
.sm-portee small{ color:var(--text-muted); font-size:12px; }
.sm-portee .chip{ width:auto; margin:0; }
.chip-actif{ background:var(--accent,#151E3F) !important; color:#fff !important;
  border-color:transparent !important; }

/* =========================================================================
   23/08, CORRIGE - LA TUILE ET SON COMPTEUR
   « the catalog items are not aligned and + is out of box »

   CE QUI N'ALLAIT PAS : le compteur etait en position:absolute cale sur la
   BOITE, alors que la carte visible etait le BOUTON a l'interieur. Une grille
   etire ses cellules a la hauteur de la plus haute ; le bouton, lui, ne faisait
   que la hauteur de son texte. Le plus se posait donc au bas de la CELLULE -
   c'est-a-dire SOUS la carte blanche, dans le vide - et d'autant plus bas que
   le voisin avait un nom long. Deux boites se croyaient chacune la carte.

   CE QUI LE CORRIGE : plus d'absolu. LA BOITE EST LA CARTE (bordure, fond,
   arrondi) et elle empile en colonne : le bouton du nom prend la place
   restante, le compteur est une rangee sous lui, de hauteur FIXE. Toutes les
   cartes d'une meme ligne font alors la meme hauteur, et le compteur est
   toujours dedans.
   ========================================================================= */
.sm-tuile-boite{
  display:flex; flex-direction:column; min-height:104px;
  background:var(--surface-1); border:1px solid var(--line); border-radius:12px;
  overflow:hidden;
}
.sm-tuile{
  flex:1 1 auto; width:100%; margin:0; text-align:left;
  padding:12px 12px 6px; background:transparent; color:var(--text-primary);
  border:0; border-radius:0; font-size:14px; line-height:1.3;
}
.sm-tuile small{ display:block; color:var(--text-muted); font-size:11px; margin-top:3px; }
.sm-tuile-boite:active{ background:var(--plane); }
/* 24/08 : l'opacite a .55 disait "desactive". Ce n'est plus vrai - la tuile
   mene desormais au formulaire qui la debloque. Voir .sm-bloque plus bas. */
.sm-tuile-boite.sm-bloque{ opacity:.9; }
/* Deja dans le ticket : la carte se souligne SANS changer de taille - une
   bordure plus epaisse decalerait tout le contenu d'un pixel. */
.sm-tuile-dedans{ border-color:var(--s1); box-shadow:inset 0 0 0 1px var(--s1); }

/* Hauteur FIXE : deux cartes voisines restent alignees, que l'une porte un
   compteur et l'autre un simple plus. */
.sm-tuile-qte{
  flex:0 0 auto; height:44px;
  display:flex; align-items:center; justify-content:flex-end; gap:1px;
  padding:0 8px 8px;
}
.sm-tuile-qte button{
  width:32px; height:32px; margin:0; padding:0; border:1px solid var(--line);
  border-radius:999px; background:var(--plane); color:var(--text-primary);
  font-size:16px; line-height:1; display:flex; align-items:center;
  justify-content:center; cursor:pointer; flex:0 0 auto;
}
.sm-tuile-qte button:active{ background:var(--line); }
.sm-tuile-qte b{ min-width:30px; text-align:center; font-size:15px; font-weight:700; }
.sm-tuile-boite.sm-bloque .sm-tuile-qte{ display:none; }

/* 23/08 - une tuile qui MENE quelque part doit se voir comme telle. */
.tile.cliquable{ cursor:pointer; }
.tile.cliquable:hover{ filter:brightness(1.03); }
.tile.cliquable:active{ transform:translateY(1px); }
.tile.cliquable:focus-visible{ outline:2px solid var(--s1); outline-offset:2px; }
.sm-tuile.sm-bloque small{ color:var(--critical); }

/* --- Le brouillon retrouve ----------------------------------------------- */
.sm-brouillon{
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  background:var(--plane); border:1px solid var(--line); border-left:4px solid var(--s1);
  border-radius:10px; padding:10px 12px; margin-bottom:10px; font-size:13px;
}
.sm-brouillon button{ width:auto; margin:0; padding:6px 10px; font-size:13px; }

/* ---------------------------------------------------------------------------
   23/08 - LE LIEN « MATIERES A COMPLETER » DANS LE MENU
   Il doit se poser comme les onglets voisins - meme boite, meme hauteur - sans
   jamais prendre l'etat « selectionne » : ce n'est pas un onglet, c'est une
   sortie vers une autre page, avec sa propre serrure.
   --------------------------------------------------------------------------- */
nav a.lien-onglet{
  display:block; width:100%; box-sizing:border-box;
  padding:10px 14px; margin:2px 0; border-radius:10px;
  font:inherit; text-align:left; text-decoration:none;
  color:inherit; opacity:.92;
}
nav a.lien-onglet:hover{ background:rgba(127,127,127,.16); opacity:1; }

/* =========================================================================
   23/08 - LE STOCK ACTUEL EN TABLEAU
   « raw material stock actuel should be like a list table, better to read.
     add filter per supplier, categories, name.. »
   Les nombres a droite et en chiffres tabulaires : c'est ce qui permet de
   comparer quatre lignes d'un coup d'oeil au lieu de les lire une par une.
   L'en-tete reste colle : a la trentieme ligne on sait encore quelle colonne
   on regarde. Et le tableau defile DANS SA BOITE - la page, elle, ne part
   jamais de travers sur un telephone.
   ========================================================================= */
.rm-filtres{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; }
.rm-filtres input[type=text], .rm-filtres input:not([type]){ flex:1; min-width:150px; }
.rm-filtres select{ min-width:150px; }
.rm-case{ display:inline-flex; align-items:center; gap:6px; font-size:13px;
  color:var(--text-secondary); white-space:nowrap; }
.rm-case input{ width:auto; margin:0; }

.rm-tablewrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
/* min-width : SIX COLONNES NE RENTRENT PAS DANS UN TELEPHONE, et les tasser
   ne les rend pas lisibles - ca colle « CHOCOLAT » a « MAGASIN » et ca coupe
   les noms au milieu d'un mot. Le tableau garde donc sa largeur utile et
   DEFILE lateralement DANS SA BOITE ; la page, elle, ne bouge pas. Verifie au
   rendu a 390 et 900 points de large. */
.rm-table{ width:100%; min-width:640px; border-collapse:collapse; font-size:13px; }
.rm-table td{ white-space:nowrap; }
/* La premiere colonne (nom + marque) est la seule qui a le droit de passer a
   la ligne, et seulement entre deux mots. */
.rm-table td:first-child{ white-space:normal; overflow-wrap:normal; word-break:normal; min-width:180px; }
.rm-table th{ position:sticky; top:0; z-index:1; background:var(--plane,#fff);
  border-bottom:2px solid var(--line); padding:8px 6px; cursor:pointer;
  white-space:nowrap; font-weight:600; }
.rm-table th:hover{ color:var(--accent,#151E3F); }
.rm-table td{ border-top:1px solid var(--line); padding:7px 6px; vertical-align:top; }
.rm-table tbody tr:hover{ background:rgba(0,0,0,.03); }
.rm-num{ text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.rm-alerte{ background:rgba(211,92,0,.08); }

/* =========================================================================
   24/08 - LA TAXE DU FOURNISSEUR
   « in reception fourniseur only when i pick fournisseur show me list of tax
     one time if not set in supplier settings, also the colors tax i asked »
   LA COULEUR N'EST PAS DECORATIVE. Elle dit la seule chose qui change le
   montant : est-ce que le prix saisi va bouger, et dans quel sens.
     ORANGE la taxe s'AJOUTE - VERT elle se RETIRE - BLEU rien ne bouge
   La meme convention, aux memes couleurs, que la pastille de la caisse.
   ========================================================================= */
.sm-taxe{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:10px; }
.sm-taxe small{ color:var(--text-muted); font-size:12px; }
.sm-taxe-pastille{ width:auto; margin:0; padding:8px 14px; border:0; border-radius:999px;
  color:#fff; font-weight:600; font-size:13px; cursor:pointer; }

.sm-taxe-choix{ margin-top:10px; padding:12px; border:1px solid var(--line);
  border-radius:12px; background:var(--plane); }
.sm-taxe-titre{ font-size:14px; margin-bottom:10px; }
.sm-taxe-titre small{ display:block; color:var(--text-muted); font-size:12px; margin-top:2px; }
/* 24/08 - L'ORDRE DEMANDE EST EN COLONNES : col 1 = HT paie / HT paie pas,
   col 2 = TTC paie / TTC paie pas, col 3 = modifier le taux, rien dessous.
   grid-auto-flow:column remplit colonne par colonne - c'est lui qui garantit
   cet arrangement, l'ordre du HTML etant [HT+, HT-, TTC+, TTC-, TAUX]. Sur un
   telephone etroit on repasse en une seule colonne : les paires HT puis TTC
   restent ensemble, ce qui est l'essentiel. */
.sm-taxe-grille{ display:grid; grid-template-rows:repeat(2,auto);
  grid-auto-flow:column; grid-auto-columns:1fr; gap:8px; }
@media(max-width:640px){
  .sm-taxe-grille{ grid-auto-flow:row; grid-template-rows:none;
    grid-template-columns:1fr; }
}
.sm-taxe-opt{ width:auto; margin:0; border:0; border-radius:12px; padding:12px;
  color:#fff; text-align:left; cursor:pointer; line-height:1.35; }
.sm-taxe-opt b{ display:block; font-size:13px; }
.sm-taxe-opt span{ display:block; font-size:12px; opacity:.9; }
.sm-taxe-opt em{ display:block; font-size:12px; font-style:normal; opacity:.85; margin-top:4px; }
.sm-taxe-pied{ display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.sm-taxe-pied .chip{ width:auto; margin:0; }

/* Ce que la taxe fait au prix de CETTE ligne, ecrit sous le champ. Un montant
   enregistre different du prix qu'on vient de taper, sans un mot a cote,
   ressemble a une erreur de saisie. */
.sm-taxe-ligne{ font-size:12px; margin-top:4px; text-align:right; }

/* =========================================================================
   24/08 - RECEPTIONS / SORTIES A CONFIRMER
   « in production, reception sortie a confirmer, add buttiin for admin
     confirmer tout »
   Le SENS se voit sans lire : un liseré vert pour ce qui ENTRE, orange pour
   ce qui SORT. C'est la meme convention de couleur que l'ecran de saisie -
   deux ecrans qui coloreraient le sens differemment se relisent deux fois.
   ========================================================================= */
.tr-tete{ display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; }
.tr-tout{ width:auto; margin:0; padding:12px 20px; border:0; border-radius:999px;
  background:#1E8449; color:#fff; font-weight:600; font-size:14px; cursor:pointer; }
.tr-tout:disabled{ opacity:.5; cursor:default; }

.tr-lot{ border-left:4px solid var(--line); }
.tr-recep{ border-left-color:#1E8449; }
.tr-sortie{ border-left-color:#D35C00; }
.tr-haut{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; flex-wrap:wrap; }
.tr-genre{ font-size:11px; font-weight:700; letter-spacing:.03em; margin-bottom:6px; }
.tr-recep .tr-genre{ color:#1E8449; }
.tr-sortie .tr-genre{ color:#D35C00; }
.tr-prod{ font-size:15px; line-height:1.4; }
.tr-ok{ width:auto; margin:0; padding:11px 18px; border:0; border-radius:999px;
  background:#1E8449; color:#fff; font-weight:600; font-size:13px; cursor:pointer;
  white-space:nowrap; }
.tr-ok:disabled{ opacity:.5; cursor:default; }

/* =========================================================================
   24/08 - COMPLETER LE CONDITIONNEMENT SUR PLACE
   « as cant use product a definir, if i click, say cant use it, u want to
     update it? »
   Une tuile bloquee n'est plus morte : elle est ORANGE et porte un chevron,
   parce qu'elle mene quelque part. Un bouton grise ne dit rien et ne mene
   nulle part - c'est une impasse pour quelqu'un qui a le sac dans les mains.
   ========================================================================= */
.sm-bloque .sm-tuile{ opacity:1; border-style:dashed; border-color:#D35C00; }
.sm-bloque .sm-tuile small{ color:#D35C00; font-weight:600; }

.sm-compl{ border:1px solid var(--line); border-radius:12px; padding:14px;
  background:var(--plane); text-align:left; }
.sm-compl-tete{ margin-bottom:12px; }
.sm-compl .lb small{ font-weight:400; }
.sm-compl-pied{ display:flex; gap:8px; justify-content:flex-end; align-items:center;
  flex-wrap:wrap; margin-top:10px; }
.sm-compl-pied .chip{ width:auto; margin:0; }

/* =========================================================================
   24/08 - LA PORTE DE LA SAISIE
   « shouldnt be able to click categorie or product before choosing
     fournisseur in reception, and departement in sortie »
   Une porte fermee sans explication ressemble a une panne. Celle-ci dit
   ce qui manque, et pourquoi ca compte : un ticket ne porte qu'un seul
   fournisseur ou departement, en changer plus tard vide les lignes.
   ========================================================================= */
.sm-porte{ border:1px dashed #D35C00; border-radius:10px; padding:10px 12px;
  margin-bottom:8px; font-size:13px; color:var(--text-secondary); }
.sm-porte small{ display:block; color:var(--text-muted); font-size:12px; margin-top:4px; }
.sm-parcourir .chip:disabled, #smScan:disabled, #smCam:disabled{
  opacity:.45; cursor:not-allowed; }

/* --- 24/08 : un facteur CALCULE se voit ---------------------------------- */
.cc-note{ font-size:12px; margin-top:4px; color:var(--text-muted); }
.cc-note-ok{ color:#1E8449; }
.cc-note-attention{ color:#D35C00; }
input.cc-calcule{ background:rgba(30,132,73,.08); border-color:#1E8449;
  font-weight:600; cursor:not-allowed; }

/* 24/08 - la taxe de LA ligne : une petite pastille dans la rangee cout /
   peremption, coloree comme le reste du systeme taxe. */
.smTaxeL{ width:auto; margin:0; padding:8px 10px; border:0; border-radius:999px;
  color:#fff; font-size:11px; font-weight:600; cursor:pointer; white-space:nowrap; }

/* ===========================================================================
   v506 - LE CHOIX A PLUSIEURS BRANCHES (voir demanderChoix dans stock-core.js)
   confirm() ne pose que oui/non ; quand il manque des prix sur une reception
   il faut pouvoir proposer AUSSI « tout enregistrer sans prix », qui est la
   seule sortie qui n'invente pas de dette.
   =========================================================================== */
.sm-choix-voile{
  position:fixed; inset:0; z-index:120; display:flex;
  align-items:center; justify-content:center; padding:18px;
  background:rgba(0,0,0,.55);
}
.sm-choix-boite{
  background:var(--surface-1,#fff); color:var(--text-primary,#151E3F);
  border-radius:16px; padding:18px; width:min(460px,100%);
  max-height:86vh; overflow-y:auto; box-shadow:0 18px 48px rgba(0,0,0,.35);
}
.sm-choix-titre{ margin:0 0 10px; font-size:16px; letter-spacing:.02em; }
/* pre-wrap : le message porte des retours a la ligne et une liste de noms de
   matieres alignes ; les ecraser rendrait la liste illisible. */
.sm-choix-msg{
  white-space:pre-wrap; font-size:14px; line-height:1.45;
  margin-bottom:14px; color:var(--text-secondary,#444);
}
.sm-choix-btns{ display:flex; flex-direction:column; gap:8px; }
.sm-choix-btn{
  width:100%; margin:0; border:1px solid var(--line,#d8d8d8); border-radius:12px;
  padding:13px 14px; font-size:14px; text-align:left; cursor:pointer;
  background:var(--surface-2,#f4f4f6); color:var(--text-primary,#151E3F);
}
/* Le premier bouton est le retour en arriere : c'est la sortie sans
   consequence, et c'est celle qui doit sauter aux yeux. */
.sm-choix-btn-1{ background:#151E3F; color:#fff; border-color:#151E3F; font-weight:600; }
.sm-choix-btn:focus-visible{ outline:3px solid #E67E22; outline-offset:2px; }

/* 2026.10.17-03 (v693) : « horizontal scrollbars not visible once I scroll down, as long as I am in that section » -
   un tableau large défile dans son propre cadre (75 % de l'écran au plus) : sa barre horizontale reste à l'écran,
   l'en-tête du tableau reste en haut du cadre. */
div[style*="overflow-x:auto"] { max-height: 75vh; overflow-y: auto; }
div[style*="overflow-x:auto"] > table > thead th { position: sticky; top: 0; z-index: 1; background: var(--surface, #fff); }

/* v972 - MENU EN SECTIONS : titres cliquables (▸ replie, ▾ ouverte), entrees repliees cachees. */
nav .nav-sec{cursor:pointer;user-select:none;display:flex;align-items:center;gap:6px;
  font-size:12px;color:rgba(255,255,255,.72);padding:14px 18px 6px;border-top:1px solid rgba(255,255,255,.08)}
nav .nav-sec:first-of-type{border-top:0}
nav .nav-sec::after{content:'▸';margin-left:auto;font-size:12px;opacity:.7}
nav .nav-sec.ouverte::after{content:'▾'}
nav .nav-sec:hover{color:#fff}
nav .nav-replie{display:none !important}
nav a.lien-onglet[data-rapgo]{color:rgba(255,255,255,.82);padding:13px 18px;margin:0;border-radius:0;font-size:15px}

/* =========================================================================
   v973 - TELEPHONE : PROPRE, LISIBLE, « STYLE IPHONE »
   « in portable portal. texts are mixes its not clear, layout messed up »
   Causes trouvees : tableaux en table-layout:fixed (colonnes egales -> les
   montants debordaient sur la colonne voisine et les noms se coupaient au
   milieu des mots), page plus large que l'ecran, .muted (bloc centre fait pour
   « rien a afficher ») utilise aussi comme petit texte, familles de rapports
   empilees. Chaque tableau est maintenant dans un cadre .tbl-scroll qui defile.
   ========================================================================= */
.tbl-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; max-width:100%; }
.rap-familles{ margin-bottom:6px; }
.rap-fam{ display:flex; align-items:center; gap:6px; padding:0 0 6px; }
.rap-fam-lab{ font-size:12px; font-weight:600; color:var(--text-muted); min-width:150px; }
.rap-fam-chips{ display:flex; flex-wrap:wrap; gap:6px; }
.tile .muted, td .muted, th .muted, .note .muted, label .muted, .frow .muted, span.muted{ padding:0; text-align:inherit; }

@media (max-width:700px){
  html, body{ overflow-x:clip; }
  body{ font-family:-apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
        font-size:15px; -webkit-font-smoothing:antialiased; -webkit-text-size-adjust:100%; }
  main, #main{ padding-left:12px !important; padding-right:12px !important; max-width:100vw; box-sizing:border-box; }
  header{ padding:12px 14px calc(12px) 14px; padding-top:max(12px, env(safe-area-inset-top)); }
  header h1{ font-size:15px; letter-spacing:.02em; line-height:1.25; }

  /* champs : 16 px = l'iPhone ne zoome plus en touchant un champ */
  input, select, textarea{ font-size:16px !important; border-radius:12px; min-height:44px; box-sizing:border-box; }

  /* barres de boutons (dates, filtres, familles) : UNE ligne qui glisse */
  .frow{ padding:8px 12px; }
  .frow.presets, #filtreRow{ flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
  #filtreRow::-webkit-scrollbar, .rap-fam-chips::-webkit-scrollbar{ display:none; }
  #filtreRow .flt-lab{ white-space:nowrap; font-size:13px; flex:0 0 auto; }
  .chip{ flex:0 0 auto; white-space:nowrap; min-height:36px; border-radius:999px; font-size:14px; }

  .rap-familles{ background:var(--surface-1); border-radius:16px; padding:6px 0 2px; margin:0 0 12px;
                 box-shadow:0 1px 2px rgba(0,0,0,.05); }
  .rap-fam{ display:block; padding:6px 0 4px; }
  .rap-fam + .rap-fam{ border-top:1px solid var(--line); }
  .rap-fam-lab{ min-width:0; padding:2px 14px 6px; font-size:12px; letter-spacing:.04em; text-transform:uppercase; }
  .rap-fam-chips{ flex-wrap:nowrap; overflow-x:auto; -webkit-overflow-scrolling:touch; padding:0 14px 6px; scrollbar-width:none; }

  /* cartes : arrondies, sans bord, ombre legere (groupes iOS) */
  .card{ border-radius:16px; border-color:transparent; box-shadow:0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.03);
         padding:14px; margin-bottom:12px; }
  .card h2{ font-size:13px; letter-spacing:.03em; margin-bottom:10px; line-height:1.3; }
  .card .muted{ text-align:left; padding:6px 0; line-height:1.45; }
  .card > .muted:only-child, .card > h2 + .muted:last-child{ text-align:center; padding:14px 0; }
  .note{ line-height:1.45; }

  /* tuiles : 2 par ligne, chiffres nets */
  .tiles{ gap:10px; }
  .tile{ border-radius:16px; border-color:transparent; box-shadow:0 1px 2px rgba(0,0,0,.06); padding:12px 12px 12px 14px; }
  .tile .lab{ font-size:11px; line-height:1.25; }
  .tile .val{ font-size:21px; line-height:1.2; }
  .tile .note, .tile .muted{ font-size:12px; line-height:1.35; }

  /* tableaux : colonnes a la taille de leur contenu, le cadre defile */
  table{ table-layout:auto; font-size:14px; }
  table.rep th:first-child, table.rep td:first-child{ width:auto; }
  td:first-child, th:first-child{ overflow-wrap:normal; word-break:normal; min-width:110px; }
  th{ white-space:nowrap; font-size:11px; padding:8px 8px; }
  td{ padding:10px 8px; line-height:1.3; }
  td.n, th.n{ white-space:nowrap; }
  .tbl-scroll{ margin:0 -14px; padding:0 14px; }
  .barcell .fill{ height:22px; border-radius:6px; }

  /* boutons d'action : cibles de doigt confortables */
  button.act, .btn{ min-height:44px; border-radius:12px; }
}

/* v973 - 📱 employes et telephones (Equipe ▸ Pointage telephone) */
.pt-emp{ padding:12px 0; border-top:1px solid var(--line); }
.pt-emp:first-of-type{ border-top:0; }
.pt-nom{ font-weight:650; font-size:15px; }
.pt-poste{ font-weight:400; font-size:12px; color:var(--text-muted); }
.pt-tel{ margin-top:6px; padding:8px 10px; background:var(--plane); border-radius:12px; }
.pt-app{ font-size:13px; color:var(--text-secondary); }
.pt-quand{ font-size:12px; color:var(--text-muted); margin-top:4px; }
.pt-actions{ display:flex; gap:6px; flex-wrap:wrap; margin-top:6px; }
.pt-actions .btn{ width:auto; margin:0 !important; }
@media (max-width:700px){
  .pt-lieu{ display:grid !important; grid-template-columns:1fr 1fr; }
  .pt-lieu label{ display:flex; flex-direction:column; gap:4px; font-size:13px; min-width:0 !important; }
  .pt-lieu label input{ width:100% !important; }
  .pt-lieu label[style*="flex:1"]{ grid-column:1 / -1; }
  .pt-lieu .btn{ width:100%; }
}
@media (max-width:700px){ .badge{ white-space:nowrap; } }

/* v975 - 📑 dettes & engagements */
.fin-eng{ border:1px solid var(--line); border-left:4px solid var(--s4); border-radius:12px; padding:10px 12px; margin:8px 0; cursor:pointer; background:var(--surface-1); }
.fin-eng.urg{ border-left-color:#C0392B; }
.fin-eng:hover{ filter:brightness(1.02); }
.fin-eng-haut{ display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.fin-eng-reste{ font-weight:700; font-size:17px; white-space:nowrap; font-variant-numeric:tabular-nums; }
.fin-eng-bas{ display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin-top:6px; }
.card.cliquable{ cursor:pointer; }
@media (max-width:700px){ .card span.muted, .card td .muted, .card .note .muted{ padding:0; } }
.tile .val .badge{ white-space:normal; display:inline-block; line-height:1.3; }
/* v985 : barre du rapport choisi + liste repliable */
.rap-barre{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:space-between;
  padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--plane);margin-bottom:8px}
.rap-actuel{font-size:15px;min-width:0;overflow:hidden;text-overflow:ellipsis}
.rap-toggle{white-space:nowrap}
#rapFamilles{max-height:60vh;overflow:auto;border:1px solid var(--line);border-radius:12px;padding:8px;margin-bottom:8px}
