:root {
  /* ---- Neutre — base commune (sombre par défaut, voir html[data-theme="light"]) ---- */
  --bg: oklch(15% 0.018 258);
  --card: oklch(21% 0.02 258);
  --surface-2: oklch(24% 0.022 258);
  --text: oklch(96% 0.004 258);
  --muted: oklch(64% 0.02 258);
  --border: oklch(32% 0.02 258);

  /* ---- Accent — couleur Buvetix par défaut, remplacée à la connexion par
     celle de l'entreprise, puis par celle de l'équipe du match affiché en
     Accueil (styles posés en ligne sur <html>, voir js/branding.js). ---- */
  --accent: #F2B23A; /* ambre Buvetix (assets/brand) */
  --accent-deep: color-mix(in oklab, #F2B23A 42%, oklch(15% 0.018 258)); /* même dérivation que branding.js */

  /* ---- Statuts de demande — fixes, ne changent JAMAIS avec le club ---- */
  --red: oklch(62% 0.19 25);        /* non traitée / nouvelle */
  --orange: oklch(60% 0.15 65);     /* en préparation / manquant */
  --green: oklch(60% 0.15 145);     /* livrée */
  --status-critical: oklch(48% 0.19 25); /* rupture de stock */

  /* ---- Alias historiques : tout le fichier compose ses dégradés avec ces
     deux noms, donc les redéfinir ici suffit à rendre tout le reste de
     l'app dynamique (club) sans toucher chaque déclaration une par une. ---- */
  --stadium-navy: var(--bg);
  --stadium-blue: var(--accent-deep);
  --stadium-pink: var(--accent);

  /* ---- Typographie : une display (titres, gros chiffres) + une texte ---- */
  --font-display: "Big Shoulders", "Arial Narrow", sans-serif;
  --font-text: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="light"] {
  --bg: oklch(97% 0.004 258);
  --card: oklch(100% 0 0);
  --surface-2: oklch(94% 0.006 258);
  --text: oklch(22% 0.02 258);
  --muted: oklch(50% 0.02 258);
  --border: oklch(89% 0.006 258);
}

* { box-sizing: border-box; }

html { touch-action: manipulation; color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

body {
  margin: 0;
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--red);
  color: white;
}
.topbar .logo { font-size: 1.1rem; font-family: var(--font-display); font-weight: 700; }
.user-info { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.link-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.6);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

#app { max-width: 900px; margin: 0 auto; padding: 16px; }

.hidden { display: none !important; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ---- Bouton clair/sombre — flottant, visible sur tous les onglets manager/log/admin ---- */
.theme-toggle-btn {
  position: fixed;
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  z-index: 160;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.theme-toggle-icon-dark,
.theme-toggle-icon-light { width: 18px; height: 18px; }
.icon.theme-toggle-icon-light { display: block; }
.icon.theme-toggle-icon-dark { display: none; }
html[data-theme="light"] .icon.theme-toggle-icon-light { display: none; }
html[data-theme="light"] .icon.theme-toggle-icon-dark { display: block; }

/* ---- Messagerie interne : bulle flottante déplaçable + écran plein ---- */
.inbox-fab {
  position: fixed;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px color-mix(in oklch, var(--accent) 35%, transparent);
  z-index: 170;
  cursor: grab;
  touch-action: none;
}
.inbox-fab .icon { width: 22px; height: 22px; }
.inbox-fab.dragging { cursor: grabbing; transition: none; }
.inbox-fab-corner-br { bottom: calc(92px + env(safe-area-inset-bottom)); right: 16px; }
.inbox-fab-corner-bl { bottom: calc(92px + env(safe-area-inset-bottom)); left: 16px; }
.inbox-fab-corner-tr { top: calc(64px + env(safe-area-inset-top)); right: 16px; }
.inbox-fab-corner-tl { top: calc(14px + env(safe-area-inset-top)); left: 16px; }
.inbox-fab-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.inbox-scroll { flex: 1; overflow-y: auto; padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.inbox-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  align-self: flex-start;
}
.inbox-msg-mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  border-color: transparent;
  color: #fff;
}
.inbox-msg-meta { font-size: 0.72rem; opacity: 0.75; margin-bottom: 3px; display: flex; gap: 6px; }
.inbox-msg-text { font-size: 0.92rem; line-height: 1.35; white-space: pre-wrap; word-break: break-word; }

.inbox-composer { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.inbox-recipients { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 10px; padding-bottom: 2px; }
.inbox-recipients .pill { flex-shrink: 0; }
.inbox-input-row { display: flex; gap: 8px; align-items: center; }
.inbox-input-row input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}
.inbox-input-row input::placeholder { color: var(--muted); }
.inbox-input-row .icon-btn {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  flex-shrink: 0;
}
.inbox-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.inbox-empty .quick-btn { max-width: 260px; margin: 16px auto 0; }

/* Liste des discussions (écran d'accueil de la messagerie) */
.inbox-conv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
}
.inbox-conv-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.inbox-conv-info { flex: 1; min-width: 0; }
.inbox-conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.inbox-conv-name { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-conv-time { font-size: 0.72rem; color: var(--muted); flex-shrink: 0; }
.inbox-conv-preview { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.inbox-conv-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Recherche de destinataire (nouveau message, admin/RZ uniquement) */
.inbox-recipient-search { position: relative; margin-bottom: 10px; }
.inbox-recipient-search input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}
.inbox-recipient-search input::placeholder { color: var(--muted); }
.inbox-recipient-suggestions {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
  z-index: 5;
}
.inbox-suggestion {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.inbox-suggestion:last-child { border-bottom: none; }
.inbox-suggestion:hover, .inbox-suggestion:active { background: var(--surface-2); }
.inbox-suggestion strong { font-size: 0.88rem; }
.inbox-suggestion small { color: var(--muted); font-size: 0.75rem; }

/* ---- Connexion (et connexion par code) : écran partagé. À gauche un
   panneau de marque sombre (logo, accroche, deux écrans de l'app), coupé
   en diagonale ; à droite le formulaire, dans les couleurs du thème. Sur
   téléphone, le panneau passe en haut et le formulaire remonte dessus. ---- */
body:has(.auth-view.view:not(.hidden)) { background: var(--bg); }
body:has(.auth-view.view:not(.hidden)) .topbar { display: none; }
/* l'écran de connexion occupe toute la fenêtre (pas la colonne de 900 px
   des autres vues) */
body:has(.auth-view.view:not(.hidden)) #app { max-width: none; padding: 0; }

.auth-view.view {
  --hero-ink: #17150F;
  --hero-text: #F2F0EB;
  --hero-muted: #B9B4A8;
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  background: var(--bg);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: calc(40px + env(safe-area-inset-top)) 56px 0;
  background: var(--hero-ink);
  color: var(--hero-text);
  /* coupe diagonale côté formulaire */
  clip-path: polygon(0 0, 100% 0, 84% 100%, 0 100%);
  margin-right: -8%;
  z-index: 1;
}
/* halo ambre et léger quadrillage en fond */
.auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 70% 85%, color-mix(in oklch, var(--accent) 38%, transparent), transparent 70%),
    radial-gradient(40% 35% at 10% 10%, color-mix(in oklch, var(--accent) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(242, 240, 235, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, black, transparent 75%);
  -webkit-mask-image: linear-gradient(180deg, black, transparent 75%);
  pointer-events: none;
}
.auth-hero > * { position: relative; z-index: 1; }
.auth-hero-logo { height: 34px; width: auto; align-self: flex-start; }
.auth-hero-text { max-width: 560px; }
.auth-hero-sub { max-width: 42ch; }
.auth-hero-eyebrow {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.auth-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 3.6vw, 3.4rem);
  font-weight: 800;
  line-height: 0.98;
  text-wrap: balance;
}
.auth-hero-sub { margin: 14px 0 0; color: var(--hero-muted); font-size: 1rem; line-height: 1.5; }

/* deux écrans de l'app, inclinés, qui sortent par le bas */
.auth-hero-phones {
  position: relative;
  flex: 1;
  min-height: 300px;
  margin-top: auto;
}
.auth-phone {
  position: absolute;
  bottom: -18%;
  width: min(44%, 250px);
  max-width: 100%;
  border-radius: 28px;
  border: 6px solid #2C281E;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(242, 240, 235, 0.08);
  background: #0E0D0A;
}
.auth-phone-back { left: 6%; transform: rotate(-9deg); opacity: 0.85; bottom: -26%; }
.auth-phone-front { left: 34%; transform: rotate(5deg); }

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(32px + env(safe-area-inset-top)) 24px calc(32px + env(safe-area-inset-bottom)) 12%;
  min-width: 0;
}
.auth-head { width: 100%; }
.auth-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.auth-head p { margin: 8px 0 0; color: var(--muted); font-size: 0.95rem; }

.login-wrap {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
}

.login-card {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}
.login-card.shake {
  animation: loginShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes loginShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-9px); }
  40%, 60% { transform: translateX(9px); }
}
@media (prefers-reduced-motion: reduce) {
  .login-card.shake { animation: none; }
}

