/* ============================================================
   CISKO GROUP — Design System Premium
   Style Linear / Vercel / Apple
   Palette 60-30-10 — Accent : Bleu électrique #3b82f6
   Version 2.0 — App Shell SaaS (Vercel/Linear)
   ============================================================ */

/* Polices premium Google : Inter (corps) + Poppins (titres) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* ============ VARIABLES (60-30-10) ============ */
:root {
  /* --- 60% : Fonds (blancs cassés / zinc) --- */
  --bg: #f4f4f5;
  --bg-subtle: #fafafa;
  --bg-elevated: #ffffff;

  /* --- 30% : Composants & texte --- */
  --surface: #ffffff;
  --surface-hover: #fafafa;
  --border: rgba(24, 24, 27, 0.08);
  --border-strong: rgba(24, 24, 27, 0.14);
  --text: #18181b;
  --text-muted: #71717a;
  --text-faint: #a1a1aa;

  /* --- 10% : Accent unique (bleu électrique) --- */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-soft: rgba(59, 130, 246, 0.1);
  --accent-border: rgba(59, 130, 246, 0.3);

  /* --- États sémantiques --- */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.1);
  --info: var(--accent);
  --info-soft: var(--accent-soft);

  /* --- Typographie --- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.25rem;

  /* --- Rayons --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Espacements --- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-8: 3rem;
  --sp-10: 4rem;

  /* --- Ombres --- */
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md: 0 4px 16px rgba(24, 24, 27, 0.06);
  --shadow-lg: 0 12px 40px rgba(24, 24, 27, 0.1);
  --shadow-accent: 0 4px 20px rgba(59, 130, 246, 0.35);

  /* --- Transitions --- */
  --transition: all 300ms ease-in-out;
  --transition-fast: all 150ms ease-in-out;

  /* --- Layout --- */
  --container-xs: 480px;
  --container-sm: 640px;
  --container-md: 860px;
  --container-lg: 1100px;
}

/* ============ RESET MODERNE ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: var(--text-base);
}

/* ============ LAYOUT ============ */
.container {
  width: 100%;
  max-width: var(--container-md);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4);
}

.container-sm { max-width: var(--container-sm); }
.container-xs { max-width: var(--container-xs); }
.container-lg { max-width: var(--container-lg); }

/* ============ CARTES ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card + .card {
  margin-top: var(--sp-5);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.card-entete {
  text-align: center;
}

.card h1,
.card h2,
.card h3 {
  margin-bottom: var(--sp-3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.card h1 { font-size: var(--text-2xl); }
.card h2 { font-size: var(--text-xl); }
.card h3 { font-size: var(--text-lg); }

/* ============ BOUTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 28px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============ CHAMPS DE FORMULAIRE ============ */
.input,
input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="file"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-base);
  transition: var(--transition);
}

.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.form-group {
  margin-bottom: var(--sp-4);
}

.form-group label {
  display: block;
  margin-bottom: var(--sp-2);
  font-weight: 600;
  font-size: var(--text-sm);
}

.help {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-2);
}

/* ============ BADGES / INDICATEURS ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.badge-success {
  background: var(--success-soft);
  color: #059669;
}

.badge-warning {
  background: var(--warning-soft);
  color: #d97706;
}

.badge-danger {
  background: var(--danger-soft);
  color: #dc2626;
}

.badge-neutral {
  background: var(--surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-admin {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
}

.badge-compteur {
  background: var(--danger);
  color: #fff;
  border-radius: var(--radius-full);
  min-width: 20px;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
  margin-left: var(--sp-1);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  margin-left: var(--sp-1);
  vertical-align: middle;
  animation: pulse 1.5s infinite;
}

.badge-compteur.zero,
.badge-dot.zero {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--success-soft);
  color: #059669;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
}

.live-badge.hors-ligne {
  background: var(--danger-soft);
  color: #dc2626;
}

/* ============ ALERTES (flash) ============ */
.alert {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
}

