/* Tableau réutilisable (js/tableau.js) */
.tbl-barre{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 8px}
.tbl-barre input[type=search]{flex:1 1 240px;min-width:180px;height:40px;box-sizing:border-box;padding:0 12px;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);color:var(--ink);font:500 15px var(--f-body)}
.tbl-compte{margin-left:auto;color:var(--ink2);font-size:14px}
.tbl-panneau{border:1px solid var(--line);border-radius:var(--r);padding:8px 12px;margin:0 0 8px;background:var(--surface)}
.tbl-panneau ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:4px 16px}
.tbl-panneau li{display:flex;align-items:center;gap:4px}
.tbl-panneau li label{flex:1}
.tbl-panneau .btn{height:30px;min-height:30px;padding:0 8px}
.tbl-defile{max-height:75vh;overflow:auto}
.tbl thead th{position:sticky;top:0;background:var(--surface);z-index:2;white-space:nowrap}
.tbl thead tr.tbl-filtres th{top:38px;z-index:1;padding:2px 4px}
.tbl thead tr.tbl-filtres input,.tbl thead tr.tbl-filtres select{width:100%;min-width:70px;height:30px;box-sizing:border-box;padding:0 4px;border:1px solid var(--line);border-radius:var(--r);background:var(--surface);color:var(--ink);font:500 13px var(--f-body)}
.tbl-tri{appearance:none;background:none;border:0;padding:4px 4px;font:600 13px var(--f-body);color:var(--ink);cursor:pointer;text-align:left}
.tbl-fleche{margin-left:4px;color:var(--ink2);font-size:11px}
th[aria-sort="ascending"] .tbl-fleche,th[aria-sort="descending"] .tbl-fleche{color:var(--accent)}
.tbl th[draggable=true]{cursor:grab}
.tbl-cliquable{cursor:pointer}
.tbl-cliquable:hover td{background:var(--sunk)}
.tbl-ouverte td{background:var(--sunk);font-weight:600}
.tbl-ouvrir{height:auto;min-height:32px;padding:2px 8px;font-weight:600}
.tbl td select{height:30px;max-width:150px;font:500 13px var(--f-body);background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:var(--r)}
.tbl-detail>td{padding:0;background:var(--surface)}
.tbl-detail-in{border:3px solid var(--accent);border-radius:var(--r);margin:4px 0 12px;padding:12px 16px;font-weight:400;cursor:auto}
.tbl-libre{max-height:none}
/* Dans la fiche d'une ligne ouverte, un menu remplit sa boîte bordée (.inp) au lieu de garder la largeur d'une cellule (D-2026-11-04-01) */
.tbl td .inp select,.tbl td .inp input{max-width:none;width:100%}

/* Direction B (Q-393, docs/APPARENCE.md, section 5) : champ de recherche et filtres arrondis, fond en retrait comme les champs .inp; ligne ouverte en carte.
   Vaut pour tous les modules qui utilisent le tableau commun (Équipements, Demandes internes, Administration, Produits) : seules les formes et les couleurs changent. */
.tbl-barre input[type=search]{border-color:var(--champ-line);border-radius:var(--r-ctl);background:var(--champ-bg)}
.tbl-barre input[type=search]:focus{outline:none;background:var(--surface);border-color:var(--ink);box-shadow:0 0 0 1px var(--ink),0 0 0 4px var(--hover)}
.tbl-panneau{border-color:var(--card-line);border-radius:var(--r-ctl);box-shadow:var(--sh-card)}
.tbl thead tr.tbl-filtres input,.tbl thead tr.tbl-filtres select,.tbl td select{border-color:var(--champ-line);border-radius:10px;background:var(--champ-bg)}
.tbl-tri{font-weight:600}
.tbl-cliquable:hover td{background:var(--bg)}
.tbl-ouverte td{background:var(--bg)}
.tbl-detail-in{border:1px solid var(--card-line);border-left:4px solid var(--accent);border-radius:var(--r-card);box-shadow:var(--sh-card);background:var(--surface)}
.tbl-ouvrir{border-radius:var(--r-btn)}
@media (max-width:699px){
  .tbl-barre input[type=search]{height:44px;min-width:0;flex-basis:100%}
  .tbl-barre .btn{min-height:44px}
}