/* Téléphone / tablette étroite : panneau en haut, formulaire par-dessus */
@media (max-width: 860px) {
  .auth-view.view { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-hero {
    margin-right: 0;
    clip-path: none;
    gap: 18px;
    padding: calc(28px + env(safe-area-inset-top)) 24px 0;
    min-height: 330px;
  }
  .auth-hero-title { font-size: 2rem; }
  .auth-hero-sub { display: none; }
  .auth-hero-phones { min-height: 170px; }
  /* placés depuis le haut de leur zone : ils débordent vers le bas (sous
     le formulaire), jamais sur l'accroche, quelle que soit la largeur */
  .auth-phone { width: min(38%, 200px); top: 10px; bottom: auto; border-radius: 20px; border-width: 4px; }
  .auth-phone-back { left: 8%; top: 34px; bottom: auto; }
  .auth-phone-front { left: 46%; }
  .auth-main {
    position: relative;
    z-index: 2;
    align-items: flex-start;
    margin-top: -48px;
    padding: 0 16px calc(28px + env(safe-area-inset-bottom));
  }
  .login-wrap {
    max-width: 440px;
    margin: 0 auto;
    padding: 24px 20px;
    border-radius: 24px;
    background: var(--bg);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.18);
  }
  .auth-head h1 { font-size: 1.9rem; }
  .login-card { padding: 0; border: none; box-shadow: none; background: transparent; }
}

.login-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.login-card input,
.login-card select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: color-mix(in oklch, var(--text) 6%, transparent);
  color: var(--text);
}
.login-card select option { color: var(--text); background: var(--card); }
.login-card input::placeholder { color: var(--muted); }
.login-card input:focus,
.login-card select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 25%, transparent);
}
.quickconnect-link {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
}
/* Vrai bouton (pas juste un lien souligné) pour basculer entre connexion
   classique et connexion par code — bien visible, sans reprendre le
   dégradé plein du bouton principal pour ne pas les confondre. */
.auth-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  text-align: center;
}
.auth-switch-btn:active { filter: brightness(1.08); }
.qc-code-card { align-items: center; text-align: center; }
.qc-code-logo {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  margin: 0 auto 14px;
  box-shadow: 0 10px 24px color-mix(in oklch, var(--accent) 25%, transparent);
}
.qc-code-title { margin: 0 0 6px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.qc-code-hint { margin: 0 0 18px; color: var(--muted); font-size: 0.85rem; }
.qc-code-boxes { display: flex; gap: 8px; justify-content: center; }
.qc-digit {
  width: 42px;
  height: 52px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in oklch, var(--text) 6%, transparent);
  color: var(--text);
}
.qc-digit:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 25%, transparent);
}
.password-field { position: relative; display: flex; }
.password-field input { flex: 1; padding-right: 40px; }
.password-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}
.password-toggle-btn:hover { color: var(--text); }
.password-toggle-btn .icon { width: 18px; height: 18px; }
.login-card button[type="submit"] {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  font-weight: 700;
  box-shadow: 0 10px 30px color-mix(in oklch, var(--accent) 30%, transparent);
}
.login-card button[type="submit"]:hover { filter: brightness(1.08); }
.login-card .error { color: var(--red); }

button {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--font-text);
  cursor: pointer;
}
button:disabled { background: var(--border); color: var(--muted); cursor: not-allowed; }

.error { color: var(--red); font-size: 0.9rem; }

