/* =========================================================================
   L'ESPACE DE DIRECTION D'ENSEIGNE (chaine_layout.html et chaine_*.html).
   Les composants viennent du socle (biopoint.css) ; cette feuille ne porte
   que les blocs propres a la direction, et chaque valeur vient d'un jeton.
   ========================================================================= */

/* Un bloc de page : une carte de niveau 1 (surface, filet, aucune ombre). */
.ch-bloc { border: 1px solid var(--bp-border); border-radius: var(--bp-r);
    background: var(--bp-surface); padding: var(--bp-3); margin-bottom: var(--bp-4); }
@media (min-width: 768px) { .ch-bloc { padding: var(--bp-4); } }
.ch-bloc h2 { font-size: var(--bp-fs-h2); font-weight: 600; color: var(--bp-text);
    display: flex; align-items: center; gap: var(--bp-2); margin: 0 0 var(--bp-2h);
    line-height: 1.3; text-wrap: balance; }
.ch-bloc h2 > i { font-size: 1.125rem; color: var(--bp-text-3); }
.ch-bloc h2 > a { color: var(--bp-text); }
.ch-bloc h2 > a:hover { color: var(--bp-primary-soft); }
.ch-note { font-size: var(--bp-fs-small); color: var(--bp-text-3); line-height: 1.5;
    margin: 0 0 var(--bp-3); max-width: 68ch; text-wrap: pretty; }
.ch-note strong { color: var(--bp-text-2); font-weight: 600; }