.alert-success {
  background: var(--success-soft);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-info {
  background: var(--info-soft);
  color: var(--accent-hover);
  border: 1px solid var(--accent-border);
}

.alert-warning {
  background: var(--warning-soft);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.alert-danger {
  background: var(--danger-soft);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.messages {
  margin-bottom: var(--sp-4);
}

/* ============ TOASTS ============ */
.toast {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 600;
  font-size: var(--text-sm);
  z-index: 9999;
  box-shadow: var(--shadow-lg);
  animation: slideIn 300ms ease-in-out;
  max-width: calc(100vw - 2rem);
  cursor: pointer;
}

.toast-success { background: var(--success); }
.toast-info { background: var(--accent); }
.toast-warning { background: var(--warning); }
.toast-danger { background: var(--danger); }

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============ AVATARS ============ */
.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.avatar:hover {
  box-shadow: 0 0 0 6px var(--accent-soft);
}

.avatar-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-md);
}

.avatar-sm {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}

/* ============ TABLEAUX ============ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

th,
td {
  text-align: left;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-hover);
}

tbody tr {
  transition: var(--transition-fast);
}

tbody tr:hover {
  background: var(--surface-hover);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============ STATUTS COLORÉS ============ */
.status-payee,
.status-completed,
.statut.confirme,
.stock-ok {
  color: var(--success);
  font-weight: 600;
}

.status-attente,
.status-en-cours,
.statut.en_attente,
.stock-faible {
  color: var(--warning);
  font-weight: 600;
}

.status-annulee,
.status-insuffisant,
.status-cancelled,
.statut.echec,
.stock-rupture {
  color: var(--danger);
  font-weight: 600;
}

/* ============ GRILLE PRODUITS ============ */
.produits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
}

.produit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: var(--transition);
  animation: fadeInUp 400ms ease-in-out both;
}

.produit:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.produit h3 {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.produit .desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  min-height: 2.4em;
  flex: 1;
}

.produit .prix {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.produit .stock {
  font-size: var(--text-xs);
  font-weight: 600;
}

.photo-produit {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.actions-produit form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

.actions-produit input[type="number"] {
  width: 64px;
  padding: 0.5rem;
}

.actions-produit button {
  flex: 1;
  min-width: 80px;
}

/* ============ STATS ADMIN ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-4);
}

.stat {
  text-align: center;
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: var(--transition);
}

.stat:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat .nombre {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.stat .label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* ============ GRILLE SOLDES ============ */
.soldes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-4);
}

.solde-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  background: linear-gradient(160deg, var(--surface), var(--surface-hover));
  transition: var(--transition);
}

.solde-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.solde-card h3 {
  font-size: var(--text-base);
  color: var(--accent);
  margin-bottom: var(--sp-2);
}

.solde-card .montant {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.solde-card .ligne {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--text-muted);
  padding: var(--sp-1) 0;
}

/* ============ NAVIGATION / LIENS ============ */
.nav {
  text-align: center;
  margin-top: var(--sp-5);
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-1);
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: var(--text-sm);
  transition: var(--transition);
}

.nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.actions a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
  transition: var(--transition);
}

/* ============ NOTIFICATIONS ============ */
.notif {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-3);
  background: var(--surface);
  transition: var(--transition);
}

.notif:hover {
  box-shadow: var(--shadow-md);
}

.notif.non-lue {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.notif .icone {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.notif h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--sp-1);
}

.notif p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.notif .date {
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-top: var(--sp-2);
}

.activation {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  transition: var(--transition);
}

.activation:hover {
  box-shadow: var(--shadow-md);
}

.activation input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  cursor: pointer;
}

.activation .label {
  flex: 1;
}

.activation .label strong {
  font-size: var(--text-base);
  display: block;
}