/* ---- App shell: manager, log & admin (tabs + bottom nav) ---- */
body:has(#manager-view.view:not(.hidden)) .topbar,
body:has(#log-view.view:not(.hidden)) .topbar,
body:has(#admin-view.view:not(.hidden)) .topbar,
body:has(#sites-view.view:not(.hidden)) .topbar {
  display: none;
}

.app-shell { position: relative; }
/* Sans ça, le contenu des onglets (bannière match, en-têtes "Stock"/
   "Demandes"...) démarre sous l'encoche/la barre de statut sur iPhone —
   #app n'a qu'un padding fixe de 16px, jamais adapté à la zone sûre. */
.app-content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); padding-top: env(safe-area-inset-top); }
.app-tab.hidden { display: none; }

/* Encart "match à venir" (Paris FC / Stade Français) — le seul élément fort
   de l'écran Accueil : fond en dégradé à l'accent dynamique du club, le
   reste de l'écran reste neutre. */
.match-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  padding: 20px 20px 22px;
  margin-bottom: 18px;
  color: #fff;
  background: linear-gradient(150deg, var(--accent-deep) 0%, var(--accent) 135%);
  border: 1px solid var(--border);
}
.match-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% -12%, rgba(255, 255, 255, 0.22), transparent 55%);
  pointer-events: none;
}
.match-card.hidden { display: none; }
.match-card-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
  margin-bottom: 12px;
}
.match-card-today .match-card-badge { background: rgba(255, 255, 255, 0.28); }
.match-card-teams {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.match-card-crest-slot { display: flex; align-items: center; justify-content: center; }
.match-card-crest { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.match-card-teams-center {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  min-width: 0;
}
.match-card-vs { position: relative; font-family: var(--font-text); font-size: 0.72rem; font-weight: 600; color: rgba(255, 255, 255, 0.6); text-transform: uppercase; }
.match-card-meta { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 0.85rem; color: rgba(255, 255, 255, 0.8); }
.match-card-time { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: #fff; }
.match-card-finished .match-card-badge {
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.85);
}

/* Liste du calendrier (onglet Calendrier) */
.match-list { display: flex; flex-direction: column; gap: 10px; }
.match-list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-radius: 14px;
  padding: 14px 12px;
  border: 1px solid var(--border);
}
.match-list-item.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.match-list-item.is-finished { opacity: 0.55; }
.match-list-finished-badge {
  position: absolute;
  top: -7px;
  left: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 8px;
  border: 2px solid var(--bg);
}
.match-list-delete,
.match-list-edit {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--bg);
  font-size: 0.65rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.match-list-edit {
  right: 20px;
  background: var(--accent);
  font-size: 0.7rem;
}
.match-list-competition {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 5px;
}
.match-list-side { flex: 1 1 0; display: flex; align-items: center; gap: 8px; min-width: 0; }
.match-list-side-right { justify-content: flex-end; text-align: right; }
.match-list-team-name {
  color: var(--text);
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.match-list-crest { width: 30px; height: 30px; object-fit: contain; flex-shrink: 0; }
.match-list-crest-empty { background: var(--surface-2); border-radius: 6px; }
.match-list-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 64px;
  padding: 0 6px;
}
.match-list-date { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 2px; }
.match-list-time { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--text); }
.match-list .chart-empty { color: var(--muted); }

/* Événement autre qu'un match (concert, festival...) dans le Calendrier */
.event-list-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklch, var(--accent) 16%, var(--surface-2));
  color: var(--accent);
}
.event-list-icon .icon { width: 18px; height: 18px; }
.event-list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.event-list-kind { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.event-list-item .match-list-center { min-width: 84px; }
.event-list-item .match-list-time { font-size: 0.95rem; white-space: nowrap; }

/* Encart Accueil pour un concert, festival... */
.match-card-event {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
  min-width: 0;
}
.match-card-event-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
}
.match-card-event-icon .icon { width: 22px; height: 22px; }

/* Formulaire "Nouvel événement" (Calendrier admin) */
.event-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.event-type-pills { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.event-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.event-form-row > * { flex: 1 1 140px; min-width: 0; }
.event-form-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.event-form-row label small { text-transform: none; letter-spacing: 0; font-weight: 400; display: inline; }
.event-form-row label > span { display: block; }
.event-form input,
.event-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}
.event-form input:focus,
.event-form select:focus { outline: none; border-color: var(--accent); }
.event-form .error { margin: 0; }
.event-form .pdv-list-hint { margin: 0; }

.greeting { margin-bottom: 18px; }
.greeting h1 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--text); }
.greeting p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.icon {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 1px;
}
.status-dot-red { background: var(--red); }
.status-dot-orange { background: var(--orange); }
.status-dot-green { background: var(--green); }

/* Bandeau KPI — un seul repère visuel pour les 4 indicateurs, façon tableau
   de bord : même structure pour tous, séparés par de fines lignes. Seul
   "Nouvelles" porte l'accent du club, et uniquement quand il y a une
   demande à traiter (voir .kpi-value-accent, posée en JS) — le reste (et
   le "0 partout") reste sobre. */
.kpi-card {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 4px;
  margin-bottom: 20px;
}
.kpi-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px 2px;
  font-family: inherit;
  cursor: pointer;
}
.kpi-icon { width: 18px; height: 18px; stroke-width: 1.8; color: var(--muted); }
.kpi-value { font-family: var(--font-display); font-weight: 800; font-size: 1.55rem; line-height: 1; color: var(--text); }
.kpi-value-accent { color: var(--accent); }
.kpi-label { font-size: 0.68rem; color: var(--muted); text-align: center; }
.kpi-div { width: 1px; align-self: stretch; margin: 2px 0; background: var(--border); flex-shrink: 0; }

.quick-access h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0 0 10px; color: var(--text); }
.quick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  text-align: left;
}
.quick-btn .quick-icon { font-size: 1.2rem; }
.quick-btn .quick-label { flex: 1; font-weight: 600; }
.quick-btn .quick-chevron { color: var(--muted); font-size: 1.2rem; }
.quick-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-btn-primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  border: none;
  box-shadow: 0 10px 24px color-mix(in oklch, var(--accent) 25%, transparent);
}
.quick-btn-primary .quick-chevron { color: rgba(255, 255, 255, 0.85); }

/* ---- Barre du bas : pilule sombre flottante + ligne "vague" sous l'onglet
   actif (tracé posé par js/app.js setupNavWave). Sombre dans les deux
   thèmes, pour se détacher du contenu. ---- */
.bottom-nav {
  --nav-bg: oklch(17% 0.012 260);
  --nav-fg: oklch(78% 0.01 260);
  position: fixed;
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 560px;
  height: 66px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--nav-bg);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
  padding: 0 10px;
  overflow: hidden;
  isolation: isolate;
  z-index: 150;
}
.nav-wave {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
  overflow: visible;
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.25, 1);
}
.nav-wave path { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.nav-wave-line { stroke-width: 2.5; }
.nav-wave-glow { stroke-width: 10; opacity: 0.22; filter: blur(5px); }
.nav-btn {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--nav-fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  transition: color 0.3s;
}
.nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
/* halo flou derrière l'icône active */
.nav-icon-wrap::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklch, var(--accent) 45%, transparent), transparent 70%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s, transform 0.35s;
  z-index: -1;
}
.bottom-nav:has(.nav-btn:nth-child(7)) .nav-btn { font-size: 0.6rem; }
.bottom-nav:has(.nav-btn:nth-child(8)) .nav-btn { font-size: 0.55rem; }
.nav-btn .nav-icon { font-size: 1.35rem; transition: transform 0.35s; }
.nav-btn.active { color: var(--accent); }
.nav-btn.active .nav-icon { fill: currentColor; fill-opacity: 0.25; transform: translateY(-1px); }
.nav-btn.active .nav-icon-wrap::before { opacity: 1; transform: scale(1); }
.nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -6px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) {
  .nav-wave, .nav-btn, .nav-btn .nav-icon, .nav-icon-wrap::before { transition: none; }
}
.nav-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--nav-bg);
}

