/* Compléments au style historique du club (styles.css, conservé tel quel) :
   profils, connexion, adaptation téléphone / tablette / ordinateur, configuration en onglets,
   hors ligne, thème sombre. Même palette : rouge #dc143c, noir #1a1a1a, dégradé du bandeau. */

:root {
  --k-grad: linear-gradient(135deg, var(--primary-red), var(--primary-black));
  --k-card: #ffffff;
  --k-ground: var(--light-gray);
  --k-text: var(--dark-gray);
  --k-muted: #6b6b6b;
  --k-line: var(--border-color);
}

/* ---------- Bandeau : logo du club (texte blanc) + bénévole connecté ---------- */
header .logo-img { border: 0; border-radius: 0; width: 64px; height: 64px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.user-zone { display: flex; align-items: center; gap: 12px; }
.net-dot {
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.15); color: #fff; font-weight: 600; font-size: 0.9em;
}
.net-dot i { color: #7ee2a0; }
.net-dot.off { background: #fff; color: var(--primary-red); }
.net-dot.off i { color: var(--primary-red); }
.user-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 30px;
  background: rgba(255, 255, 255, 0.15); border: 2px solid rgba(255, 255, 255, 0.6); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
}
.user-chip .initials {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--primary-red); font-weight: 800;
}
.nav-user { display: none; }

/* Menu : lien actif + badge du service */
.nav-link .nav-badge {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px;
  background: var(--primary-red); color: #fff; font-size: 0.8em; line-height: 20px; text-align: center;
}