.activation .label span {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.activation .etat {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #059669;
}

.activation .etat.desactive {
  color: var(--text-faint);
}

/* ============ TITRE / EN-TÊTE ============ */
.entete {
  text-align: center;
}

.entete h2 {
  font-size: var(--text-2xl);
  letter-spacing: -0.02em;
  margin-top: var(--sp-3);
}

.entete p {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* ============ INFOS ANNULATION ============ */
.info-annulation {
  background: var(--warning-soft);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  font-size: var(--text-sm);
  color: #92400e;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ============ BLOC PAIEMENT ============ */
.bloc-paiement {
  margin-top: var(--sp-4);
  padding: var(--sp-4);
  border: 1px dashed var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  text-align: left;
  font-size: var(--text-sm);
}

.bloc-paiement h3 {
  margin: 0 0 var(--sp-2) 0;
  font-size: var(--text-base);
}

.bloc-paiement p {
  margin: 0.2rem 0;
  color: var(--text);
}

.bloc-paiement .token {
  color: var(--text-faint);
  font-size: var(--text-xs);
  word-break: break-all;
}

/* ============ VIDE / ÉTATS VIDES ============ */
.vide {
  text-align: center;
  color: var(--text-muted);
  padding: var(--sp-6) var(--sp-4);
  font-size: var(--text-base);
}

/* ============ GRILLE FORMULAIRE AJOUT PRODUIT ============ */
.form-ajout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* ============ FORM-INLINE ============ */
.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}

/* ============ UTILITAIRES ============ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.flex-1 { flex: 1; }

.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: 1fr; }

.miniature {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.sans-photo {
  font-size: 1.5rem;
  color: var(--text-faint);
}

.hidden { display: none !important; }

/* ============================================================
   APP SHELL — Layout SaaS (Vercel/Linear)
   Classes réutilisables : .app-layout, .app-sidebar, .app-main,
   .app-header, .app-content, .sidebar-nav, .sidebar-link
   ============================================================ */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar fixe gauche --- */
.app-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: var(--sp-4) var(--sp-3);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) var(--sp-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-4);
}

.sidebar-logo img {
  width: 32px;
  height: 32px;
}

.sidebar-logo span {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-fast);
  position: relative;
}

.sidebar-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-link .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-link .icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-link .badge-compteur {
  margin-left: auto;
  min-width: 18px;
  padding: 0.05rem 0.4rem;
  font-size: 0.65rem;
}

.sidebar-link .badge-dot {
  margin-left: auto;
}

.sidebar-footer {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-3);
}

.sidebar-footer .sidebar-link {
  color: var(--text-faint);
}

.sidebar-footer .sidebar-link:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* --- Main content (droite) --- */
.app-main {
  flex: 1;
  margin-left: 260px;
  min-width: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.app-header h1 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.header-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--border-strong);
}

.header-icon-btn .icon {
  width: 18px;
  height: 18px;
}

.header-icon-btn .icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-icon-btn .badge-compteur {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-weight: 700;
}

.header-icon-btn .badge-compteur.zero {
  display: none;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: var(--transition-fast);
}

.header-avatar:hover {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.header-avatar-placeholder {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  border: 2px solid var(--accent);
  cursor: pointer;
}

.app-content {
  flex: 1;
  padding: var(--sp-5);
  max-width: 1200px;
  width: 100%;
}

/* --- Bandeau status discret --- */
.status-banner {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--warning-soft);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.2);
  margin-bottom: var(--sp-4);
}

.status-banner .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulse 1.5s infinite;
}

.status-banner.success {
  background: var(--success-soft);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.2);
}

.status-banner.success .dot {
  background: var(--success);
}

/* --- Section header compact --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.section-header h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

/* --- Cartes produits compactes (SaaS) --- */
.produits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-4);
}

.produit {
  background: var(--surface);
  border: 1px solid #e4e4e7;
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  transition: var(--transition);
  animation: fadeInUp 400ms ease-in-out both;
}

.produit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.produit h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.produit .desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-height: 2.4em;
  flex: 1;
  margin: 0;
}

.produit .prix {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.produit .stock {
  font-size: var(--text-xs);
  font-weight: 500;
}

.photo-produit {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
}

/* Actions produit compactes */
.actions-produit form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

.actions-produit select {
  grid-column: 1 / -1;
  padding: 0.4rem 0.5rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.actions-produit input[type="number"] {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0.4rem 0.5rem;
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}

.actions-produit button {
  padding: 0.45rem 0.5rem;
  font-size: var(--text-xs);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.actions-produit .btn-panier {
  background: var(--success);
  color: #fff;
}

.actions-produit .btn-panier:hover {
  background: #059669;
}

.actions-produit .btn-acheter {
  background: var(--accent);
  color: #fff;
}

.actions-produit .btn-acheter:hover {
  background: var(--accent-hover);
}

.actions-produit .btn-indispo {
  grid-column: 1 / -1;
  background: var(--text-faint);
  color: #fff;
  cursor: not-allowed;
  width: 100%;
}

/* ============================================================
   FOOD DELIVERY — Top Bar + Catégories + Grille compacte
   Style inspiré Dakar Food Delivery (haut de gamme)
   ============================================================ */

/* --- Top Bar horizontale premium --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 0.75rem var(--sp-5);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
}

.topbar-logo img {
  height: 40px;
  width: auto;
  border-radius: var(--radius-sm);
}

.topbar-logo span {
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topbar-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

/* Indicateur de navigation — tiret bleu qui glisse d'un lien à l'autre */
.nav-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  border-radius: var(--radius-full);
  background: var(--accent);
  transition: left 300ms ease, width 300ms ease;
  pointer-events: none;
}

.topbar-nav a {
  position: relative;
  padding: 0.45rem 0.9rem 0.55rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-display);
  font-weight: 500;
  text-decoration: none;
  transition: color 200ms ease;
}

.topbar-nav a:hover {
  color: var(--text);
}

.topbar-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

/* Badges dans la navigation (commandes, paiements) */
.topbar-nav a .badge-compteur {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  border: 2px solid var(--surface);
  margin-left: 0;
  vertical-align: middle;
}

.topbar-nav a .badge-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  display: inline-block;
  margin-left: 0;
  vertical-align: middle;
  animation: pulse 1.5s infinite;
}