/* ---- Profil : en-tête (avatar, nom, rôle, entreprise) ---- */
.profile-card {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 24px;
}
.profile-name { font-size: 1.25rem; font-weight: 700; margin: 12px 0 4px; }
.profile-detail { color: var(--muted); margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.profile-detail .icon { width: 1em; height: 1em; }
.profile-org {
  margin: 10px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-avatar {
  position: relative;
  width: 88px;
  height: 88px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.profile-avatar-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 0 1px var(--border);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
}
.profile-avatar-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
}
.profile-avatar-badge .icon { width: 16px; height: 16px; }
.profile-avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.profile-avatar.is-loading .profile-avatar-face { opacity: 0.45; }
.profile-avatar.is-loading .profile-avatar-badge { animation: profilePulse 0.9s ease-in-out infinite alternate; }
@keyframes profilePulse { to { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) {
  .profile-avatar.is-loading .profile-avatar-badge { animation: none; }
}

/* ---- Profil : carte "Mon compte" (lignes cliquables) ---- */
.profile-section { margin-bottom: 16px; padding: 6px 0; }
.profile-section-title {
  margin: 10px 20px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 20px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
}
.profile-section-title + .profile-row { border-top: none; }
button.profile-row { cursor: pointer; }
button.profile-row:active { background: var(--surface-2); }
.profile-row > .icon { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.profile-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text);
  flex-shrink: 0;
}
.profile-row-icon .icon { width: 16px; height: 16px; }
.profile-row-label { flex: 1; min-width: 0; font-weight: 600; font-size: 0.95rem; }
.profile-row-label small { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.profile-row-value {
  min-width: 0;
  max-width: 55%;
  color: var(--muted);
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Profil : fenêtres nom / mot de passe ---- */
.profile-modal-error { margin: 0; font-size: 0.88rem; color: var(--red); }
.profile-pw-toggle,
.profile-pw-forgot {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.profile-pw-toggle .icon { width: 16px; height: 16px; }
.profile-pw-forgot { align-self: center; text-decoration: underline; text-underline-offset: 3px; }

.notif-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.notif-card-title { font-weight: 600; margin: 0 0 2px; }
.notif-card-status { color: var(--muted); font-size: 0.82rem; margin: 0; }
.notif-toggle-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
}
.notif-toggle-btn.is-on {
  background: none;
  border: 1px solid var(--muted);
  color: var(--muted);
}
.notif-toggle-btn:disabled { opacity: 0.6; }
.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--red) 14%, transparent);
  border: none;
  color: var(--red);
  font-weight: 600;
}
.logout-btn:active { background: color-mix(in oklch, var(--red) 22%, transparent); }
.log-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  border: none;
  color: var(--accent-deep);
  font-weight: 600;
  margin-bottom: 10px;
}
.log-mode-btn:active { background: color-mix(in oklch, var(--accent) 22%, transparent); }

/* Manager */
.product-groups { display: flex; flex-direction: column; gap: 18px; margin: 16px 0; }
.product-group h3 { margin-bottom: 8px; color: var(--text); font-family: var(--font-display); font-weight: 700; }
.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.product-name { flex: 1; }
.product-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-2);
  margin-right: 10px;
  flex-shrink: 0;
}
.product-thumb-empty { background: var(--surface-2); }
/* Effet "shimmer" pendant le chargement de la photo produit, puis
   fondu d'apparition une fois chargée — évite le popup brutal/vide. */
img.product-thumb {
  opacity: 0;
  transition: opacity 0.25s ease;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%);
  background-size: 200% 100%;
  animation: productThumbShimmer 1.3s ease-in-out infinite;
}
img.product-thumb.img-loaded {
  opacity: 1;
  animation: none;
  background: none;
}
@keyframes productThumbShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.admin-product-row { display: flex; align-items: center; gap: 10px; }
.admin-product-row .product-thumb { width: 36px; height: 36px; margin-right: 8px; }
.admin-product-row .ios-switch { margin-left: auto; }
.icon-btn-sm { width: 30px; height: 30px; }
.icon-btn-sm .icon { width: 0.95em; height: 0.95em; }
.qty-control { display: flex; align-items: center; gap: 10px; }
.qty-control button {
  width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 1.1rem; line-height: 1;
}
.qty-value { min-width: 20px; text-align: center; font-weight: 600; }
.stock-propose-qty-input {
  width: 46px;
  padding: 4px 2px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
}
.stock-propose-qty-input.has-delta { border-color: var(--accent); color: var(--accent); }

.send-bar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; }
.send-bar button { width: 100%; padding: 14px; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 8px; }

.fab-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  flex-shrink: 0;
}

/* Écran plein "Nouvelle demande" */
.new-request-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 180;
  display: flex;
  flex-direction: column;
}
.new-request-screen.hidden { display: none; }
.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  padding-top: calc(16px + env(safe-area-inset-top));
}
.screen-header h1 { margin: 0; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; flex: 1; }
.screen-header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-btn-danger {
  background: color-mix(in oklch, var(--red) 18%, transparent);
  color: var(--red);
}
.icon-btn-danger .icon { width: 1.05em; height: 1.05em; }
.new-request-scroll { flex: 1; overflow-y: auto; padding: 0 16px; }
.new-request-scroll h2 { color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 20px 0 10px; }

.pdv-select-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  text-align: left;
}
.pdv-select-card > .icon:first-child { color: var(--accent); flex-shrink: 0; }
.pdv-select-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pdv-select-name { font-weight: 700; }
.pdv-select-hint { font-size: 0.78rem; color: var(--muted); }
.pdv-select-card > .icon:last-child { color: var(--muted); flex-shrink: 0; }

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}
.search-field-icon {
  position: absolute;
  left: 14px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}
.search-field input::placeholder { color: var(--muted); }
.search-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 20%, transparent);
}
/* Le champ de recherche natif ajoute une petite croix "effacer" — on la
   garde mais on retire les autres boutons décoratifs de certains navigateurs. */
.search-field input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.category-pills { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 2px; }
.category-pills .pill {
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
}
.category-pills .pill.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

