:root {
  --fond: #f4f6f9; --carte: #fff; --texte: #1d2733; --doux: #5b6777; --accent: #1f3a5f; --accent2: #e8792b;
  --bord: #dde3ea; --ok: #1e7a46; --err: #b42318;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #12171e; --carte: #1b222c; --texte: #e6ebf1; --doux: #9aa6b5; --accent: #8fb6e8; --bord: #2b3542; }
}
* { box-sizing: border-box; }
a { color: var(--accent); }
body { margin: 0; font: 16px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--fond); color: var(--texte); }
.barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
  background: #1f3a5f; color: #fff; }
.marque { color: #fff; font-weight: 800; letter-spacing: .08em; text-decoration: none; font-size: 1.15rem; }
.barre-droite { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: .9rem; }
.barre-droite a, .lien { color: #fff; background: none; border: 0; font: inherit; cursor: pointer; text-decoration: underline; padding: 0; }
.qui { opacity: .85; }
.barre-gauche { display: flex; align-items: center; gap: 14px; }
.retour { display: inline-flex; align-items: center; gap: 4px; padding: 7px 12px 7px 8px; border-radius: 9px; background: rgba(255, 255, 255, .14);
  color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem; }
.retour:hover { background: rgba(255, 255, 255, .24); }
.retour svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 560px) { .qui { display: none; } .barre { padding: 8px 12px; } }
.page { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
h1 { font-size: 1.5rem; margin: 0 0 6px; }
.aide { color: var(--doux); margin: 0 0 18px; }
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 22px; }
.etroite { max-width: 420px; margin: 30px auto; }
label { display: block; font-weight: 600; margin: 0 0 14px; }
input { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit; border: 1px solid var(--bord);
  border-radius: 8px; background: var(--carte); color: var(--texte); }
.bouton { width: 100%; padding: 12px; font: inherit; font-weight: 700; border: 0; border-radius: 8px; background: var(--accent2);
  color: #fff; cursor: pointer; }
.message { padding: 10px 12px; border-radius: 8px; background: #e7f4ec; color: var(--ok); }
.message.error, .errorlist { background: #fdecea; color: var(--err); }
.errorlist { list-style: none; padding: 8px 12px; border-radius: 8px; margin: -6px 0 12px; }
.pastille { display: inline-block; padding: 1px 8px; margin-right: 4px; border-radius: 99px; background: var(--accent); color: var(--carte);
  font-size: .8rem; font-weight: 700; }
/* Accueil */
.bienvenue { margin: 8px 0 26px; }
.bienvenue h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.bienvenue p { margin: 0; color: var(--doux); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.module { --c: var(--accent2); position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 170px; padding: 22px; border-radius: 18px; color: #fff; text-decoration: none; overflow: hidden;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #000));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 35%, transparent); transition: transform .15s, box-shadow .15s; }
.module[href]:hover { transform: translateY(-3px); box-shadow: 0 10px 24px color-mix(in srgb, var(--c) 45%, transparent); }
.module svg { width: 46px; height: 46px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .95; }
.module span { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: .01em; line-height: 1.15; }
.module::after { content: ""; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); }
.module[aria-disabled] { cursor: default; }
@media (max-width: 560px) {
  .modules { grid-template-columns: 1fr 1fr; gap: 12px; }
  .module { min-height: 130px; padding: 16px; border-radius: 14px; }
  .module svg { width: 36px; height: 36px; }
  .module span { font-size: 1.08rem; overflow-wrap: anywhere; }
}

/* Modules : en-tête et onglets */
.entete-module { margin: 0 0 18px; }
.entete-module h1 { color: var(--c); font-size: 1.9rem; }
.onglets { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--bord); }
.onglets { border-bottom: 0; gap: 8px; }
.onglets a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 99px; text-decoration: none;
  color: var(--doux); font-weight: 600; background: var(--carte); border: 1px solid var(--bord); }
.onglets a:hover { border-color: var(--c); color: var(--texte); }
.onglets a.actif { background: var(--c); border-color: var(--c); color: #fff; }

/* Icônes au trait */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Accueil du Stock : grandes tuiles, alerte, cartes camions */
.actions-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 0 0 16px; }
.tuile-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 104px;
  padding: 14px 10px; border-radius: 16px; background: var(--c); color: #fff; text-decoration: none; font-weight: 700;
  font-size: 1.02rem; text-align: center; transition: transform .12s, filter .12s; }
.tuile-action .ico { width: 36px; height: 36px; stroke-width: 1.9; }
.tuile-action:hover { transform: translateY(-3px); filter: brightness(1.08); }
.tuile-action:active { transform: scale(.97); }
.bandeau-alerte { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px;
  padding: 12px 16px; border-radius: 12px; background: #fff4e5; color: #8a3b06; border: 1px solid #f3c58f; font-weight: 600; }
.carte-camion { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px; border-radius: 14px; background: var(--carte);
  border: 1px solid var(--bord); color: var(--texte); text-decoration: none; transition: transform .12s, border-color .12s; }
.carte-camion:hover { transform: translateY(-2px); border-color: var(--accent2); }
.carte-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 1.05rem; }
.etiquette { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: #e2e8f0; color: #334155; }
.etiquette.s-gsn { background: #fde3d3; color: #8a3b06; }
.etiquette.s-ngbat { background: #dbeafe; color: #1e3a8a; }
.etiquette.s-gie { background: #dcfce7; color: #14532d; }
.jauge { display: block; height: 10px; border-radius: 99px; background: var(--fond); border: 1px solid var(--bord); overflow: hidden; margin: 4px 0 2px; }
.jauge b { display: block; height: 100%; border-radius: 99px; background: #3b9d3b; }
.niveau-bas .jauge b { background: #e9962a; }
.niveau-vide .jauge b { background: #dc3c3c; }
.position { font-size: .85rem; color: var(--doux); }
@media (prefers-color-scheme: dark) {
  .bandeau-alerte { background: #3a2410; color: #ffd3a3; border-color: #6b4419; }
}
.sous-titre { font-size: 1.1rem; margin: 22px 0 10px; }
h2 { font-size: 1.25rem; margin: 0 0 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; align-items: center; }
.btn { display: inline-block; padding: 9px 14px; border-radius: 9px; background: var(--accent2); color: #fff; text-decoration: none;
  font-weight: 600; border: 0; font: inherit; cursor: pointer; }
.btn.discret { background: transparent; color: var(--texte); border: 1px solid var(--bord); }
.titre-ligne { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.carte-depot { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--carte);
  border: 1px solid var(--bord); border-left: 5px solid #e8792b; color: var(--texte); text-decoration: none; }
.carte-depot:hover { border-color: #e8792b; }
.chiffres { font-size: .9rem; }
.alerte { color: #c2410c; font-style: normal; font-weight: 700; margin-left: 6px; }
.recherche { margin: 0 0 12px; }
.recherche.grande { font-size: 1.1rem; padding: 14px; margin-top: 8px; }
.tableau-defile { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; background: var(--carte); border-radius: 10px; overflow: hidden; font-size: .93rem; }
.tableau th, .tableau td { padding: 8px 10px; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: top; }
.tableau th { background: color-mix(in srgb, var(--bord) 45%, var(--carte)); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--doux); }
.tableau .n { text-align: right; white-space: nowrap; }
tr.bas td, .legende .bas { color: #c2410c; }
tr.negatif td, .legende .negatif { color: var(--err); }
input.qte { width: 90px; display: inline-block; margin: 0; padding: 6px 8px; text-align: right; }
input.modifie { outline: 2px solid var(--accent2); }
.en-ligne { display: flex; align-items: center; gap: 8px; margin: 0; }
.bloc { margin: 0 0 22px; }
.vide { padding: 30px; text-align: center; color: var(--doux); background: var(--carte); border-radius: 12px; }
.filtres select, .champs-bon select { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit; border-radius: 8px;
  border: 1px solid var(--bord); background: var(--carte); color: var(--texte); }
.filtres { max-width: 360px; margin-bottom: 14px; }
.bon-ligne { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; margin-bottom: 8px; }
.bon-ligne summary { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 12px; cursor: pointer; }
.bon-ligne .tableau { border-radius: 0; }
.badge { padding: 2px 8px; border-radius: 99px; font-size: .75rem; font-weight: 700; color: #fff; background: #64748b; }
.t-entree { background: #1f9d6b; } .t-transfert { background: #2f6fd6; } .t-sortie_chantier { background: #e8792b; }
.t-retour { background: #8a4fd8; } .t-inventaire { background: #64748b; }
.pages { display: flex; gap: 16px; justify-content: center; }
.champs-bon { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.titre-bon { font-size: 1.5rem; margin-bottom: 14px; }
.panier-titre { margin: 18px 0 8px; }
.liste-art { display: flex; flex-direction: column; gap: 6px; }
.art { display: flex; align-items: center; gap: 8px; background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 6px 8px; }
.art.choisi { border-color: var(--accent2); background: color-mix(in srgb, var(--accent2) 8%, var(--carte)); }
.art-nom { flex: 1; text-align: left; background: none; border: 0; color: var(--texte); font: inherit; cursor: pointer; padding: 4px; }
.art-nom small { display: block; color: var(--doux); }
.pas { display: flex; align-items: center; gap: 4px; }
.pas button { width: 40px; height: 40px; border-radius: 9px; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); font-size: 1.3rem; cursor: pointer; }
.pas button.zero { font-size: .95rem; color: var(--err); }
.pas input { width: 64px; margin: 0; padding: 8px 4px; text-align: center; }
/* Camion (technicien) */
.camion-entete h1 { font-size: 1.7rem; }
.gros-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 8px; }
.gros-bouton { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; border-radius: 16px;
  color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 800; text-align: center; }
.gros-bouton svg { width: 38px; height: 38px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gros-bouton.entree { background: linear-gradient(135deg, #1f9d6b, #157450); }
.gros-bouton.sortie { background: linear-gradient(135deg, #e8792b, #b8571a); }
.centre { text-align: center; }
.mvt { margin: 4px 0; font-size: .93rem; }
/* Vignettes d'articles et logos de fournisseurs */
.vignette { flex: none; display: inline-grid; place-items: center; border-radius: 9px; object-fit: cover; vertical-align: middle;
  background: #fff; border: 1px solid var(--bord); }
.vignette.picto, .vignette.lettre { --c: #64748b; background: color-mix(in srgb, var(--c) 16%, var(--carte)); border-color: color-mix(in srgb, var(--c) 35%, transparent);
  color: var(--c); font-weight: 800; font-size: 1.05rem; }
.vignette.picto svg { width: 62%; height: 62%; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo-f { display: inline-block; vertical-align: middle; max-width: 110px; object-fit: contain; border-radius: 5px; }
img.logo-f { background: #fff; padding: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.logo-f.initiales { --c: #64748b; display: inline-grid; place-items: center; padding: 0 6px; background: var(--c); color: #fff;
  font-size: .72rem; font-weight: 800; letter-spacing: .04em; line-height: 1; }
.cel-vignette { width: 1%; padding-left: 16px !important; padding-right: 4px !important; }
.vignette-photo { vertical-align: middle; }
.titre-vignette { display: flex; gap: 14px; align-items: center; }
.avec-vignette { display: inline-flex; align-items: center; gap: 8px; }
.art-nom { display: flex; align-items: center; gap: 10px; }
.art-texte { min-width: 0; }
.art-nom small { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.art-nom small .logo-f { max-width: 70px; }

/* Menu déroulant de choix du matériel */
.menu-art { position: relative; margin: 8px 0 4px; }
.menu-art-bouton { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; font: inherit;
  font-size: 1.1rem; font-weight: 700; border-radius: 10px; border: 2px solid #e8792b; background: var(--carte); color: var(--texte); cursor: pointer; }
.menu-art-bouton svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; transition: transform .15s; }
.menu-art.ouvert .menu-art-bouton { border-radius: 10px 10px 0 0; }
.menu-art.ouvert .menu-art-bouton svg { transform: rotate(180deg); }
.menu-art-panneau { border: 2px solid #e8792b; border-top: 0; border-radius: 0 0 10px 10px; background: var(--fond); padding: 10px;
  max-height: 65vh; overflow-y: auto; }
.menu-art-panneau .recherche { position: sticky; top: -10px; z-index: 1; margin: -10px -10px 10px; width: calc(100% + 20px);
  border-radius: 0; border-width: 0 0 1px; padding: 13px 14px; font-size: 1.05rem; }
.menu-groupe { margin: 10px 2px 4px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); }
.menu-fermer { width: 100%; margin-top: 10px; }

.barre-recherche { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.barre-recherche .recherche { flex: 1 1 260px; margin: 0; }
.barre-recherche select { padding: 10px; font: inherit; border-radius: 8px; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); }
.case { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin: 0 0 14px; }
.case input { width: auto; margin: 0; }
.barre-recherche .case { margin: 0; }
.tableau.cliquable tbody tr { cursor: pointer; }
.tableau.cliquable tbody tr:hover td { background: color-mix(in srgb, var(--accent2) 7%, var(--carte)); }
tr.inactif td { opacity: .55; }
.fiches { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; margin-top: 8px; }
.fiches h3 { margin: 0 0 10px; font-size: 1.05rem; }
.fiches .carte { padding: 16px; }
.formulaire { max-width: 760px; }
.champs-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 16px; }
.formulaire select, .formulaire input:not([type=checkbox]) { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit;
  border: 1px solid var(--bord); border-radius: 8px; background: var(--carte); color: var(--texte); }
@media (max-width: 560px) {
  .art { flex-wrap: wrap; }
  .pas { margin-left: auto; }
  .tableau { font-size: .88rem; }
}

.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tuile { background: var(--carte); border: 1px solid var(--bord); border-left: 5px solid var(--accent2); border-radius: 12px; padding: 16px; }
.tuile h2 { margin: 0 0 6px; font-size: 1.15rem; }
.tuile p { margin: 0; color: var(--doux); font-size: .92rem; }
.tuile.bientot { border-left-color: var(--bord); }
/* ===== Style « ludique » commun à tous les onglets du Stock ===== */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 12px; font-weight: 700;
  transition: transform .12s, filter .12s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn.discret { background: var(--carte); }
.btn.vert { background: #2f8a2f; } .btn.bleu { background: #1f6fb8; } .btn.violet { background: #6a4fc4; } .btn.gris { background: #5b6777; }
.bouton { border-radius: 12px; padding: 14px; font-size: 1.05rem; margin-top: 8px; transition: filter .12s; }
.bouton:hover { filter: brightness(1.08); }
input.recherche { padding-left: 42px; border-radius: 99px; border-width: 2px;
  background: var(--carte) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b97a6' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 14px center / 20px; }
input.recherche:focus, .barre-recherche select:focus, .filtres select:focus { outline: none; border-color: var(--accent2); }
.barre-recherche select, .filtres select { border-radius: 99px !important; border-width: 2px !important; padding: 10px 16px !important; }
.tableau { border-collapse: separate; border-spacing: 0; border: 1px solid var(--bord); border-radius: 14px; }
.tableau th { background: transparent; text-transform: none; letter-spacing: 0; font-size: .85rem; font-weight: 700; padding: 12px; }
.tableau td { padding: 11px 12px; vertical-align: middle; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tbody tr:hover td { background: color-mix(in srgb, var(--accent2) 6%, var(--carte)); }
.tableau td a { font-weight: 600; text-decoration: none; }
.tableau td a:hover { text-decoration: underline; }
.qte-pastille { display: inline-block; min-width: 46px; padding: 3px 10px; border-radius: 99px; text-align: center; font-weight: 800;
  background: color-mix(in srgb, #2f8a2f 14%, var(--carte)); color: #2f7a2f; }
tr.bas .qte-pastille { background: color-mix(in srgb, #e9962a 18%, var(--carte)); color: #b45309; }
tr.negatif .qte-pastille { background: color-mix(in srgb, #dc3c3c 16%, var(--carte)); color: #c62828; }
tr.bas td, tr.negatif td { color: inherit; }
.vide { padding: 40px 20px; border: 2px dashed var(--bord); background: transparent; font-size: 1.05rem; }
.vide .ico { display: block; margin: 0 auto 8px; width: 40px; height: 40px; color: var(--doux); }
.pages { align-items: center; margin-top: 16px; }
.pages a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--bord); background: var(--carte); text-decoration: none; font-weight: 600; }
.carte { border-radius: 16px; }
.fiches h3 { display: flex; align-items: center; gap: 8px; }
.aide.intro { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, var(--carte)); border: 1px solid var(--bord); }
.aide.intro .ico { margin-top: 3px; color: var(--accent); }
/* En-tête de dépôt */
.entete-depot { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 14px;
  border-radius: 16px; background: var(--carte); border: 1px solid var(--bord); }
.entete-depot .gros-ico { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 16px; background: var(--c, #e8792b); color: #fff; }
.entete-depot .gros-ico .ico { width: 34px; height: 34px; }
.entete-depot .titre { flex: 1 1 220px; }
.chiffres-cles { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.chiffre-cle { flex: 1 1 140px; padding: 12px 14px; border-radius: 14px; background: var(--carte); border: 1px solid var(--bord); }
.chiffre-cle b { display: block; font-size: 1.6rem; line-height: 1.1; }
.chiffre-cle span { color: var(--doux); font-size: .88rem; }
.chiffre-cle.orange b { color: #d0621c; } .chiffre-cle.vert b { color: #2f8a2f; } .chiffre-cle.bleu b { color: #1f6fb8; }
/* Mouvements : une carte par bon, couleur selon le type */
.bon-ligne { --t: #64748b; border-radius: 14px; border-left: 6px solid var(--t); overflow: hidden; }
.bon-ligne.t-entree { --t: #1f9d6b; } .bon-ligne.t-transfert { --t: #2f6fd6; } .bon-ligne.t-sortie_chantier { --t: #e8792b; }
.bon-ligne.t-retour { --t: #8a4fd8; } .bon-ligne.t-inventaire { --t: #64748b; }
.bon-ligne { background: var(--carte); }
.bon-ligne summary { list-style: none; padding: 12px 14px; }
.bon-ligne summary::-webkit-details-marker { display: none; }
.bon-ligne summary .rond { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--t); color: #fff; flex: none; }
.bon-ligne summary .milieu { flex: 1 1 240px; min-width: 0; }
.bon-ligne summary .milieu small { display: block; color: var(--doux); }
.bon-ligne[open] summary { border-bottom: 1px solid var(--bord); }
.bon-ligne .tableau { border: 0; border-radius: 0; }
/* Refacturation : une carte par couple de sociétés */
.refac { padding: 0; overflow: hidden; margin-bottom: 16px; }
.refac .titre-ligne { padding: 14px 18px; margin: 0; align-items: center; }
.refac .total { font-size: 1.35rem; font-weight: 800; color: var(--accent2); }
.refac .tableau { border: 0; border-radius: 0; border-top: 1px solid var(--bord); }
.fleche { color: var(--doux); margin: 0 4px; }
/* Photos d'articles */
.photo-bloc { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.photo-bloc form { margin: 0; }
.btn-photo { display: inline-block; margin: 0; padding: 6px 12px; border-radius: 99px; background: var(--accent2); color: #fff;
  font-size: .85rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.vignette-photo { position: relative; display: inline-block; margin: 0; cursor: pointer; }
input[type=file][hidden] { display: none; }
.cel-vignette form { margin: 0; }
.vignette-photo .pastille-photo { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--accent2); font-size: .7rem; box-shadow: 0 0 0 2px var(--carte); }
.vignette-photo:hover .vignette { outline: 2px solid var(--accent2); }
/* Carte des camions (Geotab) */
.carte-geo { height: 340px; border-radius: 16px; border: 1px solid var(--bord); margin: 0 0 8px; overflow: hidden; z-index: 0; }
.position.en-route { color: #1f6fb8; font-weight: 600; }
.position.ancienne { font-style: italic; }
.etat { display: inline-block; margin-top: 10px; font-size: .78rem; color: var(--doux); border: 1px dashed var(--bord); padding: 1px 8px; border-radius: 99px; }

/* Commandes */
.ligne-cmd { --t: #64748b; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 8px;
  border-radius: 14px; background: var(--carte); border: 1px solid var(--bord); border-left: 6px solid var(--t);
  color: var(--texte); text-decoration: none; transition: transform .12s; }
.ligne-cmd:hover { transform: translateY(-1px); border-color: var(--accent2); border-left-color: var(--t); }
.ligne-cmd .milieu { flex: 1 1 260px; min-width: 0; }
.ligne-cmd .milieu small { display: block; color: var(--doux); }
.ligne-cmd .montant { font-weight: 800; white-space: nowrap; }
.ligne-cmd .statut, .statut-pastille { font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: #fff; background: var(--t, #64748b); white-space: nowrap; }
.st-brouillon { --t: #64748b; } .st-envoyee { --t: #1f6fb8; } .st-partielle { --t: #e9962a; } .st-recue, .st-livree { --t: #2f8a2f; }
.st-annulee, .st-refusee { --t: #9aa6b5; } .st-attente { --t: #d0621c; }
.statut-pastille { font-size: .75rem; vertical-align: middle; }
.formulaire textarea, .carte textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; font: inherit; border: 1px solid var(--bord);
  border-radius: 8px; background: var(--carte); color: var(--texte); resize: vertical; }
.tableau tfoot td { border-top: 2px solid var(--bord); border-bottom: 0; }
details.carte summary { cursor: pointer; }

/* ---------- Électroportatif ---------- */
.e-en_service { --t: #2f8a2f; } .e-a_reparer { --t: #d0621c; } .e-en_reparation { --t: #1f6fb8; }
.e-hors_service { --t: #6b7280; } .e-manquant { --t: #c62828; }
.grille-outils { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.carte-outil { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; gap: 4px 10px; align-items: center;
  padding: 10px; border-radius: 12px; background: var(--carte); border: 1px solid var(--bord); border-left: 5px solid var(--t);
  color: inherit; text-decoration: none; }
.carte-outil:hover { border-color: var(--t); }
.carte-outil img, .carte-outil .picto-outil { grid-row: span 2; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.carte-outil .picto-outil { display: grid; place-items: center; background: color-mix(in srgb, #6a4fc4 14%, var(--carte)); color: #6a4fc4; }
.carte-outil .picto-outil .ico { width: 28px; height: 28px; }
.carte-outil .texte b { display: block; } .carte-outil .texte small { color: var(--doux); }
.etat-outil { justify-self: start; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; color: #fff; background: var(--t); }
.groupe-outils { margin-bottom: 14px; }
.photo-outil { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.fiche-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.fiche-dl dt { color: var(--doux); } .fiche-dl dd { margin: 0; font-weight: 600; }
.choix-etat { display: grid; gap: 6px; margin-bottom: 10px; }
.choix-etat label { display: flex; gap: 8px; align-items: center; font-weight: 500; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 10px; }
.ligne-inv { padding: 10px; border: 1px solid var(--bord); border-radius: 12px; background: var(--carte); margin-bottom: 8px; display: grid; gap: 8px; }
.ligne-inv .nom { display: flex; gap: 10px; align-items: center; } .ligne-inv .nom small { display: block; }
.ligne-inv img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.choix-inv { display: flex; gap: 6px; flex-wrap: wrap; }
.choix-inv label { flex: 1 1 90px; display: flex; gap: 6px; justify-content: center; align-items: center; padding: 10px 6px; border-radius: 10px;
  border: 2px solid var(--bord); font-weight: 600; cursor: pointer; }
.choix-inv label:has(input:checked).r-present { border-color: #2f8a2f; background: color-mix(in srgb, #2f8a2f 14%, var(--carte)); }
.choix-inv label:has(input:checked).r-absent { border-color: #c62828; background: color-mix(in srgb, #c62828 14%, var(--carte)); }
.choix-inv label:has(input:checked).r-abime { border-color: #d0621c; background: color-mix(in srgb, #d0621c 14%, var(--carte)); }

/* ---------- Scan ---------- */
.scan-ligne { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 10px; }
.scan-ligne .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -3px; margin-right: 6px; }
.scan-voile { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.88); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.scan-cadre { position: relative; width: min(92vw, 520px); aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #000; }
.scan-cadre video { width: 100%; height: 100%; object-fit: cover; }
.scan-viseur { position: absolute; inset: 22% 10%; border: 3px solid #4ade80; border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
.scan-aide { color: #fff; margin: 0; }
.scan-page .tuile-action { width: 100%; margin-bottom: 14px; border: 0; cursor: pointer; font: inherit; }

/* ---------- BL et factures ---------- */
.lignes-doc input { width: 100%; min-width: 90px; }
.lignes-doc .art-choix { min-width: 220px; }
.lignes-doc input.qte { width: 90px; min-width: 70px; }
.case.petit { font-size: .75rem; font-weight: 500; display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
details.dossier summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
details.dossier[open] summary { margin-bottom: 10px; }

/* Téléphone : onglets sur une ligne qui défile */
@media (max-width: 760px) {
  .onglets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .onglets::-webkit-scrollbar { display: none; }
  .onglets a { flex: 0 0 auto; }
}
a.chiffre-cle { text-decoration: none; color: inherit; }
.choix-etat label, .choix-inv label { flex-direction: row; }
.choix-etat input[type=radio], .choix-inv input[type=radio] { width: auto; min-width: 0; flex: 0 0 auto; margin: 0; padding: 0; }
.choix-etat label { justify-content: flex-start; text-align: left; }

/* ---------- Chantiers : bons ---------- */
.st-recu { --t: #1f6fb8; } .st-en_attente { --t: #d0621c; } .st-planifie { --t: #6a4fc4; } .st-fait { --t: #2f8a2f; }
.st-attente_regul { --t: #b45309; } .st-a_facturer { --t: #0e7490; } .st-cloture { --t: #9aa6b5; }
.ligne-bon { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 10px 12px;
  margin-bottom: 6px; border-radius: 12px; background: var(--carte); border: 1px solid var(--bord); border-left: 5px solid var(--t);
  color: inherit; text-decoration: none; }
.ligne-bon:hover { border-color: var(--t); }
.ligne-bon.retard { background: color-mix(in srgb, #c62828 7%, var(--carte)); border-left-color: #c62828; }
.ligne-bon.urgent { background: color-mix(in srgb, #d0621c 7%, var(--carte)); }
.ligne-bon .milieu small { display: block; color: var(--doux); }
.ligne-bon .delai { text-align: right; font-weight: 700; } .ligne-bon .delai small { display: block; font-weight: 500; color: var(--doux); }
.ligne-bon.retard .delai small { color: #c62828; font-weight: 700; }
.ligne-bon .statut { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; color: #fff; background: var(--t); white-space: nowrap; }
.type-bon { font-size: .72rem; font-weight: 800; padding: 4px 7px; border-radius: 8px; color: #fff; background: #2f6fd6; min-width: 46px; text-align: center; }
.type-bon.t-REGUL { background: #b45309; } .type-bon.t-EDLS { background: #6a4fc4; } .type-bon.t-BSC { background: #0e7490; }
.type-bon.t-GARANTIE { background: #64748b; }
.gros-ico.type-bon { font-size: .95rem; display: grid; place-items: center; }
@media (max-width: 600px) {
  .ligne-bon { grid-template-columns: auto 1fr auto; }
  .ligne-bon .statut { grid-column: 2 / 4; justify-self: start; }
}
.zone-depot { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 110px; padding: 18px;
  border: 2px dashed #2f6fd6; border-radius: 14px; background: color-mix(in srgb, #2f6fd6 6%, var(--carte)); cursor: pointer; margin-bottom: 10px; }
.zone-depot.survol { background: color-mix(in srgb, #2f6fd6 18%, var(--carte)); }
.zone-depot input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.zone-depot small { color: var(--doux); }
.resultats-depot p { margin: 4px 0; } .resultats-depot .res-erreur { color: #c62828; }
.grille-lots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 14px 0; }
.carte-lot { display: grid; gap: 4px; padding: 14px; border-radius: 14px; background: var(--carte); border: 1px solid var(--bord);
  border-top: 4px solid #2f6fd6; color: inherit; text-decoration: none; }
.carte-lot small { color: var(--doux); }
.filtres-bons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.filtres-bons .recherche { flex: 1 1 260px; margin: 0; } .filtres-bons select { flex: 0 1 200px; }
.texte-bon { white-space: pre-line; background: var(--fond, transparent); border-left: 3px solid var(--bord); padding: 6px 10px; }
.pagination { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; }
.ligne-vehicule { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; white-space: nowrap; }
.ligne-vehicule small { color: var(--doux); }
.onglets-depot { --c: #1f6fb8; margin: 4px 0 14px; }
/* Planning des techniciens */
.barre-semaine { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.barre-semaine b { flex: 1 1 auto; text-align: center; }
.barre-semaine .bouton { width: auto; flex: 0 0 auto; margin: 0; }
.planning-tech h3 { margin-top: 0; }
.semaine { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; }
.semaine .jour { display: grid; gap: 5px; align-content: start; }
.semaine .jour > b { font-size: .85rem; text-transform: capitalize; padding: 2px 4px; border-radius: 6px; }
.semaine .jour.aujourdhui > b { background: #2f6fd6; color: #fff; }
.creneau { display: block; font-size: .8rem; padding: 6px 7px; border-radius: 9px; border: 1px solid var(--bord); min-height: 46px; }
.creneau small { display: block; color: var(--doux); font-size: .72rem; }
.creneau.libre { color: var(--doux); border-style: dashed; opacity: .6; }
.creneau.pris { background: color-mix(in srgb, #2f6fd6 9%, var(--carte)); color: inherit; text-decoration: none; font-weight: 700; }
.creneau.pris .type-bon { font-size: .62rem; padding: 1px 4px; min-width: 0; margin-right: 4px; }
.creneau.propose { border: 2px dashed #d0621c; background: color-mix(in srgb, #d0621c 9%, var(--carte)); }
.proposition { border-left: 4px solid #d0621c; }
.table-defile { overflow-x: auto; }
.tableau-prop { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 12px; }
.tableau-prop th, .tableau-prop td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau-prop input { width: auto; margin: 0; }
.tableau-prop tr.hors-delai { background: color-mix(in srgb, #c62828 7%, transparent); }
.sms-rdv .ligne-form { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.sms-rdv .ligne-form label { margin: 0; } .sms-rdv .ligne-form .bouton { width: auto; margin: 0; }
.prop-rdv { padding: 8px 10px; border-left: 3px solid var(--bord); margin-top: 8px; }
.prop-rdv small { display: block; color: var(--doux); }
.prop-rdv.st-choisie { border-left-color: #2f8a2f; } .prop-rdv.st-erreur { border-left-color: #c62828; }
.page-rdv { max-width: 560px; }
.choix-rdv { display: flex; gap: 10px; align-items: center; padding: 14px; margin: 0 0 10px; border: 1px solid var(--bord);
  border-radius: 12px; font-weight: 600; cursor: pointer; }
.choix-rdv input { width: auto; margin: 0; } .choix-rdv:has(input:checked) { border: 2px solid #2f6fd6; }
.rdv-ok { border-left: 4px solid #2f8a2f; }
.sms-essai { background: color-mix(in srgb, #2f8a2f 8%, var(--carte)); border-left: 3px solid #2f8a2f; padding: 8px 10px; border-radius: 8px; }
/* Fond d'ambiance : halos de couleur doux (orange, bleu, violet, vert) au lieu d'un aplat */
body { background-color: var(--fond); background-attachment: fixed; background-image:
  radial-gradient(900px 600px at 0% 0%, rgba(232, 121, 43, .16), transparent 60%),
  radial-gradient(800px 600px at 100% 10%, rgba(47, 128, 237, .16), transparent 60%),
  radial-gradient(900px 700px at 85% 100%, rgba(140, 82, 220, .13), transparent 60%),
  radial-gradient(700px 600px at 5% 95%, rgba(46, 160, 100, .12), transparent 60%); }
.barre { background: linear-gradient(90deg, #1f3a5f, #2a5288 55%, #4a3f8f); box-shadow: 0 2px 12px rgba(0, 0, 0, .18); }
@media (prefers-color-scheme: dark) {
  body { background-image:
    radial-gradient(900px 600px at 0% 0%, rgba(232, 121, 43, .20), transparent 60%),
    radial-gradient(800px 600px at 100% 10%, rgba(47, 128, 237, .22), transparent 60%),
    radial-gradient(900px 700px at 85% 100%, rgba(140, 82, 220, .20), transparent 60%),
    radial-gradient(700px 600px at 5% 95%, rgba(46, 160, 100, .15), transparent 60%); }
}

/* Stock et commandes : deux onglets principaux (Stocks / Commandes) sur toute la largeur, puis les sous-onglets */
.rubriques { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.rubriques a { --r: #e8792b; display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 16px; text-decoration: none;
  background: var(--carte); border: 2px solid var(--bord); color: var(--doux); box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  transition: transform .12s, border-color .12s; }
.rubriques a.r-commandes { --r: #2f80ed; }
.rubriques a .ico { width: 34px; height: 34px; flex: none; color: var(--r); }
.rubriques a span { display: flex; flex-direction: column; line-height: 1.2; }
.rubriques a b { font-size: 1.3rem; font-weight: 800; color: var(--texte); }
.rubriques a small { font-size: .82rem; }
.rubriques a:hover { border-color: var(--r); transform: translateY(-2px); }
.rubriques a.actif { background: var(--r); border-color: var(--r); color: rgba(255, 255, 255, .85);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--r) 45%, transparent); }
.rubriques a.actif b, .rubriques a.actif .ico { color: #fff; }
.rubriques.en-commandes + .onglets { --c: #2f80ed; }
.entete-module .onglets { flex-wrap: wrap; }
@media (max-width: 560px) { .rubriques a { padding: 12px; gap: 9px; } .rubriques a small { display: none; } .rubriques a .ico { width: 26px; height: 26px; } }

/* Prêt ponctuel d'outils du dépôt */
.pret-outil { margin-bottom: 14px; }
.ligne-pret { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.ligne-pret label { flex: 1 1 200px; margin: 0; }
.ligne-pret .btn { flex: none; }
.liste-prets { display: grid; gap: 8px; margin-bottom: 14px; }
.ligne-pret-en-cours { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 10px 14px; border-radius: 12px;
  background: var(--carte); border: 1px solid var(--bord); border-left: 4px solid #1f6fb8; }
.ligne-pret-en-cours form { margin: 0 0 0 auto; }
.ligne-pret-en-cours.en-retard { border-left-color: #dc3c3c; }
.pret-badge { grid-column: 1 / -1; justify-self: start; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 99px;
  background: color-mix(in srgb, #1f6fb8 18%, var(--carte)); color: var(--accent); }
.pret-badge.en-retard { background: color-mix(in srgb, #dc3c3c 18%, var(--carte)); color: #e05555; }
.ligne-pret.formulaire { margin: 0; } .ligne-pret label { font-weight: 600; } .ligne-pret .btn { padding: 12px 22px; }
.carte-un-camion { height: 460px; }
.en-direct { color: #2ea064; font-weight: 700; }

/* Photo depuis un téléphone */
.choix-photo { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.btn-photo.secondaire { background: transparent; color: var(--texte); border: 1px solid var(--bord); }
.choix-photo .envoi { display: none; margin: 0; text-align: center; }
form.envoi-photo .envoi { display: block; }
form.envoi-photo .btn-photo { opacity: .5; pointer-events: none; }
@media (max-width: 560px) { .titre-vignette { flex-direction: column; align-items: stretch; }
  .btn-photo { padding: 12px 16px; font-size: 1rem; text-align: center; } }

/* Photo du conducteur (cartes camions et fiche) */
.avec-avatar { display: inline-flex; align-items: center; gap: 9px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid var(--bord); background: var(--fond); }
.avatar.grand { width: 74px; height: 74px; display: grid; place-items: center; font-size: 2rem; }
.photo-conducteur { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.photo-conducteur .choix-photo { flex-direction: row; }
.btn-photo.mini { padding: 4px 9px; font-size: .85rem; }
.gros-ico[hidden] { display: none; }

/* ================= Accueil : tableau de bord ================= */
.page:has(.tb) { max-width: none; padding-left: clamp(12px, 1.6vw, 32px); padding-right: clamp(12px, 1.6vw, 32px); }  /* toute la largeur de l'écran */
.tb { --tb-carte: color-mix(in srgb, var(--carte) 88%, transparent); --tb-ombre: 0 10px 30px rgba(40, 50, 110, .08);
  --tb-bleu: #5b7cfa; --tb-violet: #a78bfa; --tb-nuit: #16224a;
  display: grid; grid-template-columns: 74px 1fr; gap: 22px; align-items: start; }
.tb-rail { position: sticky; top: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0;
  min-height: calc(100vh - 110px); border-radius: 40px; background: linear-gradient(180deg, #1d2c5e, var(--tb-nuit));
  box-shadow: 0 12px 30px rgba(22, 34, 74, .35); }
.tb-rail a, .tb-rail button { --c: #fff; position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  color: rgba(255, 255, 255, .62); background: none; border: 0; cursor: pointer; transition: background .15s, color .15s; }
.tb-rail svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb-rail a[href]:hover, .tb-rail button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.tb-rail a[href]:hover svg { stroke: var(--c); }
.tb-rail a.actif { background: #fff; color: var(--tb-nuit); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.tb-rail a[aria-disabled] { opacity: .3; cursor: default; }
.tb-rail [data-nom]:hover::after { content: attr(data-nom); position: absolute; left: 56px; white-space: nowrap; padding: 4px 10px; border-radius: 8px;
  background: var(--tb-nuit); color: #fff; font-size: .8rem; font-weight: 600; z-index: 5; pointer-events: none; }
.tb-logo { margin-bottom: 10px; font-weight: 900; font-size: 1.4rem; color: #fff !important; text-decoration: none;
  background: linear-gradient(135deg, #e8792b, #f3a35b) !important; }
.tb-rail-bas { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tb-rail form { margin: 0; }

.tb-corps { min-width: 0; }
.tb-haut { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.tb-fil, .tb-date, .tb-qui { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px;
  background: var(--tb-carte); box-shadow: var(--tb-ombre); font-size: .9rem; color: var(--doux); }
.tb-fil b { color: var(--texte); }
.tb-date { text-transform: capitalize; }
.tb-date b { color: var(--texte); }
.point-vert { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
.tb-qui { margin-left: auto; padding: 6px 16px 6px 6px; }
.tb-qui > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.tb-qui b { color: var(--texte); }
.tb-qui small { font-size: .75rem; }
.tb-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-weight: 800; font-size: .85rem;
  background: linear-gradient(135deg, var(--tb-bleu), var(--tb-violet)); }

.tb-bienvenue { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.tb-etat { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 6px; color: var(--doux); font-size: .9rem; }
.tb-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600;
  background: color-mix(in srgb, var(--tb-bleu) 14%, transparent); color: var(--tb-bleu); }
.tb-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tb-badge.alerte { background: rgba(239, 68, 68, .12); color: #dc2626; }
.tb-bienvenue h1 { margin: 0; font-size: clamp(2.2rem, 5.5vw, 4rem); line-height: 1.02; font-weight: 800; letter-spacing: -.03em; }
.tb-bienvenue h1 em { display: block; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-style: italic; letter-spacing: -.01em;
  background: linear-gradient(90deg, #3b4fd8, var(--tb-violet)); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 4px; }
.tb-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.tb-pilule { padding: 11px 18px; border-radius: 14px; background: var(--tb-carte); box-shadow: var(--tb-ombre); color: var(--texte);
  text-decoration: none; font-weight: 600; font-size: .92rem; transition: transform .12s; }
.tb-pilule:hover { transform: translateY(-2px); }

.tb-grille { display: grid; grid-template-columns: minmax(0, 1fr) clamp(360px, 25vw, 520px); gap: 20px; align-items: start; }
.tb-gauche, .tb-droite { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tb-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 16px; }
.tb-carte, .tb-kpi { background: var(--tb-carte); border: 1px solid color-mix(in srgb, var(--bord) 60%, transparent); border-radius: 22px;
  box-shadow: var(--tb-ombre); padding: 20px 22px; backdrop-filter: blur(8px); }
.tb-kpi { display: flex; flex-direction: column; gap: 14px; color: var(--texte); text-decoration: none; transition: transform .14s, box-shadow .14s; }
.tb-kpi:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(40, 50, 110, .14); }
.tb-kpi-titre { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tb-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; font-style: normal; font-size: 1rem;
  background: var(--fond); box-shadow: inset 0 0 0 1px var(--bord); }
.tb-kpi-corps { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 64px; }
.tb-kpi-corps b { font-size: 2.6rem; line-height: 1; font-weight: 800; letter-spacing: -.03em; }
.tb-spark { width: 55%; height: 56px; overflow: visible; }
.tb-barres { display: flex; align-items: flex-end; gap: 5px; height: 56px; width: 55%; justify-content: flex-end; }
.tb-barres i { flex: 1; max-width: 9px; border-radius: 4px; background: linear-gradient(180deg, #3b4fd8, var(--tb-bleu)); opacity: .85; }
.tb-barres i:nth-child(odd) { opacity: .45; }
.tb-barres.fines { gap: 2px; }
.tb-barres.fines i { max-width: 4px; border-radius: 2px; background: var(--tb-nuit); }
@media (prefers-color-scheme: dark) { .tb-barres.fines i { background: var(--tb-violet); } }
.tb-kpi-pied { font-size: .8rem; color: var(--doux); }
.tb-kpi-pied em { font-style: normal; font-weight: 700; }
.hausse { color: #16a34a; } .baisse { color: #dc2626; } .neutre { color: var(--texte); }

.tb-duo { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(230px, 1fr); gap: 20px; }
.tb-carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tb-carte-titre h2 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tb-onglet-mini { padding: 4px 12px; border-radius: 99px; background: var(--fond); font-size: .78rem; font-weight: 600; color: var(--doux); }
.tb-legende { display: flex; gap: 16px; font-size: .8rem; color: var(--doux); margin-bottom: 8px; }
.tb-legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tb-graph { position: relative; height: 200px; margin-left: 34px; }
.tb-graph svg { width: 100%; height: 100%; overflow: visible; }
.tb-grille-l { stroke: var(--bord); stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.tb-axe { position: absolute; left: -34px; top: -.5em; height: calc(100% + 1em); display: flex; flex-direction: column; justify-content: space-between;
  font-size: .72rem; color: var(--doux); }
.tb-points { position: absolute; inset: 0; pointer-events: none; }
.tb-points i { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--carte);
  border: 2.5px solid var(--tb-bleu); pointer-events: auto; }
.tb-points i.p2 { border-color: var(--tb-violet); }
.tb-semaines { display: grid; grid-template-columns: repeat(12, 1fr); margin: 8px 0 0 34px; font-size: .7rem; color: var(--doux); }
.tb-anneau { position: relative; width: min(220px, 100%); aspect-ratio: 1; margin: 4px auto 14px; }
.tb-anneau svg { width: 100%; height: 100%; }
.tb-anneau > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tb-anneau b { font-size: 2.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.tb-anneau small { color: var(--doux); font-size: .82rem; }
.tb-repartition { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
.tb-repartition li { display: flex; align-items: center; gap: 8px; }
.tb-repartition i { width: 10px; height: 10px; border-radius: 3px; }
.tb-repartition b { margin-left: auto; }

.tb-sombre { border-radius: 24px; padding: 20px; color: #e8ecff; background: radial-gradient(120% 80% at 100% 0%, #2a3d86 0%, transparent 60%),
  linear-gradient(180deg, #1b2856, #111a3a); box-shadow: 0 18px 40px rgba(17, 26, 58, .4); }
.tb-sombre h2 { color: #fff; }
.tb-live { display: block; width: 100%; font-size: .66rem; letter-spacing: .12em; color: #f87171; font-weight: 700; }
.tb-puces { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tb-puces span { padding: 3px 10px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: rgba(255, 255, 255, .08); color: #c7d0f5; }
.tb-puces span.vert { background: rgba(34, 197, 94, .16); color: #4ade80; }
.tb-flotte { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tb-flotte li, .tb-flotte a { display: flex; align-items: center; gap: 12px; }
.tb-flotte li { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .06); }
.tb-flotte a { flex: 1; color: inherit; text-decoration: none; min-width: 0; }
.tb-flotte li:has(a):hover { background: rgba(255, 255, 255, .1); }
.tb-flotte-nom { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tb-flotte-nom b { color: #fff; font-size: .92rem; }
.tb-flotte-nom small { color: #9aa7d6; font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-pastille { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.tb-pastille.route { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .18); animation: tb-pouls 1.8s infinite; }
.tb-pastille.arret { background: #fbbf24; }
@keyframes tb-pouls { 50% { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); } }
.tb-fleche { margin-left: auto; color: #6f7fb8; font-size: 1.3rem; }
.tb-rdv { display: flex; flex-direction: column; align-items: center; min-width: 46px; padding: 4px; border-radius: 10px; background: rgba(255, 255, 255, .08); }
.tb-rdv b { color: #fff; font-size: .8rem; text-transform: capitalize; }
.tb-rdv small { color: #9aa7d6; font-size: .72rem; }
.tb-sombre-vide { color: #9aa7d6; font-size: .85rem; margin: 0 0 12px; }
.tb-bouton-sombre { display: block; text-align: center; padding: 11px; border-radius: 14px; background: rgba(255, 255, 255, .08);
  color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; border: 1px solid rgba(255, 255, 255, .1); }
.tb-bouton-sombre:hover { background: rgba(255, 255, 255, .14); }

.tb-tag { padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: rgba(34, 197, 94, .14); color: #16a34a; }
.tb-equipe { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tb-equipe li { display: flex; align-items: center; gap: 12px; }
.tb-equipe li > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tb-equipe small { color: var(--doux); font-size: .78rem; }
.tb-photo { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; font-weight: 700;
  font-size: .82rem; color: #fff; background: linear-gradient(135deg, #64748b, #334155); border: 2px solid var(--carte); box-shadow: 0 0 0 2px var(--bord); }
.tb-dispo { margin-left: auto; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap;
  background: rgba(34, 197, 94, .12); color: #16a34a; }
.tb-dispo.occupe { background: color-mix(in srgb, var(--tb-bleu) 14%, transparent); color: var(--tb-bleu); }
.tb-vide { color: var(--doux); font-size: .9rem; }

@media (max-width: 1150px) { .tb-grille { grid-template-columns: 1fr; } .tb-droite { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } }
@media (max-width: 760px) {
  .tb { grid-template-columns: 1fr; gap: 14px; }
  .tb-rail { position: static; flex-direction: row; min-height: 0; padding: 8px 12px; border-radius: 22px; overflow-x: auto; }
  .tb-rail-bas { margin: 0 0 0 auto; flex-direction: row; }
  .tb-logo { margin: 0 6px 0 0; }
  .tb-rail [data-nom]:hover::after { display: none; }
  .tb-duo { grid-template-columns: 1fr; }
  .tb-qui { margin-left: 0; }
  .tb-kpi-corps b { font-size: 2.1rem; }
}

@media (prefers-color-scheme: dark) { .tb-bienvenue h1 em { background-image: linear-gradient(90deg, #8fa2ff, #c4b5fd); } }

/* ================= Toutes les pages : même cadre que l'accueil (barre latérale, ligne du haut, cartes) ================= */
.tb-rail { min-height: calc(100vh - 40px); }
.tb-rail a.actif[style] svg { stroke: var(--c); }
.tb-fil a { color: inherit; text-decoration: none; }
.tb-retour { display: inline-flex; align-items: center; gap: 4px; padding: 8px 16px 8px 10px; border-radius: 99px; text-decoration: none;
  font-weight: 700; font-size: .9rem; color: #fff; background: linear-gradient(135deg, #1d2c5e, #16224a); box-shadow: var(--tb-ombre); }
.tb-retour:hover { filter: brightness(1.2); }
.tb-retour svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.tb-corps > .message { border-radius: 14px; }

/* En-tête de module : grand titre comme « Bonjour », onglets dans une barre arrondie */
.avec-cadre .entete-module { margin: 4px 0 22px; }
.avec-cadre .entete-module h1 { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; color: var(--texte);
  font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.avec-cadre .entete-module h1::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--c);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 20%, transparent); }
.avec-cadre .onglets { display: flex; width: fit-content; max-width: 100%; gap: 4px; padding: 6px; border-radius: 18px;
  background: var(--tb-carte); box-shadow: var(--tb-ombre); border: 1px solid color-mix(in srgb, var(--bord) 60%, transparent); }
.avec-cadre .onglets a { border: 0; background: transparent; padding: 9px 16px; border-radius: 13px; }
.avec-cadre .onglets a:hover { background: color-mix(in srgb, var(--c) 10%, transparent); color: var(--texte); }
.avec-cadre .onglets a.actif { background: var(--c); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 40%, transparent); }
.avec-cadre .rubriques a { border-radius: 22px; border-color: color-mix(in srgb, var(--bord) 60%, transparent); background: var(--tb-carte);
  box-shadow: var(--tb-ombre); }
.avec-cadre .rubriques a.r-stock.actif { background: linear-gradient(135deg, #e8792b, #f19a4f); }
.avec-cadre .rubriques a.r-commandes.actif { background: linear-gradient(135deg, #2f6fe0, #5b8ff5); }

/* Cartes et tableaux : coins plus ronds et ombre douce, comme les cartes de l'accueil */
.avec-cadre :is(.carte, .carte-camion, .carte-depot, .tableau) { border-radius: 20px; box-shadow: var(--tb-ombre);
  border-color: color-mix(in srgb, var(--bord) 60%, transparent); }
.avec-cadre :is(.carte-camion, .carte-depot):hover { box-shadow: 0 16px 36px rgba(40, 50, 110, .14); }

@media (max-width: 760px) {
  .tb-rail { min-height: 0; }
  .tb-date { display: none; }
  .tb-qui small { display: none; }
  .avec-cadre .onglets { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .avec-cadre .onglets a { white-space: nowrap; }
}

/* ================= Pages Stocks et Commandes : même architecture que l'accueil ================= */
.tb-espace { margin-top: 20px; }
.tb-actions-rapides { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tb-actions-rapides a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; text-decoration: none;
  color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #fff));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--c) 35%, transparent); transition: transform .14s; }
.tb-actions-rapides a:hover { transform: translateY(-3px); }
.tb-actions-rapides .ico { width: 30px; height: 30px; flex: none; }
.tb-actions-rapides span { display: flex; flex-direction: column; line-height: 1.2; }
.tb-actions-rapides b { font-size: 1rem; }
.tb-actions-rapides small { opacity: .85; font-size: .78rem; }
.tb-carte .cartes { margin: 0; }
.tb-carte .carte-geo { margin: 0; border-radius: 16px; }
.tb-carte .ligne-cmd { margin: 0 0 8px; }
.tb-carte .ligne-cmd:last-child { margin-bottom: 0; }
.tb-carte .vide { margin: 4px 0; }
.tb-carte-titre a.tb-onglet-mini { text-decoration: none; }
.tb-manque { margin-left: auto; flex: none; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 700;
  background: rgba(251, 191, 36, .16); color: #fbbf24; }
.tb-logo-f { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fff; overflow: hidden; }
.tb-tag.alerte { background: rgba(239, 68, 68, .12); color: #dc2626; }
.tb-mouvements { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tb-mouvements li { display: flex; align-items: center; gap: 10px; }
.tb-mouvements li > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.tb-mouvements small { color: var(--doux); font-size: .78rem; }
.tb-mouvements .tb-ico { width: 34px; height: 34px; flex: none; }
.tb-quand { margin-left: auto; white-space: nowrap; }

/* Chantiers en tableau de bord */
.tb-pastille.retard { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .2); }
.tb-pastille.urgent { background: #60a5fa; }
.tb-puces span.rouge { background: rgba(248, 113, 113, .16); color: #f87171; }
.tb-manque.rouge { background: rgba(248, 113, 113, .16); color: #f87171; }
.tb-heure { font-style: normal; font-size: .72rem !important; font-weight: 800; color: #2f6fd6; }
.tb-carte .grille-lots { margin: 0; }
.tb-gauche > .tb-carte.depot-bons h2 { margin-top: 0; }
.tb-mouvements a.tb-quand { text-decoration: none; font-size: 1.3rem; color: var(--doux); }.tb-puces span { white-space: nowrap; }
@media (max-width: 1150px) { .tb-droite { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); } }
.tb-rail { scrollbar-width: none; }

/* ================= Stock et commandes simplifié : 4 entrées, À faire, Lieux, Articles, Commandes, écran technicien ================= */
.menu-stock { display: flex; gap: 6px; padding: 6px; margin: 0 0 12px; background: var(--carte); border: 1px solid var(--bord);
  border-radius: 16px; overflow-x: auto; scrollbar-width: none; }
.menu-stock a { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 16px;
  border-radius: 12px; color: var(--doux); font-weight: 700; text-decoration: none; white-space: nowrap; }
.menu-stock a:hover { background: var(--fond); color: var(--texte); }
.menu-stock a.actif { background: var(--c, #e8792b); color: #fff; }
.menu-stock .ico { width: 20px; height: 20px; }
.nb { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: #d64545; color: #fff; font-size: .78rem; font-weight: 800; line-height: 1; }
.nb.gris { background: #8a94a3; }
.recherche-stock { display: flex; gap: 8px; margin: 0 0 6px; }
.recherche-stock input { flex: 1; min-width: 0; margin: 0; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--bord);
  background: var(--carte); color: var(--texte); font: inherit; }
.recherche-stock .btn { flex: none; }

.pilules { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.pilules a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--bord);
  background: var(--carte); color: var(--doux); font-weight: 600; text-decoration: none; }
.pilules a:hover { color: var(--texte); border-color: var(--doux); }
.pilules a.actif { background: #2f80ed; border-color: #2f80ed; color: #fff; }
.pilules a.actif .nb { background: #fff; color: #2f80ed; }
.pilules .ico { width: 17px; height: 17px; }
.pilules small { opacity: .8; font-weight: 400; }

.btn.plein { background: #e8792b; }
.btn.petit { padding: 6px 11px; font-size: .85rem; border-radius: 9px; }
.btn.discret { color: var(--texte); border: 1px solid var(--bord); }

.taches { list-style: none; margin: 0; padding: 0; }
.tache { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--bord); }
.tache:last-child { border-bottom: 0; }
.tache-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; }
.tache-ico .ico { width: 22px; height: 22px; }
.tache-ico.c-o { background: #fdebdc; color: #c45f15; } .tache-ico.c-r { background: #fbe1e1; color: #b83232; }
.tache-ico.c-b { background: #dfeafc; color: #1f5fb8; } .tache-ico.c-v { background: #dcf3e9; color: #17805a; }
.tache-ico.c-g { background: #e8ebef; color: #5b6777; }
.tache-ico .ico { stroke: currentColor; }
.tache-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tache-txt small { color: var(--doux); overflow-wrap: anywhere; }
.tache .btn { flex: none; white-space: nowrap; }
.tache-vide { display: flex; align-items: center; gap: 10px; padding: 18px 0; color: var(--ok, #2f8a2f); font-weight: 600; }
@media (max-width: 640px) {
  .tache { flex-wrap: wrap; }
  .tache .btn { margin-left: 56px; }
}

.bandeau-ajout { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin: 0 0 14px;
  background: var(--carte); border: 1px solid var(--bord); border-left: 4px solid #e8792b; border-radius: 14px; }
.bandeau-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #fdebdc; color: #c45f15; }
.bandeau-ico .ico { width: 24px; height: 24px; stroke: currentColor; }
.bandeau-txt { flex: 1 1 260px; display: flex; flex-direction: column; line-height: 1.3; }
.bandeau-txt small { color: var(--doux); }
.bandeau-ajout form { margin: 0; }

.a-commander { margin: 4px 0 18px; }
.ligne-cmd .btn { pointer-events: none; }

/* Écran du technicien : quatre gros boutons */
.boutons-camion { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 14px 0 10px; }
.bouton-camion { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 16px; text-decoration: none;
  background: var(--carte); color: var(--texte); border: 1px solid var(--bord); border-left: 6px solid var(--c); }
.bouton-camion:hover { background: var(--fond); }
.bouton-camion .ico { flex: none; width: 34px; height: 34px; stroke: var(--c); }
.bouton-camion span { display: flex; flex-direction: column; line-height: 1.25; }
.bouton-camion b { font-size: 1.1rem; }
.bouton-camion small { color: var(--doux); }
.bouton-camion .nb { position: absolute; top: 10px; right: 10px; }
.bouton-camion.scan { --c: #fff; background: #1f6fb8; color: #fff; border-color: #1f6fb8; justify-content: center; }
.bouton-camion.scan small { color: rgba(255, 255, 255, .85); }

.lignes-compter { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.ligne-compter { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--bord); border-radius: 12px; background: var(--carte); }
.ligne-compter .nom { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ligne-compter .nom small { color: var(--doux); }
.plus-moins { flex: none; display: flex; align-items: center; gap: 6px; }
.plus-moins button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--bord); background: var(--fond); color: var(--texte);
  font-size: 1.3rem; cursor: pointer; padding: 0; }
.plus-moins input { width: 64px; margin: 0; text-align: center; font-weight: 700; }

/* Écran simple façon téléphone : sortie, retour, rechargement d'un camion */
.ecran-simple { max-width: 720px; }
.champ-gros { font-weight: 700; font-size: 1.05rem; }
.champ-gros select { font-size: 1.05rem; padding: 12px; }
.champ-gros small { font-weight: 400; color: var(--doux); }
.ligne-compter.choisi { border-color: #1f9d6b; box-shadow: inset 4px 0 0 #1f9d6b; }
.bouton-valider { background: #1f9d6b; font-size: 1.1rem; padding: 16px; }
.champ-gros { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.champ-gros select { width: 100%; }

/* Inventaire des outils, écran simple */
.tous-presents { width: 100%; font: inherit; cursor: pointer; text-align: left; margin: 0 0 14px; }
.lignes-outils { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.ligne-outil { padding: 12px; border: 1px solid var(--bord); border-radius: 14px; background: var(--carte); }
.ligne-outil[data-etat="present"] { border-color: #1f9d6b; box-shadow: inset 4px 0 0 #1f9d6b; }
.ligne-outil[data-etat="absent"] { border-color: #d64545; box-shadow: inset 4px 0 0 #d64545; }
.ligne-outil[data-etat="abime"] { border-color: #e8792b; box-shadow: inset 4px 0 0 #e8792b; }
.ligne-outil-haut { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ligne-outil-photo { flex: none; width: 48px; height: 48px; border-radius: 10px; object-fit: cover; }
.ligne-outil-photo.vide { display: grid; place-items: center; background: var(--fond); color: var(--doux); }
.ligne-outil-photo.vide .ico { width: 26px; height: 26px; stroke: currentColor; }
.ligne-outil .nom { display: flex; flex-direction: column; line-height: 1.25; }
.ligne-outil .nom small { color: var(--doux); }
.choix-outil { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choix-outil label { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px;
  border: 2px solid var(--bord); background: var(--fond); font-weight: 700; cursor: pointer; text-align: center; }
.choix-outil label span { font-size: 1.3rem; line-height: 1; }
.choix-outil input { position: absolute; opacity: 0; pointer-events: none; }
.choix-outil label.c-present:has(input:checked) { border-color: #1f9d6b; background: #1f9d6b; color: #fff; }
.choix-outil label.c-absent:has(input:checked) { border-color: #d64545; background: #d64545; color: #fff; }
.choix-outil label.c-abime:has(input:checked) { border-color: #e8792b; background: #e8792b; color: #fff; }
.ligne-outil .precision { display: none; margin: 10px 0 0; }
.ligne-outil[data-etat="absent"] .precision, .ligne-outil[data-etat="abime"] .precision { display: block; }

/* Inventaire rayon par rayon */
.inventaire { max-width: 820px; }
.inv-avancement { margin: 6px 0 10px; }
.inv-avancement p { margin: 4px 0 0; color: var(--doux); }
.inv-barre { height: 10px; border-radius: 99px; background: var(--bord); overflow: hidden; }
.inv-barre span { display: block; height: 100%; background: #1f9d6b; }
.inv-rayons a.fini:not(.actif) { border-color: #1f9d6b; color: #1f9d6b; }
.inv-outils { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inv-outils .recherche { flex: 1; min-width: 200px; margin: 0; }
.inv-douchette { width: 100%; margin: 8px 0 0; font-size: .9rem; border-style: dashed; }
.inventaire .ligne-compter .nom small b { color: var(--texte); }
.inv-fait { color: #1f9d6b; font-weight: 600; }
.inv-egal { flex: none; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--bord); background: var(--fond);
  color: var(--doux); font-weight: 600; cursor: pointer; white-space: nowrap; }
.inv-egal:hover { color: #1f9d6b; border-color: #1f9d6b; }
.ligne-compter.flash { background: #e6f6ef; transition: background .2s; }
.inv-pied { position: sticky; bottom: 0; background: var(--fond); padding: 10px 0; border-top: 1px solid var(--bord); }

.inv-pied .bouton-valider { width: 100%; }
@media (max-width: 560px) { .inv-egal { display: none; } .ligne-compter .vignette, .ligne-compter img { width: 40px; height: 40px; } }
.inv-famille { margin: 10px 0 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--doux); }

/* Accueil : vue d'ensemble du gestionnaire de stock */
.tb-puces span.orange { background: rgba(232, 121, 43, .18); color: #f59e5b; }
.tb-kpi-jauge { display: block; height: 6px; border-radius: 99px; background: var(--bord); overflow: hidden; margin: 2px 0 6px; }
.tb-kpi-jauge i { display: block; height: 100%; background: #1f9d6b; }
.tb-avancement { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.tb-avancement a { display: grid; grid-template-columns: minmax(0, 1fr) 90px 52px; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-size: .88rem; }
.tb-av-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-av-barre { height: 8px; border-radius: 99px; background: var(--bord); overflow: hidden; }
.tb-av-barre i { display: block; height: 100%; background: #1f9d6b; }
.tb-avancement small { color: var(--doux); text-align: right; }
.tb-chiffres { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tb-chiffres a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 6px 8px; border-radius: 10px; }
.tb-chiffres a:hover { background: var(--fond); }
.tb-chiffres i { font-style: normal; width: 26px; text-align: center; }
.tb-chiffres b { font-size: 1.15rem; min-width: 44px; }
.tb-chiffres span { color: var(--doux); font-size: .88rem; }
.tb-quand-txt { margin-left: auto; white-space: nowrap; }
.tb-carte + .tb-carte, .tb-duo + .tb-carte, .tb-kpis + .tb-duo { margin-top: 20px; }
.tb-taches .tb-flotte-nom small { white-space: normal; }
.tb-duo > .tb-carte { margin-top: 0; }
.inv-ajout { border: 1px dashed var(--bord); border-radius: 14px; padding: 12px; margin: 12px 0; }
.inv-ajout h3 { margin: 0 0 8px; font-size: 1rem; }
.inv-resultats { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 360px; overflow: auto; }
.inv-trouve { display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px; border: 1px solid var(--bord); border-radius: 10px;
  background: var(--carte); color: var(--texte); cursor: pointer; }
.inv-trouve:hover { border-color: #1f9d6b; }
.inv-trouve span { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.inv-trouve small { color: var(--doux); }
.inv-trouve i { font-style: normal; font-size: 1.4rem; font-weight: 700; color: #1f9d6b; padding: 0 6px; }
.tb-av-barre.orange i { background: #e8792b; }

/* Accueil : Ma boîte mail */
.tb-boite { margin-bottom: 20px; }
.tb-mails { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; }
.tb-mails a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; padding: 8px 6px; border-bottom: 1px solid var(--bord);
  text-decoration: none; color: inherit; border-radius: 8px; }
.tb-mails a:hover { background: var(--fond); }
.tb-mail-de { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-mail-heure { font-size: .75rem; color: var(--doux); }
.tb-mail-objet { grid-column: 1 / -1; font-size: .8rem; color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-mails li.non-lu .tb-mail-de { font-weight: 700; }
.tb-mails li.non-lu .tb-mail-objet { color: var(--texte); }
.tb-mails li.non-lu a { box-shadow: inset 3px 0 0 #2f80ed; }
.tb-boite-pied { display: flex; gap: 8px; align-items: center; }
.tb-boite-pied form { margin: 0; }

/* ================= Boîte mail (Microsoft 365) ================= */
.mail { display: grid; grid-template-columns: clamp(200px, 14vw, 260px) minmax(300px, 1fr) minmax(0, 1.8fr); gap: 16px; align-items: start; }
.mail > .tb-carte { margin: 0; padding: 14px; }
.mail-dossiers { position: sticky; top: 14px; display: flex; flex-direction: column; gap: 12px; }
.mail-nouveau { justify-content: center; }
.mail-dossiers nav { display: flex; flex-direction: column; gap: 2px; }
.mail-dossiers nav a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--texte); font-size: .92rem; }
.mail-dossiers nav a:hover { background: var(--fond); }
.mail-dossiers nav a.actif { background: color-mix(in srgb, #2f80ed 14%, transparent); font-weight: 700; }
.mail-dossier-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-dossiers nav b { font-size: .75rem; padding: 1px 8px; border-radius: 99px; background: #2f80ed; color: #fff; }
.mail-compte { border-top: 1px solid var(--bord); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.mail-compte small { color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-compte form { margin: 0; }
.lien-discret { background: none; border: 0; padding: 0; color: var(--doux); font: inherit; font-size: .8rem; text-decoration: underline; cursor: pointer; }
.mail-recherche input { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--bord); background: var(--fond); color: var(--texte); font: inherit; }
.mail-liste-titre { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.mail-liste-titre h2 { flex: 1; margin: 0; font-size: 1.05rem; }
.mail-actualiser { text-decoration: none; font-size: 1.2rem; color: var(--doux); padding: 0 6px; }
.mail-tout { display: grid; place-items: center; padding: 0 6px; }
.mail-outils { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; margin-bottom: 6px; border-radius: 10px; background: var(--fond); }
.mail-outils[hidden] { display: none; }
.mail-outils select, .mail-actions-form select { padding: 5px 8px; border-radius: 9px; border: 1px solid var(--bord); background: var(--carte); color: var(--texte); font: inherit; font-size: .85rem; }
.btn.rouge { background: #b42318; }
.mail-lignes { list-style: none; margin: 0; padding: 0; }
.mail-lignes li { display: flex; align-items: flex-start; gap: 6px; border-bottom: 1px solid var(--bord); }
.mail-lignes li > input { margin: 14px 4px 0 6px; flex: none; }
.mail-lignes a { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 9px 8px; border-radius: 10px;
  text-decoration: none; color: inherit; }
.mail-lignes a:hover { background: var(--fond); }
.mail-lignes li.ouvert a { background: color-mix(in srgb, #2f80ed 12%, transparent); }
.mail-lignes li.non-lu a { box-shadow: inset 3px 0 0 #2f80ed; }
.mail-lignes li.non-lu .mail-qui, .mail-lignes li.non-lu .mail-objet { font-weight: 700; color: var(--texte); }
.mail-qui { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-qui em { color: #b42318; font-style: normal; font-weight: 700; }
.mail-quand { font-size: .75rem; color: var(--doux); white-space: nowrap; }
.mail-objet { grid-column: 1 / -1; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-apercu { grid-column: 1 / -1; font-size: .78rem; color: var(--doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-pages { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.mail-lecture { min-height: 60vh; }
.mail-fermer { display: none; margin-bottom: 8px; font-weight: 700; text-decoration: none; }
.mail-sujet { margin: 0 0 10px; font-size: 1.25rem; overflow-wrap: anywhere; }
.mail-entete { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.mail-entete > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mail-entete small { color: var(--doux); }
.mail-dest { display: block; }
.mail-date { white-space: nowrap; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.mail-actions-form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.mail-pjs { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mail-pjs a, .mail-pjs span { display: inline-block; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--bord); text-decoration: none; color: var(--texte); font-size: .88rem; }
.mail-pjs a:hover { background: var(--fond); }
.mail-pjs small { color: var(--doux); }
.mail-cadre { width: 100%; height: 70vh; border: 1px solid var(--bord); border-radius: 12px; background: #fff; }
.mail-cadre.petit { height: 40vh; }
.mail-rien { display: grid; place-items: center; text-align: center; min-height: 50vh; font-size: 2.4rem; color: var(--doux); }
.mail-rien p { font-size: .95rem; margin: 6px 0 0; }
.mail-connexion { max-width: 640px; }
.mail-ecrire { max-width: 900px; display: flex; flex-direction: column; gap: 10px; }
.mail-champ { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--bord); padding-bottom: 6px; }
.mail-champ span { width: 54px; color: var(--doux); font-weight: 600; }
.mail-champ input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--texte); font: inherit; padding: 6px 0; outline: none; }
.mail-ecrire textarea { width: 100%; min-height: 220px; padding: 12px; border-radius: 12px; border: 1px solid var(--bord); background: var(--fond);
  color: var(--texte); font: inherit; resize: vertical; }
.mail-joindre { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mail-joindre .aide { margin: 0; }
.mail-joindre .erreur { color: #b42318; font-weight: 700; }
.mail-envoi { display: flex; gap: 8px; flex-wrap: wrap; }
.mail-cite-titre { margin: 10px 0 0; font-size: .9rem; color: var(--doux); }
@media (max-width: 1250px) { .mail { grid-template-columns: 200px minmax(0, 1fr); } .mail-lecture { grid-column: 1 / -1; }
  .mail:not(.avec-lecture) .mail-lecture { display: none; } }
@media (max-width: 1250px) { .mail.avec-lecture .mail-liste { display: none; } .mail.avec-lecture .mail-lecture { grid-column: 2; } .mail-fermer { display: inline-block; } }
@media (max-width: 760px) { .mail { grid-template-columns: 1fr; } .mail-dossiers { position: static; }
  .mail.avec-lecture .mail-dossiers { display: none; } .mail.avec-lecture .mail-lecture { grid-column: 1; } }
.mail input[type=checkbox] { display: inline-block; width: 17px; height: 17px; margin: 0; padding: 0; flex: none; accent-color: #2f80ed; }
.mail-lignes li > input[type=checkbox] { margin: 14px 2px 0 6px; }
.mail-recherche input, .mail-champ input { margin: 0; }
.mail-recherche { margin: 0; }

/* ================= Réglages : accès des utilisateurs ================= */
.reglages { display: grid; grid-template-columns: clamp(260px, 22vw, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.reglages > .tb-carte { margin: 0; padding: 16px; }
.reglages h2 { margin: 0 0 10px; font-size: 1.1rem; }
.reglages-gens { position: sticky; top: 14px; }
.reglages-gens input[type=search] { margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; background: var(--fond); }
.reglages-gens ul { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow: auto; }
.reglages-gens a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--texte); }
.reglages-gens a:hover { background: var(--fond); }
.reglages-gens a.actif { background: color-mix(in srgb, #5b7cfa 16%, transparent); }
.reglages-gens a > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reglages-gens small, .reglages-qui small { color: var(--doux); }
.reglages-gens em { font-style: normal; font-size: .7rem; padding: 2px 8px; border-radius: 99px; background: rgba(232, 121, 43, .18); color: #f59e5b; }
.reglages-qui { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.reglages-qui h2 { margin: 0; }
.reglages-groupe { margin: 18px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--doux); }
.reglages-fonctions { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.reglages-fonctions li { border: 1px solid var(--bord); border-radius: 12px; padding: 10px 12px; }
.reglages-fonctions li.impossible { opacity: .5; }
.reglages-fonctions li.eteint { opacity: .45; }
.interrupteur { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin: 0; }
.impossible .interrupteur { cursor: not-allowed; }
.interrupteur input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.glissiere { flex: none; position: relative; width: 42px; height: 24px; margin-top: 2px; border-radius: 99px; background: var(--bord); transition: background .15s; }
.glissiere::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.interrupteur input:checked + .glissiere { background: #2f8a2f; }
.interrupteur input:checked + .glissiere::after { left: 21px; }
.interrupteur input:focus-visible + .glissiere { outline: 2px solid #5b7cfa; outline-offset: 2px; }
.reglages-texte { display: flex; flex-direction: column; min-width: 0; }
.reglages-texte small { color: var(--doux); font-size: .82rem; }
.reglages-texte em { font-style: normal; font-size: .7rem; padding: 1px 7px; border-radius: 99px; background: rgba(232, 121, 43, .18); color: #f59e5b; vertical-align: 2px; }
.reglages-boutons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 860px) { .reglages { grid-template-columns: 1fr; } .reglages-gens { position: static; } .reglages-gens ul { max-height: 40vh; } }
