/* ===================================================================
   Food Truck — feuille de style commune
   =================================================================== */

:root {
    --orange: #e8590c;
    --orange-clair: #fd7e14;
    --orange-pale: #fff4ec;
    --sombre: #1f2328;
    --gris: #6b7280;
    --gris-clair: #f3f4f6;
    --bord: #e5e7eb;
    --blanc: #ffffff;
    --vert: #16a34a;
    --vert-pale: #dcfce7;
    --rouge: #dc2626;
    --rouge-pale: #fee2e2;
    --ambre: #d97706;
    --ambre-pale: #fef3c7;
    --bleu: #2563eb;
    --bleu-pale: #dbeafe;
    --radius: 12px;
    --ombre: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; }

/*
   L'attribut « hidden » ne pose qu'un « display: none » de feuille utilisateur,
   que la moindre règle d'auteur emporte. Une classe qui déclare « display: flex »
   rend donc visible un élément qu'on croyait masqué — c'est ce qui faisait
   imprimer un cadre QR vide et la mention « Wi-Fi gratuit » sur l'affiche alors
   que la case n'était pas cochée. On rend l'attribut incontestable.
*/
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--sombre);
    background: var(--gris-clair);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; line-height: 1.5; }
a { color: var(--orange); }

/* ---------- Mise en page ---------- */

.entete {
    background: var(--sombre);
    color: var(--blanc);
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.entete h1 { margin: 0; font-size: 1.15rem; }
.entete .sous { font-size: .8rem; color: #9ca3af; }
.entete nav { margin-left: auto; display: flex; gap: .35rem; flex-wrap: wrap; }
.entete nav a, .entete nav button {
    color: #d1d5db; background: transparent; border: 1px solid #374151;
    padding: .4rem .7rem; border-radius: 8px; font-size: .85rem;
    text-decoration: none; cursor: pointer;
}
.entete nav a.actif, .entete nav button.actif { background: var(--orange); color: #fff; border-color: var(--orange); }

.conteneur { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.conteneur.etroit { max-width: 720px; }

/* ---------- Cartes ---------- */

.carte {
    background: var(--blanc);
    border-radius: var(--radius);
    box-shadow: var(--ombre);
    padding: 1rem;
    margin-bottom: 1rem;
}
.carte h2 { display: flex; align-items: center; gap: .5rem; }

.grille { display: grid; gap: .75rem; }
.grille.c2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grille.c3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grille.c4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- Boutons ---------- */

button, .btn {
    font: inherit;
    border: 1px solid var(--bord);
    background: var(--blanc);
    color: var(--sombre);
    padding: .6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    text-decoration: none;
    transition: filter .12s, background .12s;
    touch-action: manipulation;
}
button:hover:not(:disabled), .btn:hover { filter: brightness(.97); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }

.btn-principal { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
.btn-vert   { background: var(--vert);  border-color: var(--vert);  color: #fff; }
.btn-rouge  { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn-bleu   { background: var(--bleu);  border-color: var(--bleu);  color: #fff; }
.btn-bloc   { width: 100%; }
.btn-large  { padding: .9rem 1.2rem; font-size: 1.05rem; }
.btn-petit  { padding: .35rem .6rem; font-size: .8rem; border-radius: 8px; }

/* ---------- Formulaires ---------- */

label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; color: #374151; }
input, select, textarea {
    font: inherit; width: 100%; padding: .55rem .7rem;
    border: 1px solid var(--bord); border-radius: 9px; background: var(--blanc); color: var(--sombre);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange-clair); outline-offset: -1px; }
.champ { margin-bottom: .75rem; }
.ligne-champs { display: flex; gap: .6rem; flex-wrap: wrap; }
.ligne-champs > * { flex: 1 1 140px; }

/* ---------- Tableaux ---------- */

.tableau-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .5rem .6rem; text-align: left; border-bottom: 1px solid var(--bord); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--gris); background: #fafafa; }
tbody tr:hover { background: var(--orange-pale); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Badges ---------- */

.badge {
    display: inline-block; padding: .15rem .55rem; border-radius: 999px;
    font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.badge.vert   { background: var(--vert-pale);  color: #14532d; }
.badge.rouge  { background: var(--rouge-pale); color: #7f1d1d; }
.badge.ambre  { background: var(--ambre-pale); color: #78350f; }
.badge.bleu   { background: var(--bleu-pale);  color: #1e3a8a; }
.badge.gris   { background: var(--gris-clair); color: var(--gris); }

/* ---------- Divers ---------- */

.muted { color: var(--gris); font-size: .875rem; }
.centre { text-align: center; }
.entre { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.pile { display: flex; flex-direction: column; gap: .5rem; }
.rangee { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.gros { font-size: 1.8rem; font-weight: 700; line-height: 1.1; }

.alerte { padding: .7rem .9rem; border-radius: 10px; margin-bottom: .75rem; font-size: .9rem; }
.alerte.erreur  { background: var(--rouge-pale); color: #7f1d1d; }
.alerte.succes  { background: var(--vert-pale);  color: #14532d; }
.alerte.info    { background: var(--bleu-pale);  color: #1e3a8a; }
.alerte.attention { background: var(--ambre-pale); color: #78350f; }

.vide { text-align: center; color: var(--gris); padding: 2rem 1rem; }

/* ---------- Toast ---------- */

#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 999;
          display: flex; flex-direction: column; gap: .5rem; width: min(420px, 92vw); }
.toast { padding: .75rem 1rem; border-radius: 10px; color: #fff; background: var(--sombre);
         box-shadow: var(--ombre); font-size: .9rem; animation: monte .2s ease; }
.toast.erreur { background: var(--rouge); }
.toast.succes { background: var(--vert); }
@keyframes monte { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Modale ---------- */

.modale-fond {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .5);
    display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 200;
}
.modale {
    background: var(--blanc); border-radius: var(--radius); padding: 1.25rem;
    width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--ombre);
}

@media print {
    .entete, nav, button, .no-print { display: none !important; }
    body { background: #fff; }
}