.comment-label { display: block; color: var(--muted); font-size: 0.85rem; margin: 20px 0 8px; }
#manager-comment {
  width: 100%;
  min-height: 70px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  margin-bottom: 16px;
}
#manager-comment::placeholder { color: var(--muted); }

/* Récap / détail (modales) */
.recap-card { max-width: 400px; }
.recap-pdv { font-weight: 700; margin: 0 0 6px; }
.recap-items { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.recap-items li { display: flex; justify-content: space-between; font-size: 0.92rem; }
.recap-comment { font-size: 0.85rem; color: var(--muted); font-style: italic; margin: 0 0 10px; }
.recap-comment:empty { display: none; }
.recap-actions { display: flex; gap: 10px; }
.recap-actions button {
  flex: 1;
  margin-top: 0;
  font-size: 0.85rem;
  padding: 12px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.recap-actions button .icon { width: 0.95em; height: 0.95em; flex-shrink: 0; }
.secondary-btn { background: none; border: 1px solid var(--border); color: var(--text); }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  padding: 0;
  width: 28px;
  height: 28px;
}
.modal-card { position: relative; }

/* Spinner de chargement (bouton) */
.btn-spinner { width: 24px; height: 24px; display: inline-block; }
button:has(.btn-spinner:not(.hidden)) > *:not(.btn-spinner) { display: none; }

/* Confirmation d'envoi (animation succès) */
.success-card {
  background: var(--card);
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.success-lottie { width: 140px; height: 140px; }
.success-text { margin: 4px 0 0; font-size: 1.05rem; font-weight: 700; }

/* Chargement plein écran (connexion) */
.loading-lottie { width: 180px; height: 180px; }

/* Annuler une demande (manager, statut "nouvelle") */
.request-card-actions { display: flex; gap: 8px; margin-top: 10px; }
.request-card-actions .cancel-btn,
.request-card-actions .secondary-btn,
.request-card-actions .claim-btn { margin-top: 0; flex: 1; width: auto; }
.request-card-actions .secondary-btn:disabled { opacity: 0.55; cursor: default; }
.partial-hint.refusal-note { color: var(--status-critical); }
.cancel-btn {
  margin-top: 10px;
  width: 100%;
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
}

.request-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.request-list li {
  background: var(--card);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  border-left: 4px solid var(--muted);
}
.request-list li.status-nouvelle { border-color: var(--red); }
.request-list li.status-en_cours { border-color: var(--orange); }
.request-list li.status-livree { border-color: var(--green); }
.request-list li.status-refusee { border-color: var(--status-critical); }

/* Log dashboard */
/* padding-right : dégage la place du bouton clair/sombre (fixe, en haut à
   droite) pour qu'il ne recouvre jamais un bouton "+" de fin de ligne. */
.screen-header-inline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-right: 54px; }
.screen-header-inline h1 { margin: 0; color: var(--text); font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; }

.status-filter-pills { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; }
.status-filter-pills .pill,
.event-type-pills .pill {
  flex-shrink: 0;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
}
.status-filter-pills .pill.active,
.event-type-pills .pill.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

.cards { display: flex; flex-direction: column; gap: 10px; }

.request-card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px 30px 14px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  position: relative;
}
.request-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.request-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
}
.request-pdv { flex: 1; font-weight: 700; display: flex; align-items: center; gap: 4px; min-width: 0; }
.request-pdv .icon { width: 0.85em; height: 0.85em; color: var(--muted); flex-shrink: 0; }
.request-pdv span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  color: #fff;
  flex-shrink: 0;
}
.status-pill-red { background: var(--red); }
.status-pill-orange { background: var(--orange); }
.status-pill-green { background: var(--green); }
.status-pill-critical { background: var(--status-critical); }
.request-card-sub { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; padding-left: 2px; }
.request-items-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.request-items-list li { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.request-items-list .item-name { flex: 1; }
.request-items-list .item-qty { font-weight: 600; color: var(--muted); }
.item-status-done { color: var(--green); font-size: 0.8rem; font-weight: 600; flex-shrink: 0; }
.item-status-missing { color: var(--orange); font-size: 0.8rem; font-weight: 600; flex-shrink: 0; }
.item-status-rupture { color: var(--status-critical); font-size: 0.8rem; font-weight: 600; flex-shrink: 0; }
.item-pick { display: flex; gap: 6px; flex-shrink: 0; }
.item-pick-btn {
  border: 1px solid var(--border);
  background: none;
  color: var(--muted);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}
.item-pick-btn.active { color: #fff; border-color: transparent; }
.item-pick-btn[data-pick="delivered"].active { background: var(--green); }
.item-pick-btn[data-pick="missing"].active { background: var(--orange); }
.partial-hint { font-size: 0.78rem; color: var(--orange); margin: 4px 0 0; }
.request-chevron {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 1.1em;
  height: 1.1em;
  color: var(--muted);
}
.request-card:has(.stock-hint-btn) { padding-right: 48px; }
.stock-hint-btn {
  position: absolute;
  top: 10px;
  right: 32px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.request-card.status-en_cours .request-card-sub { color: var(--orange); }
.request-card.status-livree .request-card-sub { color: var(--green); }
.request-card.status-refusee .request-card-sub { color: var(--status-critical); }
.request-card .claim-btn { margin-top: 10px; width: 100%; }

/* Admin */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-tab-btn {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.admin-tab-btn.active { background: var(--accent); color: white; }
.inline-form { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.inline-form input, .inline-form select { padding: 8px; border: 1px solid var(--border); border-radius: 8px; flex: 1; min-width: 140px; background: var(--card); color: var(--text); }
.admin-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.admin-list li {
  background: var(--card);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.admin-list .zones-input { flex: 1; padding: 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--text); }
.admin-list-label { flex: 1; min-width: 0; }
.admin-list-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.admin-list-clickable { cursor: pointer; }
.admin-list-chevron { width: 1.1em; height: 1.1em; color: var(--muted); flex-shrink: 0; }
.pdv-list-hint { color: var(--muted); font-size: 0.82rem; margin: -6px 0 12px; }

.today-conn-group { margin-bottom: 16px; }
.today-conn-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 0 0 8px; }
.today-conn-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.today-conn-list li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}
.today-conn-detail { color: var(--muted); font-size: 0.82rem; flex-shrink: 0; }

/* Interrupteur style iOS — activer/désactiver un produit ou un point de
   vente. À l'accent du club (jamais un vert générique) : c'est une action
   de configuration, pas un statut de demande. */
.ios-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.ios-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.ios-switch-track {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 13px;
  transition: background 0.2s ease;
}
.ios-switch-track::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}
.ios-switch input:checked + .ios-switch-track { background: var(--accent); }
.ios-switch input:checked + .ios-switch-track::before { transform: translateX(18px); }
.ios-switch input:disabled + .ios-switch-track { opacity: 0.5; }
.account-pdv-inline-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 0.85rem;
}
.stats-summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-box { background: var(--card); border-radius: 10px; padding: 12px 18px; min-width: 120px; text-align: center; }
.stat-box .value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; }
.stat-box .label { font-size: 0.8rem; color: var(--muted); }

