:root {
  --fond: #f6f5f1; --carte: #ffffff; --texte: #1f1e1b; --discret: #6b6a64; --ligne: #e4e2da;
  --accent: #1d6fb8; --accent-fond: #e6f1fb; --ok: #2f7d32; --erreur: #b3261e;
  --cafet: #3b8b2e; --bar: #d4537e; --resto: #185fa5;
}
@media (prefers-color-scheme: dark) {
  :root { --fond: #1c1c1a; --carte: #262624; --texte: #ecebe6; --discret: #a3a29b; --ligne: #3a3936; --accent: #85b7eb; --accent-fond: #0c2c4a; --ok: #97c459; --erreur: #f09595; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--fond); color: var(--texte); }
body.centre { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 20px; background: var(--carte); border-bottom: 1px solid var(--ligne); }
header h1 { margin: 0; font-size: 20px; }
main { padding: 20px; max-width: 1200px; margin: 0 auto; }
h1, h2, h3 { font-weight: 600; }
h2 { font-size: 17px; margin: 0 0 12px; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: 12px; padding: 16px 20px; margin-bottom: 20px; }
.connexion { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.connexion h1 { margin: 0; }
.discret { color: var(--discret); font-size: 13px; margin: 0; }
.erreur { color: var(--erreur); font-size: 14px; margin: 0; min-height: 1em; }
input, select, button { font: inherit; color: inherit; }
input[type=password], input[type=text], input[type=number], select { height: 40px; padding: 0 12px; border: 1px solid var(--ligne); border-radius: 8px; background: var(--carte); }
button { height: 40px; padding: 0 16px; border: 1px solid var(--ligne); border-radius: 8px; background: var(--carte); cursor: pointer; }
button.principal { background: var(--accent); color: #fff; border-color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--discret); padding: 8px 6px; border-bottom: 1px solid var(--ligne); white-space: nowrap; }
td { padding: 7px 6px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
td.c, th.c { text-align: center; }
tr.groupe td { background: var(--fond); font-weight: 600; padding-top: 14px; }
tr.off td { color: var(--discret); }
tr.off td.nom { text-decoration: line-through; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--fond); color: var(--discret); }
.lots { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.lots label { display: flex; gap: 6px; align-items: center; }
.defile { overflow-x: auto; }
.onglets { display: flex; gap: 4px; }
.onglets button { border-color: transparent; }
.onglets button.actif, .pastilles button.actif { background: var(--accent-fond); color: var(--accent); border-color: var(--accent); }
.pastilles { display: flex; gap: 6px; flex-wrap: wrap; }
.pastilles button { height: 34px; font-size: 14px; }
.ligne-champs { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pastille-espace { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
td input.qte { width: 72px; height: 32px; text-align: right; padding: 0 8px; }
td input.qte.force { border-color: #ba7517; background: #faeeda; color: #633806; }
td input.pct { width: 64px; height: 32px; text-align: right; padding: 0 6px; }
td.ferme { color: var(--discret); font-size: 12px; text-align: center; }
tr.regle td { background: var(--fond); }
.petit { height: 30px; padding: 0 10px; font-size: 13px; }
.pastilles.grosses button { height: 42px; font-size: 16px; padding: 0 18px; }