/* Direction B, le tableau lui-même (Q-393, docs/APPARENCE.md, section 5, règle 7) : même allure que le tableau des Demandes internes (css/tickets-materiel.css).
   Cadre arrondi à bordure pâle, titres de colonne en phrase normale, lignes aérées séparées d'un trait, survol en retrait, pastilles d'état, boutons d'action compacts.
   Seules les formes et les couleurs changent : tri, filtres, recherche, colonnes, ligne ouverte et export restent ceux de js/tableau.js.
   Au téléphone, le tableau garde sa forme et défile dans son cadre (jamais la page), comme le catalogue des Produits. */
.tw.tbl-defile{margin:0 0 8px;padding:0;border:1px solid var(--card-line);border-radius:var(--r-ctl);background:var(--surface)}
.tb.tbl{width:100%;margin:0;font-size:13.5px}
.tb.tbl th,.tb.tbl td{padding:8px 12px;border-top:1px solid var(--line);vertical-align:middle}
.tb.tbl thead th{border-top:0;color:var(--ink2);font:600 13px/1.2 var(--f-body);letter-spacing:0;text-transform:none;background:var(--surface)}
.tb.tbl thead tr:first-child th{height:40px;padding:4px 12px;box-sizing:border-box}
.tb.tbl thead tr.tbl-filtres th{top:40px;padding:0 4px 8px;border-bottom:1px solid var(--line)}
.tb.tbl tbody tr:first-child td{border-top:0}
.tb.tbl .tbl-tri{padding:4px 0;font:600 13px/1.2 var(--f-body);color:var(--ink2);border-radius:calc(var(--r-ctl) - 4px)}
.tb.tbl th[aria-sort="ascending"] .tbl-tri,.tb.tbl th[aria-sort="descending"] .tbl-tri{color:var(--ink)}
.tb.tbl .tbl-tri:hover{color:var(--ink)}
.tb.tbl .tbl-tri:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tb.tbl th[aria-sort="none"] .tbl-fleche{opacity:.6}
.tbl-cliquable:hover td,.tbl-ouverte td{background:var(--bg)}
.tbl-ouverte td{font-weight:600}
/* Pastilles d'état dans une cellule (.etat de css/moderne.css, .st des modules) : sur une ligne, centrées */
.tb.tbl td .etat,.tb.tbl td .st{vertical-align:middle;white-space:nowrap}
/* Ouvrir la fiche : bouton tonal compact; quand le bouton porte le nom de la ligne (première colonne), il se lit comme un lien en gras */
.tb.tbl .btn.tbl-ouvrir{min-height:32px;height:auto;padding:2px 12px;border-color:transparent;background:var(--sunk);color:var(--ink);font:600 13px/1.2 var(--f-body);box-shadow:none}
.tb.tbl .btn.tbl-ouvrir:hover{background:var(--hover);border-color:var(--line-f)}
.tb.tbl .btn.tbl-ouvrir.tbl-ouvrir-nom{background:none;padding:2px 0;min-height:32px;justify-content:flex-start;text-align:left;font-weight:600}
.tb.tbl .btn.tbl-ouvrir.tbl-ouvrir-nom:hover{background:none;border-color:transparent;text-decoration:underline}
.tb.tbl .btn.tbl-ouvrir[aria-expanded="true"]{background:var(--ink);color:var(--bg)}
.tb.tbl .btn.tbl-ouvrir.tbl-ouvrir-nom[aria-expanded="true"]{background:none;color:var(--accent)}
/* Icônes d'action dans une cellule (Supprimer du Journal, .ib) : carré compact, bordure pâle; rouge au survol */
.tb.tbl td .ib{width:34px;height:34px;border-color:var(--card-line);border-radius:var(--r-ctl);color:var(--ink2)}
.tb.tbl td .ib svg{width:16px;height:16px}
@media (hover:hover){.tb.tbl td .ib:hover{background:var(--bad-soft);border-color:var(--bad);color:var(--bad)}}
.tb.tbl td .btn{box-shadow:none}
@media (max-width:699px){
  .tb.tbl{font-size:13px}
  .tb.tbl th,.tb.tbl td{padding:8px 8px}
  .tb.tbl thead tr:first-child th{padding:4px 8px}
  .tb.tbl .btn.tbl-ouvrir{min-height:40px}
  .tb.tbl td .ib{width:40px;height:40px}
}