/* Gestion (PDV / Équipe log) */
.gestion-section.hidden { display: none; }

/* Graphiques (Accueil admin) */
.chart-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}
.chart-card h2 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--text); }
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-row-label { display: flex; justify-content: space-between; font-size: 0.85rem; }
.bar-row-label .value { font-weight: 700; }
.bar-track { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; min-width: 3px; transition: width 0.4s ease; }
.pdv-stat-row { border-bottom: 1px solid var(--border); }
.pdv-stat-row:last-child { border-bottom: none; }
.pdv-stat-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 12px 0;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.pdv-stat-name { font-weight: 700; font-size: 0.9rem; flex: 1; }
.pdv-stat-count { font-size: 0.8rem; color: var(--muted); }
.pdv-stat-chevron { color: var(--muted); transition: transform 0.2s ease; flex-shrink: 0; }
.pdv-stat-chevron.open { transform: rotate(90deg); }
.pdv-stat-detail {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px;
  margin: 0 0 12px;
}
.bar-fill-red { background: var(--red); }
.bar-fill-orange { background: var(--orange); }
.bar-fill-green { background: var(--green); }
.bar-fill-blue { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.chart-empty { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 8px 0; }

.stats-match-picker { margin-bottom: 14px; }
.stats-match-picker label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}
.stats-match-picker select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
}
.stats-match-banner {
  font-size: 0.82rem;
  color: var(--muted);
  margin: -4px 0 14px;
}

.admin-demandes-summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  background: var(--card);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 14px;
}

/* Fiche produit (ajout / édition) */
.product-image-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.product-image-preview {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-image-preview img { width: 100%; height: 100%; object-fit: contain; }
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.field-label { display: block; color: var(--muted); font-size: 0.85rem; margin: 14px 0 6px; }
#admin-product-name-input,
#admin-product-category-input,
#admin-product-description-input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
#admin-product-description-input { min-height: 70px; resize: vertical; }
#admin-product-name-input::placeholder,
#admin-product-category-input::placeholder,
#admin-product-description-input::placeholder { color: var(--muted); }
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--text);
  font-size: 0.92rem;
}
.toggle-row input { width: 18px; height: 18px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 20, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
  animation: modalFadeIn 0.2s ease;
}
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  background: var(--card);
  border-radius: 22px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border);
  animation: modalPopIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes modalPopIn { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  box-shadow: 0 10px 24px color-mix(in oklch, var(--accent) 30%, transparent);
  margin-bottom: 4px;
}
.modal-icon .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.modal-card h2 { margin: 0 0 4px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; }
.modal-card-hint { margin: -8px 0 4px; font-size: 0.85rem; color: var(--muted); }
.modal-card label { font-size: 0.82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.modal-card select,
.modal-card input[type="text"],
.modal-card input[type="email"],
.modal-card input[type="password"],
.modal-card input[type="date"],
.modal-card input[type="time"] {
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.modal-card select:focus,
.modal-card input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
}
.modal-card button { margin-top: 6px; }
.modal-card button[disabled] { opacity: 0.5; }
.modal-primary-btn {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 10px 24px color-mix(in oklch, var(--accent) 28%, transparent);
}
.account-qr-canvas {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
}
#account-qr-result .secondary-btn,
#access-qr-download { display: block; text-align: center; text-decoration: none; }
.match-code-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  text-align: center;
}
.match-code-title { font-weight: 700; font-size: 0.9rem; margin: 0 0 8px; color: var(--text); }
.match-code-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin: 0 0 10px;
  color: var(--accent);
}
.zone-picker { display: flex; gap: 10px; }
.zone-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.zone-option input { display: none; }
.zone-option.checked {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}
.zone-option-sm { flex: 0 0 auto; padding: 6px 12px; font-size: 0.82rem; border-radius: 10px; }

.pdv-products-hint { color: var(--muted); font-size: 0.82rem; margin: 0 0 14px; }

/* ---- Stock (réserves) ---- */
.stock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
}
.stock-row-name { flex: 1; min-width: 0; }
.stock-row-name strong { display: block; font-size: 0.9rem; }
.stock-row-name small { color: var(--muted); font-size: 0.76rem; }
.stock-row .product-thumb { width: 36px; height: 36px; margin: 0; flex-shrink: 0; }

.stock-row-edit { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.stock-confirm-btn,
.stock-cancel-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.stock-confirm-btn { background: linear-gradient(135deg, var(--accent-deep), var(--accent)); color: #fff; }
.stock-confirm-btn .icon, .stock-cancel-btn .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.stock-cancel-btn { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }

.stock-reserve-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stock-reserve-icon .icon { width: 17px; height: 17px; }

.stock-out-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--status-critical);
  flex-shrink: 0;
}
.stock-qty-input {
  width: 66px;
  padding: 8px 6px;
  text-align: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.stock-qty-input:disabled { opacity: 0.6; }
.stock-qty-readonly {
  min-width: 40px;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  flex-shrink: 0;
}
.stock-reserve-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  flex-shrink: 0;
}

.stockreq-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}
.stockreq-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.stockreq-who { font-weight: 700; font-size: 0.9rem; }
.stockreq-time { font-size: 0.75rem; color: var(--muted); }
.stockreq-reserve { font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
.stockreq-changes { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; }
.stockreq-changes li { display: flex; justify-content: space-between; font-size: 0.86rem; }
.stockreq-changes .positive { color: var(--green); font-weight: 700; }
.stockreq-changes .negative { color: var(--status-critical); font-weight: 700; }
.stockreq-actions { display: flex; gap: 8px; }
.stockreq-actions button { flex: 1; margin-top: 0; }

.stock-suggest-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.stock-suggest-item { border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.stock-suggest-item:last-child { border-bottom: none; padding-bottom: 0; }
.stock-suggest-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 4px; }
.stock-suggest-source { font-size: 0.84rem; color: var(--muted); display: flex; justify-content: space-between; }
.stock-suggest-source strong { color: var(--text); }
.stock-suggest-short { color: var(--status-critical); font-weight: 600; }

.pdv-restrict-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
}
.pdv-restrict-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.pdv-restrict-option input { display: none; }
.pdv-restrict-option.checked {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}

