:root {
    --pantone-222c: #682145;
    --pantone-199c: #D50032;
    --bg-light: #f8f9fa;
    --text-dark: #2d2d2d;
    --success: #28a745;
    --warning: #ffc107;
    --gray: #6c757d;
}

body { font-family: 'Segoe UI', Arial, sans-serif; background-color: var(--bg-light); margin: 0; padding: 20px; color: var(--text-dark); overflow-x: hidden; display: flex; flex-direction: column; min-height: 100vh; touch-action: pan-x pan-y; }
.hidden { display: none !important; }
body.no-scroll { overflow: hidden; }
/* La place de la barre de défilement reste réservée : la page ne s'élargit pas (et ne se réorganise pas) quand une fenêtre s'ouvre */
html { scrollbar-gutter: stable; }

.view-section { flex: 1; max-width: 1920px; margin: 0 auto; width: 100%; position: relative; }
.modal { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh; background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 15px; box-sizing: border-box; overflow-y: auto; }
.modal-content { background: white; padding: 30px; border-radius: 15px; width: 100%; max-width: 450px; text-align: center; box-sizing: border-box; margin: auto; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--success); color: white; padding: 15px 30px; border-radius: 50px; font-weight: bold; opacity: 0; transition: 0.3s; z-index: 9999; pointer-events: none; }
#toast.show { opacity: 1; }

