/* Styles propres à PCLPlanRepas (en complément de Bootstrap 5.3.3) ; base reprise de PCLMesGestProj */

:root {
    --app-couleur: #1f7a4d;
}

.bg-app {
    background-color: var(--app-couleur) !important;
}

/* Logo + nom (images/logo.svg, nom par marque_nom()) */
.marque {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}
.marque-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .35); /* détache la tuile vert sombre de la barre verte */
}
.marque-nom {
    font-weight: 400;
    letter-spacing: -.01em;
}
.marque-nom b {
    font-weight: 700;
}
.navbar .marque-nom b {
    color: #ffb020; /* ambre du logo */
}

/* Pied de page toujours visible, collé au bas de la fenêtre (demande de l'utilisateur), sur toutes les pages.
   La page garde en bas une marge de la hauteur du pied, pour que la fin du contenu ne passe jamais dessous. */
:root {
    --hauteur-pied: 3.25rem;
}
body.d-flex {
    height: auto !important; /* remplace h-100 : la page s'allonge avec son contenu */
    min-height: 100vh;
    padding-bottom: var(--hauteur-pied);
}
.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1020;
    height: var(--hauteur-pied);
    display: flex;
    align-items: center;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-shadow: 0 -2px 8px rgba(15, 39, 71, .15);
}
.toast-container.bottom-0 {
    bottom: var(--hauteur-pied) !important; /* messages au-dessus du pied de page */
}

/* Petit logo du pied de page, aligné sur la ligne de texte */
.pied-logo {
    border-radius: 4px;
    vertical-align: -4px;
    margin-right: .35rem;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}

/* Nom de l'auteur dans le pied de page : ouvre la fenêtre de présentation */
.pied-auteur {
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    cursor: pointer;
}
.pied-auteur:hover, .pied-auteur:focus-visible {
    text-decoration-style: solid;
}
.auteur-logo {
    border-radius: 22px;
    box-shadow: 0 4px 14px rgba(15, 39, 71, .25);
}
#modal-auteur .marque-nom {
    color: var(--app-couleur); /* nom de l'application en couleur de l'app */
    font-weight: 700;
}

/* Pages hors connexion : le cadre est centré verticalement entre la barre et le pied de page
   (marges automatiques : si l'écran est trop bas, la page défile normalement, rien n'est coupé) */
