/* ============================================================
   CISKO GROUP — DESIGN SYSTEM UNIFIÉ (v3.0)
   ------------------------------------------------------------
   Source de vérité UNIQUE pour toute l'application.

   Objectif : unifier les 5 systèmes visuels historiques
   (style.css / user.css / admin.css / auth.css / --ds-*)
   SANS modifier le HTML, le JavaScript ni le backend.

   Méthode : remappage par variables CSS + couche de composants.
   Ce fichier est chargé EN DERNIER sur chaque page.

   Identité : marketplace + restauration
   - Bleu "Cisko"  : confiance, professionnalisme
   - Orange        : appétit, restauration, découverte culinaire
   - Contrastes    : conformes WCAG 2.1 AA (≥ 4,5:1 texte normal)
   ============================================================ */

/* ============================================================
   1. TOKENS — Couleurs
   ============================================================ */
:root {
  /* --- Marque : bleu Cisko --- */
  --c-brand-50:  #eff6ff;
  --c-brand-100: #dbeafe;
  --c-brand-200: #bfdbfe;
  --c-brand-300: #93c5fd;
  --c-brand-500: #3b82f6;
  --c-brand-600: #2563eb;   /* 5,17:1 sur blanc — AA */
  --c-brand-700: #1d4ed8;   /* 7,4:1  sur blanc — AAA */
  --c-brand-800: #1e40af;
  --c-brand-900: #1e3a8a;

  /* --- Accent restauration : orange --- */
  --c-accent-50:  #fff7ed;
  --c-accent-100: #ffedd5;
  --c-accent-200: #fed7aa;
  --c-accent-500: #f97316;  /* surfaces, icônes, badges */
  --c-accent-600: #ea580c;
  --c-accent-700: #c2410c;  /* 5,18:1 sur blanc — AA (texte) */

  /* --- Neutres --- */
  --c-bg:            #f5f7fa;
  --c-surface:       #ffffff;
  --c-surface-2:     #f8fafc;
  --c-surface-3:     #f1f5f9;
  --c-border:        #e2e8f0;
  --c-border-strong: #cbd5e1;
  --c-text:          #0f172a;   /* 17,9:1 — AAA */
  --c-text-muted:    #475569;   /* 7,6:1  — AAA */
  --c-text-faint:    #64748b;   /* 4,8:1  — AA  */

  /* --- Sémantique (texte AA + fonds + aplats) --- */
  --c-success:      #047857;  /* 5,5:1 — AA */
  --c-success-bg:   #ecfdf5;
  --c-success-fill: #10b981;

  --c-warning:      #b45309;  /* 5,0:1 — AA */
  --c-warning-bg:   #fffbeb;
  --c-warning-fill: #f59e0b;

  --c-danger:       #b91c1c;  /* 6,5:1 — AAA */
  --c-danger-bg:    #fef2f2;
  --c-danger-fill:  #ef4444;

  --c-info:      #1d4ed8;
  --c-info-bg:   #eff6ff;
  --c-info-fill: #3b82f6;

  /* --- Surfaces interactives --- */
  --c-hover:   rgba(15, 23, 42, 0.04);
  --c-active:  rgba(15, 23, 42, 0.07);
  --c-overlay: rgba(15, 23, 42, 0.55);
}

/* ============================================================
   2. TOKENS — Typographie, rayons, ombres, rythme
   ============================================================ */
:root {
  --f-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --f-display: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont,
    'Segoe UI', Roboto, sans-serif;

  --t-xs:   0.8125rem;  /* 13px — minimum lisible mobile */
  --t-sm:   0.875rem;   /* 14px — seuil recommandé */
  --t-base: 1rem;
  --t-lg:   1.125rem;
  --t-xl:   1.375rem;
  --t-2xl:  1.75rem;
  --t-3xl:  2.125rem;

  --r-xs:   6px;
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   28px;
  --r-full: 9999px;

  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sh-md: 0 4px 16px rgba(15, 23, 42, 0.07);
  --sh-lg: 0 12px 36px rgba(15, 23, 42, 0.10);
  --sh-brand: 0 6px 22px rgba(37, 99, 235, 0.28);
  --sh-accent: 0 6px 22px rgba(249, 115, 22, 0.28);

  --tr:      all 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --tr-fast: all 150ms cubic-bezier(0.4, 0, 0.2, 1);

  --z-topbar: 100;
  --z-nav:    90;
  --z-modal:  1000;
  --z-toast:  1100;

  --nav-h: 64px;
  --topbar-h: 58px;
}