/* ---------- Hors ligne : pastille fixe en haut à droite + fenêtre non bloquante ---------- */
[hidden] { display: none !important; }
.k-net-pill {
  position: fixed; top: calc(var(--k-net-top, 8px) + env(safe-area-inset-top, 0px)); right: 8px; z-index: 3000;
  display: inline-flex; align-items: center; gap: 6px; max-width: calc(100vw - 16px); padding: 7px 12px;
  border: 2px solid #fff; border-radius: 999px; background: #d7191f; color: #fff; font: inherit; font-size: 0.85em; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); cursor: pointer; text-align: left;
}
.k-net-pill.sending { background: #e08e0b; cursor: default; }
.k-net-pill i { flex: none; }
.k-net-popup {
  position: fixed; top: calc(var(--k-net-top, 8px) + 46px + env(safe-area-inset-top, 0px)); right: 8px; z-index: 3001;
  display: flex; gap: 12px; align-items: flex-start; width: min(360px, calc(100vw - 16px)); box-sizing: border-box; padding: 14px 12px 14px 14px;
  border-radius: 14px; border-left: 6px solid #d7191f; background: var(--k-card, #fff); color: var(--k-text, #222);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
}
.k-net-popup b { display: block; font-size: 1.05em; color: #d7191f; margin-bottom: 4px; }
.k-net-popup p { margin: 0 0 8px; font-size: 0.92em; line-height: 1.4; }
.k-net-popup .k-net-attente { font-weight: 700; }
.k-net-popup-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fde8e9; color: #d7191f; font-size: 1.2em; }
.k-net-close { flex: none; width: 32px; height: 32px; margin: -6px -2px 0 0; border: 0; border-radius: 50%; background: transparent; color: var(--k-muted, #666); font-size: 1.5em; line-height: 1; cursor: pointer; }
html[data-theme="sombre"] .k-net-popup b { color: #ff6b7a; }
html[data-theme="sombre"] .k-net-popup-icon { background: rgba(255, 59, 92, 0.18); color: #ff6b7a; }
@media (prefers-reduced-motion: no-preference) { .k-net-popup { animation: kNetIn 0.2s ease-out; } }
@keyframes kNetIn { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Fenêtres (même style que les modales historiques) ---------- */
.k-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.6); animation: kFade 0.15s ease-out; }
.k-modal .modal-content { width: 100%; max-width: 520px; max-height: 92vh; display: flex; flex-direction: column; animation: kPop 0.2s ease-out; }
.k-modal.wide .modal-content { max-width: 680px; }
.k-modal .modal-body { overflow-y: auto; padding: 20px; }
.k-modal .modal-header h3 i { margin-right: 8px; }
.k-modal .modal-footer { flex-wrap: wrap; }
.k-modal .modal-footer .btn { flex: 1; min-height: 48px; font-size: 1.05em; }
@keyframes kFade { from { opacity: 0; } }
@keyframes kPop { from { transform: scale(0.96); opacity: 0; } }

.k-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.k-field > span { font-weight: 600; color: var(--k-text); }
.k-input, .k-field input:not([type="checkbox"]):not([type="color"]):not([type="range"]), .k-field select {
  width: 100%; min-height: 48px; padding: 10px 14px; border: 2px solid var(--k-line); border-radius: 8px;
  background: var(--k-card); color: var(--k-text); font: inherit; font-size: 1.05em;
}
.k-input:focus, .k-field input:focus, .k-field select:focus { outline: none; border-color: var(--primary-red); box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.15); }
.k-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--k-line); }
.k-row:last-child { border-bottom: 0; }
.k-row .grow { flex: 1; min-width: 0; }
.k-row small { display: block; color: var(--k-muted); }
.k-help { color: var(--k-muted); font-size: 0.92em; margin: 6px 0 0; }
.k-error { color: var(--danger-color); font-weight: bold; min-height: 1.4em; text-align: center; }

/* Interrupteur */
.k-switch { position: relative; width: 54px; height: 32px; flex: none; }
.k-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.k-switch span { position: absolute; inset: 0; border-radius: 16px; background: #c9c9c9; transition: background 0.2s; pointer-events: none; }
.k-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.k-switch input:checked + span { background: var(--success-color); }
.k-switch input:checked + span::after { transform: translateX(22px); }
.k-switch input:focus-visible + span { outline: 3px solid var(--primary-red); outline-offset: 2px; }

/* Choix segmenté */
.k-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.k-seg button { flex: 1; min-height: 44px; padding: 8px 12px; border: 2px solid var(--k-line); border-radius: 8px; background: var(--k-card); color: var(--k-text); font: inherit; font-weight: 600; cursor: pointer; }
.k-seg button[aria-pressed="true"] { border-color: var(--primary-red); background: var(--primary-red); color: #fff; }

/* Connexion : liste des bénévoles */
.k-login .modal-content { max-width: 440px; }
.k-login .login-logo { display: block; width: 120px; margin: 0 auto 10px; }
.k-person { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-bottom: 1px solid var(--k-line); background: none; color: var(--k-text); font: inherit; text-align: left; cursor: pointer; }
.k-person:hover { background: rgba(220, 20, 60, 0.05); }
.k-person .initials { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--primary-red); color: #fff; font-weight: 800; flex: none; }
.k-person b { display: block; font-size: 1.08em; }
.k-person small { color: var(--k-muted); }
.k-people { max-height: 45vh; overflow-y: auto; border: 1px solid var(--k-line); border-radius: 8px; }

/* Notifications (style historique) */
.k-toasts { position: fixed; top: 20px; right: 20px; left: 20px; z-index: 10100; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.k-toasts .notification-base { position: static; pointer-events: auto; max-width: 420px; animation: slideIn 0.3s ease; }
.k-toasts .notification-base { display: flex; align-items: center; gap: 8px; padding-right: 6px; }
.k-toasts .grow { flex: 1; min-width: 0; }
.k-toast-close { flex: none; width: 36px; height: 36px; margin: -6px 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.25); color: inherit; font-size: 1.4em; line-height: 1; cursor: pointer; }

/* ---------- Caisse ---------- */
.article-btn { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html[data-photos="off"] .article-image-caisse { display: none !important; }
html[data-monnaie="off"] .montant-donne,
html[data-monnaie="off"] .monnaie-buttons,
html[data-monnaie="off"] .monnaie { display: none !important; }
.monnaie-grid .btn-monnaie[data-value="100.00"] { grid-column: auto; }
.action-status {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px;
  color: #b35900; font-weight: bold; text-align: center;
}
.actions-caisse { display: flex; gap: 10px; align-items: stretch; }
.actions-caisse .btn { flex: 1; min-height: 52px; font-size: 1.05em; }
.actions-caisse #actionVente { flex: 2; }
.btn-appoint { background: linear-gradient(135deg, var(--primary-red), #a10f2c); color: #fff; border: 0; }

/* Monnaie à rendre : grande fenêtre après la vente */
.k-done .modal-content { max-width: 420px; text-align: center; border-top: 6px solid var(--success-color); }
.k-done .modal-body { padding: 28px 20px; }
.k-done .kind { font-size: 1.2em; font-weight: bold; color: var(--k-muted); text-transform: uppercase; letter-spacing: 1px; }
.k-done .big { font-size: 4em; font-weight: 800; color: var(--success-color); line-height: 1.1; margin: 6px 0 10px; }
.k-done .big.neutral { color: var(--primary-red); }
.k-done .ticketno { display: inline-block; margin-top: 10px; padding: 10px 22px; border: 3px solid var(--primary-red); border-radius: 12px; font-size: 2em; font-weight: 800; color: var(--primary-red); }
.k-done .ticketno small { display: block; font-size: 0.4em; letter-spacing: 1px; text-transform: uppercase; }
.k-done .note { color: var(--k-muted); margin-top: 10px; }

/* Pavé du numéro de ticket */
.k-ticket-input { font-size: 2.4em !important; font-weight: 800; text-align: center; letter-spacing: 4px; }

/* Barre rouge d'encaissement (téléphone) */
.k-paybar { display: none; }

/* ---------- Téléphone ---------- */
html[data-device="phone"] .caisse-layout { display: block; }
html[data-device="phone"] .caisse-header { margin-bottom: 8px; }
html[data-device="phone"] .articles-grid { padding: 8px; min-height: 0 !important; margin-bottom: 90px; }
html[data-device="phone"] .article-btn { min-height: 96px; }
html[data-device="phone"] .mobile-total-display { display: none !important; }
html[data-device="phone"] .k-paybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1400;
  display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border: 0; background: var(--k-grad); color: #fff; font: inherit; font-weight: bold; cursor: pointer;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.35);
}
html[data-device="phone"] .k-paybar.empty { background: #fff; color: #888; border-top: 1px solid var(--k-line); box-shadow: none; }
html[data-device="phone"] .k-paybar .count { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px; background: #fff; color: var(--primary-red); }
html[data-device="phone"] .k-paybar .cta { flex: 1; text-align: left; font-size: 1.15em; }
html[data-device="phone"] .k-paybar.empty .cta { text-align: center; }
html[data-device="phone"] .k-paybar .total { font-size: 1.6em; }
html[data-device="phone"] .caisse-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500; margin: 0;
  max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%); transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
}
html[data-device="phone"] body.panel-open .caisse-panel { transform: none; }
html[data-device="phone"] body.panel-open::after { content: ""; position: fixed; inset: 0; z-index: 1450; background: rgba(0, 0, 0, 0.45); }
html[data-device="phone"] body.panel-open .k-paybar { display: none; }
.panel-grip { display: none; }
html[data-device="phone"] .panel-grip { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 10px; }
html[data-device="phone"] .panel-grip b { font-size: 1.2em; color: var(--primary-red); }
html[data-device="phone"] .ecran-caisse { order: -1; margin: 0 0 12px; }
html[data-device="phone"] .caisse-panel { display: flex; flex-direction: column; }
html[data-device="phone"] .calculatrice { margin: 0 0 10px; }
html[data-device="phone"] .monnaie-grid { grid-template-columns: repeat(5, 1fr); }
html[data-device="phone"] .btn-monnaie { min-height: 46px; font-size: 1em; }

/* ---------- Tablette ---------- */
html[data-device="tablet"] .caisse-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
html[data-device="tablet"] .caisse-panel { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }

html[data-device="tablet"] .mobile-total-display { display: none !important; }

/* ---------- Ordinateur ---------- */
html[data-device="desktop"] .caisse-panel { position: sticky; top: 210px; max-height: calc(100vh - 230px); overflow-y: auto; }
/* Grille d'articles : le nombre de colonnes du profil est un MAXIMUM ; quand la place manque
   (zoom, petit écran), les tuiles ne descendent jamais sous --k-min et passent à la ligne. */
.category-articles-grid {
  --k-min: 170px; --k-gap: 15px; --k-auto: 99;
  grid-template-columns: repeat(auto-fill, minmax(max(var(--k-min), calc((100% - (var(--k-cols, var(--k-auto)) - 1) * var(--k-gap)) / var(--k-cols, var(--k-auto)))), 1fr)) !important;
  gap: var(--k-gap) !important;
}
html[data-device="tablet"] .category-articles-grid { --k-min: 140px; }
html[data-device="phone"] .category-articles-grid { --k-min: 96px; --k-gap: 6px; --k-auto: 3; }
.container.wide { max-width: 1500px; }

/* ---------- Configuration en onglets ---------- */
.k-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin-bottom: 20px; background: var(--k-card); border-radius: 12px; box-shadow: var(--shadow); scrollbar-width: none; }
.k-tabs::-webkit-scrollbar { display: none; }
.k-tabs button { flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 16px; border: 0; border-radius: 8px; background: none; color: var(--k-text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.k-tabs button[aria-selected="true"] { background: var(--k-grad); color: #fff; }
.k-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.k-toolbar .grow { flex: 1; }
.k-cat-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; padding: 10px 14px; border-radius: 8px; background: var(--c); color: #fff; font-weight: bold; text-transform: uppercase; letter-spacing: 0.5px; }
.k-cat-title .count { margin-left: auto; font-weight: 600; opacity: 0.9; text-transform: none; }
.k-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--k-card); border-left: 5px solid var(--c, var(--primary-red)); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.k-item.off { opacity: 0.6; }
.k-item .handle { cursor: grab; padding: 10px 4px; color: #aaa; touch-action: none; }
.k-item .thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: contain; background: #f2f2f2; flex: none; }
.k-item .thumb.icon { display: grid; place-items: center; color: var(--c); font-size: 1.3em; }
.k-item .info { flex: 1; min-width: 0; }
.k-item .info b { display: block; font-size: 1.05em; }
.k-item .info small { color: var(--k-muted); }
.k-item .price { font-weight: 800; font-size: 1.05em; color: var(--c, var(--primary-red)); white-space: nowrap; }
.k-item .dispo { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.75em; font-weight: 700; color: var(--k-muted); }
.k-item .btn-edit { min-width: 48px; min-height: 48px; }
.sortable-ghost { opacity: 0.35; }
.sortable-chosen { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.k-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.78em; font-weight: 700; background: #eee; color: #555; }
.k-badge.red { background: #fdecef; color: var(--primary-red); }
.k-badge.green { background: #e8f6ec; color: #1e7e34; }
.k-mode { display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin-bottom: 12px; border: 3px solid var(--k-line); border-radius: 12px; background: var(--k-card); cursor: pointer; text-align: left; width: 100%; font: inherit; color: var(--k-text); }
.k-mode i { font-size: 1.8em; color: var(--primary-red); width: 40px; text-align: center; margin-top: 4px; }
.k-mode b { display: block; font-size: 1.15em; margin-bottom: 4px; }
.k-mode[aria-pressed="true"] { border-color: var(--primary-red); background: rgba(220, 20, 60, 0.05); }
.k-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.k-icons button { aspect-ratio: 1; border: 2px solid var(--k-line); border-radius: 8px; background: var(--k-card); color: var(--k-text); font-size: 1.2em; cursor: pointer; }
.k-icons button[aria-pressed="true"] { border-color: var(--c, var(--primary-red)); background: var(--c, var(--primary-red)); color: #fff; }
.k-colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.k-colors button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 2px var(--k-line); cursor: pointer; }
.k-colors button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--k-text); }
.k-photo { display: flex; gap: 14px; align-items: center; }
.k-photo .preview { width: 96px; height: 96px; border-radius: 10px; background: #f2f2f2; border: 1px solid var(--k-line); display: grid; place-items: center; overflow: hidden; color: #aaa; font-size: 2em; flex: none; }
.k-photo .preview img { width: 100%; height: 100%; object-fit: contain; }
.k-crop { height: min(58vh, 420px); background: #222; border-radius: 10px; overflow: hidden; }
.k-crop img { display: block; max-width: 100%; }
.k-crop .cropper-view-box { outline: 2px solid var(--primary-red); }
.k-crop .cropper-line, .k-crop .cropper-point { background-color: var(--primary-red); }
.k-crop .cropper-point { width: 12px; height: 12px; border-radius: 50%; opacity: 1; }

/* ---------- Écran public (page d'accueil du site) ---------- */
body.page-menu { padding-top: 0; background: #f5f5f5; }
.menu-header { position: sticky; top: 0; z-index: 10; background: var(--k-grad); color: #fff; box-shadow: var(--shadow); }
.menu-header .container { display: flex; align-items: center; gap: 16px; padding: 14px 20px; max-width: none; }
.menu-header img { width: 84px; height: auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4)); }
.menu-header h1 { margin: 0; font-size: 2.4em; line-height: 1; }
.menu-header p { margin: 4px 0 0; opacity: 0.9; font-style: italic; }
.menu-header .clock { margin-left: auto; text-align: right; font-weight: bold; font-size: 2em; }
.menu-header .clock small { display: block; font-size: 0.4em; font-weight: normal; opacity: 0.85; }
.menu-body { padding: 16px 20px 20px; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.menu-cat { background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.menu-cat-header { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px 18px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 78%, #000)); color: #fff; font-size: 1.5em; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-left: 4px solid var(--c); background: linear-gradient(145deg, #fff, #f8f9fa); }
.menu-item + .menu-item { border-top: 1px solid #eee; }
.menu-item img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.menu-item .n { flex: 1; font-weight: 700; font-size: 1.25em; color: #2c3e50; text-transform: uppercase; letter-spacing: 0.3px; }
.menu-item .p { font-weight: 800; font-size: 1.7em; color: var(--c); text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.08); white-space: nowrap; }
.menu-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px 16px; color: #777; font-size: 0.9em; }
.menu-footer a { color: var(--primary-red); font-weight: bold; text-decoration: none; }
html[data-device="phone"] .menu-header img { width: 56px; }
html[data-device="phone"] .menu-header h1 { font-size: 1.6em; }
html[data-device="phone"] .menu-header .clock { display: none; }
html[data-device="phone"] .menu-body { padding: 12px; }

/* ---------- Thème sombre (au choix de chaque bénévole) ---------- */
html[data-theme="sombre"] {
  --light-gray: #141416; --dark-gray: #e7e7e7; --border-color: #3a3b40;
  --k-card: #1f2023; --k-text: #e7e7e7; --k-muted: #a6a6a6; --k-line: #3a3b40;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}
html[data-theme="sombre"] { background: #141416; color-scheme: dark; }
html[data-theme="sombre"] body { background: #141416; color: #e7e7e7; }
html[data-theme="sombre"] .modal-content,
html[data-theme="sombre"] .welcome-section,
html[data-theme="sombre"] .module-card,
html[data-theme="sombre"] .quick-stats,
html[data-theme="sombre"] .caisse-header,
html[data-theme="sombre"] .serveurs-header,
html[data-theme="sombre"] .ticket-card,
html[data-theme="sombre"] .ticket-detail-popup,
html[data-theme="sombre"] .config-section,
html[data-theme="sombre"] .stats-section,
html[data-theme="sombre"] .stat-card,
html[data-theme="sombre"] .articles-grid,
html[data-theme="sombre"] .caisse-panel,
html[data-theme="sombre"] .k-tabs,
html[data-theme="sombre"] .k-item,
html[data-theme="sombre"] .k-mode { background: #1f2023 !important; color: #e7e7e7 !important; }
html[data-theme="sombre"] .article-btn { background: #26272b; color: #e7e7e7; }
html[data-theme="sombre"] .article-btn.disponible-dynamic[style] .article-quantity-controls { color: #fff; }
html[data-theme="sombre"] .k-paybar.empty { background: #1f2023 !important; color: #a6a6a6 !important; }
html[data-theme="sombre"] .ticket, html[data-theme="sombre"] .calculatrice, html[data-theme="sombre"] .stat-item { background: #26272b !important; color: #e7e7e7; }
html[data-theme="sombre"] .modal-header, html[data-theme="sombre"] .modal-footer { border-color: #3a3b40; }
html[data-theme="sombre"] input, html[data-theme="sombre"] select { background: #26272b; color: #e7e7e7; border-color: #3a3b40; }
html[data-theme="sombre"] .module-card h3, html[data-theme="sombre"] .welcome-section p, html[data-theme="sombre"] .module-card p { color: #e7e7e7; }
html[data-theme="sombre"] footer { background: #0c0c0d; }
html[data-theme="sombre"] .k-photo .preview, html[data-theme="sombre"] .k-item .thumb { background: #2a2b30; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Téléphone (≤ 768 px) : le bandeau est masqué par le style historique, le logo passe dans la barre noire */
@media (max-width: 768px) {
  .main-nav .container::before { background-image: url("../images/logo-sombre-160.webp"); background-size: contain; background-repeat: no-repeat; border: 0; border-radius: 0; width: 44px; height: 44px; }
}

/* Téléphone : le bouton d'encaissement reste visible en bas du volet, le ticket passe en dessous */
html[data-device="phone"] .caisse-panel .ecran-caisse { order: 3; margin-top: 14px; }
html[data-device="phone"] .caisse-panel .actions-caisse {
  order: 2; position: sticky; bottom: 0; z-index: 2;
  margin: 0 -14px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  background: inherit; background-color: #fff; box-shadow: 0 -6px 14px -8px rgba(0, 0, 0, 0.3);
}
html[data-theme="sombre"][data-device="phone"] .caisse-panel .actions-caisse { background-color: #1f2023; }
html[data-device="phone"] .k-item { flex-wrap: nowrap; gap: 8px; padding: 8px; }
html[data-device="phone"] .k-item .thumb { width: 40px; height: 40px; }
html[data-device="phone"] .k-item .dispo { font-size: 0.7em; }
html[data-device="phone"] .k-backup { flex-wrap: wrap; }
html[data-device="phone"] .k-backup .grow { flex-basis: calc(100% - 40px); }
.k-backup .grow b { overflow-wrap: anywhere; }

/* Tablette (bandeau historique visible) : bandeau compact pour ne pas recouvrir le menu */
@media (min-width: 769px) and (max-width: 1200px) {
  header .logo h1 { font-size: 1.6em; white-space: nowrap; }
  header .logo p { display: none; }
  header .user-chip { padding-right: 10px; }
}
/* Ordinateur zoomé (disposition tablette) : même bandeau compact */
html[data-device="tablet"] header .logo h1 { font-size: 1.6em; white-space: nowrap; }
html[data-device="tablet"] header .logo p { display: none; }

/* Écran public : le pied de page reste en bas */
body.page-menu { display: flex; flex-direction: column; min-height: 100vh; }
body.page-menu .menu-body { flex: 1; }

/* Tablette : panneau un peu plus large, pièces et billets toujours visibles */
html[data-device="tablet"] .caisse-layout { grid-template-columns: minmax(0, 1fr) 370px; }
html[data-device="tablet"] .monnaie-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
html[data-device="tablet"] .btn-monnaie { padding: 10px 2px; font-size: 0.95em; min-width: 0; }
/* Thème sombre : noms d'articles lisibles (les prix gardent la couleur de leur catégorie) */
html[data-theme="sombre"] .article-btn div:not([style*="color"]) { color: #e7e7e7 !important; }

/* Icône des en-têtes de catégorie séparée du nom */
.category-header-caisse i { margin-right: 8px; }

/* =====================================================================
   Articles de la caisse : vrai état « dans le panier »
   (l'ancien style remplissait le bouton au survol, ce qui restait collé au doigt sur téléphone)
   ===================================================================== */
:root { --k-btn: #ffffff; --k-img: #f8f9fa; }
.article-btn .a-name { font-weight: bold; margin-bottom: 5px; }
.article-btn .a-price { font-weight: bold; font-size: 1.2em; }
.article-btn .a-cat { font-size: 0.75em; color: #666; }
.article-btn .a-img { width: 100%; height: 90px; margin: 8px 0; display: flex; align-items: center; justify-content: center; border-radius: 8px; overflow: hidden; background: var(--k-img); }
.article-btn .a-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.article-btn.in-cart { background: var(--category-color) !important; border-color: var(--category-color) !important; color: #fff !important; }
.article-btn.in-cart div, .article-btn.in-cart .a-price { color: #fff !important; }
@media (hover: none) {
  .article-btn.disponible-dynamic:not(.in-cart):hover,
  .article-btn.disponible:not(.in-cart):hover { background: var(--k-btn) !important; color: var(--k-text) !important; border-color: var(--category-color) !important; transform: none !important; }
  .article-btn.disponible-dynamic:not(.in-cart):hover div:not(.a-price) { color: var(--k-text) !important; }
  .article-btn.disponible-dynamic:not(.in-cart):hover .a-price { color: var(--category-color) !important; }
}

/* Téléphone : boutons compacts, noms lisibles (pas de coupure en plein mot), plus d'articles à l'écran */
html[data-device="phone"] main.container { padding: 0 8px; }
/* Téléphone : pas de titre, la ligne ne garde que le bouton des ruptures (et disparaît s'il n'y en a pas) */
html[data-device="phone"] .caisse-header { display: flex; position: static !important; order: 0 !important; flex-direction: row !important; justify-content: flex-end !important; padding: 0 !important; margin: 4px 0 0 !important; background: none !important; box-shadow: none !important; border: 0 !important; }
html[data-device="phone"] .caisse-header h2 { display: none; }
html[data-device="phone"] .caisse-header:has(#ruptureSlot:empty) { display: none; }
html[data-device="phone"] .articles-grid { background: transparent; box-shadow: none; padding: 4px 0 !important; }
html[data-device="phone"] .category-header-caisse { font-size: 0.95em !important; padding: 7px 12px !important; margin: 10px 0 6px !important; border-radius: 8px; }
html[data-device="phone"] .article-btn.article-btn-base { margin: 0; padding: 8px 5px 6px; min-height: 76px; border-radius: 10px; gap: 2px; }
html[data-device="phone"] .article-btn .a-name { font-size: 0.9em !important; line-height: 1.15; margin: 2px 0 3px !important; hyphens: none !important; -webkit-hyphens: none !important; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[data-device="phone"] .article-btn .a-price { font-size: 1.05em !important; }
html[data-device="phone"] .article-btn .a-cat { display: none; }
html[data-device="phone"] .article-quantity-controls { margin-top: 4px; }
html[data-device="phone"] .stock-info-inline { font-size: 0.7em; }

/* Téléphone : volet de paiement compact (le ticket est déjà visible sur les articles) */
html[data-device="phone"] .caisse-panel { max-height: 82vh; padding: 12px 14px 0; }
html[data-device="phone"] .caisse-panel .ecran-caisse { display: none; }
html[data-device="phone"] .panel-grip { margin: 0 0 8px; }
html[data-device="phone"] .calculatrice { padding: 10px !important; margin: 0 0 6px !important; }
html[data-device="phone"] .total-du { display: flex !important; align-items: center; justify-content: space-between; padding: 10px 14px !important; margin: 0 0 10px !important; }
html[data-device="phone"] .total-du label { margin: 0 !important; font-size: 1em; }
html[data-device="phone"] .total-du-amount strong { font-size: 1.7em !important; }
html[data-device="phone"] .montant-donne { margin-bottom: 8px !important; }
html[data-device="phone"] .montant-donne label, html[data-device="phone"] .pieces-billets-label { display: none !important; }
html[data-device="phone"] .montant-donne input { height: 42px !important; padding: 6px 10px !important; font-size: 1.1em !important; }
html[data-device="phone"] .btn-reset-montant { height: 42px !important; }
html[data-device="phone"] .monnaie-grid { gap: 5px !important; }
html[data-device="phone"] .btn-monnaie { min-height: 40px !important; padding: 4px 2px !important; font-size: 0.95em !important; }
html[data-device="phone"] .monnaie { margin-top: 6px !important; font-size: 0.95em; }
html[data-device="phone"] .caisse-panel .actions-caisse .btn { min-height: 48px; }

/* =====================================================================
   Thème sombre : éléments restés clairs (relevés par un audit automatique de toutes les pages)
   ===================================================================== */
html[data-theme="sombre"] { --primary-red: #ff3b5c; --k-btn: #26272b; --k-img: #2a2b30; }
html[data-theme="sombre"] .article-btn.disponible-dynamic:not(.in-cart) { background: #26272b !important; color: #e7e7e7 !important; }
html[data-theme="sombre"] .article-btn.indisponible-dynamic,
html[data-theme="sombre"] .article-btn.indisponible { background: #1b1b1e !important; color: #8a8a8a !important; }
html[data-theme="sombre"] .article-btn .a-cat { color: #9a9a9a; }
html[data-theme="sombre"] .btn-monnaie { background: #26272b !important; }
html[data-theme="sombre"] .btn-monnaie.piece { color: #e7e7e7 !important; }
html[data-theme="sombre"] .ticket, html[data-theme="sombre"] .ticket * { color: #e7e7e7; border-color: #3a3b40 !important; }
html[data-theme="sombre"] .ticket .ticket-item-price { color: #a6a6a6 !important; }
html[data-theme="sombre"] .popup-content-box { background: #26272b !important; color: #e7e7e7 !important; }
html[data-theme="sombre"] .popup-note, html[data-theme="sombre"] .k-done small { color: #cfcfcf !important; }
html[data-theme="sombre"] .stat-badge, html[data-theme="sombre"] .waiting-time.time-ok,
html[data-theme="sombre"] .ticket-detail-article, html[data-theme="sombre"] .article-image,
html[data-theme="sombre"] .stats-header, html[data-theme="sombre"] .chart-container,
html[data-theme="sombre"] .chart-left-section, html[data-theme="sombre"] .chart-right-section,
html[data-theme="sombre"] .stat-article, html[data-theme="sombre"] .article-stat-card, html[data-theme="sombre"] .articles-dropdown,
html[data-theme="sombre"] .vente-row, html[data-theme="sombre"] .ventes-detail,
html[data-theme="sombre"] .ventes-table, html[data-theme="sombre"] .ventes-grid-header { background: #1f2023 !important; color: #e7e7e7 !important; border-color: #3a3b40 !important; }
html[data-theme="sombre"] .ticket-number, html[data-theme="sombre"] .ventes-header-cell,
html[data-theme="sombre"] .stats-header h2, html[data-theme="sombre"] .serveurs-header h2 { color: #e7e7e7 !important; }
/* Styles écrits en ligne par l'ancien écran de statistiques */
html[data-theme="sombre"] main [style*="background: white"], html[data-theme="sombre"] main [style*="background: #fff"],
html[data-theme="sombre"] main [style*="background-color: white"], html[data-theme="sombre"] main [style*="background: rgb(255, 255, 255)"],
html[data-theme="sombre"] main [style*="background: #f8f9fa"], html[data-theme="sombre"] main [style*="background: rgb(248, 249, 250)"] { background: #1f2023 !important; }
html[data-theme="sombre"] main [style*="color: #333"], html[data-theme="sombre"] main [style*="color: rgb(51, 51, 51)"],
html[data-theme="sombre"] main [style*="color: #2c3e50"], html[data-theme="sombre"] main [style*="color: rgb(44, 62, 80)"] { color: #e7e7e7 !important; }
html[data-theme="sombre"] main [style*="color: #666"], html[data-theme="sombre"] main [style*="color: rgb(102, 102, 102)"] { color: #a6a6a6 !important; }
html[data-theme="sombre"] .k-badge { background: #2e2f34; color: #d0d0d0; }
html[data-theme="sombre"] .k-badge.red { background: rgba(255, 59, 92, 0.18); color: #ff8fa3; }
html[data-theme="sombre"] .k-badge.green { background: rgba(63, 191, 110, 0.18); color: #7ee2a0; }
html[data-theme="sombre"] .k-item .price { color: color-mix(in srgb, var(--c) 65%, #fff); }
html[data-theme="sombre"] .k-person:hover { background: rgba(255, 255, 255, 0.05); }
html[data-theme="sombre"] .modal-close { color: #e7e7e7; }
html[data-theme="sombre"] .last-update, html[data-theme="sombre"] .k-help { color: #a6a6a6; }
/* Rouges écrits en dur par l'ancien style : éclaircis pour rester lisibles sur fond sombre */
html[data-theme="sombre"] :is(#welcomeTitle, .welcome-section h2, .quick-stats h3, .config-section h3, .modal-header h3, .stats-section h3, .stats-section h4, .chart-title, .stat-value, .stat-card .stat-value, .panel-grip b, .k-done .ticketno, .k-done .big.neutral, .serveurs-header h2) { color: #ff5c77 !important; }
html[data-theme="sombre"] .k-done .ticketno { border-color: #ff5c77; }
html[data-theme="sombre"] .article-btn:not(.in-cart) .a-price { color: color-mix(in srgb, var(--category-color) 62%, #fff) !important; }
html[data-theme="sombre"] .k-item .price { color: color-mix(in srgb, var(--c) 55%, #fff); }
html[data-theme="sombre"] :is(.vente-mobile-date, .vente-mobile-info, .vente-mobile-total, .stats-section strong, .stat-badge small, .ticket-card small) { color: #e7e7e7 !important; }
html[data-theme="sombre"] .stats-section h4:not(.chart-title) { color: #e7e7e7 !important; }
/* Téléphone : filtres des statistiques sur deux colonnes (au lieu d'une pile plein écran) */
html[data-device="phone"] .stats-header { padding: 12px !important; }
html[data-device="phone"] .stats-header .date-filter { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px !important; width: 100%; }
html[data-device="phone"] .stats-header .date-filter > * { width: 100% !important; margin: 0 !important; min-height: 42px; padding: 6px 8px !important; font-size: 0.95em !important; }
/* Téléphone : raccourcis de période des statistiques sur deux colonnes */
html[data-device="phone"] .stats-header .quick-filters-layout { grid-column: 1 / -1; display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; margin: 0 !important; }
html[data-device="phone"] .stats-header .quick-filters-layout > * { width: 100% !important; margin: 0 !important; min-height: 40px; }

/* Page d'installation de l'application des bénévoles (/benevoles/) */
body.page-install { padding-top: 0; min-height: 100vh; background: var(--k-grad); color: #fff; }
.install { max-width: 480px; margin: 0 auto; padding: max(32px, env(safe-area-inset-top)) 20px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.install-logo { width: 150px; height: auto; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.45)); }
.install h1 { margin: 0; font-size: 2em; }
.install-sub { margin: 0; opacity: 0.9; }
.install-card { width: 100%; padding: 20px; border-radius: 14px; background: #fff; color: var(--dark-gray); text-align: left; box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.6); }
.install-card h2 { margin: 0 0 10px; font-size: 1.15em; color: var(--primary-red); }
.install-card ol { margin: 0; padding-left: 22px; line-height: 1.9; }
.install-btn-big { width: 100%; min-height: 58px; font-size: 1.2em; }
.install-ok { margin: 0; font-weight: bold; color: var(--success-color); font-size: 1.1em; }
.install-continue { color: #fff; opacity: 0.9; font-weight: 600; text-decoration: none; padding: 10px 16px; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 24px; }

/* Très grand zoom sur téléphone (page « vue » < 360px) : rien ne doit sortir de l'écran */
html[data-narrow] header .logo h1, html[data-narrow] .main-nav .container::after { display: none; } /* le logo suffit */
html[data-narrow] .k-item { flex-wrap: wrap; gap: 8px; }
html[data-narrow] .k-item .thumb { display: none; }
html[data-narrow] .k-item .info { flex-basis: calc(100% - 40px); }
html[data-narrow] .k-item .dispo { flex-direction: row; margin-left: auto; }
.montant-donne input { min-width: 0; width: 100%; }
.btn-reset-montant { flex: none; }


/* Vente faite : carte flottante non bloquante, barre de décompte de 2 s */
.k-done-float { position: fixed; inset: 0; z-index: 1600; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.55); pointer-events: none; }
.k-done-float .modal-content { position: relative; width: min(380px, 100%); max-width: none; margin: 0; overflow: hidden; pointer-events: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); animation: kDoneIn 0.18s ease-out; }
.k-done-float .modal-body { padding: 20px 16px 8px; }
.k-done-float .big { font-size: 3.2em; }
.k-done-float .modal-footer { justify-content: center; padding: 12px 16px 16px; border: 0; }
.k-done-float .modal-footer .btn { flex: 1; min-height: 48px; font-size: 1.1em; }
.k-done-float .modal-content::after { content: ""; position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: var(--success-color); transform-origin: left; animation: kDoneTimer 2s linear forwards; }
@keyframes kDoneIn { from { opacity: 0; transform: scale(0.94); } }
@keyframes kDoneTimer { to { transform: scaleX(0); } }

/* Téléphone : le volet d'encaissement s'ouvre au centre de l'écran */
html[data-device="phone"] .caisse-panel {
  left: 50%; right: auto; top: 50%; bottom: auto; width: min(440px, calc(100vw - 20px));
  max-height: calc(100dvh - 32px); border-radius: 18px;
  transform: translate(-50%, -50%) scale(0.96); opacity: 0; visibility: hidden;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out, visibility 0s linear 0.2s;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
}
html[data-device="phone"] body.panel-open .caisse-panel { transform: translate(-50%, -50%); opacity: 1; visibility: visible; transition: transform 0.2s ease-out, opacity 0.2s ease-out; }
html[data-device="phone"] .caisse-panel .actions-caisse { padding-bottom: 12px; }

/* Pièces et billets encadrés (la règle générique .btn de l'ancien style retirait la bordure) */
.btn.btn-monnaie { border: 2px solid #6c757d; }
.btn.btn-monnaie.billet { border-color: var(--success-color); }
html[data-theme="sombre"] .btn.btn-monnaie.piece { border-color: #8a8d93; }
html[data-theme="sombre"] .btn.btn-monnaie.billet { border-color: #3fbf6e; color: #7ee2a0 !important; }

/* Article dans le panier : pastille « − quantité » sous le prix (dans le flux, rien ne se chevauche),
   croix en badge sur le coin (retire tout l'article) */
.article-btn.in-cart .article-quantity-controls { position: static; order: 10; transform: none; align-self: center; display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 3px 12px 3px 3px; border-radius: 999px; opacity: 1; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9); }
.article-btn.in-cart .article-quantity-btn.minus { width: 46px; height: 30px; border-radius: 999px; font-size: 22px; line-height: 1; }
.article-btn.in-cart .article-quantity-display { margin: 0; min-width: 14px; font-size: 16px; }
.article-btn.in-cart .article-delete-btn { top: -6px; left: -6px; width: 26px; height: 26px; font-size: 15px; box-shadow: 0 0 0 2px #fff; }

/* Carte « Suivant » bien détachée : cadre vert + fond assombri qui ne capte pas les touchers (la caisse reste utilisable) */
.k-done-float .modal-content { border: 3px solid var(--success-color); border-top-width: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }

/* Thème sombre : fenêtres de l'ancien écran de statistiques (supprimer un ticket, messages) */
html[data-theme="sombre"] .modal-overlay .modal-content,
html[data-theme="sombre"] .modal-overlay :is(.modal-header, .modal-body, .modal-footer) { background: #1f2023 !important; color: #e7e7e7 !important; border-color: #3a3b40 !important; }
html[data-theme="sombre"] .modal-overlay .modal-body :is(p, div, strong) { color: #d6d6d6 !important; }
html[data-theme="sombre"] .modal-overlay .ticket-details { background: #26272b !important; color: #e7e7e7 !important; border: 1px solid #3a3b40 !important; }
html[data-theme="sombre"] .modal-overlay .modal-body .warning-text { color: #ff8fa3 !important; }
html[data-theme="sombre"] .modal-overlay .modal-close { color: #bdbdbd !important; }
/* Rouge du club écrit en ligne (quantités, montants) : version claire lisible sur fond sombre */
html[data-theme="sombre"] main [style*="color: var(--primary-red)"] { color: #ff5c77 !important; }

/* Logo + nom du club cliquables → accueil (zone transparente posée dessus) */
header .logo { position: relative; }
header .k-home { position: absolute; inset: 0; z-index: 1; }
.main-nav .k-home { display: none; }
@media (max-width: 768px) {
  .main-nav .k-home { display: block; position: absolute; left: 0; top: 0; bottom: 0; width: min(240px, calc(100% - 124px)); z-index: 1; }
}

/* Page en cours de mise en place (js/boot.js) : aucune transition ni animation */
html.k-preload *, html.k-preload *::before, html.k-preload *::after { transition: none !important; animation: none !important; }

/* Téléphone : bouton « annuler la commande » posé à gauche de la barre d'encaissement (panier non vide) */
.k-paybar-clear { display: none; }
html[data-device="phone"] .k-paybar:not(.empty) { padding-left: 72px; }
html[data-device="phone"] .k-paybar:not(.empty) + .k-paybar-clear {
  display: grid; place-items: center; position: fixed; z-index: 1401; left: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.7); border-radius: 12px; background: rgba(0, 0, 0, 0.25); color: #fff; font-size: 1.15em; cursor: pointer;
}
html[data-device="phone"] body.panel-open .k-paybar-clear { display: none !important; }
html[data-narrow] .k-paybar .cta { display: none; }


/* Stock restant lisible en mode sombre, et sur un article sélectionné (fond de la couleur de catégorie) */
/* Stock restant : discret s'il en reste beaucoup, orange quand ça baisse, rouge plein quand il en reste 5 ou moins */
.article-btn .stock-info-inline.stock-ok { background: transparent !important; color: var(--k-muted, #666) !important; font-weight: 600; }
.article-btn .stock-info-inline.stock-medium { background: #ffe8bf !important; color: #7a4300 !important; font-weight: 700; }
.article-btn .stock-info-inline.stock-low { background: #d7191f !important; color: #fff !important; font-weight: 800; }
html[data-theme="sombre"] .article-btn .stock-info-inline.stock-ok { color: #a6a6a6 !important; }
html[data-theme="sombre"] .article-btn .stock-info-inline.stock-medium { background: rgba(255, 170, 0, 0.22) !important; color: #ffc85c !important; }
html[data-theme="sombre"] .article-btn .stock-info-inline.stock-low { background: #e8283a !important; color: #fff !important; }
/* Article sélectionné (fond couleur catégorie) : l'alerte reste visible */
html .article-btn.in-cart .stock-info-inline.stock-ok.stock-ok { background: transparent !important; color: rgba(255, 255, 255, 0.85) !important; }
html .article-btn.in-cart .stock-info-inline.stock-medium.stock-medium { background: #ffb020 !important; color: #1b1400 !important; }
html .article-btn.in-cart .stock-info-inline.stock-low.stock-low { background: #fff !important; color: #d7191f !important; }

/* Téléphone : pastille du profil (initiales) à gauche du bouton menu */
.k-nav-profil { display: none; }
@media (max-width: 768px) {
  .k-nav-profil { display: grid; place-items: center; position: absolute; right: 70px; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: var(--primary-red); color: #fff; font-weight: 800; font-size: 0.95em; cursor: pointer; }
}

/* Configuration : article désactivé (ni en caisse ni sur l'écran public) + bouton marche/arrêt */
.k-item.masque .info b { text-decoration: line-through; }
.k-power { background: var(--k-btn, #fff); color: var(--success-color); border: 2px solid var(--success-color); }
.k-power.on { background: var(--primary-red); color: #fff; border-color: var(--primary-red); }
html[data-device="phone"] .k-item .btn-edit { width: 42px; min-width: 42px; min-height: 42px; padding: 0; display: inline-grid; place-items: center; }
.k-item .info b { overflow-wrap: break-word; }

/* Configuration → Sauvegardes : un bloc par action (icône colorée, titre, explication) */
.k-bloc { border-left: 5px solid var(--c); }
.k-bloc-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.k-bloc-head h3 { margin: 2px 0 4px !important; }
.k-bloc-head .k-help { margin: 0; }
.k-bloc-icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); font-size: 1.35em; }
.k-bloc > .btn, .k-bloc form + .btn { margin-top: 10px; }
.k-periode { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.k-periode input { width: 100%; min-width: 0; box-sizing: border-box; }
.k-excel { width: 100%; min-height: 52px; font-size: 1.1em; background: #1D6F42 !important; border-color: #1D6F42 !important; }
.k-check { gap: 10px; cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.k-check input { width: 22px; height: 22px; accent-color: var(--primary-red); }
.k-backup-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--k-img, #f3f3f3); color: var(--k-muted); }
.k-backup.auto { opacity: 0.85; }
.k-danger { background: color-mix(in srgb, var(--primary-red) 5%, var(--k-card, #fff)) !important; }
html[data-theme="sombre"] .k-bloc-icon { background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 60%, #fff); }
html[data-theme="sombre"] .k-danger { background: color-mix(in srgb, #ff3b5c 8%, #1f2023) !important; }

/* Caisse : petit bouton « cacher / voir les ruptures » (seulement s'il y a des articles en rupture) */
.k-rupture-toggle { display: flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; min-height: 34px; border: 1.5px solid var(--k-line, #ddd); border-radius: 999px; background: var(--k-card, #fff); color: var(--k-muted, #666); font: inherit; font-size: 0.85em; font-weight: 700; cursor: pointer; }
.k-rupture-toggle[aria-pressed="true"] { border-color: var(--primary-red); color: var(--primary-red); }
html[data-theme="sombre"] .k-rupture-toggle[aria-pressed="true"] { border-color: #ff5c77; color: #ff5c77; }

/* =====================================================================
   Caisse avec photos (réglage du profil) : la photo remplit la case, nom / stock / prix en blanc
   sur un bandeau sombre en bas. Sans photo : bloc de la couleur de la catégorie avec son icône.
   Préfixe long volontaire : doit passer devant les règles de l'ancien style et du thème sombre.
   ===================================================================== */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base { grid-row: auto !important; min-height: 0 !important; aspect-ratio: 4 / 5; padding: 0 !important; justify-content: flex-end !important; gap: 0 !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .a-cat { display: none !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .a-img { position: absolute !important; inset: 0; width: auto; height: auto !important; margin: 0 !important; border-radius: 7px !important; background: #fff; z-index: 0; overflow: hidden; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .a-img img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; padding: 7% 9% 42%; box-sizing: border-box; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .a-img.a-icon { background: var(--category-color) !important; align-items: flex-start; padding-top: 18%; box-sizing: border-box; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .a-img.a-icon i { color: #fff !important; font-size: 34px !important; }
/* Bandeau : opaque, donc lisible sur n'importe quelle photo */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base :is(.a-name, .a-price, .stock-info-inline) { position: relative; z-index: 1; background: rgba(18, 16, 16, 0.8) !important; color: #fff !important; text-align: left !important; margin: 0 !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .a-name { padding: 6px 8px 1px !important; font-weight: 700; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .stock-info-inline { display: block; border-radius: 0 !important; padding: 0 8px !important; font-size: 0.72em !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .a-price { order: 5; display: flex; align-items: center; min-height: 34px; box-sizing: border-box; padding: 0 8px 4px !important; border-radius: 0 0 7px 7px; font-size: 1.1em !important; } /* même hauteur sélectionné ou non */
/* Rupture : photo grisée, nom barré, texte gris clair */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.indisponible :is(.a-name, .a-price) { color: #d9d9d9 !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.indisponible .a-name { text-decoration: line-through !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.indisponible .a-img img { filter: grayscale(1) opacity(0.5); }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.indisponible .a-img.a-icon { background: #8a8a8a !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .article-cross-overlay { z-index: 2; }
/* Dans le panier : contour + bandeau à la couleur de la catégorie ; la photo reste dégagée :
   quantité en pastille sur le coin haut droit, gros bouton « − » rond dans le bandeau, à côté du prix */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.in-cart { padding: 0 !important; box-shadow: none; } /* sélection = bandeau coloré, sans contour qui déborde */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.in-cart :is(.a-name, .a-price, .stock-info-inline) { background: color-mix(in srgb, var(--category-color) 78%, #000) !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.in-cart .a-price { padding-right: 44px !important; } /* place du bouton « − », hauteur inchangée */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.in-cart .article-quantity-controls { display: contents; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.in-cart .article-quantity-btn.minus { position: absolute; right: 6px; bottom: 6px; z-index: 3; width: 30px !important; height: 30px !important; border-radius: 50% !important; font-size: 22px !important; font-weight: 800; line-height: 1; background: #ffc107 !important; color: #111 !important; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, 0.35); }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.in-cart .article-quantity-btn.minus::after { content: ""; position: absolute; inset: -7px; } /* zone de toucher de 44 px */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.in-cart .article-quantity-display { position: absolute; top: -9px; right: 5px; z-index: 3; min-width: 28px; height: 28px; padding: 0 7px; box-sizing: border-box; border-radius: 14px; background: var(--category-color); color: #fff !important; font-size: 15px !important; font-weight: 800; line-height: 28px; text-align: center; margin: 0 !important; box-shadow: 0 0 0 2px #fff; }
/* Avec photos : la ligne de stock du bandeau se colore (orange / rouge) selon ce qu'il reste */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .stock-info-inline.stock-ok { color: rgba(255, 255, 255, 0.75) !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .stock-info-inline.stock-medium { background: #ffb020 !important; color: #1b1400 !important; padding: 2px 8px !important; }
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base .stock-info-inline.stock-low { background: #e8283a !important; color: #fff !important; padding: 2px 8px !important; font-size: 0.8em !important; }

/* Pastilles de la case sélectionnée : ne débordent que vers le haut (jamais sur la case voisine) ; lignes un peu plus espacées */
html[data-photos="on"] .category-articles-grid .article-btn.article-btn-base.in-cart .article-delete-btn { top: -9px; left: 5px; }
html[data-photos="on"] .category-articles-grid { row-gap: 14px !important; }