.topbar-nav a .badge-compteur.zero,
.topbar-nav a .badge-dot.zero {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: var(--sp-2);
}

.topbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.topbar-icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.topbar-icon-btn .icon {
  width: 20px;
  height: 20px;
}

.topbar-icon-btn .icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-icon-btn .badge-compteur {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-weight: 700;
  border: 2px solid var(--surface);
}

.topbar-icon-btn .badge-compteur.zero {
  display: none;
}

/* Variante danger (déconnexion) */
.topbar-icon-btn.danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.topbar-icon-btn.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: var(--transition-fast);
}

.topbar-avatar:hover {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar-avatar-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 700;
  border: 2px solid var(--accent);
  cursor: pointer;
}

/* Menu burger (options secondaires) */
.topbar-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: var(--transition-fast);
}

.topbar-burger:hover {
  background: var(--surface-hover);
}

.topbar-burger .icon {
  width: 20px;
  height: 20px;
}

.topbar-burger .icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.burger-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: var(--sp-4);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
}

.burger-menu.open {
  display: flex;
}

.burger-menu a {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-fast);
}

.burger-menu a:hover {
  background: var(--surface-hover);
}

.burger-menu a.danger {
  color: var(--danger);
}

.burger-menu a.danger:hover {
  background: var(--danger-soft);
}

/* --- Catégories (défilement horizontal) --- */
.categories {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  padding: var(--sp-4) var(--sp-5);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.categories::-webkit-scrollbar {
  display: none;
}

.categorie-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 88px;
  min-height: 88px;
  padding: var(--sp-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.categorie-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.categorie-card.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.categorie-card .categorie-icone {
  font-size: 1.5rem;
  line-height: 1;
}

.categorie-card .categorie-nom {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

/* --- Grille produits ultra-compacte --- */
/* ============================================================
   CARTES PRODUITS — STYLE DAKAR FOOD DELIVERY (STRICT)
   Fond fondu avec la page, zoom uniquement sur l'image,
   typographie compacte et grille parfaitement alignée.
   ============================================================ */

/* --- Grille : largeurs/hauteurs uniformes, 4-5 produits max/ligne PC --- */
.fd-produits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-5);
  padding: 0 var(--sp-5) var(--sp-5);
}

@media (min-width: 1024px) {
  .fd-produits-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* --- Carte : même fond que la page (aucune boîte blanche qui tranche) --- */
.product-card,
.fd-produit {
  background: var(--bg);
  border: none;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  cursor: pointer;
  transition: none;
  animation: fadeInUp 400ms ease-in-out both;
}

/* Le texte / la carte ne bougent JAMAIS au survol */
.product-card:hover,
.fd-produit:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

/* --- Cadre de l'image : paysage strict, overflow masqué, coins arrondis --- */
.card-image-container,
.fd-produit-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg);
  border: none;
  border-radius: 12px;
}

.card-image-container img,
.fd-produit-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform 0.4s ease-in-out;
}

/* Zoom sur l'image UNIQUEMENT — jamais la carte ni le texte */
.product-card:hover .card-image-container img,
.fd-produit:hover .fd-produit-image img {
  transform: scale(1.08);
}

.fd-produit-badge {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  backdrop-filter: blur(4px);
}

.fd-badge-stock {
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
}