/* ============================================================
   3. REMAPPAGE DES 5 ANCIENS SYSTÈMES
   ------------------------------------------------------------
   Les templates et feuilles historiques utilisent 5 familles de
   variables (--, --usr-, --admin-, --auth-, --ds-).
   On les fait TOUTES pointer vers les tokens uniques ci-dessus.
   -> unification immédiate, sans toucher au HTML.
   ============================================================ */
:root {
  /* --- Ancien système 1 : style.css (--*) --- */
  --bg: var(--c-bg);
  --bg-subtle: var(--c-surface-2);
  --bg-elevated: var(--c-surface);
  --surface: var(--c-surface);
  --surface-hover: var(--c-surface-2);
  --border: var(--c-border);
  --border-strong: var(--c-border-strong);
  --text: var(--c-text);
  --text-muted: var(--c-text-muted);
  --text-faint: var(--c-text-faint);
  --accent: var(--c-brand-600);
  --accent-hover: var(--c-brand-700);
  --accent-soft: var(--c-brand-50);
  --accent-border: var(--c-brand-200);
  --success: var(--c-success-fill);
  --success-soft: var(--c-success-bg);
  --warning: var(--c-warning-fill);
  --warning-soft: var(--c-warning-bg);
  --danger: var(--c-danger-fill);
  --danger-soft: var(--c-danger-bg);
  --info: var(--c-info);
  --info-soft: var(--c-info-bg);
  --font-sans: var(--f-sans);
  --font-display: var(--f-display);
  --text-xs: var(--t-xs);
  --text-sm: var(--t-sm);
  --text-base: var(--t-base);
  --text-lg: var(--t-lg);
  --text-xl: var(--t-xl);
  --text-2xl: var(--t-2xl);
  --text-3xl: var(--t-3xl);
  --radius-sm: var(--r-sm);
  --radius-md: var(--r-md);
  --radius-lg: var(--r-lg);
  --radius-xl: var(--r-xl);
  --radius-full: var(--r-full);
  --shadow-sm: var(--sh-sm);
  --shadow-md: var(--sh-md);
  --shadow-lg: var(--sh-lg);
  --shadow-accent: var(--sh-brand);
  --transition: var(--tr);
  --transition-fast: var(--tr-fast);
  --container-xs: 480px;
  --container-sm: 640px;
  --container-md: 860px;
  --container-lg: 1140px;

  /* --- Ancien système 2 : user.css (--usr-*) --- */
  --usr-primary: var(--c-brand-600);
  --usr-primary-2: var(--c-brand-500);
  --usr-accent: var(--c-brand-500);
  --usr-orange: var(--c-accent-500);
  --usr-success: var(--c-success-fill);
  --usr-danger: var(--c-danger-fill);
  --usr-warning: var(--c-warning-fill);
  --usr-dark: var(--c-text);
  --usr-slate: var(--c-text-muted);
  --usr-bg: var(--c-bg);
  --usr-surface: var(--c-surface);
  --usr-border: var(--c-border);
  --usr-gradient: linear-gradient(135deg, var(--c-brand-700) 0%,
    var(--c-brand-600) 55%, var(--c-brand-500) 100%);
  --usr-shadow: var(--sh-md);
  --usr-shadow-lg: var(--sh-lg);
  --usr-radius-sm: var(--r-sm);
  --usr-radius: var(--r-md);
  --usr-radius-full: var(--r-full);
  --usr-bottom-nav-h: var(--nav-h);

  /* --- Ancien système 3 : admin.css (--admin-*) --- */
  --admin-accent: var(--c-brand-600);
  --admin-accent-hover: var(--c-brand-700);
  --admin-accent-soft: var(--c-brand-50);
  --admin-bg: var(--c-text);
  --admin-bg-soft: #1e293b;
  --admin-surface: var(--c-surface);
  --admin-surface-soft: var(--c-surface-2);
  --admin-border: var(--c-border);
  --admin-text: var(--c-text);
  --admin-text-muted: var(--c-text-muted);
  --admin-success: var(--c-success-fill);
  --admin-success-soft: var(--c-success-bg);
  --admin-warning: var(--c-warning-fill);
  --admin-warning-soft: var(--c-warning-bg);
  --admin-danger: var(--c-danger-fill);
  --admin-danger-soft: var(--c-danger-bg);
  --admin-purple: #7c3aed;
  --admin-purple-soft: #f5f3ff;
  --admin-pink: #db2777;
  --admin-pink-soft: #fdf2f8;
  --admin-cyan: #0891b2;
  --admin-cyan-soft: #ecfeff;
  --admin-radius: var(--r-lg);
  --admin-radius-sm: var(--r-md);
  --admin-shadow: var(--sh-md);
  --admin-shadow-lg: var(--sh-lg);
  --admin-transition: var(--tr);

  /* --- Ancien système 4 : auth.css (--auth-*) --- */
  --auth-primary: var(--c-brand-600);
  --auth-primary-2: var(--c-brand-500);
  --auth-accent: var(--c-brand-600);
  --auth-accent-2: var(--c-brand-500);
  --auth-dark: var(--c-text);
  --auth-dark-2: #1e293b;
  --auth-slate: var(--c-text-muted);
  --auth-slate-light: var(--c-text-faint);
  --auth-bg: var(--c-bg);
  --auth-surface: var(--c-surface);
  --auth-border: var(--c-border);
  --auth-success: var(--c-success-fill);
  --auth-danger: var(--c-danger-fill);
  --auth-warning: var(--c-warning-fill);
  --auth-gradient: linear-gradient(135deg, var(--c-brand-700) 0%,
    var(--c-brand-600) 55%, var(--c-brand-500) 100%);
  --auth-shadow: var(--sh-lg);
  --auth-shadow-sm: var(--sh-sm);
  --auth-radius: var(--r-lg);
  --auth-radius-sm: var(--r-md);

  /* --- Ancien système 5 : --ds-* (caché dans user.css) --- */
  --ds-primary: var(--c-brand-600);
  --ds-primary-hover: var(--c-brand-700);
  --ds-success: var(--c-success-fill);
  --ds-warning: var(--c-warning-fill);
  --ds-danger: var(--c-danger-fill);
  --ds-info: var(--c-brand-500);
  --ds-text: var(--c-text);
  --ds-text-muted: var(--c-text-muted);
  --ds-border: var(--c-border);
  --ds-shadow-xl: var(--sh-lg);
  --ds-transition: var(--tr);
  --ds-transition-fast: var(--tr-fast);
}

