/* Gestion Bar — feuille de style unique, sans outil de compilation. Pensée d'abord pour le téléphone. */
:root {
  --encre: #1d2433;        /* texte */
  --encre-2: #5b6474;      /* texte secondaire */
  --fond: #f4f2ee;         /* fond de page, papier chaud */
  --carte: #ffffff;
  --trait: #e2ded6;
  --ambre: #b8661a;        /* accent : la bière, l'étiquette */
  --ambre-clair: #fbeee0;
  --vert: #2f7d4f;  --vert-clair: #e6f3eb;
  --rouge: #b3362f; --rouge-clair: #fbe9e7;
  --rayon: 10px;
  --ombre: 0 1px 2px rgba(29, 36, 51, .06), 0 2px 8px rgba(29, 36, 51, .04);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--encre);
  background: var(--fond);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; font-size: 16px; }
a { color: var(--ambre); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* En-tête */
.entete { background: var(--encre); color: #fff; padding-block: 10px; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.entete .marque { font-weight: 700; letter-spacing: .02em; color: #fff; text-decoration: none; margin-right: auto; }
.entete .marque span { color: #f2b56b; }
.entete .qui { font-size: 14px; opacity: .85; }
.entete form { margin: 0; }
.entete button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; padding: 6px 10px; font-size: 14px; cursor: pointer; }

.page { max-width: 1000px; margin: 0 auto; padding-block: 20px 48px; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 16px; align-content: start; }
h1 { font-size: 22px; margin: 0; line-height: 1.25; text-wrap: balance; }
h2 { font-size: 17px; margin: 0 0 10px; }
.sous-titre { color: var(--encre-2); margin: 2px 0 0; font-size: 15px; }
.fil { font-size: 14px; }

/* Cartes et grilles */
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); min-width: 0; }
.grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.ligne { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ligne.entre { justify-content: space-between; }

/* Menu principal : défile horizontalement au téléphone */
.menu { background: #2a3245; display: flex; gap: 2px; overflow-x: auto; padding-inline: max(12px, env(safe-area-inset-left, 0px)) max(12px, env(safe-area-inset-right, 0px)); scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu a { color: rgba(255,255,255,.78); text-decoration: none; padding: 10px 12px; font-size: 15px; white-space: nowrap; border-bottom: 3px solid transparent; }
.menu a:hover { color: #fff; }
.menu a.actif { color: #fff; border-bottom-color: #f2b56b; font-weight: 600; }
.inactif td { color: var(--encre-2); }
.inactif td:first-child { text-decoration: line-through; }

/* Chiffres clés */
.chiffres { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.chiffre { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); padding: 12px; }
.chiffre .lib { font-size: 13px; color: var(--encre-2); }
.chiffre .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.chiffre.fort { background: var(--encre); color: #fff; border-color: var(--encre); }
.chiffre.fort .lib { color: rgba(255,255,255,.75); }

/* Pastilles d'état */
.pastille { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; letter-spacing: .02em; }
.pastille.ouverte { background: var(--vert-clair); color: var(--vert); }
.pastille.cloturee { background: #e8eaef; color: var(--encre-2); }
.pastille.absente { background: var(--ambre-clair); color: var(--ambre); }

/* Messages */
.message { border-radius: var(--rayon); padding: 12px 14px; font-size: 15px; }
.message.ok { background: var(--vert-clair); color: #1f5a37; border: 1px solid #bfdfca; }
.message.erreur { background: var(--rouge-clair); color: #7d221d; border: 1px solid #f0c4bf; }
.message ul { margin: 0; padding-left: 18px; }

/* Formulaires */
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 0 12px; border: 1px solid #cfc9be; border-radius: 8px; background: #fff; color: var(--encre); height: 44px; line-height: normal; }
textarea { height: auto; min-height: 88px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(184, 102, 26, .25); border-color: var(--ambre); }
input[type=checkbox] { width: 18px; height: 18px; padding: 0; accent-color: var(--ambre); flex: none; }
.champ { display: grid; gap: 4px; min-width: 0; align-content: start; }
.champs { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); align-items: start; }
fieldset.champs { margin: 0; }
form.carte, form.contenu { max-width: 100%; }
.aide { font-size: 13px; color: var(--encre-2); line-height: 1.35; }
.case { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 0; cursor: pointer; }

.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--ambre); color: #fff; }
.bouton:hover { filter: brightness(.95); }
.bouton:focus-visible { outline: 3px solid rgba(184, 102, 26, .35); outline-offset: 2px; }
.bouton.second { background: #fff; color: var(--encre); border-color: #cfc9be; }
.bouton.sombre { background: var(--encre); }
.bouton.large { width: 100%; }

/* Sections repliables (opérations de la journée) */
details.carte { padding: 0; }
details.carte > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.carte > summary::-webkit-details-marker { display: none; }
details.carte > summary::after { content: "+"; font-size: 20px; color: var(--ambre); }
details.carte[open] > summary::after { content: "−"; }
details.carte > .contenu { padding: 0 16px 16px; display: grid; gap: 12px; }

/* Tableaux */
.tableau { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--trait); vertical-align: middle; }
th { font-size: 13px; color: var(--encre-2); font-weight: 600; }
td.d, th.d { text-align: right; }
tr.total td { font-weight: 700; border-top: 2px solid var(--encre); }
.vide { color: var(--encre-2); font-size: 14px; }

/* Comptage : une ligne par boisson, lisible au téléphone */
.comptage td input { min-width: 70px; max-width: 110px; text-align: right; height: 40px; }
.comptage tr.compte td:first-child { box-shadow: inset 3px 0 0 var(--vert); }
.ecart-neg { color: var(--rouge); font-weight: 700; }
.ecart-pos { color: var(--vert); font-weight: 700; }

/* Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.connexion .carte { width: 100%; max-width: 380px; display: grid; gap: 14px; }

@media (min-width: 720px) {
  h1 { font-size: 26px; }
  .page { padding-top: 24px; }
}
@media print {
  .entete, .bouton, details.carte > summary::after { display: none; }
}