/* Les chiffres cles : libelle discret, chiffre tabulaire en --bp-text, contexte. */
.ch-chiffres { display: grid; gap: var(--bp-2h);
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: var(--bp-4); }
@media (max-width: 575.98px) { .ch-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ch-chiffre { background: var(--bp-surface); border: 1px solid var(--bp-border);
    border-radius: var(--bp-r); padding: var(--bp-3); min-width: 0; }
.ch-chiffre > span { display: block; font-size: var(--bp-fs-small); color: var(--bp-text-3);
    font-weight: 500; margin-bottom: var(--bp-1); }
.ch-chiffre > strong { font-size: var(--bp-fs-chiffre); font-weight: 600; color: var(--bp-text);
    display: block; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-chiffre strong.ch-chiffre-mot { font-size: var(--bp-fs-h3); letter-spacing: 0; white-space: normal; }
.ch-chiffre > em { font-style: normal; font-size: var(--bp-fs-small); color: var(--bp-text-3);
    display: block; margin-top: var(--bp-1); line-height: 1.45; }
@media (max-width: 575.98px) { .ch-chiffre > strong { font-size: 1.375rem; } }

/* Le regime du magasin : un mot, sur une pastille neutre. */
.ch-regime { display: inline-flex; align-items: center; gap: var(--bp-1);
    min-height: 22px; padding: 0 var(--bp-2); border-radius: var(--bp-r-pill);
    font-size: var(--bp-fs-micro); font-weight: 600; letter-spacing: .02em; white-space: nowrap;
    background: var(--bp-surface-3); color: var(--bp-text-2); }

/* L'etat de la saisie d'un magasin : un mot sur une pastille de sens. */
.ch-saisie { display: inline-flex; align-items: center; min-height: 22px; padding: 0 var(--bp-2);
    border-radius: var(--bp-r-pill); font-size: var(--bp-fs-micro); font-weight: 600;
    letter-spacing: .02em; white-space: nowrap; font-variant-numeric: tabular-nums;
    background: var(--bp-surface-3); color: var(--bp-text-2); }
.ch-saisie.complet { background: var(--bp-success-fond); color: var(--bp-success-soft); }
.ch-saisie.partiel { background: var(--bp-warning-fond); color: var(--bp-warning); }
.ch-saisie.faible { background: var(--bp-danger-fond); color: var(--bp-danger-soft); }

/* Les tableaux de la direction. */
.ch-table { width: 100%; border-collapse: collapse; font-size: var(--bp-fs-ui);
    font-variant-numeric: tabular-nums; }
.ch-table th { text-align: left; font-size: var(--bp-fs-micro); text-transform: uppercase;
    letter-spacing: .04em; color: var(--bp-text-3); font-weight: 600;
    padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--bp-border-strong); white-space: nowrap; }
.ch-table td { padding: 0.625rem 0.75rem; height: 44px; border-bottom: 1px solid var(--bp-border);
    color: var(--bp-text); vertical-align: middle; }
.ch-table tbody tr:last-child td { border-bottom: none; }
.ch-table .nombre { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-table th.ch-col-rang, .ch-table td.ch-col-rang { width: 1%; padding-right: 0; }
.ch-table .ch-libelle { color: var(--bp-text-3); width: 40%; }
.ch-table tr.ch-non-classe td { color: var(--bp-text-2); }
.ch-nom { color: var(--bp-text); font-weight: 600; display: inline-flex; align-items: center;
    min-height: 44px; }
.ch-nom:hover { color: var(--bp-primary-soft); }
.ch-sous { display: block; font-size: var(--bp-fs-small); color: var(--bp-text-3); line-height: 1.4; }
.ch-rang { display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%; font-size: var(--bp-fs-micro);
    font-weight: 600; background: var(--bp-surface-3); color: var(--bp-text-2); }
.ch-rang.or { background: var(--bp-text-2); color: var(--bp-bg); }
.ch-table td.carte-titre .ch-rang { margin-right: var(--bp-2); }
@media (max-width: 1199.98px) {
    .ch-table.table-cartes td.ch-col-rang { display: none; }
    .ch-table.table-cartes td { height: auto; }
    .ch-table.table-cartes td.carte-titre { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 var(--bp-2); }
    .ch-table.table-cartes td.carte-titre .ch-sous { flex-basis: 100%; }
    .ch-table.table-cartes .ch-nom { min-height: 44px; }
}

/* Les recettes jour par jour : une case par jour, le jour non saisi est un tiret. */
.ch-jours { display: grid; gap: var(--bp-1); grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.ch-jour { display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 44px; padding: var(--bp-1); border-radius: var(--bp-r-sm);
    font-size: var(--bp-fs-micro); line-height: 1.3; font-variant-numeric: tabular-nums;
    background: var(--bp-surface-2); border: 1px solid var(--bp-border); color: var(--bp-text-2); }
.ch-jour b { font-weight: 600; color: var(--bp-text); }
.ch-jour.non-saisi { background: transparent; border-style: dashed; border-color: var(--bp-border-strong);
    color: var(--bp-text-3); }
.ch-jour.non-saisi b { color: var(--bp-text-3); }

/* Un echange avec un magasin (fiche du magasin). */
.ch-echange { margin-bottom: var(--bp-2); padding: var(--bp-2h) var(--bp-3); border-radius: var(--bp-r-sm);
    background: var(--bp-surface-2); border: 1px solid var(--bp-border); }
.ch-echange-tete { display: flex; justify-content: space-between; gap: var(--bp-2);
    font-size: var(--bp-fs-small); margin-bottom: var(--bp-1); }
.ch-echange-tete strong { color: var(--bp-text); font-weight: 600; }
.ch-echange-tete span { color: var(--bp-text-3); white-space: nowrap; }
.ch-echange p { margin: 0; color: var(--bp-text-2); font-size: var(--bp-fs-ui); white-space: pre-wrap;
    overflow-wrap: anywhere; }

/* Un geste qui ne se defait pas (fermer, detacher) : le bloc le dit par son filet. */
.ch-bloc.ch-risque { border-color: rgba(var(--bp-danger-soft-rgb), .35); }
.ch-bloc.ch-risque h2 > i { color: var(--bp-danger-soft); }
.ch-bloc.ch-accord { border-color: rgba(var(--bp-success-soft-rgb), .35); }
.ch-bloc.ch-accord h2 > i { color: var(--bp-success-soft); }

/* Les gestes de la page : l'action principale seule, en tete. */
.ch-actions { display: flex; flex-wrap: wrap; gap: var(--bp-2); margin-bottom: var(--bp-4); }
@media (max-width: 575.98px) { .ch-actions > .btn { flex: 1 1 100%; } }
/* Le geste secondaire, en bas de page, hors du rang de l'action principale. */
.ch-pied { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bp-2) var(--bp-3);
    padding-top: var(--bp-3); border-top: 1px solid var(--bp-border); margin-top: var(--bp-4); }
.ch-pied p { margin: 0; font-size: var(--bp-fs-small); color: var(--bp-text-3); flex: 1 1 260px; }

.ch-vide { text-align: center; padding: var(--bp-5) var(--bp-3); color: var(--bp-text-2);
    font-size: var(--bp-fs-ui); line-height: 1.5; }
.ch-vide.compact { padding: var(--bp-4) var(--bp-3); }
.ch-vide i { font-size: 1.5rem; display: block; margin-bottom: var(--bp-2h);
    color: var(--bp-text-3); }
.ch-vide strong { display: block; color: var(--bp-text); font-size: var(--bp-fs-h3); font-weight: 600;
    margin-bottom: var(--bp-1); }
.ch-vide .btn { margin-top: var(--bp-3); }

/* Le bandeau qui dit pourquoi une case est fermee : fond teinte, filet de sens,
   icone de sens, texte neutre. */
.ch-ferme { border: 1px solid rgba(var(--bp-warning-rgb), .35);
    background: var(--bp-warning-fond); border-radius: var(--bp-r);
    padding: var(--bp-2h) var(--bp-3); margin-bottom: var(--bp-4); }
.ch-ferme p { margin: 0; font-size: var(--bp-fs-small); color: var(--bp-text-2); line-height: 1.5; }
.ch-ferme p > i:first-child { color: var(--bp-warning); margin-right: var(--bp-1); }
.ch-ferme strong { color: var(--bp-text); font-weight: 600; }

label.ch-champ { display: block; font-size: var(--bp-fs-small); color: var(--bp-text-2);
    margin-bottom: var(--bp-2); font-weight: 600; }

/* La fiche d'identite de l'enseigne : libelle, valeur ; empile au telephone. */
@media (max-width: 575.98px) {
    .ch-fiche tr { display: block; padding: var(--bp-2) 0; border-bottom: 1px solid var(--bp-border); }
    .ch-fiche tbody tr:last-child { border-bottom: none; }
    .ch-fiche td { display: block; height: auto; padding: 0; border: none; }
    .ch-fiche td.ch-libelle { width: auto; font-size: var(--bp-fs-small); }
}

/* Le rang ecrit en toutes lettres ne sert qu'aux fiches (la pastille de rang
   est masquee sous 1200 px). */
@media (min-width: 1200px) { .ch-rang-texte { display: none; } }
/* Un mois a venir : present pour la lecture de l'annee, en retrait. */
.ch-table tr.ch-a-venir td { color: var(--bp-text-3); }

/* Les horaires d'un jour : la case, puis ouverture et fermeture, sur une ligne. */
.ch-horaire { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 8.5rem) auto minmax(0, 8.5rem);
    align-items: center; gap: var(--bp-2); margin-bottom: var(--bp-2); max-width: 36rem; }
@media (max-width: 575.98px) {
    .ch-horaire { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    .ch-horaire-jour { grid-column: 1 / -1; }
}
.ch-horaire-jour, .ch-choix { display: flex; align-items: center; gap: var(--bp-2); min-height: 44px;
    margin: 0; cursor: pointer; color: var(--bp-text); font-size: var(--bp-fs-ui); }
.ch-choix { align-items: flex-start; padding: var(--bp-2) 0; }
.ch-choix .form-check-input, .ch-horaire-jour .form-check-input { flex: none; margin: 0; }
.ch-choix .form-check-input { margin-top: 0.15rem; }

/* Ce que chaque regime ouvre a la direction (droits, rattachement). */
.ch-regle { border: 1px solid var(--bp-border); border-radius: var(--bp-r); padding: var(--bp-3);
    background: var(--bp-surface-2); }
.ch-regle-liste { font-size: var(--bp-fs-small); line-height: 1.7; }
/* Le code d'acces a remettre en main propre. */
.ch-code { font-size: 1.5rem; letter-spacing: .06em; color: var(--bp-text); margin: var(--bp-2h) 0; }