/* ============================================================
   4. BASE & TYPOGRAPHIE
   ============================================================ */
body {
  font-family: var(--f-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.12);
  overscroll-behavior-y: none;
}

h1, h2, h3, h4, h5, h6,
.title-bar h2,
.auth-card h2,
.admin-card-header h2,
.admin-profile-info h2 {
  font-family: var(--f-display);
  color: var(--c-text);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }
h5, h6 { font-size: var(--t-base); }

p { color: var(--c-text-muted); }

/* Liens : couleur de marque + soulignement au survol uniquement */
a { color: var(--c-brand-600); transition: var(--tr-fast); }
a:hover { color: var(--c-brand-700); }

/* Accessibilité : anneau de focus visible homogène partout */
:focus-visible,
.btn:focus-visible,
.admin-btn:focus-visible,
.auth-btn:focus-visible,
.topbar-icon-btn:focus-visible,
.usr-bottom-nav a:focus-visible,
.admin-bottom-nav a:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--c-brand-600);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Sélection de texte aux couleurs de la marque */
::selection { background: var(--c-brand-100); color: var(--c-brand-900); }

/* Images : jamais de débordement, rendu net */
img { max-width: 100%; height: auto; }
img, svg { display: block; }

/* Barre de défilement discrète (desktop) */
@media (min-width: 768px) {
  * { scrollbar-width: thin; scrollbar-color: var(--c-border-strong) transparent; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: var(--c-border-strong);
    border-radius: var(--r-full);
    border: 3px solid var(--c-bg);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--c-text-faint); }
}

/* ============================================================
   5. BOUTONS — un seul langage visuel
   ============================================================ */
.btn,
.admin-btn,
.auth-btn {
  font-family: var(--f-sans);
  font-weight: 600;
  border-radius: var(--r-md);
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  font-size: var(--t-sm);
  line-height: 1.3;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: var(--tr);
}

.btn:active, .admin-btn:active, .auth-btn:active {
  transform: translateY(1px) scale(0.985);
}

/* --- Action principale : bleu Cisko (contraste AA garanti) --- */
.btn-primary,
.admin-btn-primary,
.auth-btn {
  background: var(--c-brand-600);
  color: #fff;
  border-color: var(--c-brand-600);
  box-shadow: var(--sh-brand);
}
.btn-primary:hover,
.admin-btn-primary:hover,
.auth-btn:hover {
  background: var(--c-brand-700);
  border-color: var(--c-brand-700);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 26px rgba(29, 78, 216, 0.34);
}