/* Titres "nus" posés directement sur le fond de page (hors carte blanche) */
#manager-pdv-name,
#manager-tab-demandes > h2,
#manager-tab-profil > h1,
#log-tab-profil > h1,
#admin-tab-produits > h2,
#admin-tab-pdv > h2,
#admin-tab-log > h2,
#admin-tab-stats > h2 {
  color: var(--text);
}

.center-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: var(--surface-2);
  color: var(--text);
  padding: 24px 26px;
  border-radius: 18px;
  max-width: 320px;
  width: calc(100% - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.center-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.center-toast-icon {
  width: 34px;
  height: 34px;
  padding: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  flex-shrink: 0;
}

/* ---- Marque blanche : logo de l'entreprise dans la barre du haut ---- */
.topbar .logo { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo-img { height: 26px; width: auto; max-width: 80px; object-fit: contain; border-radius: 6px; }

/* ---- Gestion > Charte ---- */
.branding-card { display: flex; flex-direction: column; gap: 12px; }
.branding-title { color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin: 0; }
.branding-logo-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; }
.branding-logo-preview {
  width: 56px; height: 56px; flex: none; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; overflow: hidden;
}
.branding-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.branding-card label:not(.branding-file-btn) { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.branding-card input[type="text"] {
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  background: var(--surface-2);
  color: var(--text);
}
.branding-card input[type="text"]:focus { outline: none; border-color: var(--accent); background: var(--card); }
.branding-card label.branding-color-row { flex-direction: row; align-items: center; justify-content: space-between; }
/* Bouton d'envoi de fichier (label autour d'un input file masqué), aussi
   utilisé dans la fenêtre d'édition d'une équipe. */
label.branding-file-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
label.branding-file-btn:hover { border-color: var(--accent); }
input[type="color"] { width: 52px; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); cursor: pointer; }
#team-add-btn { margin-top: 10px; }
.team-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.team-list-crest { width: 22px; height: 22px; object-fit: contain; vertical-align: -6px; margin-right: 6px; }

/* Bouton "+1h" des buvettes (fenêtre de demandes prolongée) */
[data-extended-pdv] { font-size: 0.7rem; font-weight: 700; color: var(--muted); }
[data-extended-pdv].is-on { color: var(--accent); border-color: var(--accent); }

/* ---- Mes sites (multi-site, js/sites.js) ---- */
#sites-view { min-height: 100%; background: var(--bg); }
.sites-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}
.sites-header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.sites-header-top { display: flex; align-items: center; gap: 12px; }
.sites-heading { min-width: 0; }
.sites-eyebrow {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sites-header h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
}
.sites-count {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-text);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 16%, transparent);
}
.sites-quota { margin: 0; color: var(--muted); font-size: 0.88rem; }
.sites-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sites-search { flex: 1 1 220px; margin: 0; }
.sites-new-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}
.sites-new-btn .icon { width: 18px; height: 18px; }

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}
.site-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}
.site-card:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--accent) 50%, var(--border)); }
.site-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-card.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
@media (prefers-reduced-motion: reduce) { .site-card { transition: none; } .site-card:hover { transform: none; } }
.site-card-visual { position: relative; display: block; aspect-ratio: 16 / 9; max-width: 100%; }
.site-card-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-card-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-deep), color-mix(in oklch, var(--accent) 70%, var(--accent-deep)));
  color: rgba(255, 255, 255, 0.35);
}
.site-card-photo-empty .icon { width: 56px; height: 56px; }
/* dégradé de lisibilité sous le nom */
.site-card-visual::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  pointer-events: none;
}
.site-card-type,
.site-card-current {
  position: absolute;
  top: 12px;
  z-index: 1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-card-type { left: 12px; color: #fff; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.site-card-current { right: 12px; color: #1a1712; background: var(--accent); }
.site-card-title {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #fff;
}
.site-card-name { font-size: 1.2rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; color: rgba(255, 255, 255, 0.85); }
.site-card-meta .icon { width: 13px; height: 13px; }
.site-card-stats { display: grid; grid-template-columns: 1fr 1fr; }
.site-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-top: 1px solid var(--border); min-width: 0; }
.site-stat + .site-stat:not(.site-stat-wide) { border-left: 1px solid var(--border); }
.site-stat-wide { grid-column: 1 / -1; }
.site-stat-label { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.site-stat-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.site-stat-next { font-size: 0.92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sites-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 48px 16px;
  border: 1px dashed var(--border);
  border-radius: 18px;
}
.sites-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklch, var(--accent) 16%, transparent);
  color: var(--accent);
}
.sites-empty-icon .icon { width: 26px; height: 26px; }
.sites-empty h2 { margin: 8px 0 0; font-family: var(--font-display); font-size: 1.3rem; color: var(--text); }
.sites-empty p { margin: 0; max-width: 46ch; color: var(--muted); }

/* Bouton "site en cours" en haut de l'Accueil admin */
.site-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 56px);
  margin: 0 0 14px;
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
}
.site-switch > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-switch .icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent); }
.site-switch .site-switch-chevron { color: var(--muted); }

/* ---- Admin : menu latéral et tableau de bord ----
   Sur téléphone, rien ne change (barre du bas). À partir de 1024 px, le
   menu latéral remplace la barre du bas, le contenu s'élargit, et
   l'Accueil devient un tableau de bord en grille. */
.admin-sidebar { display: none; }