/* Options du tableau (Recherche des Achats, 23 novembre 2026; docs/TABLEAU.md) : filtres De / À et multiple, total en bas, lignes serrées.
   Sans ces options, rien de ce qui suit ne s'applique. */
.tbl-inter{display:flex;gap:4px}
.tb.tbl thead tr.tbl-filtres .tbl-inter input{min-width:0;width:50%;flex:1 1 0}
.tb.tbl thead tr.tbl-filtres .tbl-inter input[type=date]{min-width:120px}
.tbl-multi{display:flex;align-items:center;justify-content:space-between;gap:4px;width:100%;min-width:90px;height:30px;box-sizing:border-box;padding:0 8px;border:1px solid var(--champ-line);border-radius:10px;background:var(--champ-bg);color:var(--ink2);font:500 13px var(--f-body);cursor:pointer;text-align:left}
.tbl-multi-t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px}
.tbl-multi.tbl-multi-actif{border-color:var(--ink);color:var(--ink);font-weight:600}
.tbl-multi:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.tbl-pop{position:fixed;inset:auto;margin:0;min-width:220px;max-width:min(360px,calc(100vw - 16px));overflow:auto;box-sizing:border-box;padding:8px;border:1px solid var(--card-line);border-radius:var(--r-ctl);background:var(--surface);color:var(--ink);box-shadow:var(--sh-card);font:500 13px var(--f-body)}
.tbl-pop input[type=search]{width:100%;height:32px;box-sizing:border-box;margin:0 0 4px;padding:0 8px;border:1px solid var(--champ-line);border-radius:10px;background:var(--champ-bg);color:var(--ink);font:500 13px var(--f-body)}
.tbl-pop ul{list-style:none;margin:0;padding:0;max-height:280px;overflow:auto}
.tbl-pop li label{display:flex;align-items:center;gap:8px;min-height:32px;padding:0 4px;cursor:pointer}
.tbl-pop li label:hover{background:var(--bg)}
.tbl-pop .tbl-pop-inact{display:flex;align-items:center;gap:8px;min-height:32px;margin-top:4px;border-top:1px solid var(--line);padding-top:4px}
.tbl-pop .acts{margin-top:4px}
.tb.tbl tfoot td{position:sticky;bottom:0;background:var(--surface);border-top:2px solid var(--line-f);font-weight:600;white-space:nowrap}
.tb.tbl tfoot tr.tbl-note td{position:static;border-top:0;font-weight:400;color:var(--ink2);white-space:normal}
.tb.tbl.tbl-compact th,.tb.tbl.tbl-compact td{padding:4px 8px}
.tb.tbl.tbl-compact tbody td{white-space:nowrap;max-width:280px;overflow:hidden;text-overflow:ellipsis}
.tb.tbl.tbl-compact thead tr:first-child th{height:36px;padding:4px 8px}
.tb.tbl.tbl-compact thead tr.tbl-filtres th{top:36px}
@media (max-width:699px){.tbl-multi{min-height:40px}.tb.tbl thead tr.tbl-filtres .tbl-inter input{min-height:40px}}