.btn { padding: 10px 15px; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.2s; }
.btn-primary { background: var(--pantone-199c); color: white; font-size: 16px; }
.btn-primary:hover { background: var(--pantone-222c); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-outline { background: transparent; border: 2px solid var(--pantone-222c); color: var(--pantone-222c); font-size: 16px; }

.input-group { margin-bottom: 15px; text-align: left; }
.input-group label { display: block; font-size: 14px; margin-bottom: 5px; font-weight: bold; }
.modal .req, .admin-tab .req { color: #c62828; }
.req-legend { display: block; margin-top: 12px; font-size: 12px; color: gray; text-align: left; }
.modal .field-error > label, .admin-tab .field-error > label { color: #c62828; }
.modal .field-error > input, .modal .field-error > select, .modal .field-error > textarea, .admin-tab .field-error > input, .admin-tab .field-error > select { border-color: #c62828; background: #fff5f5; }
.form-errors { background: #fdecea; border: 1px solid #f1b0ab; color: #b71c1c; padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; font-size: 14px; font-weight: bold; text-align: left; }
.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px; box-sizing: border-box; font-size: 16px; font-family: inherit; }

header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 30px; background: white; padding: 15px 30px; border-radius: 15px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); border-bottom: 4px solid var(--pantone-222c); }
.user-greeting { font-size: 24px; color: var(--pantone-222c); font-weight: bold; }
/* Titre d'en-tête + pastille du site, centrés verticalement l'un par rapport à l'autre */
.header-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
/* Le style est ici (et pas en inline) : appliquerDroits() vide style.display en affichant le bloc */
#header-admin-btns { display: flex; gap: 10px; flex-wrap: wrap; }

.main-content { display: flex; gap: 30px; align-items: flex-start; }
.menu-section { flex: 2; }
.categories { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.category-btn { padding: 12px 25px; font-size: 16px; font-weight: bold; border: none; border-radius: 10px; background: white; color: var(--pantone-222c); cursor: pointer; }
.category-btn.active { background: var(--pantone-199c); color: white; }

.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.product-card { background: white; border-radius: 15px; padding: 15px; text-align: center; cursor: pointer; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.product-card:active { transform: scale(0.95); }
.product-card.epuise { opacity: 0.5; pointer-events: none; filter: grayscale(100%); }
/* Produit clôturé (heure limite passée) avec un univers Castalia : pas de transparence (le fond de l'univers passerait à travers), seulement grisé */
html.castalia-actif .product-card.epuise.cloture { opacity: 1; }

.badge-epuise { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-15deg); background: var(--pantone-199c); color: white; font-weight: bold; padding: 10px 20px; border-radius: 5px; border: 3px solid white; font-size: 20px; z-index: 20; }
.product-card img { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; background: #eee; margin-bottom: 10px; aspect-ratio: 3/2; }
.product-price { color: var(--pantone-199c); font-weight: bold; font-size: 18px; margin-top: 5px; }

.btn-allergene-badge { position: absolute; top: 10px; right: 10px; background: white; border: 1px solid #ccc; border-radius: 50%; width: 30px; height: 30px; font-weight: bold; color: var(--pantone-222c); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); z-index: 10; }
.btn-allergene-badge:hover { background: var(--warning); color: white; }

.cart-section { flex: 1; background: white; border-radius: 20px; padding: 25px; border: 2px solid var(--pantone-222c); position: sticky; top: 20px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); }
.cart-items { list-style: none; padding: 0; margin: 0; max-height: 400px; overflow-y: auto; text-align: left; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #eee; }
.qty-controls { display: flex; align-items: center; gap: 10px; }
.qty-btn { background: #eee; border: none; width: 30px; height: 30px; border-radius: 50%; font-weight: bold; font-size: 18px; cursor: pointer; }
.cart-total { font-size: 26px; font-weight: bold; text-align: right; margin: 20px 0; color: var(--pantone-222c); }

.cuisine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.ticket { background: white; border-left: 8px solid var(--warning); border-radius: 10px; padding: 20px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; text-align: left; touch-action: pan-y; transition: transform 0.2s ease; }
.ticket.terminee { border-left: 8px solid var(--gray); opacity: 0.8; }
.ticket-header { display: flex; justify-content: space-between; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 10px; }
.ticket-client { font-size: 18px; font-weight: bold; color: var(--pantone-222c); }
.ticket-time { color: gray; font-size: 14px; }
.ticket-items { list-style: none; padding: 0; margin: 0 0 15px 0; flex: 1; font-size: 16px; }
.ticket-items li { margin-bottom: 5px; font-weight: bold; }

.admin-layout { display: flex; gap: 30px; height: 85vh; text-align: left; }
.admin-sidebar { width: 250px; flex-shrink: 0; box-sizing: border-box; background: white; border-radius: 15px; padding: 20px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.admin-sidebar button { text-align: left; padding: 12px 15px; font-size: 16px; flex-shrink: 0; background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.admin-sidebar button:hover, .admin-sidebar button.active { background: var(--bg-light); border-color: var(--pantone-222c); color: var(--pantone-222c); font-weight: bold; }
.admin-content { flex: 1; background: white; border-radius: 15px; padding: 30px; overflow-y: auto; scrollbar-gutter: stable; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); }

.table-responsive { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 15px; min-width: 600px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #ddd; }
th { background: var(--bg-light); color: var(--pantone-222c); }
.action-cell { display: flex; gap: 5px; }
/* Dans un tableau, la cellule reste une vraie cellule (bordure et centrage vertical alignés sur la ligne) ; boutons de même taille, serrés à droite */
td.action-cell { display: table-cell; width: 1%; white-space: nowrap; text-align: right; vertical-align: middle; }
/* Produits d'une catégorie repliée : la ligne garde sa place dans le calcul des colonnes, sans être affichée */
tr.prod-row-repliee { visibility: collapse; }
/* Bouton à deux libellés superposés : il garde la largeur du plus long, le texte ne bouge pas au clic */
.btn-libelle-fixe { display: inline-grid; justify-items: center; }
.btn-libelle-fixe > span { grid-area: 1 / 1; }
.btn-libelle-fixe > .libelle-masque { visibility: hidden; }
td.action-cell .btn { margin-left: 5px; font-size: 14px; border: 2px solid transparent; vertical-align: middle; }
td.action-cell .btn:first-child { margin-left: 0; }
td.action-cell .btn-outline { border-color: var(--pantone-222c); }
th.action-head { text-align: right; }

#global-footer { text-align: center; padding: 20px 0 5px 0; font-size: 13px; color: gray; width: 100%; }
#global-footer a { color: var(--pantone-222c); text-decoration: underline; font-weight: bold; cursor: pointer; }


/* Borne sur grand écran : le panier démarre à la hauteur de la première ligne de produits, sous les filtres de catégories */
@media (min-width: 769px) {
    #page-borne .main-content { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 32%, 460px); column-gap: 30px; align-items: start; }
    #page-borne .menu-section { display: contents; }
    #page-borne .menu-section > .service-selector { grid-column: 1; grid-row: 1; }
    #page-borne .menu-section > .categories { grid-column: 1; grid-row: 2; }
    #page-borne .menu-section > .products-grid { grid-column: 1; grid-row: 3; }
    #page-borne .cart-section { grid-column: 2; grid-row: 3; }
}

#mobile-cart-btn { display: none; position: fixed; bottom: 20px; right: 20px; background: var(--pantone-199c); color: white; padding: 15px 25px; border-radius: 50px; font-size: 18px; font-weight: bold; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); z-index: 999; cursor: pointer; align-items: center; gap: 10px; }

#prod-allergenes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 10px;
    justify-content: center; /* Permet de centrer les boutons */
}

@media (max-width: 768px) {
    header { flex-direction: column; gap: 15px; text-align: center; }
    header>div { justify-content: center; width: 100%; }
    .header-title { justify-content: center; }
    #header-action-buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    #header-admin-btns { width: 100%; justify-content: center; margin-bottom: 10px; }
    .btn { padding: 8px 12px; font-size: 14px; }
    .main-content { flex-direction: column; align-items: stretch; }
    .cart-section { position: relative; top: 0; width: 100%; margin-top: 20px; box-sizing: border-box; margin-bottom: 60px; }
    .admin-layout { flex-direction: column; height: auto; }
    .admin-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; box-sizing: border-box; }
    .admin-sidebar button { text-align: center; flex: 1 1 45%; }
    .admin-sidebar .nav-group-title { flex-basis: 100%; }
    .cuisine-grid { grid-template-columns: 1fr; }
    #mobile-cart-btn.show-mobile { display: flex; }
}
/* Fenêtre de confirmation (suppression...) */
.confirm-icon { width: 64px; height: 64px; margin: 0 auto 15px; border-radius: 50%; background: #fdecea; display: flex; align-items: center; justify-content: center; font-size: 30px; }
.confirm-icon.neutre { background: var(--bg-light); }
#modal-confirm .btn { padding: 12px; font-size: 16px; border: 2px solid transparent; }
#modal-confirm .btn-outline { border-color: var(--pantone-222c); }

/* Tableaux d'administration à l'étroit (borne, tablette, menu latéral ouvert) : boutons d'action en icônes seules, colonnes resserrées */
.admin-content { container-type: inline-size; }
@container (max-width: 1050px) {
    td.action-cell .btn-label { display: none; }
    .admin-content th, .admin-content td { padding: 10px 6px; }
}
@media (max-width: 1100px) {
    td.action-cell .btn-label { display: none; }
    .admin-content th, .admin-content td { padding: 10px 6px; }
}

/* Onglet Gestion : réglages regroupés par blocs, champs côte à côte quand la largeur le permet */
.gestion-form { max-width: 900px; display: flex; flex-direction: column; gap: 15px; }
.gestion-form .form-errors { margin-bottom: 0; }
.gestion-card { background: var(--bg-light); border: 1px solid #ddd; border-radius: 10px; padding: 15px 20px 20px; }
.gestion-card h4 { margin: 0 0 12px; color: var(--pantone-222c); }
.gestion-row { display: flex; flex-wrap: wrap; gap: 15px 20px; }
.gestion-row > .input-group { flex: 1 1 240px; min-width: 0; margin-bottom: 0; }
.gestion-card .input-group input, .gestion-card .input-group select { background: white; }
.gestion-card .input-group small { display: block; margin-top: 6px; line-height: 1.4; }
.gestion-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.gestion-actions .btn { padding: 12px 30px; }

/* Choix de couleur (message d'information) : pastilles prédéfinies + sélecteur libre */
.color-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px #bbb; cursor: pointer; padding: 0; }
.color-swatch.active { box-shadow: 0 0 0 3px var(--pantone-222c); }
.input-group label.color-custom { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: normal; cursor: pointer; }
.input-group .color-custom input[type="color"] { width: 48px; height: 36px; padding: 2px; border-radius: 8px; cursor: pointer; background: white; }
.color-custom code { background: white; border: 1px solid #ccc; border-radius: 6px; padding: 4px 8px; font-size: 13px; }

/* Statistiques : choix des produits en cartes (image, case à cocher en bas à gauche, nom) */
.stats-prod-grid-wrap { max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.stats-prod-cat { font-weight: bold; color: var(--pantone-222c); margin: 12px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stats-prod-cat label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; }
.stats-prod-cat input { width: 18px; height: 18px; margin: 0; accent-color: var(--pantone-222c); cursor: pointer; }
.stats-prod-cat small { color: gray; font-weight: normal; }
.stats-prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.stats-prod-card { display: flex; flex-direction: column; border: 2px solid #e2e2e2; border-radius: 10px; overflow: hidden; cursor: pointer; background: white; transition: border-color 0.15s, box-shadow 0.15s; margin: 0; }
.stats-prod-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.stats-prod-card.coche { border-color: var(--pantone-222c); background: #fbf5f8; }
.stats-prod-img { height: 100px; background: #f4f4f4; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.stats-prod-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stats-prod-card:not(.coche) .stats-prod-img { opacity: 0.55; }
.stats-prod-pied { display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; font-size: 14px; line-height: 1.3; text-align: left; }
.stats-prod-pied input { width: 18px; height: 18px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--pantone-222c); cursor: pointer; }

/* Fiche d'un grade : permissions par section, libellé + clé technique, « Tout cocher / décocher » */
.modal-content.grade-modal { max-width: 880px; width: 100%; padding: 0; text-align: left; display: flex; flex-direction: column; max-height: calc(100dvh - 30px); overflow: hidden; }
.grade-head { display: flex; align-items: center; gap: 12px; padding: 20px 25px; border-bottom: 1px solid #eee; background: linear-gradient(#fff, #fbf7f9); }
.grade-head h2 { margin: 0; font-size: 22px; color: var(--pantone-222c); }
.grade-badge { font-size: 12px; font-weight: bold; letter-spacing: .06em; text-transform: uppercase; padding: 3px 10px; border-radius: 6px; background: #f3e5f5; color: var(--pantone-222c); border: 1px solid #e1c4d6; white-space: nowrap; }
.grade-close { margin-left: auto; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; border: 1px solid #ddd; background: white; font-size: 20px; cursor: pointer; color: #555; }
.grade-close:hover { border-color: var(--pantone-222c); color: var(--pantone-222c); }
.grade-body { padding: 18px 25px; overflow-y: auto; flex: 1; }
.grade-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 15px 25px; border-top: 1px solid #eee; background: #fbf7f9; }
.grade-foot .btn { width: auto; margin: 0; padding: 12px 22px; font-size: 16px; }
.grade-note { color: gray; margin: 0 0 5px; font-size: 14px; }
.grade-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 20px 0 10px; }
.grade-section-head b { text-transform: uppercase; letter-spacing: .07em; font-size: 14px; color: #5a6270; }
.grade-section-head b small { text-transform: none; letter-spacing: 0; font-weight: normal; color: gray; }
.grade-toggle { background: none; border: none; color: #6b7280; cursor: pointer; font-size: 15px; padding: 0; }
.grade-toggle:hover { color: var(--pantone-222c); text-decoration: underline; }
.grade-perms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .grade-perms { grid-template-columns: 1fr; } .grade-head h2 { font-size: 19px; } }
label.grade-perm { display: flex; gap: 12px; align-items: flex-start; padding: 12px 15px; border: 1px solid #e6dce2; border-radius: 10px; background: #faf6f8; cursor: pointer; font-weight: normal; margin: 0; transition: border-color .15s, background .15s; }
label.grade-perm:hover { border-color: var(--pantone-222c); }
label.grade-perm:has(input:checked) { background: #f3e5f5; border-color: #c98fb0; }
label.grade-perm input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--pantone-222c); flex-shrink: 0; }
label.grade-perm .grade-perm-label { display: block; color: #333; font-size: 15px; }
label.grade-perm .grade-perm-aide { display: block; color: gray; font-size: 12px; margin-top: 2px; }
label.grade-perm code { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: #888; margin-top: 4px; }
label.grade-perm.grade-perm-off { opacity: .5; cursor: not-allowed; }
label.grade-perm.grade-perm-off:hover { border-color: #e6dce2; }
label.grade-perm.grade-perm-danger input { accent-color: red; }
label.grade-perm.grade-perm-danger .grade-perm-label { color: #c00; font-weight: bold; }

/* ==========================================
   EN-TÊTE DE LA BORNE : profil (menu déroulant) + porte de déconnexion
   ========================================== */
#header-action-buttons { display: flex; gap: 12px; align-items: center; justify-content: flex-end; }
.profil-wrap { position: relative; }
.btn-profil { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 2px solid var(--pantone-222c); border-radius: 30px; padding: 3px 12px 3px 3px; cursor: pointer; color: var(--pantone-222c); font-family: inherit; }
.btn-profil:hover, .btn-profil[aria-expanded="true"] { background: var(--bg-light); }
.profil-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--pantone-222c); color: white; display: inline-flex; align-items: center; justify-content: center; font-weight: bold; font-size: 16px; flex-shrink: 0; }
.profil-avatar-grand { width: 72px; height: 72px; font-size: 28px; }
.profil-caret { font-size: 14px; }
.btn-porte { width: 50px; height: 50px; font-size: 26px; line-height: 1; background: transparent; border: 2px solid #dc3545; border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.btn-porte:hover { background: #fdecea; }
.menu-profil { position: absolute; right: 0; top: calc(100% + 8px); background: white; border: 1px solid #e3d6dd; border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); min-width: 270px; padding: 8px; z-index: 600; text-align: left; }
.menu-profil-entete { padding: 8px 12px 10px; border-bottom: 1px solid #eee; margin-bottom: 6px; }
.menu-profil-entete b { display: block; color: var(--pantone-222c); font-size: 16px; }
.menu-profil-entete small { color: gray; word-break: break-all; }
.menu-profil button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 12px; border: none; background: none; border-radius: 8px; cursor: pointer; font-size: 15px; font-family: inherit; color: var(--text-dark); text-align: left; }
.menu-profil button:hover:not(:disabled) { background: var(--bg-light); color: var(--pantone-222c); }
.menu-profil button:disabled { opacity: 0.55; cursor: default; }
.menu-profil button small { margin-left: auto; font-size: 11px; background: #eee; color: #555; padding: 2px 8px; border-radius: 10px; }
.menu-profil-sep { height: 1px; background: #eee; margin: 6px 0; }

/* Page « Informations personnelles » */
.profil-carte { background: white; border-radius: 15px; padding: 30px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); max-width: 640px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.profil-carte-tete { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; flex-wrap: wrap; }
.profil-carte-tete .site-badge { margin-top: 6px; }
.profil-infos { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0 0 20px; }
.profil-infos dt { font-weight: bold; color: gray; }
.profil-infos dd { margin: 0; word-break: break-word; }
@media (max-width: 500px) { .profil-infos { grid-template-columns: 1fr; gap: 2px; } .profil-infos dd { margin-bottom: 10px; } }

/* Fiche produit / nouveau produit : proposition de créer un groupe ou un modèle */
.aide-creer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 10px 12px; background: #f6eef2; border: 1px dashed var(--pantone-222c); border-radius: 10px; font-size: 14px; color: var(--pantone-222c); }
.aide-creer .btn { padding: 6px 12px; font-size: 14px; }

/* ==========================================
   MENU LATÉRAL DE L'ADMINISTRATION : ⇤ pour le replier, ☰ pour le rouvrir
   ========================================== */
.admin-sidebar-wrap { position: relative; display: flex; flex-shrink: 0; }
.btn-replier-menu, .btn-menu-lateral { display: inline-flex; align-items: center; justify-content: center; background: white; border: 1px solid #e3d6dd; box-shadow: 0 2px 8px rgba(0,0,0,0.12); color: var(--pantone-222c); cursor: pointer; font-family: inherit; padding: 0; }
.btn-replier-menu { position: absolute; top: 12px; right: -18px; width: 36px; height: 36px; border-radius: 10px; font-size: 18px; z-index: 5; }
.btn-menu-lateral { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; flex-shrink: 0; }
.btn-replier-menu:hover, .btn-menu-lateral:hover { background: var(--bg-light); border-color: var(--pantone-222c); }
.admin-layout.menu-replie .admin-sidebar-wrap { display: none; }
/* Menu replié : le bouton ☰ s'affiche sous l'en-tête, au-dessus du contenu */
.admin-layout.menu-replie { flex-direction: column; gap: 12px; }
.admin-layout.menu-replie .admin-content { min-height: 0; }
.btn-deplier-menu { align-self: flex-start; width: auto; padding: 0 16px; gap: 8px; font-size: 20px; }
.btn-deplier-menu span { font-size: 15px; font-weight: bold; }
/* En-tête cuisine / administration : profil + porte de déconnexion */
.header-profil-slot { display: flex; gap: 12px; align-items: center; }
.header-profil-slot:empty { display: none; }
/* Menu du profil : choix du centre */
.menu-profil-fleche { margin-left: auto; transition: transform 0.15s; }
#menu-profil-sites-btn[aria-expanded="true"] .menu-profil-fleche { transform: rotate(90deg); }
.menu-profil-sites { padding: 2px 0 4px 18px; }
.menu-profil .menu-profil-sites button { justify-content: space-between; padding: 9px 12px; font-weight: bold; color: var(--pantone-222c); }
.menu-profil .menu-profil-sites button.active { background: var(--pantone-222c); color: white; }
.menu-profil .menu-profil-sites button small { background: none; color: inherit; opacity: 0.8; font-weight: normal; margin-left: 10px; padding: 0; }
/* Fenêtre « fermeture dans 5 minutes » : grande, au centre de l'écran */
.modal-fermeture { z-index: 1200; background: rgba(0, 0, 0, 0.75); }
.modal-fermeture .modal-content { max-width: 620px; padding: 45px 35px; border-top: 10px solid var(--pantone-199c); animation: fermeture-pop 0.35s ease-out; }
.modal-fermeture .fermeture-icone { font-size: 90px; line-height: 1; margin-bottom: 15px; animation: fermeture-pulse 1s ease-in-out infinite alternate; }
.modal-fermeture h2 { color: var(--pantone-199c); font-size: 38px; margin: 0 0 15px; }
.modal-fermeture p { font-size: 21px; margin: 0 0 25px; }
.modal-fermeture .btn { width: 100%; padding: 18px; font-size: 20px; border-radius: 12px; }
@keyframes fermeture-pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fermeture-pulse { from { transform: scale(1); } to { transform: scale(1.12); } }
@media (max-width: 500px) { .modal-fermeture h2 { font-size: 28px; } .modal-fermeture p { font-size: 18px; } .modal-fermeture .fermeture-icone { font-size: 70px; } }
/* Page « Informations personnelles » : modification du nom, de la classe et du code secret */
.profil-section { border-top: 1px solid #eee; padding-top: 20px; margin-top: 20px; }
.profil-section h3 { margin: 0 0 12px; color: var(--pantone-222c); font-size: 18px; }
.profil-section .input-group input { width: 100%; box-sizing: border-box; }
.profil-section .btn { padding: 12px 20px; }
.profil-champs-ligne { display: flex; gap: 12px; flex-wrap: wrap; }
.profil-champs-ligne > .input-group { flex: 1 1 180px; min-width: 0; }
.profil-aide { color: gray; font-size: 14px; margin: 20px 0 0; }
.profil-aide a { color: var(--pantone-199c); font-weight: bold; }
[data-theme="sombre"] .profil-section { border-color: var(--bordure); }
@media (max-width: 768px) {
    .btn-replier-menu, .btn-menu-lateral { display: none !important; }
    .admin-sidebar-wrap, .admin-layout.menu-replie .admin-sidebar-wrap { display: block; width: 100%; }
    #header-action-buttons { justify-content: center; }
    /* Menu du profil : centré sous l'en-tête (et non collé au bouton, qui le faisait sortir de l'écran) */
    header { position: relative; }
    .profil-wrap { position: static; }
    .menu-profil { left: 50%; right: auto; transform: translateX(-50%); top: calc(100% - 6px); width: min(340px, calc(100vw - 32px)); min-width: 0; box-sizing: border-box; }
    /* Administration : pas de grand vide entre « Menu Administration » et le contenu */
    .admin-layout, .admin-layout.menu-replie { gap: 0; }
    #btn-mobile-sidebar { margin-bottom: 12px !important; }
    .admin-sidebar.show { margin-bottom: 12px; }
    /* Onglets (Réservations / Factures / Groupes & prix / Réglages…) : tiennent dans la largeur de l'écran */
    /* (sélecteurs renforcés : les styles de .plan-vues dans index.php sont chargés après ce fichier) */
    div.plan-vues { display: flex; max-width: 100%; }
    div.plan-vues > button { flex: 1 1 0; min-width: 0; height: auto; padding: 8px 6px; font-size: 13px; overflow-wrap: anywhere; }
    .plan-nav div.plan-vues { height: auto; min-height: 40px; }
}

/* ==========================================
   THÈME SOMBRE (choisi dans le menu du profil, mémorisé sur l'appareil)
   ========================================== */
:root[data-theme="sombre"] {
    color-scheme: dark;
    --pantone-222c: #c4568e;
    --bg-light: #16171c;
    --text-dark: #e7e7ec;
    --surface: #23242c;
    --surface-2: #2c2d36;
    --bordure: #3b3c47;
}
[data-theme="sombre"] body { background-color: var(--bg-light); color: var(--text-dark); }
[data-theme="sombre"] header, [data-theme="sombre"] .modal-content, [data-theme="sombre"] .admin-sidebar, [data-theme="sombre"] .admin-content,
[data-theme="sombre"] .product-card, [data-theme="sombre"] .cart-section, [data-theme="sombre"] .ticket, [data-theme="sombre"] .category-btn,
[data-theme="sombre"] .service-selector, [data-theme="sombre"] .service-btn, [data-theme="sombre"] .site-menu, [data-theme="sombre"] .menu-profil, [data-theme="sombre"] .profil-carte,
[data-theme="sombre"] .btn-replier-menu, [data-theme="sombre"] .btn-menu-lateral, [data-theme="sombre"] .btn-allergene-badge, [data-theme="sombre"] .plan-cal,
[data-theme="sombre"] .grade-close, [data-theme="sombre"] .color-custom code, [data-theme="sombre"] .gestion-card .input-group input, [data-theme="sombre"] .gestion-card .input-group select {
    background: var(--surface); color: var(--text-dark);
}
/* Blocs stylés directement dans la page ou par le script */
[data-theme="sombre"] [style*="background: white"], [data-theme="sombre"] [style*="background:white"], [data-theme="sombre"] [style*="background-color: white"],
[data-theme="sombre"] [style*="background: #fff;"], [data-theme="sombre"] [style*="background:#fff;"], [data-theme="sombre"] [style*="background: #ffffff"], [data-theme="sombre"] [style*="background:#ffffff"] {
    background: var(--surface) !important; color: var(--text-dark);
}
[data-theme="sombre"] [style*="background: #fff7f9"], [data-theme="sombre"] [style*="background:#fff7f9"], [data-theme="sombre"] [style*="background: #f9f9f9"], [data-theme="sombre"] [style*="background:#f9f9f9"], [data-theme="sombre"] [style*="background: #fafafa"], [data-theme="sombre"] [style*="background:#fafafa"], [data-theme="sombre"] [style*="background: #f3f8ff"], [data-theme="sombre"] [style*="background:#f3f8ff"], [data-theme="sombre"] [style*="background: #fbf8fa"], [data-theme="sombre"] [style*="background:#fbf8fa"], [data-theme="sombre"] [style*="background: #f6eef2"], [data-theme="sombre"] [style*="background:#f6eef2"], [data-theme="sombre"] [style*="background: #f4f4f4"], [data-theme="sombre"] [style*="background:#f4f4f4"], [data-theme="sombre"] [style*="background: #f1f1f1"], [data-theme="sombre"] [style*="background:#f1f1f1"], [data-theme="sombre"] [style*="background: #f0f0f0"], [data-theme="sombre"] [style*="background:#f0f0f0"], [data-theme="sombre"] [style*="background: #f8f9fa"], [data-theme="sombre"] [style*="background:#f8f9fa"], [data-theme="sombre"] .weekend, [data-theme="sombre"] .hors-mois,
[data-theme="sombre"] .stats-prod-img, [data-theme="sombre"] .aide-creer, [data-theme="sombre"] label.grade-perm:has(input:checked), [data-theme="sombre"] .stats-prod-card.coche {
    background: var(--surface-2) !important; color: var(--text-dark);
}
[data-theme="sombre"] [style*="color: #333"], [data-theme="sombre"] [style*="color:#333"], [data-theme="sombre"] [style*="color: black"], [data-theme="sombre"] [style*="color: #000"] { color: var(--text-dark) !important; }
[data-theme="sombre"] input, [data-theme="sombre"] select, [data-theme="sombre"] textarea { background-color: var(--surface-2); color: var(--text-dark); border-color: var(--bordure); }
[data-theme="sombre"] input[type="checkbox"], [data-theme="sombre"] input[type="radio"], [data-theme="sombre"] input[type="color"] { background-color: transparent; }
[data-theme="sombre"] th, [data-theme="sombre"] td { border-color: var(--bordure); }
[data-theme="sombre"] th { background: var(--surface-2); }
/* Encadrés d'alerte clairs (jaune, rouge) : gardés lisibles en sombre */
[data-theme="sombre"] [style*="background: #fff4e0"], [data-theme="sombre"] [style*="background:#fff4e0"], [data-theme="sombre"] [style*="background:#fffbea"], [data-theme="sombre"] [style*="background: #fffbea"] { background: #3a3120 !important; color: #f3dfb3 !important; }
[data-theme="sombre"] [style*="background: #ffe6e6"], [data-theme="sombre"] [style*="background:#ffe6e6"], [data-theme="sombre"] .form-errors { background: #3a2023 !important; color: #f4b7bd !important; }
[data-theme="sombre"] tr:hover td { background-color: rgba(255,255,255,0.03); }
[data-theme="sombre"] label.grade-perm, [data-theme="sombre"] .stats-prod-card, [data-theme="sombre"] .menu-profil, [data-theme="sombre"] .btn-replier-menu, [data-theme="sombre"] .btn-menu-lateral { border-color: var(--bordure); }
[data-theme="sombre"] .menu-profil-entete, [data-theme="sombre"] .grade-foot { border-color: var(--bordure); }
[data-theme="sombre"] .menu-profil-sep { background: var(--bordure); }
[data-theme="sombre"] .menu-profil button small { background: var(--surface-2); color: #bbb; }
[data-theme="sombre"] .btn-porte:hover { background: rgba(220,53,69,0.15); }
[data-theme="sombre"] .product-card img { background: var(--surface-2); }
[data-theme="sombre"] #global-footer, [data-theme="sombre"] #global-footer a { color: #999 !important; }
[data-theme="sombre"] .admin-sidebar button { color: var(--text-dark); }
[data-theme="sombre"] .admin-sidebar button:hover, [data-theme="sombre"] .admin-sidebar button.active { background: var(--surface-2); color: #f0b8d4; }
[data-theme="sombre"] .modal { background: rgba(0,0,0,0.75); }

/* Logo des en-têtes : ramène à la réservation des repas */
.logo-accueil { background: none; border: none; padding: 0; cursor: pointer; display: inline-flex; flex-shrink: 0; border-radius: 6px; }
.logo-accueil img { height: 60px; width: auto; border-radius: 5px; display: block; transition: transform 0.15s; }
.logo-accueil:hover img { transform: scale(1.04); }
.logo-accueil:focus-visible { outline: 3px solid var(--pantone-199c); outline-offset: 3px; }
header .logo-accueil img { height: 60px; }
/* Barre d'en-tête : même hauteur sur toutes les pages (borne, cuisine, admin, profil, préférences, suivi…) */
header { box-sizing: border-box; min-height: 94px; }
@media (max-width: 768px) { header { min-height: 0; } }
/* Changement du mot de passe : 3 étapes */
.pin-etapes { display: flex; gap: 6px; margin-bottom: 18px; }
.pin-etapes span { flex: 1; font-size: 12px; font-weight: bold; padding: 6px 4px; border-radius: 8px; background: #eee; color: #777; }
.pin-etapes span.active { background: var(--pantone-222c); color: white; }
.pin-etapes span.fait { background: #e3f3e6; color: #2e7d32; }
.pin-chg-champ { width: 100%; box-sizing: border-box; text-align: center; font-size: 26px; letter-spacing: 10px; padding: 12px; }
.pin-chg-btn { width: 100%; padding: 14px; font-size: 17px; }
[data-theme="sombre"] .pin-etapes span { background: var(--surface-2); color: #bbb; }
[data-theme="sombre"] .pin-etapes span.active { background: var(--pantone-222c); color: white; }

/* Profil : options (e-mail de confirmation, promotions) */
.profil-option { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin: 0 0 14px; }
.profil-option input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.profil-option small { display: block; color: gray; font-size: 13px; margin-top: 3px; }
/* Préférences : favoris */
.favoris-carte { max-width: 760px; }
.favoris-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 25px; }
.favoris-vide { grid-column: 1 / -1; color: gray; background: var(--bg-light); padding: 15px; border-radius: 10px; margin: 0; }
.favori-carte { border: 2px solid #eee; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.favori-carte-tete { display: flex; justify-content: space-between; gap: 10px; color: var(--pantone-222c); font-size: 17px; }
.favori-carte-tete span { color: var(--pantone-199c); font-weight: bold; white-space: nowrap; }
.favori-carte ul { margin: 0; padding-left: 18px; font-size: 14px; flex: 1; }
.favori-carte li { margin-bottom: 3px; }
.favori-alerte { color: #8a5a00; }
.favori-carte-actions { display: flex; gap: 8px; }
.favori-carte-actions .btn { padding: 8px 12px; font-size: 14px; }
.favori-carte-actions .btn-primary { flex: 1; }
.favori-editeur { border-top: 1px solid #eee; padding-top: 20px; text-align: left; }
.favori-editeur h3 { margin: 0 0 12px; color: var(--pantone-222c); }
.favori-editeur .input-group input { width: 100%; box-sizing: border-box; }
.favori-lignes { list-style: none; padding: 0; margin: 0 0 12px; border: 1px solid #eee; border-radius: 10px; }
.favori-lignes li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #f2f2f2; }
.favori-lignes li:last-child { border-bottom: none; }
.favori-lignes .favori-lignes-vide { color: gray; font-style: italic; }
.favori-ajout { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; }
.favori-ajout select { flex: 1 1 220px; min-width: 0; padding: 10px; border-radius: 8px; border: 1px solid #ccc; }
.favori-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.favori-actions .btn { padding: 12px 20px; }
/* Borne : favoris en raccourci au-dessus des catégories */
.favoris-borne { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: white; padding: 10px 14px; border-radius: 12px; margin-bottom: 15px; border: 2px dashed #e0b84a; }
.favoris-borne-titre { color: var(--pantone-222c); margin-right: 4px; }
.favori-chip { border: 2px solid var(--pantone-222c); background: white; color: var(--pantone-222c); border-radius: 20px; padding: 8px 14px; font-weight: bold; font-size: 15px; cursor: pointer; font-family: inherit; }
.favori-chip:hover { background: var(--pantone-222c); color: white; }
.favori-chip small { font-weight: normal; opacity: 0.8; margin-left: 4px; }
.favori-chip-gerer { border-style: dashed; font-weight: normal; }
[data-theme="sombre"] .favori-carte, [data-theme="sombre"] .favori-lignes, [data-theme="sombre"] .favori-lignes li, [data-theme="sombre"] .favori-editeur { border-color: var(--bordure); }
[data-theme="sombre"] .favoris-borne, [data-theme="sombre"] .favori-chip { background: var(--surface, #222); }

/* Éditeur de favori dans une fenêtre (page Préférences) */
.modal-content.favori-editeur { max-width: 560px; text-align: left; border-top: none; padding: 30px; }
.modal-content.favori-editeur h3 { font-size: 22px; }
/* Favoris en haut de la colonne du panier (page de commande) */
.cart-section .favoris-borne { flex-direction: column; align-items: stretch; gap: 6px; margin: 0 0 18px; padding: 12px; background: #fffbea; border: 2px dashed #e0b84a; }
.cart-section .favoris-borne-titre { margin: 0 0 2px; }
.cart-section .favori-chip { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; border-radius: 10px; padding: 10px 12px; }
.cart-section .favori-chip small { white-space: nowrap; }
[data-theme="sombre"] .cart-section .favoris-borne { background: var(--surface-2); }

/* ==========================================
   MENU CONSULTABLE QUAND LES COMMANDES SONT CLÔTURÉES + HISTORIQUE DES COMMANDES
   ========================================== */
.borne-consultation { grid-column: 1 / -1; margin: 0; padding: 14px 18px; border-radius: 10px; background: #fdecea; color: #b3261e; font-weight: bold; text-align: center; }
.product-card.consultation { cursor: default; }
.product-card.consultation:hover { transform: none; }
.historique-carte { max-width: 760px; }
.historique-liste { display: flex; flex-direction: column; gap: 12px; margin-bottom: 15px; }
.historique-jour { margin: 14px 0 0; font-size: 16px; color: var(--pantone-222c); text-transform: capitalize; }
.historique-jour:first-child { margin-top: 0; }
.historique-cmd { border: 2px solid #eee; border-radius: 10px; padding: 14px 16px; text-align: left; }
.historique-cmd.annulee { opacity: 0.6; }
.historique-cmd.annulee ul { text-decoration: line-through; }
.historique-cmd-tete { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; color: gray; font-size: 14px; margin-bottom: 8px; }
.historique-statut { padding: 4px 10px; border-radius: 8px; font-weight: bold; font-size: 13px; white-space: nowrap; }
.historique-cmd ul { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.historique-cmd li { margin: 3px 0; }
.historique-total { text-align: right; font-weight: bold; color: var(--pantone-199c); margin-top: 6px; }
[data-theme="sombre"] .historique-cmd { border-color: var(--bordure); }
[data-theme="sombre"] .borne-consultation { background: rgba(220,53,69,0.15); color: #f2a7a0; }

/* Paniers garnis > Réglages : choix des sandwichs du plateau parmi la carte du site */
.garnitures-outils { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.garnitures-outils input[type="search"] { flex: 1 1 200px; min-width: 0; padding: 9px 12px; border-radius: 8px; border: 1px solid #ccc; font-size: 15px; }
.garnitures-compte { color: var(--pantone-222c); font-weight: bold; font-size: 14px; white-space: nowrap; }
.garnitures-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; padding: 8px; border: 1px solid #ddd; border-radius: 10px; background: var(--bg-light); margin-bottom: 6px; }
.garniture-choix { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: white; border: 1px solid #e3d6dd; cursor: pointer; font-weight: normal; margin: 0; }
.garniture-choix.coche { border-color: var(--pantone-222c); background: #f6eef2; font-weight: bold; }
.garniture-choix.hors-carte small { color: #c62828; font-weight: normal; }
[data-theme="sombre"] .garnitures-choix { border-color: var(--bordure); }
[data-theme="sombre"] .garniture-choix { background: var(--surface-2); border-color: var(--bordure); }
[data-theme="sombre"] .garniture-choix.coche { background: rgba(196,86,142,0.18); border-color: var(--pantone-222c); }

/* Modification de commande : bandeau du panier, mention dans le suivi, détail sur les tickets cuisine */
.cart-modif-banner { display: flex; flex-direction: column; gap: 8px; background: #fff4e5; border: 2px solid var(--warning); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-weight: bold; color: #7a4b00; font-size: 14px; }
.cart-modif-banner .btn { padding: 6px 10px; font-size: 13px; align-self: flex-start; }
.suivi-modifiee { margin: 10px 0 0; color: #b26a00; font-size: 14px; font-weight: bold; }
.badge-modifiee { display: inline-block; margin-top: 5px; background: var(--warning); color: black; padding: 3px 8px; border-radius: 10px; font-size: 13px; font-weight: bold; }
.ticket-modifs { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: #fff4e5; border-left: 5px solid var(--warning); font-size: 14px; text-align: left; }
.ticket-modifs + .ticket-modifs { margin-top: 6px; }
.ticket-modifs .modif-entete { color: #7a4b00; }
.ticket-modifs ul { list-style: none; margin: 4px 0 0; padding: 0; }
.ticket-modifs li { margin: 2px 0; font-weight: bold; }
.ticket-modifs li.ajout { color: #1b7f3b; }
.ticket-modifs li.retrait { color: #c62828; text-decoration: line-through; }
.ticket-modifs .modif-avant { margin-top: 4px; color: gray; font-size: 12px; }
#admin-cmd-modifs { margin-bottom: 12px; }
#admin-cmd-modifs .ticket-modifs .modif-entete { margin-top: 6px; }
#admin-cmd-modifs .ticket-modifs .modif-entete:first-child { margin-top: 0; }
[data-theme="sombre"] .cart-modif-banner, [data-theme="sombre"] .ticket-modifs { background: rgba(255,193,7,0.12); color: #ffd58a; }
[data-theme="sombre"] .ticket-modifs .modif-entete { color: #ffd58a; }

/* Validation : « Un petit plus ? » (dessert, soupe, bar à salade…) */
.recap-suggestions { margin: 15px 0 0; padding: 12px; background: #fffbea; border: 2px dashed #e0b84a; border-radius: 12px; text-align: left; }
.recap-suggestions-titre { margin: 0 0 8px; font-weight: bold; color: var(--pantone-222c); font-size: 17px; }
.recap-suggestions-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.recap-suggestion { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; background: white; border: 1px solid #e6dcc0; border-radius: 10px; cursor: pointer; font-family: inherit; color: var(--text-dark); text-align: center; }
.recap-suggestion:hover { border-color: var(--pantone-222c); }
.recap-suggestion:active { transform: scale(0.96); }
.recap-suggestion img, .recap-suggestion-vide { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: #eee; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.recap-suggestion-nom { font-size: 14px; font-weight: bold; line-height: 1.2; overflow-wrap: anywhere; }
.recap-suggestion-prix { font-size: 13px; color: var(--pantone-199c); font-weight: bold; }
.recap-suggestion-plus { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; color: transparent; font-size: 0; background: linear-gradient(#fff, #fff) center / 10px 2px no-repeat, linear-gradient(#fff, #fff) center / 2px 10px no-repeat, var(--success); }
[data-theme="sombre"] .recap-suggestions { background: var(--surface-2); border-color: var(--bordure); }
[data-theme="sombre"] .recap-suggestion { background: var(--surface); border-color: var(--bordure); }

/* Fiche allergènes (bouton « ? » d'un produit) : grille des 14 allergènes, style affiche du menu */
.modal-content.allergenes-fiche { width: 640px; max-width: 96vw; text-align: left; }
.allergenes-surtitre { margin: 0; font-size: 13px; font-weight: bold; color: var(--pantone-199c); text-transform: uppercase; letter-spacing: .04em; }
.allergenes-fiche h2 { margin: 4px 0 8px; color: var(--pantone-222c); letter-spacing: .05em; text-transform: uppercase; font-size: 22px; }
.allergenes-resume { margin: 0 0 14px; padding: 10px 14px; background: var(--bg-light); border-radius: 10px; font-size: 16px; line-height: 1.5; }
.allergenes-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.allergene-case { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px 8px; border-radius: 12px; border: 2px solid transparent; background: #f4f4f4; text-align: center; opacity: .45; filter: grayscale(80%); }
.allergene-case.present { opacity: 1; filter: none; border-color: var(--allergene-couleur); background: color-mix(in srgb, var(--allergene-couleur) 12%, white); }
.allergene-pastille { width: 52px; height: 52px; border-radius: 50%; background: var(--allergene-couleur); display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: inset 0 0 0 3px rgba(255,255,255,.35); }
.allergene-nom { font-size: 12px; font-weight: bold; line-height: 1.15; color: var(--text-dark); }
.allergene-marque { position: absolute; top: 4px; right: 6px; font-size: 18px; line-height: 1; color: #111; }
.allergenes-legende { margin: 12px 0 0; font-size: 13px; color: gray; display: flex; align-items: center; gap: 6px; }
.allergenes-point { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #111; flex: none; }
[data-theme="sombre"] .allergene-case { background: var(--surface-2); }
[data-theme="sombre"] .allergene-case.present { background: color-mix(in srgb, var(--allergene-couleur) 22%, var(--surface)); }
[data-theme="sombre"] .allergene-marque, [data-theme="sombre"] .allergenes-point { color: white; background-color: transparent; }
[data-theme="sombre"] .allergenes-point { background: white; }
@media (max-width: 480px) { .allergenes-grille { grid-template-columns: repeat(3, 1fr); } .allergene-pastille { width: 44px; height: 44px; font-size: 24px; } }

/* Choix de la sauce (fenêtre de personnalisation) : tuiles avec pastille de couleur */
.sauces-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 4px; }
.sauce-choix { position: relative; display: block; cursor: pointer; margin: 0; }
.sauce-choix input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sauce-carte { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; background: white; border: 2px solid #e2e2e2; border-radius: 12px; text-align: center; transition: border-color .15s, box-shadow .15s, transform .1s; }
.sauce-choix:hover .sauce-carte { border-color: #c9c9c9; }
.sauce-choix:active .sauce-carte { transform: scale(0.96); }
.sauce-pastille { width: 38px; height: 38px; border-radius: 50%; background: var(--sauce-couleur); box-shadow: inset 0 -4px 0 rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.15); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.sauce-sans .sauce-pastille { box-shadow: none; }
.sauce-nom { font-size: 15px; font-weight: bold; line-height: 1.2; color: var(--text-dark); overflow-wrap: anywhere; }
.sauce-sans .sauce-nom { font-weight: normal; font-style: italic; color: gray; }
.sauce-coche { position: absolute; top: 5px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--pantone-222c); color: white; font-size: 13px; font-weight: bold; line-height: 20px; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .15s; }
.sauce-choix input:checked + .sauce-carte { border-color: var(--pantone-222c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pantone-222c) 18%, transparent); background: color-mix(in srgb, var(--pantone-222c) 5%, white); }
.sauce-choix input:checked + .sauce-carte .sauce-coche { opacity: 1; transform: scale(1); }
.sauce-choix input:focus-visible + .sauce-carte { outline: 3px solid var(--warning); outline-offset: 2px; }
[data-theme="sombre"] .sauce-carte { background: var(--surface); border-color: var(--bordure); }
[data-theme="sombre"] .sauce-choix input:checked + .sauce-carte { background: color-mix(in srgb, var(--pantone-222c) 25%, var(--surface)); }

/* Retrait des ingrédients : mêmes tuiles que les sauces ; cochée = ingrédient retiré (rouge, barré) */
.customize-ingredients.avec-sauces { border-top: 1px solid #ddd; margin-top: 14px; padding-top: 8px; }
.ingredient-emoji { width: 38px; height: 38px; border-radius: 50%; background: #eef6f3; display: flex; align-items: center; justify-content: center; font-size: 22px; transition: filter .15s, opacity .15s; }
.ingredient-etat { font-size: 11px; font-weight: bold; text-transform: uppercase; letter-spacing: .05em; }
.ingredient-garde { color: var(--success); }
.ingredient-retire { display: none; color: #c62828; }
.ingredient-choix .sauce-coche { background: #c62828; }
.ingredient-choix input:checked + .sauce-carte { border-color: #c62828; box-shadow: 0 0 0 3px rgba(198, 40, 40, .15); background: #fff3f3; }
.ingredient-choix input:checked + .sauce-carte .sauce-nom { text-decoration: line-through; text-decoration-thickness: 2px; color: #c62828; }
.ingredient-choix input:checked + .sauce-carte .ingredient-emoji { filter: grayscale(100%); opacity: .5; }
.ingredient-choix input:checked + .sauce-carte .ingredient-garde { display: none; }
.ingredient-choix input:checked + .sauce-carte .ingredient-retire { display: inline; }
.ingredient-autre { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; padding: 8px 12px; background: white; border: 2px dashed #d5d5d5; border-radius: 12px; font-size: 18px; cursor: text; }
.ingredient-autre input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 16px; padding: 4px 0; font-family: inherit; color: var(--text-dark); }
.ingredient-autre:focus-within { border-color: var(--pantone-222c); border-style: solid; }
[data-theme="sombre"] .ingredient-emoji { background: var(--surface-2); }
[data-theme="sombre"] .ingredient-choix input:checked + .sauce-carte { background: color-mix(in srgb, #c62828 22%, var(--surface)); }
[data-theme="sombre"] .ingredient-autre { background: var(--surface); border-color: var(--bordure); }

/* Personnalisation en deux étapes : 1. sauce, 2. ingrédients */
.customize-etapes { display: flex; gap: 6px; margin: -6px 0 12px; }
.customize-etapes span { flex: 1; padding: 6px 8px; border-radius: 20px; background: #eee; color: gray; font-size: 13px; font-weight: bold; text-align: center; }
.customize-etapes span.actif { background: var(--pantone-222c); color: white; }
.customize-etapes span.fait { background: color-mix(in srgb, var(--pantone-222c) 15%, white); color: var(--pantone-222c); }
.customize-retour { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px; padding: 6px 12px; border: 1px solid #ddd; border-radius: 20px; background: white; color: var(--text-dark); font-size: 14px; font-family: inherit; cursor: pointer; }
.customize-retour span { color: gray; font-size: 12px; }
.customize-retour:hover { border-color: var(--pantone-222c); }
[data-theme="sombre"] .customize-etapes span { background: var(--surface-2); }
[data-theme="sombre"] .customize-retour { background: var(--surface); border-color: var(--bordure); }

/* Étapes cliquables ; badge des ingrédients : ✓ vert = gardé, ✕ rouge = retiré */
.customize-etapes button { flex: 1; padding: 6px 8px; border: none; border-radius: 20px; background: #eee; color: gray; font-size: 13px; font-weight: bold; text-align: center; font-family: inherit; cursor: pointer; }
.customize-etapes button.actif { background: var(--pantone-222c); color: white; cursor: default; }
.customize-etapes button.fait { background: color-mix(in srgb, var(--pantone-222c) 15%, white); color: var(--pantone-222c); }
.customize-etapes button.fait:hover { background: color-mix(in srgb, var(--pantone-222c) 28%, white); }
[data-theme="sombre"] .customize-etapes button { background: var(--surface-2); }
.ingredient-choix .sauce-coche.ingredient-badge { opacity: 1; transform: scale(1); background: var(--success); color: white; }
.ingredient-choix .ingredient-badge .ingredient-garde { color: white; }
.ingredient-choix .ingredient-badge .ingredient-retire { color: white; }
.ingredient-choix input:checked + .sauce-carte .sauce-coche.ingredient-badge { background: #c62828; }

/* Sélection de masse des produits */
.prod-sel-cell { width: 34px; text-align: center; }
.prod-sel-cell input, .prod-sel-cat { width: 18px; height: 18px; cursor: pointer; accent-color: var(--pantone-222c); vertical-align: middle; margin-right: 6px; }
.selection-bar { position: sticky; top: 38px; margin-right: 200px; z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; background: #f6eef2; border: 2px solid var(--pantone-222c); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.selection-bar.hidden { display: none; }
.selection-bar b { color: var(--pantone-222c); margin-right: auto; }
.selection-bar .btn { padding: 6px 14px; }
.btn-danger-outline { border-color: #c62828 !important; color: #c62828 !important; }
tr.prod-ligne-selectionnee > td { background: #fbf3f7; }
[data-theme="sombre"] .selection-bar { background: var(--surface); }
[data-theme="sombre"] tr.prod-ligne-selectionnee > td { background: color-mix(in srgb, var(--pantone-222c) 25%, var(--surface)); }

/* Fenêtre « Modifier N produits » */
.modal-content.masse-modal { width: 700px; max-width: 100%; padding: 0; text-align: left; display: flex; flex-direction: column; max-height: calc(100dvh - 30px); overflow: hidden; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.masse-entete { background: linear-gradient(135deg, var(--pantone-222c), #9a3a69); color: white; padding: 22px 28px; }
.masse-entete h3 { margin: 0; font-size: 22px; color: white; }
.masse-entete p { margin: 4px 0 0; opacity: .85; font-size: 14px; }
.masse-corps { padding: 18px 24px; overflow-y: auto; flex: 1; background: #fafafa; display: flex; flex-direction: column; gap: 10px; }
.masse-bloc { background: white; border: 2px solid #ececec; border-radius: 14px; transition: border-color .15s, box-shadow .15s; }
.masse-bloc:hover { border-color: #d9c3cf; }
.masse-bloc:has(.masse-switch input:checked) { border-color: var(--pantone-222c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pantone-222c) 12%, transparent); }
.masse-tete { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; margin: 0; }
.masse-ico { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; background: #f3e9ef; border-radius: 12px; }
.masse-bloc:has(.masse-switch input:checked) .masse-ico { background: var(--pantone-222c); filter: none; }
.masse-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.masse-txt b { font-size: 16px; color: var(--text-dark, #222); }
.masse-txt small { color: gray; font-size: 13px; }
.masse-switch { position: relative; flex: none; width: 46px; height: 26px; }
.masse-switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.masse-switch i { position: absolute; inset: 0; background: #c9c9c9; border-radius: 26px; transition: background .2s; }
.masse-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: white; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.masse-switch input:checked + i { background: var(--pantone-222c); }
.masse-switch input:checked + i::after { transform: translateX(20px); }
.masse-switch input:focus-visible + i { outline: 3px solid var(--warning, #f0a500); outline-offset: 2px; }
.masse-champ { padding: 2px 16px 16px 72px; }
.masse-champ.hidden { display: none; }
.masse-champ select, .masse-champ input[type="number"], .masse-champ input[type="time"] { width: 100%; padding: 11px 12px; border: 1px solid #ccc; border-radius: 10px; font-size: 16px; font-family: inherit; box-sizing: border-box; background: white; }
.masse-champ select:focus, .masse-champ input:focus { outline: none; border-color: var(--pantone-222c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pantone-222c) 15%, transparent); }
.masse-aide { display: block; margin-top: 6px; color: gray; font-size: 13px; }
.masse-montant { position: relative; }
.masse-montant input { padding-right: 36px !important; }
.masse-montant span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: gray; font-weight: bold; }
.masse-seg { display: flex; background: #efe7ec; border-radius: 12px; padding: 4px; gap: 4px; }
.masse-seg label { flex: 1; margin: 0; cursor: pointer; }
.masse-seg input { position: absolute; opacity: 0; pointer-events: none; }
.masse-seg span { display: block; text-align: center; padding: 9px 10px; border-radius: 9px; font-weight: bold; font-size: 15px; color: #6b5a64; transition: background .15s, color .15s; }
.masse-seg input:checked + span { background: white; color: var(--pantone-222c); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.masse-seg input:focus-visible + span { outline: 3px solid var(--warning, #f0a500); }
.masse-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.masse-chips label { margin: 0; cursor: pointer; }
.masse-chips input { position: absolute; opacity: 0; pointer-events: none; }
.masse-chips span { display: inline-block; padding: 6px 14px; border: 2px solid #e2e2e2; border-radius: 20px; font-size: 14px; background: white; transition: all .15s; user-select: none; }
.masse-chips label:hover span { border-color: #c9a9bb; }
.masse-chips input:checked + span { background: var(--pantone-222c); border-color: var(--pantone-222c); color: white; font-weight: bold; }
.masse-chips input:focus-visible + span { outline: 3px solid var(--warning, #f0a500); }
.masse-pied { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid #e6e6e6; background: white; }
.masse-pied > span:first-child { color: gray; font-size: 14px; }
.masse-pied > span:first-child.actif { color: var(--pantone-222c); font-weight: bold; }
@media (max-width: 520px) { .masse-champ { padding-left: 16px; } .masse-corps { padding: 14px; } }
[data-theme="sombre"] .masse-corps { background: var(--bg-light); }
[data-theme="sombre"] .masse-bloc, [data-theme="sombre"] .masse-pied, [data-theme="sombre"] .masse-champ select, [data-theme="sombre"] .masse-champ input[type="number"], [data-theme="sombre"] .masse-champ input[type="time"], [data-theme="sombre"] .masse-chips span { background: var(--surface); border-color: var(--bordure); color: inherit; }
[data-theme="sombre"] .masse-seg { background: var(--bg-light); }
[data-theme="sombre"] .masse-seg input:checked + span { background: var(--surface); }
[data-theme="sombre"] .masse-ico { background: color-mix(in srgb, var(--pantone-222c) 25%, var(--surface)); }
[data-theme="sombre"] .masse-txt b { color: inherit; }

/* Profil : liaison Castalia (Bouba) */
.castalia-statut { margin: 0 0 12px; font-size: 14px; }
.castalia-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
#castalia-choix .btn { margin: 0 8px 8px 0; }
#castalia-choix select { width: 100%; box-sizing: border-box; font-size: 16px; padding: 10px; border-radius: 8px; border: 1px solid #ccc; }

/* Castalia : fond de page (couches derrière tout le site), police et rayon des coins de l'univers choisi */
#castalia-fond { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.castalia-couche { position: absolute; inset: 0; }
html.castalia-fond-actif { background-color: var(--bg-light); }
html.castalia-fond-actif body, html.castalia-fond-actif[data-theme="sombre"] body { background: transparent; }
html.castalia-police body, html.castalia-police button, html.castalia-police input, html.castalia-police select, html.castalia-police textarea { font-family: var(--castalia-police); }
html.castalia-rayon .btn, html.castalia-rayon .product-card, html.castalia-rayon .profil-carte, html.castalia-rayon .modal-content, html.castalia-rayon .menu-profil,
html.castalia-rayon input, html.castalia-rayon select, html.castalia-rayon textarea { border-radius: var(--castalia-rayon); }

/* ===== Écran d'accueil / connexion (borne et téléphone) ===== */
#page-connexion { display: flex; flex-direction: column; align-items: center; padding-bottom: 30px; }
.accueil-entete { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; width: 100%; margin-bottom: 16px; }
.accueil-entete::after { content: ''; }
.accueil-logo { height: auto; max-height: 64px; width: auto; max-width: 100%; border-radius: 10px; justify-self: start; }
.accueil-horloge { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1.1; color: var(--pantone-222c); }
#accueil-heure { font-size: 34px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
#accueil-date { font-size: 16px; text-transform: capitalize; color: var(--gray); }
.accueil-corps { display: flex; flex-wrap: wrap; gap: 24px; width: 100%; max-width: 1150px; justify-content: center; align-items: flex-start; }
.accueil-carte { background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); text-align: center; border-top: 6px solid var(--pantone-222c); width: 100%; max-width: 450px; flex: 1 1 380px; box-sizing: border-box; }
.accueil-menu { background: white; border-radius: 20px; padding: 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border-top: 6px solid var(--pantone-199c); flex: 1.4 1 420px; max-width: 640px; box-sizing: border-box; }
.accueil-menu h2 { margin: 0 0 4px; color: var(--pantone-222c); font-size: 22px;  }
.accueil-menu-note { margin: 0 0 12px; color: var(--gray); font-size: 14px; }
.accueil-menu-liste { max-height: 58vh; overflow-y: auto; padding-right: 4px; }
.accueil-cat { margin: 14px 0 6px; font-size: 14px; font-weight: bold; color: var(--pantone-222c); text-transform: uppercase; letter-spacing: .5px; }
.accueil-cat:first-child { margin-top: 0; }
.accueil-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.accueil-produit { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid #eee; border-radius: 12px; position: relative; }
.accueil-produit img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: #eee; }
.accueil-produit b { display: block; font-size: 14px; line-height: 1.25; }
.accueil-prix { color: var(--pantone-199c); font-weight: bold; font-size: 14px; }
.accueil-produit.epuise { opacity: .5; }
.accueil-epuise-badge { font-size: 11px; font-weight: bold; color: white; background: var(--gray); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.accueil-qr { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 190px; padding: 12px; background: white; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); border-top: 6px solid var(--pantone-222c); box-sizing: border-box; text-align: center; }
.accueil-qr img { width: 100%; height: auto; display: block; }
.accueil-qr p { margin: 0; color: var(--pantone-222c); font-size: 15px; line-height: 1.3; }
#page-connexion.avec-qr { padding-right: 230px; }
[data-theme="sombre"] .accueil-carte, [data-theme="sombre"] .accueil-menu, [data-theme="sombre"] .accueil-qr { background: var(--surface); color: var(--text-dark); }
[data-theme="sombre"] .accueil-produit { border-color: var(--bordure); }
@media (max-width: 900px) { #page-connexion.avec-qr { padding-right: 0; padding-bottom: 210px; } .accueil-qr { width: 130px; padding: 8px; } .accueil-qr p { font-size: 12px; } }
@media (max-width: 600px) { .accueil-carte { padding: 26px 18px; } #accueil-heure { font-size: 28px; } .accueil-logo { max-height: 52px; } }
/* Borne : texte plus grand, touches larges, contraste renforcé */
.kiosque .accueil-logo { max-height: 84px; }
.kiosque #accueil-heure { font-size: 54px; }
.kiosque #accueil-date { font-size: 22px; color: var(--text-dark); }
.kiosque .accueil-carte { max-width: 560px; padding: 48px 40px; border-top-width: 8px; }
.kiosque .accueil-carte #ui-title { font-size: 38px !important; }
.kiosque .accueil-carte #ui-subtitle { font-size: 22px !important; }
.kiosque .accueil-carte #ui-desc { font-size: 18px !important; color: #444 !important; }
.kiosque .accueil-carte input { font-size: 24px; min-height: 70px; border: 3px solid var(--pantone-222c); }
.kiosque .accueil-carte .btn { min-height: 70px; font-size: 26px !important; }
.kiosque .accueil-menu h2 { font-size: 28px; }
.kiosque .accueil-menu-note { font-size: 17px; color: var(--text-dark); }
.kiosque .accueil-cat { font-size: 17px; }
.kiosque .accueil-produit b, .kiosque .accueil-prix { font-size: 17px; }
.kiosque .accueil-produit img { width: 80px; height: 80px; }
[data-theme="sombre"].kiosque #accueil-date, [data-theme="sombre"].kiosque .accueil-menu-note { color: var(--text-dark); }
/* Sablier : la borne revient à l'accueil après inactivité */
#sablier-inactivite { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 400; background: var(--pantone-222c); color: white; padding: 14px 26px; border-radius: 40px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); font-size: 20px; text-align: center; }
#sablier-inactivite small { display: block; font-size: 14px; opacity: .9; }

.kiosque .accueil-qr { width: 220px; } .kiosque .accueil-qr p { font-size: 17px; }
.kiosque #page-connexion.avec-qr { padding-right: 260px; }
@media (max-width: 900px) { .kiosque #page-connexion.avec-qr { padding-right: 0; } .kiosque .accueil-qr { width: 150px; } }

/* Petit écran avec QR code : la liste des plats défile dans sa carte, elle ne passe jamais sous le QR code */
@media (max-width: 900px) { #page-connexion.avec-qr .accueil-menu-liste { max-height: max(110px, calc(100vh - 600px)); } #page-connexion.avec-qr .accueil-corps { margin-bottom: 10px; } }

/* Profil et déconnexion : toujours en haut à droite de l'écran, sur toutes les pages (borne, cuisine, administration…) */
.profil-wrap { position: fixed; top: 42px; right: 97px; z-index: 500; }
.btn-porte { position: fixed; top: 42px; right: 35px; z-index: 500; background: white; }
.btn-profil { background: white; }
[data-theme="sombre"] .btn-porte, [data-theme="sombre"] .btn-profil { background: var(--surface); }
header { padding-right: 205px; }
.menu-profil { position: fixed; top: 98px; right: 35px; left: auto; transform: none; width: min(340px, calc(100vw - 32px)); min-width: 0; box-sizing: border-box; max-height: calc(100vh - 100px); overflow-y: auto; }
@media (max-width: 768px) {
    /* Téléphone : logo et « Bonjour » à gauche, profil et quitter à droite sur la même ligne (pas de grande bande vide) */
    .selection-bar { top: 92px; margin-right: 0; }
    .profil-wrap { position: fixed; top: 32px; right: 76px; }
    .btn-porte { top: 32px; right: 16px; }
    header { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; text-align: left; padding: 12px 140px 12px 14px; min-height: 76px; gap: 8px 10px; }
    header > div { width: auto; justify-content: flex-start; }
    header > div:first-child { flex-direction: column; align-items: flex-start; gap: 4px !important; }
    header .logo-accueil img { height: 42px; }
    header .user-greeting { font-size: 17px; text-align: left; }
    header .header-title { justify-content: flex-start; }
    .menu-profil { position: fixed; top: 86px; right: 12px; left: auto; transform: none; }
}

/* Cuisine, mode listing : les groupes se répartissent en colonnes pour tenir sur un écran */
.listing-flux { column-width: 300px; column-gap: 20px; }
.listing-flux .listing-section { break-inside: avoid; }

/* ===== Page Profil : toute la largeur de l'écran, rubriques en tuiles côte à côte (moins de défilement) ===== */
#page-profil .profil-carte { max-width: 1500px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 20px 24px; align-items: start; padding: 28px; }
#page-profil .profil-carte-tete, #page-profil .profil-infos, #page-profil .profil-aide { grid-column: 1 / -1; margin: 0; }
#page-profil .profil-section { margin: 0; padding: 20px; border: 1px solid #eee; border-radius: 12px; background: var(--bg-light); height: 100%; box-sizing: border-box; }
/* Infos du compte : chaque libellé au-dessus de sa valeur, en colonnes */
#page-profil .profil-infos { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px 20px; }
#page-profil .profil-infos dt { font-size: 13px; }
#page-profil .profil-infos dd { margin: 2px 0 0; }
@media (min-width: 1000px) {
    #page-profil .profil-carte-tete { grid-column: 1 / 2; margin: 0; }
    #page-profil .profil-infos { grid-column: 2 / -1; align-self: center; }
}
[data-theme="sombre"] #page-profil .profil-section { border-color: var(--bordure); background: var(--surface-2); }