.fd-badge-rupture {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

/* --- Corps : texte aligné avec les bords gauche/droit de l'image --- */
.fd-produit-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) 0 0 0;
  flex: 1;
  background: transparent;
}

/* --- Titre : LETTRES CAPITALES, Inter, graisse lourde, noir profond --- */
.fd-produit-titre {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #111827;
  line-height: 1.3;
  margin: 0;
}

.fd-produit-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* --- Prix : juste sous le titre, petit, gris subtil et texturé --- */
.fd-produit-prix {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: -0.01em;
}

.fd-produit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid #e4e4e7;
}

.fd-produit-actions select,
.fd-produit-actions input[type="number"] {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.7rem;
  border: 1px solid #e4e4e7;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
}

.fd-produit-actions select:focus,
.fd-produit-actions input[type="number"]:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.fd-produit-actions button {
  padding: 0.4rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.fd-produit-actions .btn-panier {
  background: var(--success);
  color: #fff;
}

.fd-produit-actions .btn-panier:hover {
  background: #059669;
}

.fd-produit-actions .btn-acheter {
  background: var(--accent);
  color: #fff;
}

.fd-produit-actions .btn-acheter:hover {
  background: var(--accent-hover);
}

.fd-produit-actions .btn-indispo {
  grid-column: 1 / -1;
  background: var(--text-faint);
  color: #fff;
  cursor: not-allowed;
  width: 100%;
}

/* --- Titre avec double ligne décorative bleue (au-dessus ET en-dessous), aligné à gauche --- */
.title-bar {
  padding: var(--sp-4) var(--sp-5) 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
}

.title-bar h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #111827;
  margin: 0;
  text-align: left;
}

.title-bar .title-line {
  width: 60px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

/* --- Section header (FD) --- */
.fd-section-header {
  padding: var(--sp-4) var(--sp-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.fd-section-header h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

/* --- Status banner dans le contenu --- */
.fd-status {
  padding: var(--sp-4) var(--sp-5) 0;
}

/* ============================================================
   MODAL PRODUIT — Fiche dynamique plein écran (style Jumia)
   ============================================================ */

.product-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(24, 24, 27, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease-in-out, visibility 300ms ease-in-out;
}

.product-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.product-modal {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform: translateY(20px) scale(0.98);
  transition: transform 300ms ease-in-out;
}

.product-modal-overlay.open .product-modal {
  transform: translateY(0) scale(1);
}

.product-modal-close {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.product-modal-close:hover {
  background: var(--surface-hover);
  transform: rotate(90deg);
}

.product-modal-close .icon {
  width: 20px;
  height: 20px;
}

.product-modal-close .icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-modal-image {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface-hover);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.product-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal-info {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.product-modal-category {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.product-modal-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
}

.product-modal-desc {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.product-modal-price {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.product-modal-stock {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--success);
}

.product-modal-actions {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Stepper quantité */
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.qty-stepper button {
  width: 30px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.qty-stepper button:hover {
  background: var(--surface-hover);
  color: var(--accent);
}

.qty-stepper button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-stepper .qty-value {
  min-width: 40px;
  text-align: center;
  font-size: var(--text-base);
  font-weight: 600;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 36px;
  padding: 0 0.4rem;
}

.product-modal-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-accent);
}

.product-modal-add:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 28px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.product-modal-add .icon {
  width: 20px;
  height: 20px;
}

.product-modal-add .icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-modal-badge {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  backdrop-filter: blur(4px);
}

.product-modal-badge.rupture {
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
}

/* Carte produit cliquable (accueil) */
.fd-produit {
  cursor: pointer;
}

/* ============================================================
   PAGE PRODUIT DÉTAIL — style Jumia (immersive)
   ============================================================ */

/* --- Conteneur page détail --- */
.detail-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-5);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
}

.detail-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
}

.detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.detail-breadcrumb {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.detail-breadcrumb a {
  color: var(--text-faint);
  text-decoration: none;
  transition: var(--transition-fast);
}

.detail-breadcrumb a:hover {
  color: var(--accent);
}

/* Nom du produit en grand, noir profond */
.detail-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #111827;
  line-height: 1.3;
  margin: 0;
}

/* Prix réel en très gros, bleu premium */
.detail-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.detail-price-currency {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-left: 4px;
}

/* Pastille de stock verte */
.detail-stock {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: #057a55;
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  width: fit-content;
}

.detail-stock .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.detail-stock.rupture {
  color: #b91c1c;
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.2);
}

.detail-stock.rupture .dot {
  background: var(--danger);
}

/* Bloc d'actions hybride */
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

.detail-actions-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.form-panier,
.form-commander {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* Bouton Ajouter au panier (bleu) */
.detail-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-accent);
}

.detail-add:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 28px rgba(59, 130, 246, 0.45);
  transform: translateY(-1px);
}