/* ------------------------------------------------------------
   CORRECTIF : contraste des liens-boutons d'authentification.
   La règle globale `a:hover { color: var(--c-brand-700) }`
   (spécificité 0,1,1) écrase `.topbar-auth-btn { color:#fff }`
   (spécificité 0,1,0) : au survol — et donc durablement sur
   tactile où :hover reste « collant » après un appui — le libellé
   « Inscription » devenait bleu sur fond bleu, quasi illisible.
   On fige le texte en blanc pour le bouton PLEIN (non « ghost »).
   Le bouton « Connexion » (.ghost) garde son style actuel
   (fond clair + texte bleu, blanc au survol) : il est exclu.
   ------------------------------------------------------------ */
.btn-primary,
.admin-btn-primary,
.auth-btn,
.topbar-auth-btn:not(.ghost) {
  color: #fff;
}
.btn-primary:hover, .btn-primary:active, .btn-primary:focus,
.admin-btn-primary:hover, .admin-btn-primary:active, .admin-btn-primary:focus,
.auth-btn:hover, .auth-btn:active, .auth-btn:focus,
.topbar-auth-btn:not(.ghost):hover,
.topbar-auth-btn:not(.ghost):active,
.topbar-auth-btn:not(.ghost):focus {
  color: #fff;
}

/* --- Action secondaire --- */
.btn-secondary,
.admin-btn-ghost,
.admin-btn-outline {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border-strong);
}
.btn-secondary:hover,
.admin-btn-ghost:hover,
.admin-btn-outline:hover {
  background: var(--c-surface-2);
  border-color: var(--c-brand-300);
  color: var(--c-brand-700);
}

/* --- Action restauration (réserver / plats) --- */
.btn-accent,
.btn-reserver {
  background: var(--c-accent-500);
  color: #fff;
  border-color: var(--c-accent-500);
  box-shadow: var(--sh-accent);
}
.btn-accent:hover,
.btn-reserver:hover {
  background: var(--c-accent-600);
  border-color: var(--c-accent-600);
  color: #fff;
  transform: translateY(-1px);
}

/* --- Succès / Danger / Attention --- */
.admin-btn-success {
  background: var(--c-success);
  color: #fff;
  border-color: var(--c-success);
}
.admin-btn-success:hover { background: #065f46; border-color: #065f46; color: #fff; }

.admin-btn-danger,
.btn-danger {
  background: var(--c-danger);
  color: #fff;
  border-color: var(--c-danger);
}
.admin-btn-danger:hover,
.btn-danger:hover { background: #991b1b; border-color: #991b1b; color: #fff; }

/* --- Bouton pleine largeur --- */
.btn-block, .admin-btn-block { width: 100%; }

/* --- Petits boutons (actions de tableau) : 40px mini, jamais moins --- */
.admin-btn-sm,
.btn-sm {
  min-height: 40px;
  padding: 0.5rem 0.85rem;
  font-size: var(--t-xs);
  border-radius: var(--r-sm);
  gap: 0.35rem;
}

/* ============================================================
   6. CARTES — proportions et élévations unifiées
   ============================================================ */
.card,
.admin-card,
.product-card,
.cart-item,
.cart-summary-box,
.cart-select-all,
.payment-card,
.vendeur-bloc,
.notif,
.ds-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  transition: var(--tr);
}

.card,
.admin-card,
.vendeur-bloc,
.ds-card { padding: 1.25rem; }

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--c-border);
}

.admin-card-header h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--t-lg);
  margin: 0;
}

.admin-card-header h2 i { color: var(--c-brand-600); }

/* Cartes interactives : élévation au survol */
.product-card:hover,
.payment-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--c-brand-200);
}

/* ============================================================
   7. FORMULAIRES — un seul style de champ
   ============================================================ */
input[type="text"],
input[type="tel"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="time"],
select,
textarea,
.input {
  font-family: var(--f-sans);
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.9rem;
  font-size: var(--t-base);
  color: var(--c-text);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border-strong);
  border-radius: var(--r-md);
  transition: var(--tr-fast);
}

input::placeholder, textarea::placeholder { color: var(--c-text-faint); }

input:hover, select:hover, textarea:hover { border-color: var(--c-text-faint); }

input:focus, select:focus, textarea:focus {
  border-color: var(--c-brand-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

/* ------------------------------------------------------------
   CORRECTIF : champs d'authentification avec icône intégrée.
   auth.css place une icône en position absolue (left: 1rem) DANS
   le champ et réserve l'espace par `padding-left: 2.75rem`
   (.auth-field input, spécificité 0,1,1). La règle générique
   ci-dessus a la MÊME spécificité mais est chargée après : elle
   écrasait donc cette réserve et l'icône recouvrait les chiffres
   du code PIN (connexion, inscription, réinitialisation).
   On rétablit explicitement la réserve d'espace à gauche.
   ------------------------------------------------------------ */
.auth-field input,
.auth-field input[type="password"],
.auth-field input[type="text"],
.auth-field input[type="tel"] {
  padding-left: 2.75rem;
}

textarea { min-height: 110px; resize: vertical; }

/* Cases à cocher / boutons radio : cibles confortables */
input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  accent-color: var(--c-brand-600);
  cursor: pointer;
  padding: 0;
  border-radius: var(--r-xs);
}

label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--c-text);
}