.main-publique {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

/* Pages hors connexion : grand logo centré au-dessus du formulaire */
.marque-publique {
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.marque-publique img {
    border-radius: 34px;
    box-shadow: 0 6px 20px rgba(15, 39, 71, .25);
}
.marque-publique-nom {
    margin-top: .6rem;
    font-size: 1.45rem;
    color: #123d2a;
}
.marque-publique-nom b {
    color: var(--app-couleur);
}

/* Avatars à initiales */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
    user-select: none;
}

.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: .7rem; }
.avatar-md { width: 2.25rem; height: 2.25rem; font-size: .85rem; }
.avatar-lg { width: 3.5rem;  height: 3.5rem;  font-size: 1.25rem; }
.avatar-nav { width: 26px; height: 26px; font-size: .65rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.avatar-xl { width: 6rem; height: 6rem; font-size: 2rem; }

/* Pictos : tuile colorée (couleur --c), icône blanche (même style que PCLMaCompta) */
.picto {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(145deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    vertical-align: middle;
}
.picto-md { width: 32px; height: 32px; border-radius: 8px; font-size: 1.05rem; }
.picto-lg { width: 40px; height: 40px; border-radius: 10px; font-size: 1.3rem; }
.dropdown-item .picto { margin-right: .6rem; }
.dropdown-item.active .picto, .dropdown-item:active .picto { box-shadow: 0 0 0 2px #fff; }

/* Barre de menu (écran large) : picto centré au-dessus du nom de la rubrique */
@media (min-width: 992px) {
    .navbar-nav > .nav-item > .nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .2rem;
        white-space: nowrap;
    }
    .navbar-nav > .nav-item > .nav-link.dropdown-toggle::after { display: none; }
    .navbar-nav { column-gap: .5rem; }
}
/* Mobile (menu replié) : picto à gauche du nom */
@media (max-width: 991.98px) {
    .navbar-nav > .nav-item > .nav-link { display: flex; align-items: center; gap: .5rem; }
}
.nav-link .caret-menu { font-size: .6rem; vertical-align: middle; }
.navbar-dark .navbar-nav .nav-link { color: rgba(255, 255, 255, .9); }
.navbar-dark .navbar-nav .nav-link:hover { color: #fff; }
.navbar-dark .navbar-nav .nav-link.active { color: #fff; font-weight: 600; }

/* Choix de l'icône d'une catégorie */
.choix-icone { cursor: pointer; border-radius: 12px; padding: 2px; border: 2px solid transparent; }
.btn-check:checked + .choix-icone { border-color: #172b4d; }
.btn-check:focus-visible + .choix-icone { outline: 2px solid #172b4d; outline-offset: 2px; }

.poignee { cursor: grab; }
.sortable-ghost { opacity: .4; }
.avatar-xs { width: 1.4rem; height: 1.4rem; font-size: .58rem; }

/* Catalogue : carte d'un plat, liseré de la couleur de sa catégorie (--c) */
.carte-plat {
    border-left: 4px solid var(--c);
    transition: box-shadow .15s, transform .15s;
}
.carte-plat:hover, .carte-plat:focus-visible {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12);
    transform: translateY(-1px);
}
.min-w-0 { min-width: 0; }

/* Fiche d'un plat */
.fiche-info {
    background: var(--bs-tertiary-bg);
    border-radius: .5rem;
    padding: .6rem .25rem;
}
.fiche-info > i { font-size: 1.2rem; color: var(--app-couleur); }
.liste-ingredients {
    columns: 2 12rem;
    padding-left: 1.1rem;
}

/* Photos des plats : fiche (bandeau), formulaire (aperçu), catalogue (vignette) */
.photo-plat {
    display: block;
    width: 100%;
    max-height: 22rem;
    object-fit: cover;
}
.photo-plat-vide {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    height: 5rem;
    background: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    border-bottom: 1px dashed var(--bs-border-color);
}
.photo-plat-vide:hover { color: var(--app-couleur); }
.photo-apercu {
    width: 8rem;
    height: 6rem;
    object-fit: cover;
    border-radius: .5rem;
    border: 1px solid var(--bs-border-color);
}
.vignette-plat {
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
    object-fit: cover;
    border-radius: .4rem;
    align-self: center;
}

/* ---------- Vue jour (index.php, jour.js) ---------- */

/* Bande des 7 jours de la semaine */
.bande-semaine {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .35rem;
}
.bande-jour {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: .35rem 0 .3rem;
    border-radius: .5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    text-decoration: none;
    line-height: 1.15;
}
.bande-jour:hover { border-color: var(--app-couleur); }
.bande-jour-nom { font-size: .72rem; text-transform: uppercase; color: var(--bs-secondary-color); }
.bande-jour-num { font-weight: 600; font-size: 1.05rem; }
.bande-jour-pastille { width: 6px; height: 6px; border-radius: 50%; background: var(--app-couleur); margin-top: .15rem; }
.bande-jour-pastille.vide { background: transparent; }
.bande-jour.aujourdhui .bande-jour-num { color: var(--app-couleur); }
.bande-jour.active { background: var(--app-couleur); border-color: var(--app-couleur); color: #fff; }
.bande-jour.active .bande-jour-nom, .bande-jour.active .bande-jour-num { color: #fff; }
.bande-jour.active .bande-jour-pastille:not(.vide) { background: #fff; }

/* Panneau catalogue : suit le défilement, liste défilante */
.panneau-catalogue {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - var(--hauteur-pied) - 2rem);
    display: flex;
    flex-direction: column;
}
.panneau-liste { overflow-y: auto; flex: 1 1 auto; min-height: 8rem; }
.panneau-intertitre {
    padding: .35rem .75rem .2rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--c);
    background: var(--bs-tertiary-bg);
    position: sticky;
    top: 0;
    z-index: 1;
}
.item-catalogue {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .75rem;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    cursor: grab;
    background: var(--bs-body-bg);
    font-size: .9rem;
}
.item-catalogue:hover { background: var(--bs-tertiary-bg); }

/* Pastilles de catégorie (panneau et fenêtre d'ajout) */
.pastille-cat {
    --bs-btn-padding-y: .1rem;
    --bs-btn-padding-x: .55rem;
    --bs-btn-font-size: .78rem;
    border: 1px solid var(--c);
    color: var(--c);
    border-radius: 1rem;
}
.pastille-cat:hover { background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); border-color: var(--c); }
.pastille-cat.active, .pastille-cat.active:hover { background: var(--c); color: #fff; border-color: var(--c); }

/* Cartes des repas */
.carte-repas { border-top: 3px solid var(--c); }
.section-repas + .section-repas { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--bs-border-color); }
.section-titre {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--bs-secondary-color);
}
.zone-repas {
    min-height: 2.6rem;
    border-radius: .5rem;
    padding: .2rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.zone-repas:empty {
    border: 1.5px dashed var(--bs-border-color);
    align-items: center;
    justify-content: center;
}
.zone-repas:empty::before {
    content: "Aucun plat";
    font-size: .8rem;
    color: var(--bs-secondary-color);
}
@media (min-width: 992px) {
    .zone-repas:empty::before { content: "Glissez un plat ici"; }
}
.ligne-repas {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem .25rem .35rem .6rem;
    border-radius: .4rem;
    background: var(--bs-tertiary-bg);
    border-left: 3px solid var(--c, #868e96);
    cursor: grab;
}
.ligne-repas.en-cours { opacity: .6; pointer-events: none; }
.ligne-pastille { width: 9px; height: 9px; border-radius: 50%; background: var(--c, #868e96); flex-shrink: 0; }
.ligne-repas .ligne-pastille { display: none; } /* le liseré suffit dans les repas */
/* Miniature de la photo du plat dans le planning (rien si le plat n'a pas de photo) */
.ligne-photo {
    flex-shrink: 0;
    width: 2.25rem; height: 2.25rem;
    object-fit: cover;
    border-radius: .3rem;
}
.ligne-semaine .ligne-photo { width: 1.5rem; height: 1.5rem; border-radius: .2rem; align-self: center; }
.ligne-nom { flex: 1 1 auto; min-width: 0; color: var(--bs-body-color); text-decoration: none; overflow-wrap: anywhere; }
a.ligne-nom:hover { text-decoration: underline; }
.btn-ligne-retirer {
    border: 0;
    background: none;
    color: var(--bs-secondary-color);
    padding: .15rem .45rem;
    border-radius: .3rem;
    line-height: 1;
}
.btn-ligne-retirer:hover, .btn-ligne-retirer:focus-visible { color: #c92a2a; background: rgba(201, 42, 42, .1); }
.zone-repas .sortable-ghost, .zone-repas .item-catalogue.sortable-ghost {
    opacity: .5;
    border: 1.5px dashed var(--app-couleur);
}
.zone-repas .item-catalogue { border-radius: .4rem; border-bottom: 0; } /* aperçu pendant le dépôt */
#ajout-liste .list-group-item { border-left: 3px solid var(--c); }
/* Repas sans sections (petit-déjeuner) : le bouton « Ajouter » remonte dans l'en-tête de la carte */
.carte-repas .card-body { position: relative; }
.section-sans-titre { position: absolute; top: -2.35rem; right: .5rem; margin: 0 !important; }

/* ---------- Événements ---------- */
.bandeau-evenement {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .75rem;
    border-radius: .5rem;
    background: color-mix(in srgb, var(--c) 10%, var(--bs-body-bg));
    border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
    border-left: 4px solid var(--c);
}
.bandeau-evenement > .bi-star-fill { color: var(--c); }
.badge-evenement {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.5;
    padding: 0 .4rem;
    border-radius: .3rem;
    color: #fff;
    background: var(--c);
    vertical-align: middle;
}
.badge-evenement .bi { font-size: .6rem; }
.evenement-date {
    width: 2.8rem;
    flex-shrink: 0;
    text-align: center;
    border-radius: .45rem;
    background: var(--c);
    color: #fff;
    line-height: 1.05;
    padding: .3rem 0;
}
.evenement-date span { display: block; font-size: 1.15rem; font-weight: 700; }
.evenement-date small { font-size: .66rem; }
.liste-evenements .active-evenement { background: color-mix(in srgb, var(--c) 10%, var(--bs-body-bg)); }
.choix-couleur {
    width: 2rem; height: 2rem;
    border-radius: 50%;
    background: var(--c);
    cursor: pointer;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.btn-check:checked + .choix-couleur { box-shadow: 0 0 0 2px var(--bs-body-bg), 0 0 0 4px var(--c); }
.btn-check:focus-visible + .choix-couleur { outline: 2px solid var(--bs-body-color); outline-offset: 3px; }

/* ---------- Vue semaine (semaine.php) ---------- */
.grille-semaine {
    display: grid;
    gap: .75rem;
    grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 768px) { .grille-semaine { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) {
    /* 7 colonnes ; les repas restent alignés d'un jour à l'autre (sous-grille : en-tête + 3 repas) */
    .grille-semaine { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(3, auto); }
    .jour-semaine { grid-row: span 4; display: grid; grid-template-rows: subgrid; }
}
.jour-semaine { overflow: hidden; }
.jour-semaine.aujourdhui { box-shadow: 0 0 0 2px var(--app-couleur) !important; }
.jour-semaine-entete { color: var(--bs-body-color); display: block; }
.jour-semaine-entete:hover { background: color-mix(in srgb, var(--app-couleur) 10%, var(--bs-tertiary-bg)); }
.jour-semaine.aujourdhui .jour-semaine-entete { background: color-mix(in srgb, var(--app-couleur) 14%, var(--bs-body-bg)); }
.repas-semaine { padding: .35rem .5rem .5rem; border-top: 1px solid var(--bs-border-color-translucent); }
.repas-semaine-titre {
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    color: var(--c); margin-bottom: .2rem;
}
.zone-semaine { min-height: 1.9rem; display: flex; flex-direction: column; gap: .2rem; border-radius: .35rem; }
.zone-semaine:empty { border: 1.5px dashed var(--bs-border-color); }
.ligne-semaine {
    display: flex; align-items: baseline; gap: .35rem;
    font-size: .85rem; line-height: 1.25;
    padding: .2rem .4rem;
    border-radius: .3rem;
    background: var(--bs-tertiary-bg);
    border-left: 3px solid var(--c);
    cursor: grab;
    overflow-wrap: anywhere;
}
.ligne-semaine.en-cours { opacity: .6; }
.ligne-section {
    flex-shrink: 0;
    font-size: .62rem; font-weight: 700;
    color: var(--bs-secondary-color);
    width: .8rem;
}

/* ---------- Vue mois (mois.php) ---------- */
.calendrier-mois { overflow: hidden; }
.calendrier-entetes, .calendrier-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendrier-entetes > div {
    padding: .4rem; text-align: center;
    font-size: .75rem; font-weight: 700; text-transform: uppercase; color: var(--bs-secondary-color);
    background: var(--bs-tertiary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}
.case-jour {
    min-height: 7.5rem;
    padding: .3rem .35rem;
    border-right: 1px solid var(--bs-border-color-translucent);
    border-bottom: 1px solid var(--bs-border-color-translucent);
    color: var(--bs-body-color);
    text-decoration: none;
    display: flex; flex-direction: column; gap: .15rem;
    min-width: 0;
}
.case-jour:nth-child(7n) { border-right: 0; }
.case-jour:hover { background: color-mix(in srgb, var(--app-couleur) 7%, var(--bs-body-bg)); }
.case-jour.hors-mois { background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); }
.case-jour.hors-mois .case-jour-plats, .case-jour.hors-mois .badge-evenement { opacity: .6; }
.case-jour-num { font-weight: 600; font-size: .9rem; }
.case-jour.aujourdhui .case-jour-num {
    background: var(--app-couleur); color: #fff;
    border-radius: 50%; width: 1.7rem; height: 1.7rem;
    display: inline-flex; align-items: center; justify-content: center;
}
.case-jour-plats li {
    font-size: .75rem; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    padding-left: .35rem;
    border-left: 2px solid var(--c);
    margin-bottom: .1rem;
}
.case-jour-plats .case-jour-plus { border-left: 0; color: var(--bs-secondary-color); font-weight: 600; }
.case-jour-compte {
    margin-top: auto; align-self: center;
    font-size: .7rem; font-weight: 700;
    min-width: 1.3rem; text-align: center;
    border-radius: 1rem; background: var(--app-couleur); color: #fff;
}
@media (max-width: 767.98px) {
    .case-jour { min-height: 4rem; align-items: center; padding: .25rem .1rem; }
    .case-jour .badge-evenement { width: 100%; font-size: 0; height: .35rem; padding: 0; } /* simple trait de couleur */
}

/* ---------- Liste de courses (courses.php, courses.js) ---------- */
.remplir-courses > summary { cursor: pointer; list-style: none; }
.remplir-courses > summary::-webkit-details-marker { display: none; }
.remplir-courses > summary::after { content: "\F282"; font-family: bootstrap-icons; float: right; transition: transform .2s; }
.remplir-courses[open] > summary::after { transform: rotate(180deg); }
.remplir-courses:not([open]) > summary { border-bottom: 0; border-radius: var(--bs-card-inner-border-radius); }
.article-courses { display: flex; align-items: center; gap: .75rem; padding-top: .55rem; padding-bottom: .55rem; }
.article-courses .form-check-input { width: 1.4rem; height: 1.4rem; margin: 0; flex-shrink: 0; cursor: pointer; }
.article-courses label { cursor: pointer; }
.article-courses.coche .article-libelle { text-decoration: line-through; color: var(--bs-secondary-color); }
.article-courses.coche { background: var(--bs-tertiary-bg); }
.courses-intertitre {
    font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); padding-top: .3rem; padding-bottom: .3rem;
}

/* Menus types */
.menu-composition li { padding-left: .5rem; border-left: 3px solid var(--c); margin-bottom: .2rem; }

/* Aide */
.sommaire-aide { position: sticky; top: 1rem; }
.aide section { scroll-margin-top: 1rem; }
.aide li + li { margin-top: .3rem; }