.detail-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.detail-add .icon {
  width: 20px;
  height: 20px;
}

.detail-add .icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sélecteur de quartier (achat direct) */
.detail-quartier-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.detail-quartier-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Bouton Commander (orange premium) */
.detail-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 1rem 1.5rem;
  background: #f97316;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.35);
}

.detail-buy:hover {
  background: #ea580c;
  box-shadow: 0 6px 28px rgba(249, 115, 22, 0.45);
  transform: translateY(-1px);
}

.detail-buy:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================
   Section Description du produit (zone technique texturée)
   ============================================================ */
.detail-description-section {
  margin-top: var(--sp-8);
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.description-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: #111827;
  margin: 0 0 var(--sp-2) 0;
}

.description-line {
  width: 60px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--accent);
  margin-bottom: var(--sp-5);
}

.detail-description-text {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--text);
  line-height: 1.8;
  margin: 0;
  white-space: pre-line;
}

/* --- Section produits similaires --- */
.similar-section {
  margin-top: var(--sp-8);
}

.similar-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 0 0 var(--sp-2) 0;
}

.similar-line {
  width: 60px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--accent);
  margin-bottom: var(--sp-5);
}

/* ============================================================
   RESPONSIVE — Mobile-first, agrandissement fluide
   ============================================================ */
@media (max-width: 768px) {
  .detail-layout {
    grid-template-columns: 1fr;
    padding: var(--sp-4);
  }

  .detail-image {
    aspect-ratio: 4 / 3;
  }

  .detail-title {
    font-size: var(--text-xl);
  }

  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-add {
    width: 100%;
  }

  .product-modal {
    grid-template-columns: 1fr;
    max-height: 92vh;
  }

  .product-modal-image {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .product-modal-info {
    padding: var(--sp-4);
  }

  .product-modal-title {
    font-size: var(--text-xl);
  }

  .qty-stepper button {
    width: 40px;
    height: 40px;
  }

  .qty-stepper .qty-value {
    line-height: 40px;
  }

  .topbar-nav {
    display: none;
  }

  .topbar-burger {
    display: inline-flex;
  }

  .topbar {
    padding: 0.6rem var(--sp-3);
  }

  .fd-produits-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--sp-3);
    padding: 0 var(--sp-3) var(--sp-3);
  }

  .categories {
    padding: var(--sp-3);
  }

  .fd-section-header {
    padding: var(--sp-3) var(--sp-3) 0;
  }

  .fd-status {
    padding: var(--sp-3) var(--sp-3) 0;
  }
}
@media (min-width: 640px) {
  .form-ajout {
    grid-template-columns: 2fr 3fr 1fr 1fr;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .produits-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .app-sidebar {
    width: 64px;
    padding: var(--sp-3) var(--sp-2);
  }

  .sidebar-logo span {
    display: none;
  }

  .sidebar-logo {
    justify-content: center;
    padding: var(--sp-2) 0 var(--sp-3);
  }

  .sidebar-link {
    justify-content: center;
    padding: 0.6rem;
  }

  .sidebar-link .label {
    display: none;
  }

  .sidebar-link .badge-compteur {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 14px;
    height: 14px;
    font-size: 0.55rem;
    padding: 0 3px;
  }

  .sidebar-footer .sidebar-link .label {
    display: none;
  }

  .app-main {
    margin-left: 64px;
  }

  .app-header {
    padding: var(--sp-2) var(--sp-3);
  }

  .app-content {
    padding: var(--sp-3);
  }
}
@media (min-width: 640px) {
  .form-ajout {
    grid-template-columns: 2fr 3fr 1fr 1fr;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .produits-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (min-width: 768px) {
  .container {
    padding: var(--sp-6) var(--sp-5);
  }

  .card {
    padding: var(--sp-6);
  }
}

@media (min-width: 1024px) {
  body {
    font-size: var(--text-base);
  }
}

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