/* Groupes de formulaire (admin + client) */
.admin-form-group,
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

.admin-form-group label,
.form-group label {
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
}

/* Formulaires en ligne : retour à la ligne propre sur mobile */
@media (max-width: 640px) {
  .form-ajout,
  .form-inline {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  .form-ajout > *,
  .form-inline > * { width: 100% !important; }
}

/* ============================================================
   8. BADGES, STATUTS & INDICATEURS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-accent, .badge-info, .badge-admin {
  background: var(--c-brand-50);
  color: var(--c-brand-700);
  border: 1px solid var(--c-brand-200);
}
.badge-success { background: var(--c-success-bg); color: var(--c-success); border: 1px solid #a7f3d0; }
.badge-warning { background: var(--c-warning-bg); color: var(--c-warning); border: 1px solid #fde68a; }
.badge-danger  { background: var(--c-danger-bg);  color: var(--c-danger);  border: 1px solid #fecaca; }
.badge-neutral {
  background: var(--c-surface-3);
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
}

/* Compteur de notifications (rouge) — le JS masque via .zero */
.badge-compteur, .badge-count {
  background: var(--c-danger-fill);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  min-width: 20px;
  height: 20px;
  padding: 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.badge-compteur.zero, .badge-count.zero, .badge-dot.zero { display: none !important; }

.badge-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c-danger-fill);
  display: inline-block;
  margin-left: 0.25rem;
  vertical-align: middle;
  animation: ds-pulse 1.8s ease-in-out infinite;
}

@keyframes ds-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

/* --- Statuts de commande client (.status-badge) --- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-badge.payee,
.status-badge.complete   { background: var(--c-success-bg); color: var(--c-success); border-color: #a7f3d0; }
.status-badge.attente,
.status-badge.en-cours   { background: var(--c-warning-bg); color: var(--c-warning); border-color: #fde68a; }
.status-badge.annule,
.status-badge.annulee    { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #fecaca; }
.status-badge.insuffisant{ background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #fecaca; }

/* --- Statuts admin (.admin-status) --- */
.admin-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.admin-status-success { background: var(--c-success-bg); color: var(--c-success); border-color: #a7f3d0; }
.admin-status-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: #fde68a; }
.admin-status-danger  { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #fecaca; }
.admin-status-info    { background: var(--c-brand-50);   color: var(--c-brand-700); border-color: var(--c-brand-200); }
.admin-status-neutral,
.admin-status-muted   { background: var(--c-surface-3); color: var(--c-text-muted); border-color: var(--c-border); }

/* --- Badge "temps réel" --- */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: 700;
  background: var(--c-success-bg);
  color: var(--c-success);
  border: 1px solid #a7f3d0;
}
.live-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: ds-pulse 1.8s ease-in-out infinite;
}
.live-badge.hors-ligne {
  background: var(--c-danger-bg);
  color: var(--c-danger);
  border-color: #fecaca;
}
.live-badge.hors-ligne::before { animation: none; }

/* ============================================================
   9. ALERTES & TOASTS
   ============================================================ */
.alert, .admin-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--c-success-bg); color: var(--c-success); border-color: #a7f3d0; }
.alert-info    { background: var(--c-info-bg);    color: var(--c-info);    border-color: var(--c-brand-200); }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning); border-color: #fde68a; }
.alert-danger,
.alert-error   { background: var(--c-danger-bg);  color: var(--c-danger);  border-color: #fecaca; }

/* Toasts — système existant (toasts.js) CONSERVÉ, uniquement restylé */
.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 1rem);
  right: 1rem;
  z-index: var(--z-toast);
  max-width: min(380px, calc(100vw - 2rem));
  padding: 0.85rem 1.1rem;
  border-radius: var(--r-md);
  color: #fff;
  font-size: var(--t-sm);
  font-weight: 600;
  box-shadow: var(--sh-lg);
  cursor: pointer;
  animation: ds-toast-in 260ms cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes ds-toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.toast-success { background: var(--c-success); }
.toast-info    { background: var(--c-brand-600); }
.toast-warning { background: var(--c-warning); }
.toast-danger  { background: var(--c-danger); }

@media (max-width: 640px) {
  .toast {
    left: 0.75rem;
    right: 0.75rem;
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + var(--nav-h) + 0.75rem);
    max-width: none;
  }
}

