/* Dépôt des Pantacruels : lisible sur téléphone d'abord, confortable sur écran. */
:root {
    /* Palette de l'affiche du festival : bleu nuit, rose magenta, jaune, cyan. */
    --nuit: #1c1f5e;
    --nuit-fonce: #0f1237;
    --rose: #e5007d;
    --rose-fonce: #b40062;
    --rose-clair: #fde4f1;
    --jaune: #f8e600;
    --jaune-clair: #fff9c2;
    --cyan: #2ec4ea;
    --cyan-clair: #e0f5fb;
    /* Les noms « vert » restent pour la compatibilite des regles : ils portent la couleur d action. */
    --vert: #e5007d;
    --vert-fonce: #b40062;
    --vert-clair: #fde4f1;
    --ambre: #94540a; /* assez foncé pour être lu sur fond orange clair (contraste ≥ 5:1) */
    --ambre-clair: #fdf1e0;
    --rouge: #b3261e;
    --rouge-clair: #fbe9e7;
    --bleu-clair: #e0f5fb;
    --fond: #f3f3f8;
    --carte: #ffffff;
    --texte: #16183a;
    --discret: #5a5d7c; /* lisible aussi sur les fonds colorés (≥ 5:1) */
    --bordure: #d9dae8;
    --rayon: 10px;
    --ombre: 0 1px 2px rgba(0, 0, 0, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: var(--texte);
    background: var(--fond);
}
a { color: var(--rose-fonce); }
h1 { font-size: 1.5rem; margin: 0 0 .5rem; line-height: 1.25; color: var(--nuit); }
h2 { font-size: 1.1rem; margin: 1.2rem 0 .6rem; }
h2:first-child { margin-top: 0; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code { background: var(--fond); padding: .05em .35em; border-radius: 4px; font-size: .95em; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.discret { color: var(--discret); font-weight: normal; font-size: .92em; }
.rouge { color: var(--rouge); }
.orange { color: var(--ambre); }
.ok { color: #0e6f8c; font-weight: 600; }
.aide { color: var(--discret); font-size: .9rem; margin: .4rem 0 0; }
.fil { font-size: .9rem; color: var(--discret); margin: 0 0 .3rem; }
.estompe { opacity: .45; }

/* --- En-tête et navigation ------------------------------------------------ */
.entete {
    background: linear-gradient(90deg, var(--nuit) 0%, var(--nuit-fonce) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .6rem 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.marque { color: #fff; text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.marque strong { font-weight: 700; }
.marque-pictogramme { opacity: .8; margin-right: .15rem; }
.nav-haut { display: none; gap: .2rem; flex: 1; }
.nav-haut a { color: #fff; text-decoration: none; padding: .45rem .8rem; border-radius: 6px; opacity: .85; }
.nav-haut a:hover { background: rgba(255, 255, 255, .12); opacity: 1; }
.nav-haut a.actif { background: rgba(255, 255, 255, .12); opacity: 1; box-shadow: inset 0 -3px 0 var(--jaune); }
.menu-compte { margin-left: auto; position: relative; }
.menu-compte summary { cursor: pointer; list-style: none; padding: .4rem .6rem; border-radius: 6px; white-space: nowrap; }
.menu-compte summary::-webkit-details-marker { display: none; }
.menu-compte[open] summary { background: rgba(255, 255, 255, .16); }
.menu-compte-liste {
    position: absolute; right: 0; top: 100%; margin-top: .3rem;
    background: var(--carte); color: var(--texte); border-radius: var(--rayon);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .18); min-width: 200px; padding: .4rem 0; z-index: 30;
}
.menu-compte-liste a, .menu-compte-liste button.lien { display: block; width: 100%; text-align: left; padding: .55rem 1rem; color: var(--texte); text-decoration: none; }
.menu-compte-liste a:hover, .menu-compte-liste button.lien:hover { background: var(--fond); }
.nav-bas {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
    display: flex; background: var(--carte); border-top: 1px solid var(--bordure);
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-bas a { flex: 1; text-align: center; padding: .7rem .2rem; font-size: .95rem; color: var(--discret); text-decoration: none; }
.nav-bas { background: var(--nuit); border-top: 0; }
.nav-bas a { color: rgba(255, 255, 255, .7); }
.nav-bas a.actif { color: var(--jaune); font-weight: 700; border-top: 3px solid var(--jaune); margin-top: -1px; }
.contenu { padding: 1rem; padding-bottom: 5rem; max-width: 1100px; margin: 0 auto; }
@media (min-width: 900px) {
    .nav-haut { display: flex; }
    .nav-bas { display: none; }
    .contenu { padding: 1.5rem 2rem 3rem; }
}

/* --- Cartes, tuiles, titres ------------------------------------------------ */
.carte {
    background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre);
    padding: 1rem; margin-bottom: 1rem;
}
.carte-etroite { max-width: 560px; }
.connexion { margin: 3rem auto; }
.titre-page { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; }
.titre-page h1 { flex: 1 1 auto; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.deux-colonnes { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .deux-colonnes { grid-template-columns: 1fr 1fr; align-items: start; } }
.tuiles { display: grid; gap: .7rem; grid-template-columns: repeat(2, 1fr); margin-bottom: 1rem; }
@media (min-width: 700px) { .tuiles { grid-template-columns: repeat(4, 1fr); } }
.tuiles-compactes { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tuile {
    display: flex; flex-direction: column; gap: .15rem; text-decoration: none; color: var(--texte);
    background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: .9rem 1rem;
    border-left: 5px solid var(--bordure);
}
.tuile-chiffre { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.tuile-libelle { font-size: .85rem; color: var(--discret); }
.tuile-alerte { border-left-color: var(--ambre); background: var(--ambre-clair); }
.tuile-ok { border-left-color: var(--cyan); }
.tuile-info { border-left-color: var(--cyan); background: var(--cyan-clair); }
.tuiles-compactes .tuile { background: var(--fond); box-shadow: none; }

/* --- Listes et badges ------------------------------------------------------- */
.liste { list-style: none; padding: 0; margin: 0; }
.liste li { padding: .45rem 0; border-bottom: 1px solid var(--bordure); display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; }
.liste li:last-child { border-bottom: 0; }
.liste-journal .qte { min-width: 3ch; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.qte.pos { color: #0e6f8c; }
.qte.neg { color: var(--rouge); }
.badge {
    display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px;
    background: var(--fond); color: var(--discret); vertical-align: middle; white-space: nowrap;
}
.badge-materiel { background: var(--cyan-clair); color: #0e6f8c; }
.badge-consommable { background: var(--vert-clair); color: var(--vert-fonce); }
.badge-rouge { background: var(--rouge-clair); color: var(--rouge); }
.badge-orange { background: var(--ambre-clair); color: var(--ambre); }
.badge-info { background: var(--cyan-clair); color: #0e6f8c; }
.badge-pret { background: var(--vert-clair); color: var(--vert-fonce); }
.badge-location { background: var(--jaune-clair); color: #6b5f00; }
.badge-manifestation { background: #e4e5f5; color: var(--nuit); }

/* --- Messages --------------------------------------------------------------- */
.flash { padding: .7rem 1rem; border-radius: var(--rayon); margin-bottom: 1rem; border-left: 5px solid var(--vert); background: var(--vert-clair); }
.flash-erreur { border-left-color: var(--rouge); background: var(--rouge-clair); }
.flash-info { border-left-color: var(--cyan); background: var(--cyan-clair); }
.erreur-champ { display: block; color: var(--rouge); font-size: .85rem; font-weight: normal; }

/* --- Boutons ---------------------------------------------------------------- */
.bouton {
    display: inline-block; padding: .55rem .95rem; border-radius: 8px; border: 1px solid var(--bordure);
    background: var(--carte); color: var(--texte); font: inherit; font-weight: 600; text-decoration: none;
    cursor: pointer; line-height: 1.2; min-height: 42px; text-align: center;
}
.bouton:hover { background: var(--fond); }
.bouton:disabled { opacity: .45; cursor: not-allowed; }
.bouton-principal { background: var(--vert); border-color: var(--vert); color: #fff; }
.bouton-principal:hover { background: var(--vert-fonce); }
.bouton-danger { background: var(--rouge-clair); border-color: #e7b7b2; color: var(--rouge); }
.bouton-discret { background: transparent; }
.bouton-large { width: 100%; padding: .8rem 1rem; }
.bouton-plus { background: var(--cyan-clair); border-color: #9fdcee; color: #0e6f8c; }
.bouton-moins { background: var(--jaune-clair); border-color: #e6d76a; color: #6b5f00; }
button.lien { background: none; border: 0; padding: 0; color: var(--vert); font: inherit; cursor: pointer; text-decoration: underline; }
button.lien.rouge { color: var(--rouge); }
.inline { display: inline; }

/* --- Formulaires ------------------------------------------------------------ */
label { display: block; font-weight: 600; margin-bottom: .8rem; font-size: .95rem; }
label .aide { font-weight: normal; }
input[type="text"], input[type="search"], input[type="password"], input[type="email"], input[type="date"],
input[type="number"], input[type="tel"], input[type="url"], input[type="time"], select, textarea {
    display: block; width: 100%; margin-top: .25rem; padding: .6rem .7rem; font: inherit;
    border: 1px solid var(--bordure); border-radius: 8px; background: #fff; color: var(--texte); min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--vert); outline-offset: 1px; border-color: var(--vert); }
textarea { resize: vertical; }
.champ-quantite { max-width: 160px; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.case { display: inline-flex; align-items: center; gap: .4rem; font-weight: normal; margin: 0; }
.case input { width: 1.2rem; height: 1.2rem; }
.radio { display: flex; align-items: flex-start; gap: .5rem; font-weight: normal; padding: .5rem .6rem; border: 1px solid var(--bordure); border-radius: 8px; margin-bottom: .5rem; }
.radio input { margin-top: .3rem; width: 1.2rem; height: 1.2rem; flex: none; }
.radio:has(input:checked) { border-color: var(--vert); background: var(--vert-clair); }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 600; margin-bottom: .4rem; }
.grille-2, .grille-3 { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grille-2 { grid-template-columns: 1fr 1fr; } .grille-3 { grid-template-columns: 1fr 1fr 1fr; } }
.actions-form { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.actions-form .bouton-large { width: auto; flex: 1 1 220px; }
.formulaire-ligne { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; }
.formulaire-ligne label { margin-bottom: 0; flex: 1 1 160px; }
.formulaire-ligne label.grandit { flex: 3 1 260px; }
.formulaire-ligne .bouton { min-height: 44px; }
.filtres { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filtres input[type="search"] { flex: 2 1 220px; margin: 0; }
.filtres select, .filtres input[type="date"] { flex: 1 1 160px; margin: 0; width: auto; }
.filtres label { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: normal; }
.filtres label input { margin: 0; }
.boutons-mouvement { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .3rem; }
.boutons-mouvement .bouton { flex: 1 1 120px; min-height: 48px; font-size: 1.05rem; }
.formulaire-mouvement .champ-quantite { font-size: 1.4rem; }
.zone-danger { margin-top: 1.5rem; border-top: 1px solid var(--bordure); padding-top: .8rem; }
.zone-danger summary { cursor: pointer; color: var(--rouge); font-weight: 600; }
.menu-actions summary { cursor: pointer; list-style: none; display: inline-block; }
.menu-actions summary::-webkit-details-marker { display: none; }
.menu-actions-liste { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; padding: .6rem; background: var(--fond); border-radius: 8px; min-width: 240px; }
.menu-actions-liste .formulaire-ligne input { min-width: 0; }
.onglets { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1rem; align-items: center; }
.onglets a { padding: .45rem .8rem; border-radius: 999px; text-decoration: none; color: var(--texte); background: var(--carte); border: 1px solid var(--bordure); font-size: .92rem; }
.onglets a.actif { background: var(--vert); border-color: var(--vert); color: #fff; }
.onglets-filtre { display: flex; flex-wrap: wrap; gap: .3rem; margin-left: auto; }
.onglets-filtre a { font-size: .85rem; padding: .35rem .7rem; }

/* --- Tableaux --------------------------------------------------------------- */
.carte-tableau { padding: .6rem 0 .6rem; }
.carte-tableau > h2, .carte-tableau > h3, .carte-tableau > p, .carte-tableau > form { margin-left: 1rem; margin-right: 1rem; }
.defilement { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tableau th, .tableau td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.tableau th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--discret); font-weight: 600; }
.tableau th:first-child, .tableau td:first-child { padding-left: 1rem; }
.tableau th:last-child, .tableau td:last-child { padding-right: 1rem; }
.tableau tfoot th { text-transform: none; font-size: 1rem; color: var(--texte); }
.tableau .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau tr.etat-alerte { background: var(--ambre-clair); }
.tableau tr.etat-rupture { background: var(--rouge-clair); }
.tableau tr.inactif { opacity: .6; }
.nom-article { font-weight: 600; text-decoration: none; color: var(--texte); }
.nom-article:hover { text-decoration: underline; }
.stock { font-size: 1.1rem; }
.mouvement-rapide { display: inline-flex; align-items: center; gap: .25rem; }
.mouvement-rapide input { width: 4.2rem; min-height: 40px; margin: 0; padding: .3rem; text-align: center; font-size: 1.05rem; }
.mouvement-rapide .bouton { min-height: 40px; min-width: 42px; padding: .3rem .6rem; font-size: 1.15rem; }
.actions-rapides { white-space: nowrap; }
.tableau-lignes .actions-rapides form.inline { margin-left: .4rem; }
@media (max-width: 640px) {
    .cache-mobile { display: none; }
    .tableau th, .tableau td { padding: .5rem .4rem; }
    .tableau th:first-child, .tableau td:first-child { padding-left: .7rem; }
    .tableau th:last-child, .tableau td:last-child { padding-right: .5rem; }
    .tableau-stock .num .discret { display: block; font-size: .78rem; }
    .mouvement-rapide { gap: .15rem; }
    .mouvement-rapide input { width: 3rem; min-height: 38px; font-size: 1rem; }
    .mouvement-rapide .bouton { min-width: 38px; min-height: 38px; padding: .2rem .4rem; font-size: 1.1rem; }
    .actions-rapides { white-space: normal; }
    .tableau-lignes .actions-rapides form.inline { display: block; margin: .2rem 0 0; }
}

/* --- Fiche article ---------------------------------------------------------- */
.fiche-stock { border-left: 6px solid var(--cyan); }
.fiche-stock.etat-alerte { border-left-color: var(--ambre); }
.fiche-stock.etat-rupture { border-left-color: var(--rouge); }
.stock-gros { display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem .6rem; margin-bottom: .8rem; }
.stock-nombre { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.stock-unite { font-size: 1rem; color: var(--discret); }
.details { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: .3rem .8rem; margin: 0; }
.details dt { color: var(--discret); font-size: .9rem; }
.details dd { margin: 0; }

/* --- Sorties ---------------------------------------------------------------- */
.cartes-sorties { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .cartes-sorties { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.carte-sortie { display: flex; flex-direction: column; gap: .25rem; text-decoration: none; color: var(--texte); border-left: 5px solid var(--nuit); margin: 0; }
.carte-sortie:hover { box-shadow: 0 3px 12px rgba(0, 0, 0, .12); }
.carte-sortie.retard { border-left-color: var(--rouge); }
.carte-sortie.cloturee { border-left-color: var(--bordure); opacity: .85; }
.carte-sortie-tete { display: flex; gap: .4rem; flex-wrap: wrap; }
.carte-sortie-titre { font-size: 1.05rem; }
.bilan .details { margin-top: .6rem; }

/* --- Contenu d'une unite et unite entamee ----------------------------------- */
.sous-compte { display: block; font-size: .78rem; color: var(--discret); white-space: normal; }
.contenu-estime { margin: 0 0 .8rem; font-size: 1.05rem; }
.contenu-unite { border: 1px solid var(--bordure); border-radius: var(--rayon); padding: .8rem 1rem .4rem; margin-bottom: 1rem; }
.contenu-unite legend { padding: 0 .4rem; }
.contenu-unite .formulaire-ligne label { flex: 1 1 200px; }
.niveaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .4rem; margin-bottom: .6rem; }
.radio-compact { margin-bottom: 0; padding: .45rem .6rem; }
#unite-autre { margin-top: .4rem; }

/* L attribut hidden doit gagner sur les regles d affichage des champs. */
[hidden] { display: none !important; }

/* --- Page de connexion : le bleu nuit de l'affiche ------------------------- */
body.anonyme { background: linear-gradient(180deg, var(--nuit) 0%, var(--nuit-fonce) 100%); min-height: 100vh; }
body.anonyme .connexion h1 { color: var(--nuit); }
body.anonyme .connexion { border-top: 6px solid var(--rose); }
.marque strong { color: var(--jaune); }

/* --- Gestion du site public ---------------------------------------------------- */
.onglets-site { background: var(--carte); border-radius: var(--rayon); padding: .5rem .8rem; box-shadow: var(--ombre); }
.onglets-titre { font-weight: 700; color: var(--nuit); margin-right: .4rem; }
.onglets-externe { margin-left: auto; }
.editeur { font-family: ui-monospace, Consolas, monospace; font-size: .95rem; line-height: 1.5; }
.aide-notation { margin: -.4rem 0 1rem; font-size: .9rem; color: var(--discret); }
.aide-notation summary { cursor: pointer; color: var(--rose-fonce); font-weight: 600; }
.aide-notation ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.apercu-image { max-width: 240px; max-height: 160px; border-radius: 8px; margin: .5rem 0; border: 1px solid var(--bordure); }
.logo-mini { display: inline-block; height: 28px; width: auto; vertical-align: middle; margin-right: .3rem; border-radius: 4px; }
.images-grille { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin-bottom: .8rem; }
.image-item { background: var(--fond); border-radius: 8px; padding: .5rem; }
.image-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.image-item input[type="text"] { margin-top: .4rem; min-height: 36px; padding: .3rem .5rem; font-size: .9rem; }
.image-item .case { margin-top: .3rem; font-size: .85rem; }
input[type="file"] { display: block; margin-top: .3rem; }

/* ==========================================================================
   Le depot : gros chiffres, photos, boutons larges. A comprendre sans mode
   d emploi, utilisable au depot avec un telephone dans une main.
   ========================================================================== */
.vert { color: #0e6f8c; }
.barre-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.barre-actions .bouton-large { width: auto; flex: 1 1 auto; min-width: 220px; }
.recherche-stock { display: flex; gap: .5rem; margin-bottom: 1rem; }
.recherche-stock input { margin: 0; font-size: 1.05rem; }
.onglets-categories { margin-bottom: 1.2rem; }
.titre-categorie { font-size: 1.15rem; margin: 1.6rem 0 .6rem; color: var(--nuit); }

.grille-articles { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: .7rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grille-articles { grid-template-columns: 1fr 1fr; } }
.fiche-article {
    display: flex; align-items: stretch; gap: .6rem; background: var(--carte);
    border: 1px solid var(--bordure); border-left: 6px solid var(--cyan); border-radius: var(--rayon);
    box-shadow: var(--ombre); overflow: hidden;
}
.fiche-article.etat-alerte { border-left-color: var(--ambre); background: #fffdf7; }
.fiche-article.etat-rupture { border-left-color: var(--rouge); background: #fff8f7; }
.fiche-article-haut { display: flex; align-items: center; gap: .7rem; flex: 1 1 auto; min-width: 0; padding: .6rem; text-decoration: none; color: var(--texte); }
.fiche-article-haut:hover { background: var(--fond); }
.vignette { flex: none; width: 62px; height: 62px; border-radius: 8px; overflow: hidden; background: var(--fond); display: flex; align-items: center; justify-content: center; }
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.vignette-vide { font-size: 1.7rem; opacity: .55; }
.fiche-article-texte { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.fiche-article-nom { font-size: 1.02rem; line-height: 1.25; }
.fiche-article-detail { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .85rem; }
.pastille { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--fond); color: var(--discret); }
.pastille-rouge { background: var(--rouge-clair); color: var(--rouge); }
.pastille-orange { background: var(--ambre-clair); color: var(--ambre); }
.pastille-bleue { background: var(--cyan-clair); color: #0e6f8c; }
.pastille-verte { background: var(--vert-clair); color: var(--rose-fonce); }

.compteur { flex: none; display: flex; align-items: stretch; border-left: 1px solid var(--bordure); }
.compteur .bouton { border: 0; border-radius: 0; min-width: 54px; font-size: 1.6rem; font-weight: 700; padding: 0 .5rem; }
.compteur-milieu { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 62px; padding: 0 .2rem; }
.compteur-nombre { font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.compteur-unite { font-size: .7rem; color: var(--discret); }
.compteur-inactif { padding: 0 1rem; align-items: center; color: var(--discret); }

.tete-article { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.tete-article h1 { margin: 0 0 .2rem; }
.photo-article { width: 120px; height: 120px; object-fit: cover; border-radius: var(--rayon); border: 1px solid var(--bordure); }
.sous-titre-article { margin: 0; color: var(--discret); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.carte-principale { border-left: 6px solid var(--cyan); }
.carte-principale.etat-alerte { border-left-color: var(--ambre); }
.carte-principale.etat-rupture { border-left-color: var(--rouge); }
.compte-gros { display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .2rem; }
.compte-gros-nombre { font-size: 3.2rem; font-weight: 800; line-height: 1; }
.compte-gros-unite { font-size: 1.1rem; color: var(--discret); }
.mot-etat { margin: .2rem 0; font-size: 1.02rem; }
.bloc-compter { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--bordure); }
.label-compter { font-size: 1.05rem; font-weight: 700; display: block; margin-bottom: .2rem; }
.champ-compter { width: 7rem; font-size: 1.6rem; text-align: center; font-variant-numeric: tabular-nums; min-height: 56px; }
.boutons-compter { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 .6rem; }
.bouton-geant { min-height: 58px; font-size: 1.05rem; flex: 1 1 180px; }
.ligne-motif { margin-top: .4rem; font-weight: normal; }
.historique { list-style: none; margin: 0; padding: 0; }
.historique li { display: flex; gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--bordure); align-items: baseline; }
.historique li:last-child { border-bottom: 0; }
.historique-qte { flex: none; min-width: 4.5ch; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.historique-qte.pos { color: #0e6f8c; }
.historique-qte.neg { color: var(--rouge); }
.historique-texte { display: flex; flex-direction: column; }
.repli { margin-top: 1rem; border-top: 1px solid var(--bordure); padding-top: .7rem; }
.repli > summary { cursor: pointer; font-weight: 600; color: var(--rose-fonce); padding: .4rem 0; min-height: 44px; display: flex; align-items: center; }
.repli.zone-danger > summary { color: var(--rouge); }
.label-grand { font-size: 1.05rem; }
.label-grand input { font-size: 1.1rem; }
.case-grande { font-size: 1.02rem; padding: .6rem; background: var(--fond); border-radius: 8px; align-items: flex-start; }
.bloc-location { border: 2px solid var(--cyan-clair); border-radius: var(--rayon); padding: .9rem 1rem .3rem; margin-bottom: 1rem; }
.bloc-location legend { color: #0e6f8c; font-weight: 700; padding: 0 .4rem; }

.liste-location { list-style: none; margin: 0; padding: 0; }
.liste-location li { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; padding: .7rem 0; border-bottom: 1px solid var(--bordure); }
.liste-location li:last-child { border-bottom: 0; }
.liste-location .en-ligne { background: linear-gradient(90deg, var(--cyan-clair), transparent 60%); }
.liste-location-texte { flex: 1 1 220px; display: flex; flex-direction: column; gap: .15rem; }
.liste-location-actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.suggestions { display: flex; flex-wrap: wrap; gap: .5rem; }
.liste-conseils { padding-left: 1.2rem; }
.liste-conseils li { margin-bottom: .5rem; }

@media (max-width: 640px) {
    .tableau.empilable, .tableau.empilable thead, .tableau.empilable tbody,
    .tableau.empilable tr, .tableau.empilable th, .tableau.empilable td { display: block; }
    .tableau.empilable thead { display: none; }
    .tableau.empilable tr {
        background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon);
        margin: 0 .8rem .7rem; padding: .5rem .7rem;
    }
    .tableau.empilable td { border: 0; padding: .25rem 0; text-align: left !important; }
    .tableau.empilable td[data-libelle]::before {
        content: attr(data-libelle) " : "; font-weight: 700; color: var(--discret); font-size: .82rem;
    }
    .tableau.empilable td:empty { display: none; }
    .tableau.empilable tfoot tr { background: var(--fond); }
    .titre-page h1 { font-size: 1.35rem; }
}

/* Sur un petit telephone, la vignette et le compteur laissent la place au nom. */
@media (max-width: 430px) {
    .vignette { width: 50px; height: 50px; }
    .compteur .bouton { min-width: 46px; font-size: 1.4rem; }
    .compteur-milieu { min-width: 52px; }
    .compteur-nombre { font-size: 1.3rem; }
    .fiche-article-nom { font-size: .97rem; }
    .bouton-geant { flex: 1 1 100%; }
}

/* --- Espaces du back-office : sous-navigation et accueil ------------------------ */
.sous-nav { background: var(--carte); border-bottom: 1px solid var(--bordure); position: sticky; top: 52px; z-index: 15; }
.sous-nav-interieur { max-width: 1320px; margin: 0 auto; padding: .35rem 1rem; display: flex; flex-wrap: wrap; gap: .2rem; align-items: center; }
/* Sur téléphone, tous les onglets restent visibles : ils passent à la ligne au lieu de se cacher à droite. */
@media (max-width: 899px) { .sous-nav { position: static; } .sous-nav-titre { width: 100%; } .sous-nav a { padding: .5rem .6rem; background: var(--fond); } .sous-nav-externe { margin-left: 0; } }
.sous-nav-titre { font-weight: 800; color: var(--nuit); margin-right: .5rem; white-space: nowrap; }
.sous-nav a { white-space: nowrap; text-decoration: none; color: var(--texte); padding: .45rem .7rem; border-radius: 6px; font-size: .95rem; }
.sous-nav a:hover { background: var(--fond); }
.sous-nav a.actif { background: var(--rose-clair); color: var(--rose-fonce); font-weight: 700; }
.sous-nav-externe { margin-left: auto; color: var(--discret) !important; }
@media (min-width: 900px) { .sous-nav-interieur { padding: .35rem 2rem; } }
.espaces { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .espaces { grid-template-columns: 1fr 1fr; } }
.espace { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: var(--texte); background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 1.2rem 1.3rem; border-top: 6px solid var(--nuit); min-height: 11rem; }
.espace:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.espace-loto { border-top-color: var(--jaune); }
.espace-compta { border-top-color: var(--cyan); }
.espace-site { border-top-color: var(--rose); }
.espace-stock { border-top-color: var(--nuit); }
.espace-nom { font-size: 1.45rem; font-weight: 800; color: var(--nuit); }
.espace-texte { color: var(--discret); }
.espace-chiffres { display: flex; flex-wrap: wrap; gap: .4rem; }
.espace-chiffre { background: var(--fond); border-radius: 999px; padding: .25rem .8rem; font-size: 1rem; }
.espace-chiffre strong { font-variant-numeric: tabular-nums; }
.espace-alerte { background: var(--ambre-clair); color: var(--ambre); }
.espace-ouvrir { margin-top: auto; font-weight: 700; color: var(--rose-fonce); }
.acces-membre { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; border: 1px solid var(--bordure); border-radius: var(--rayon); padding: .5rem .7rem; margin: 0 0 .6rem; }
.acces-membre legend { font-weight: 600; padding: 0 .3rem; }

/* Grilles à deux colonnes : un tableau large défile dans sa carte au lieu d'élargir la page sur téléphone. */
.deux-colonnes > * { min-width: 0; }
.sous-nav a { font-size: 1rem; }

/* Lisibilité : rien d'utile en dessous de 16 px dans le back-office (bénévoles jusqu'à 75 ans). */
.compteur-unite, .tuile-libelle, .aide, .tableau th, .fiche-article-detail, dt, .onglets a { font-size: 1rem; }
.discret { font-size: 1rem; }
.badge, .pastille { font-size: .9rem; }
.tableau th { letter-spacing: .02em; }