/* Éléments du tableau de bord, toutes tailles */
.dash-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.dash-metric { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); }
.dash-metric-icon { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in oklch, var(--accent) 16%, transparent); color: var(--accent); }
.dash-metric-icon .icon { width: 19px; height: 19px; }
.dash-metric.is-alert .dash-metric-icon { background: color-mix(in oklch, var(--red) 16%, transparent); color: var(--red); }
.dash-metric-body { display: flex; flex-direction: column; min-width: 0; }
.dash-metric-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.dash-metric-value { margin-top: 2px; font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.dash-metric-hint { font-size: 0.8rem; color: var(--muted); }

.dash-live { margin-bottom: 16px; }
.dash-live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-live-head h2 { margin: 0; }
.dash-link { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: none; color: var(--text); font-size: 0.82rem; font-weight: 600; }
.dash-live-list { list-style: none; margin: 10px 0 0; padding: 0; }
.dash-live-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.dash-live-row:first-child { border-top: none; }
.dash-live-num { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.dash-live-main { display: flex; flex-direction: column; min-width: 0; }
.dash-live-main strong { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-live-main small { color: var(--muted); font-size: 0.8rem; }
.dash-live-time { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.dash-live-status { padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.dash-live-status.status-nouvelle { color: var(--red); background: color-mix(in oklch, var(--red) 15%, transparent); }
.dash-live-status.status-en_cours,
.dash-live-status.status-partielle { color: var(--orange); background: color-mix(in oklch, var(--orange) 16%, transparent); }
.dash-live-status.status-livree { color: var(--green); background: color-mix(in oklch, var(--green) 15%, transparent); }
.dash-live-status.status-refusee { color: var(--muted); background: var(--surface-2); }
.dash-live-empty { padding: 14px 0 4px; color: var(--muted); font-size: 0.9rem; }

@media (min-width: 1024px) {
  body:has(#admin-view.view:not(.hidden)) #app { max-width: none; padding: 0; }

  #admin-view.view {
    --sb-width: 260px;
    --sb-ink: #17150F;
    --sb-ink-2: #211E16;
    --sb-text: #F2F0EB;
    --sb-muted: #B9B4A8;
    display: grid;
    grid-template-columns: var(--sb-width) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    transition: grid-template-columns 0.25s ease;
  }
  #admin-view.view.sb-collapsed { --sb-width: 76px; }
  #admin-view .bottom-nav { display: none; }
  #admin-view .app-content {
    min-width: 0;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: calc(28px + env(safe-area-inset-top)) 40px 48px;
  }
  /* l'Accueil a son propre sélecteur de site : le menu suffit */
  #admin-site-switch,
  #admin-tab-accueil .quick-access,
  #admin-tab-gestion > .status-filter-pills { display: none !important; }

  .admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: calc(18px + env(safe-area-inset-top)) 12px 16px;
    background: var(--sb-ink);
    color: var(--sb-text);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 120;
  }
  .sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; min-height: 40px; }
  .sb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding-left: 4px; }
  .sb-brand-mark { width: 34px; height: 34px; border-radius: 10px; object-fit: contain; flex-shrink: 0; }
  .sb-brand-name { font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-collapse,
  .admin-sidebar .sb-item,
  .sb-site { font: inherit; }
  .sb-collapse { width: 36px; height: 36px; padding: 0; flex-shrink: 0; border-radius: 10px; border: none; background: none; color: var(--sb-muted); display: flex; align-items: center; justify-content: center; }
  .sb-collapse:hover { color: var(--sb-text); background: var(--sb-ink-2); }
  .sb-collapse .icon { width: 20px; height: 20px; }

  .sb-site { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; margin-bottom: 8px; border-radius: 14px; border: 1px solid rgba(242, 240, 235, 0.1); background: var(--sb-ink-2); color: var(--sb-text); text-align: left; cursor: pointer; }
  .sb-site.is-static { cursor: default; }
  .sb-site:disabled { opacity: 1; }
  .sb-site-icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in oklch, var(--accent) 22%, transparent); color: var(--accent); }
  .sb-site-icon .icon { width: 16px; height: 16px; }
  .sb-site-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .sb-site-text small { font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sb-muted); }
  .sb-site-text strong { font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sb-site-chevron { width: 15px; height: 15px; color: var(--sb-muted); flex-shrink: 0; }
  .sb-site.is-static .sb-site-chevron { display: none; }

  .sb-nav { display: flex; flex-direction: column; gap: 2px; }
  .sb-group { margin: 14px 12px 6px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sb-muted); white-space: nowrap; }
  .admin-sidebar .sb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: none;
    border-radius: 12px;
    background: none;
    color: var(--sb-muted);
    font-size: 0.92rem;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
  }
  .admin-sidebar .sb-item .icon { width: 19px; height: 19px; flex-shrink: 0; }
  .admin-sidebar .sb-item:hover { color: var(--sb-text); background: var(--sb-ink-2); }
  .admin-sidebar .sb-item.active { color: #1A1712; background: var(--accent); }
  .admin-sidebar .sb-item:focus-visible,
  .sb-collapse:focus-visible,
  .sb-site:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .sb-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 700; background: var(--red); color: #fff; }
  .sb-item.active .sb-badge { background: #1A1712; color: var(--accent); }

  .sb-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(242, 240, 235, 0.08); display: flex; flex-direction: column; gap: 2px; }
  .sb-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-deep), var(--accent)); color: #fff; font-size: 0.8rem; font-weight: 700; }
  .sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .sb-profile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
  .sb-profile-text strong { color: var(--sb-text); overflow: hidden; text-overflow: ellipsis; }
  .sb-profile-text small { font-size: 0.75rem; font-weight: 500; color: var(--sb-muted); }
  .sb-item.active .sb-profile-text strong,
  .sb-item.active .sb-profile-text small { color: #1A1712; }

  /* replié : icônes seules, centrées */
  #admin-view.sb-collapsed .sb-label { display: none; }
  #admin-view.sb-collapsed .sb-top { flex-direction: column; }
  #admin-view.sb-collapsed .sb-brand { padding-left: 0; }
  #admin-view.sb-collapsed .admin-sidebar .sb-item,
  #admin-view.sb-collapsed .sb-site { justify-content: center; padding-left: 0; padding-right: 0; }
  #admin-view.sb-collapsed .sb-badge { position: absolute; transform: translate(14px, -12px); min-width: 18px; height: 18px; padding: 0 5px; font-size: 0.65rem; }
  #admin-view.sb-collapsed .sb-site { border: none; background: none; }

  /* bulle de messagerie et bouton thème : décalés du menu */
  body:has(#admin-view.view:not(.hidden)) .inbox-fab-corner-br { bottom: 24px; }

  /* Accueil en tableau de bord */
  .admin-dash {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0 20px;
    align-items: start;
  }
  .admin-dash > * { grid-column: 1 / -1; }
  .admin-dash > .greeting { grid-column: 1 / -1; order: -2; }
  .admin-dash > .match-card { grid-column: 1 / span 5; order: -1; margin: 0 0 16px; }
  .admin-dash > .kpi-card { grid-column: 6 / -1; order: -1; margin: 0 0 16px; align-self: stretch; align-items: center; }
  .admin-dash > .match-card.hidden + .greeting + .kpi-card,
  .admin-dash:has(> .match-card.hidden) > .kpi-card { grid-column: 1 / -1; }
  .admin-dash > .dash-metrics { margin-top: 0; }
  .admin-dash > .dash-live { grid-column: 1 / span 7; }
  .admin-dash > .dash-charts { grid-column: 8 / -1; display: flex; flex-direction: column; gap: 16px; }
  .admin-dash > .dash-charts .chart-card { margin: 0; }
  .admin-dash .greeting h1 { font-size: 2rem; }
}
.login-forgot { align-self: center; padding: 4px 8px; border: none; background: none; color: var(--muted); font-size: 0.85rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.login-forgot:hover { color: var(--text); }