/* ============================================================
   10. TABLEAUX — lisibles sur desktop, cartes sur mobile
   ============================================================ */
.table-wrap,
.admin-table-wrap {
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--c-surface);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead th {
  background: var(--c-surface-2);
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-muted);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--c-border);
  font-size: var(--t-sm);
  color: var(--c-text);
  vertical-align: middle;
}

.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: var(--tr-fast); }
.admin-table tbody tr:hover { background: var(--c-surface-2); }

.admin-table .admin-table-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* Montants : chiffres alignés et lisibles */
.montant, .summary-total .montant, .admin-solde-card .montant {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ============================================================
   11. NAVIGATION — topbar, catégories, nav basse (client + admin)
   ============================================================ */
.topbar,
.admin-topbar {
  min-height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  z-index: var(--z-topbar);
}

.topbar-logo img,
.admin-topbar-logo img {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  object-fit: cover;
}

.admin-topbar-logo span {
  font-family: var(--f-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
}

/* Icônes de topbar : cible tactile 44px minimum */
.topbar-icon-btn,
.admin-topbar-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: var(--tr-fast);
  position: relative;
}
.topbar-icon-btn:hover,
.admin-topbar-btn:hover {
  background: var(--c-brand-50);
  color: var(--c-brand-700);
  border-color: var(--c-brand-200);
}

.topbar-avatar,
.admin-topbar-avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--r-full);
  object-fit: cover;
  object-position: center;
  border: 2px solid var(--c-border);
  background-color: var(--c-surface-3);
  flex-shrink: 0;
  display: block;
}
.topbar-avatar-placeholder,
.admin-topbar-avatar-placeholder {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: var(--r-full);
  /* Fond de SECOURS solide : l'avatar reste visible même si la
     variable de dégradé n'est pas résolue (page sans user.css). */
  background-color: var(--c-brand-600);
  background-image: var(--usr-gradient);
  color: #fff;
  font-weight: 700;
  font-size: var(--t-sm);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  user-select: none;
}
.topbar-avatar-placeholder i,
.admin-topbar-avatar-placeholder i {
  color: #fff;
  font-size: 1rem;
  line-height: 1;
}

/* Barre de catégories : colle exactement sous la topbar */
.categories-bar {
  top: var(--topbar-h);
  padding: 0.6rem 0.9rem;
  gap: 0.5rem;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  box-shadow: none;
}

.categorie-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  min-height: 40px;
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  color: var(--c-text-muted);
  font-size: var(--t-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
  transition: var(--tr-fast);
}
.categorie-chip:hover {
  border-color: var(--c-brand-300);
  color: var(--c-brand-700);
  background: var(--c-brand-50);
}
.categorie-chip.active {
  background: var(--c-brand-600);
  border-color: var(--c-brand-600);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.26);
}
.categorie-chip i,
.categorie-icone { font-size: 1rem; line-height: 1; }

/* --- Nav basse CLIENT --- */
.usr-bottom-nav {
  height: auto;
  min-height: var(--nav-h);
  padding: 0 0.35rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.07);
  z-index: var(--z-nav);
}
.usr-bottom-nav a {
  min-height: 52px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.usr-bottom-nav a i { font-size: 1.3rem; }

/* --- Nav basse ADMIN --- */
.admin-bottom-nav {
  padding: 0.4rem 0.35rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.07);
  z-index: var(--z-nav);
}
.admin-bottom-nav a {
  min-height: 48px;
  min-width: 56px;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: var(--r-sm);
}
.admin-bottom-nav a i { font-size: 1.2rem; }
.admin-bottom-nav a.active {
  color: var(--c-brand-700);
  background: var(--c-brand-50);
}

/* Espace réservé pour la nav basse — MOBILE UNIQUEMENT (nav masquée ≥768px) */
@media (max-width: 767px) {
  body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
  .admin-body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
   12. MODALES, ÉTATS VIDES, KPI & CHARGEMENT
   ============================================================ */
.admin-modal-overlay,
.cisko-install-modal {
  position: fixed;
  inset: 0;
  background: var(--c-overlay);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

/* IMPORTANT : l'affichage reste piloté par l'existant.
   - .admin-modal-overlay : style inline (JS ouvrirModal/fermerModal)
   - .cisko-install-modal : classe .open ajoutée par install-app.js
   On ne doit JAMAIS forcer display:flex sur .cisko-install-modal,
   sinon la modale PWA resterait visible en permanence. */
.admin-modal-overlay { display: flex; }
.cisko-install-modal { display: none; }
.cisko-install-modal.open { display: flex; }

.admin-modal,
.cisko-install-modal-box {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: ds-modal-in 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes ds-modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  background: var(--c-surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
.admin-modal-header h3 {
  margin: 0;
  font-size: var(--t-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-modal-close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--tr-fast);
}
.admin-modal-close:hover {
  background: var(--c-danger-bg);
  color: var(--c-danger);
  border-color: #fecaca;
}
.admin-modal-body { padding: 1.25rem; }

/* Sur mobile : la modale devient une feuille remontante (bottom-sheet) */
@media (max-width: 640px) {
  .admin-modal-overlay,
  .cisko-install-modal { align-items: flex-end; padding: 0; }
  .admin-modal,
  .cisko-install-modal-box {
    max-width: none;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 88vh;
  }
}

/* --- États vides unifiés --- */
.vide, .admin-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 2.5rem 1.25rem;
  color: var(--c-text-muted);
  font-size: var(--t-sm);
}
.vide i, .admin-empty i {
  font-size: 2.25rem;
  color: var(--c-brand-300);
  margin-bottom: 0.25rem;
}
.vide p, .admin-empty p { margin: 0; }

/* --- KPI : cartes statistiques (vendeur + super-admin) --- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.admin-stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--sh-sm);
  transition: var(--tr);
  position: relative;
  overflow: hidden;
}
.admin-stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--usr-gradient);
  opacity: 0;
  transition: var(--tr);
}
.admin-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--c-brand-200);
}
.admin-stat-card:hover::before { opacity: 1; }

.admin-stat-card .stat-number,
.stat-number {
  font-family: var(--f-display);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--c-text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.admin-stat-card .stat-label,
.stat-label {
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 0.15rem;
}
.stat-icon.blue   { background: var(--c-brand-50);  color: var(--c-brand-700); }
.stat-icon.purple { background: var(--admin-purple-soft); color: var(--admin-purple); }
.stat-icon.pink   { background: var(--admin-pink-soft);   color: var(--admin-pink); }
.stat-icon.cyan   { background: var(--admin-cyan-soft);   color: var(--admin-cyan); }
.stat-icon.orange { background: var(--c-accent-50); color: var(--c-accent-700); }
.stat-icon.green  { background: var(--c-success-bg); color: var(--c-success); }

/* --- Grille d'actions admin : hiérarchie et couleurs --- */
.admin-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
}

.admin-action-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.95rem;
  min-height: 96px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  text-decoration: none;
  font-size: var(--t-sm);
  font-weight: 600;
  position: relative;
  transition: var(--tr);
}
.admin-action-btn i {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--c-brand-50);
  color: var(--c-brand-700);
  transition: var(--tr);
}
.admin-action-btn:hover {
  transform: translateY(-2px);
  border-color: var(--c-brand-300);
  box-shadow: var(--sh-md);
  color: var(--c-brand-700);
}
.admin-action-btn:hover i { background: var(--c-brand-600); color: #fff; }
.admin-action-btn.danger i { background: var(--c-danger-bg); color: var(--c-danger); }
.admin-action-btn.danger:hover {
  border-color: #fecaca;
  color: var(--c-danger);
}
.admin-action-btn.danger:hover i { background: var(--c-danger); color: #fff; }
.admin-action-btn .badge-count { position: absolute; top: 0.6rem; right: 0.6rem; }

/* --- Cartes produit (marketplace + restauration) --- */
.fd-produits-grid,
.produits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
  padding: 0.85rem;
}

.product-card,
.fd-produit {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--sh-sm);
  transition: var(--tr);
}
.product-card:hover,
.fd-produit:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-lg);
  border-color: var(--c-brand-200);
}

/* Visuel produit : ratio 4:5, idéal pour les plats */
.card-image-container,
.fd-produit-image {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--c-surface-3);
}
.card-image-container img,
.fd-produit-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 340ms cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover .card-image-container img,
.fd-produit:hover .fd-produit-image img { transform: scale(1.06); }

/* Badge de disponibilité (rupture / stock) */
.fd-produit-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.fd-badge-stock  { background: rgba(236, 253, 245, 0.95); color: var(--c-success); }
.fd-badge-rupture { background: rgba(254, 242, 242, 0.95); color: var(--c-danger); }

/* Corps de la carte : titre + prix FCFA bien visible */
.fd-produit-body,
.product-card .fd-produit-body {
  padding: 0.7rem 0.8rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.fd-produit-titre {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.fd-produit-prix {
  font-family: var(--f-display);
  font-size: var(--t-lg);
  font-weight: 800;
  color: var(--c-brand-700);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* --- Panier : cartes articles --- */
.cart-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: var(--r-md);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  margin-bottom: 0.7rem;
}
.cart-item-img {
  width: 76px;
  height: 76px;
  border-radius: var(--r-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--c-surface-3);
}
.cart-item-name { font-weight: 600; font-size: var(--t-sm); color: var(--c-text); }
.cart-item-price,
.cart-item-sous-total {
  font-weight: 800;
  color: var(--c-brand-700);
  font-variant-numeric: tabular-nums;
}
.cart-summary-box,
.cart-select-all { padding: 1rem; border-radius: var(--r-md); }
.summary-total .montant { font-size: 1.4rem; color: var(--c-brand-700); }
.cart-buy-btn {
  border-radius: var(--r-md) !important;
  min-height: 52px;
  font-size: var(--t-base);
}

/* Stepper quantité : cible tactile 44px */
.qty-stepper button,
.detail-actions .qty-stepper button {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.qty-stepper,
.detail-actions .qty-stepper { height: 44px !important; border-radius: var(--r-full); }
.qty-stepper .qty-value,
.detail-actions .qty-stepper .qty-value {
  min-width: 44px;
  height: 44px;
  line-height: 44px;
  font-size: var(--t-base);
  font-weight: 700;
}

/* --- Soldes & passerelles --- */
.admin-solde-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.admin-solde-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--sh-sm);
  position: relative;
  overflow: hidden;
}
.admin-solde-card.disponible {
  background: linear-gradient(135deg, var(--c-brand-700), var(--c-brand-500));
  border-color: transparent;
  color: #fff;
}
.admin-solde-card.disponible * { color: #fff !important; }
.admin-solde-card .montant,
.admin-solde-card .solde-montant {
  font-family: var(--f-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  display: block;
  margin-top: 0.3rem;
}

.admin-gateway-item,
.admin-modele {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  margin-bottom: 0.6rem;
  transition: var(--tr-fast);
}
.admin-gateway-item:hover,
.admin-modele:hover { border-color: var(--c-brand-300); background: var(--c-brand-50); }

/* ============================================================
   13. CHARGEMENT & FEEDBACK (additif, sans impact fonctionnel)
   ============================================================ */
.ds-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ds-spin 700ms linear infinite;
  display: inline-block;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

.btn.is-loading,
.admin-btn.is-loading,
.auth-btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after,
.admin-btn.is-loading::after,
.auth-btn.is-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ds-spin 700ms linear infinite;
}

/* Squelettes de chargement */
.skeleton,
.ds-skeleton {
  background: linear-gradient(90deg,
    var(--c-surface-3) 25%, var(--c-surface-2) 37%, var(--c-surface-3) 63%);
  background-size: 400% 100%;
  animation: ds-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes ds-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Apparition douce des cartes produit (perception de fluidité)
   NB : on ne touche PAS à .admin-card pour préserver les
   animations existantes (.admin-fade-in / -delay-1/2/3). */
.fd-produits-grid > a,
.cart-item {
  animation: ds-fade-up 320ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes ds-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   14. RESPONSIVE — mobile-first, tablette, desktop
   ============================================================ */
/* Conteneurs : largeur maîtrisée et centrée */
.admin-container { max-width: 1200px; margin: 0 auto; padding: 1rem; }
/* NB : on n'impose PAS de max-width sur .page-content : plusieurs pages
   (ex. profil.html → 560px) définissent leur propre largeur. Imposer
   1100px ici écrasait ces valeurs (même spécificité, fichier chargé en
   dernier) et élargissait indûment les pages de formulaire. */
.page-content { margin: 0 auto; padding: 1rem; }

@media (min-width: 768px) {
  .admin-container { padding: 1.5rem; }
  .page-content    { padding: 1.5rem; }
  .fd-produits-grid,
  .produits-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
    padding: 1rem 1.5rem;
  }
  .admin-actions-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (min-width: 1024px) {
  .fd-produits-grid,
  .produits-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Petits écrans : ne jamais déborder horizontalement */
@media (max-width: 400px) {
  .admin-container, .page-content { padding: 0.75rem; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-stat-card .stat-number { font-size: 1.35rem; }
  .fd-produits-grid,
  .produits-grid { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; padding: 0.6rem; }
}

/* Aucun débordement horizontal : on n'utilise PAS overflow-x:hidden
   sur html/body (cela casserait position:sticky). On borne les
   conteneurs et on laisse les tableaux gérer leur propre défilement. */
html, body { max-width: 100%; }
.admin-container, .page-content, main { max-width: 100%; }

/* ============================================================
   15. ACCESSIBILITÉ
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Impression sobre */
@media print {
  .usr-bottom-nav, .admin-bottom-nav, .topbar, .admin-topbar, .toast { display: none !important; }
}
