/* =========================================
   Stylish Admin - Page COMMANDE
   Style: Glassmorphism + iOS-like controls

   ✅ Sans changer tes IDs / classes.
   ========================================= */

:root{
  --ink: rgba(17,24,39,0.95);
  --muted: rgba(17,24,39,0.62);
  --muted2: rgba(17,24,39,0.48);

  --accent: #4e75ff;          /* bleu iOS-ish */
  --accent2: #6d4dff;         /* violet doux */

  --glass: rgba(255,255,255,0.26);
  --glass2: rgba(255,255,255,0.34);
  --border: rgba(255,255,255,0.42);
  --border2: rgba(255,255,255,0.55);

  --shadow: 0 18px 60px rgba(0,0,0,0.12);
  --shadow2: 0 10px 26px rgba(0,0,0,0.10);

  --r16: 16px;
  --r18: 18px;
  --r14: 14px;
  --r12: 12px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  color: var(--ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background-color: #e0c4c4bd;
}

/* léger voile pour garder le texte lisible sur l'image */
body::before{
  content:"";
  position:fixed;
  inset:0;
  background:
    radial-gradient(900px 500px at 20% 15%, rgba(255,255,255,0.40), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(255,255,255,0.28), transparent 65%),
    linear-gradient(to bottom, rgba(255,255,255,0.10), rgba(255,255,255,0.18));
  pointer-events:none;
  z-index:0;
}

.app-main{ position:relative; z-index:1; padding: 16px 16px 28px; }

/* ❌ Tu as dit: header (Stylish / Dashboard) ma t7ebouch */
.app-header{ display:none !important; }

/* =========================
   TOP NAV (menu)
   ========================= */

nav.sidebar.topnav{
  width: min(1330px, 100%);
  margin: 0 auto 18px;
  padding: 10px 12px;
  border-radius: 22px;

  background: var(--glass2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);

  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;

  overflow-x:auto;
  scrollbar-width:none;
  position: sticky;
  top: 12px;
  z-index: 50;
}
nav.sidebar.topnav::-webkit-scrollbar{ display:none; }

/* en version PC: menu ouvert, donc on cache le bouton menu */
nav.sidebar.topnav .menu-toggle{ display:none !important; }

/* Si tu ajoutes un logo dans le nav (optionnel) */
nav.sidebar.topnav .nav-brand{
  margin-right: 10px;
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
}

nav.sidebar.topnav button[data-page]{
  appearance:none;
  border:0;
  background: transparent;
  cursor:pointer;

  flex: 0 0 auto;
  min-width: 108px;
  padding: 10px 14px;
  border-radius: 16px;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 6px;

  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
  white-space: nowrap;

  position:relative;
  transition: background .15s ease, transform .15s ease, color .15s ease, box-shadow .15s ease;
}

nav.sidebar.topnav button[data-page] svg{
  width: 20px;
  height: 20px;
  opacity: 0.92;
}

nav.sidebar.topnav button[data-page]:hover{
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
  color: var(--ink);
}

nav.sidebar.topnav button[data-page].active{
  background: rgba(255,255,255,0.42);
  color: var(--ink);
  box-shadow: var(--shadow2);
}

/* Indicator: petit, en bas (mouch kbira) */
nav.sidebar.topnav button[data-page].active::before{
  content:"";
  position:absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(78,117,255,0.65), rgba(109,77,255,0.55));
  opacity: 0.70;
}
nav.sidebar.topnav button[data-page].active::after{
  content:"";
  position:absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  border: 3px solid rgba(255,255,255,0.80);
  box-shadow: 0 10px 18px rgba(78,117,255,0.30);
}

/* =========================
   PAGE COMMANDE Layout
   ========================= */

.page{ display:none; }
.page.active{ display:block; }

#commande{
  margin: 0 auto;

  /* ton HTML a déjà display:grid en inline style, mais on sécurise */
  display:grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.15fr);
  gap: 18px;
  align-items: start;

  padding: 0; /* on laisse app-main gérer */
}

@media (max-width: 980px){
  #commande{ grid-template-columns: 1fr; }
}

/* Les 2 cartes (order-details / order-items) */
#commande > .section{
  min-width: 0;
  padding: 18px;
  border-radius: var(--r18);

  background: var(--glass);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);

  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

#commande > .section h3{
  margin: 0 0 12px;
  font-size: 18px;
  letter-spacing: -0.2px;
}

/* Séparateur léger */
#commande hr{
  border:0;
  border-top: 1px solid rgba(255,255,255,0.35);
  margin: 14px 0;
}

/* =========================
   Champs (inputs)
   ========================= */

#commande input,
#commande select,
#commande textarea{
  width:100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(255,255,255,0.20);
  color: var(--ink);
  outline:none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  margin-top: 10px;
}

#commande input::placeholder,
#commande textarea::placeholder{ color: rgba(17,24,39,0.45); }

#commande input:focus,
#commande select:focus,
#commande textarea:focus{
  border-color: rgba(78,117,255,0.55);
  box-shadow: 0 0 0 4px rgba(78,117,255,0.16);
  background: rgba(255,255,255,0.28);
}

/* =========================
   Fix spacing (mouch las9in)
   ========================= */

/* espaces verticaux dans les 2 sections */
#order-details > *:not(h3),
#order-items > *:not(h3){
  margin-top: 12px;
}

/* Les lignes flex (Nom/Tel + Gov/Délégation) -> wrap + gap */
#order-details > div[style*="display:flex"]{
  gap: 12px !important;
  flex-wrap: wrap;
  align-items: center;
}
#order-details > div[style*="display:flex"] > *{
  min-width: 0;
  flex: 1 1 240px;
}

/* Message client textarea + bouton analyser */
#msgClient{ min-height: 120px; resize: vertical; }
#analyserBtn{ margin-top: 10px; }

/* petite note */
.small-note{ font-size: 12px; color: var(--muted2); }

/* =========================
   Boutons (iOS-ish)
   ========================= */

/* Tous les boutons de la page commande (sans toucher le menu) */
#commande button:not([data-page]){
  appearance:none;
  border:0;
  cursor:pointer;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 16px 34px rgba(78,117,255,0.22);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
#commande button:not([data-page]):hover{ transform: translateY(-1px); filter: brightness(1.03); }
#commande button:not([data-page]):active{ transform: translateY(0px); filter: brightness(0.98); }

/* Bouton +Ajouter (dans .form-row) */
#btnAddProduit{ white-space: nowrap; }

/* Bouton valider full width */
#btnValider{
  width:100%;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 14px;
}

/* =========================
   Recherche produit / form-row
   ========================= */

.form-row{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
}
#produitInput{ flex: 1 1 360px; }
#btnAddProduit{ flex: 0 0 auto; }

/* =========================
   Table panier (mini-table)
   ========================= */

.mini-table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow:hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.38);
  background: rgba(255,255,255,0.14);
}

.mini-table thead th{
  text-align:left;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  background: rgba(255,255,255,0.20);
  border-bottom: 1px solid rgba(255,255,255,0.35);
}

.mini-table tbody td{
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.24);
}

.mini-table tbody tr:last-child td{ border-bottom:0; }

/* =========================
   Toggle boxes: Échange / Livraison gratuite
   ========================= */

.radio-boxes{
  display:grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 12px;
}
@media (max-width: 980px){
  .radio-boxes{ grid-template-columns: 1fr; }
}

.radio-box{
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.34);
}

.radio-box label{
  display:block;
  font-weight: 750;
  margin-bottom: 8px;
}

.toggle-row{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}

.chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.34);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

/* Switch iOS */
.switch{
  position:relative;
  display:inline-flex;
  align-items:center;
}
.switch input{ display:none; }
.switch .toggle{
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(17,24,39,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  position:relative;
  transition: background .18s ease;
}
.switch .toggle::after{
  content:"";
  position:absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.90);
  box-shadow: 0 10px 18px rgba(0,0,0,0.12);
  transition: left .18s ease;
}

.switch input:checked + .toggle{
  background: rgba(78,117,255,0.45);
}
.switch input:checked + .toggle::after{
  left: 23px;
}

.radio-group{
  margin-top: 12px;
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-group label{
  display:flex;
  align-items:center;
  gap: 8px;
  font-weight: 650;
  color: var(--muted);
  margin:0;
}

/* On laisse fragile/ouverture comme ton ancien comportement.
   Ton HTML a radio-box--hidden => caché, on ne touche pas. */
.radio-box--hidden{ display:none !important; }

/* =========================
   Totals row + résumé
   ========================= */

#totals{
  display:grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
}
@media (max-width: 560px){
  #totals{ grid-template-columns: 1fr; }
}

#resumeBox{
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.18);
  border: 1px dashed rgba(255,255,255,0.42);
}

/* =========================
   Petit reset (évite les collisions)
   ========================= */

#commande h4{ margin: 10px 0 8px; }
#commande p{ margin: 8px 0; }


/* =========================================================
   V3 – iOS toggles (Exchange + Livraison) + modern selects/search
   (keeps existing IDs/classes; only styles)
   ========================================================= */

/* Hide Oui/Non radios only for Échange + Livraison gratuite */
#commande .feature-card[data-feature="echange"] .radio-group,
#commande .feature-card[data-feature="livraison"] .radio-group {
  display: none !important;
}

/* iOS toggle switch (button.ios-switch) */
#commande .feature-card .feature-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#commande .switch-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#commande .switch-badge {
  font-weight: 700;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.45);
  color: rgba(16,24,40,.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
#commande .switch-badge.is-on {
  background: rgba(52, 211, 153, .22);
  border-color: rgba(52, 211, 153, .55);
  color: rgba(6, 95, 70, .95);
}

#commande .ios-switch {
  position: relative;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(148, 163, 184, .35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.25),
    0 12px 28px rgba(15,23,42,.10);
  cursor: pointer;
  outline: none;
  transition: background .22s ease, border-color .22s ease, box-shadow .22s ease;
}

#commande .ios-switch .ios-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}

#commande .ios-switch .ios-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  box-shadow:
    0 10px 22px rgba(15,23,42,.18),
    inset 0 -1px 0 rgba(0,0,0,.08);
  transform: translateX(0);
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}

#commande .ios-switch.is-on {
  background: rgba(34, 197, 94, .35);
  border-color: rgba(34, 197, 94, .55);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.20),
    0 14px 30px rgba(16,185,129,.16);
}
#commande .ios-switch.is-on .ios-knob {
  transform: translateX(20px);
}

#commande .ios-switch:focus-visible {
  box-shadow:
    0 0 0 4px rgba(59,130,246,.25),
    inset 0 0 0 1px rgba(255,255,255,.20);
}

/* Make "Fragile" + "Ouverture" radios look cleaner (keep Oui/Non) */
#commande .feature-card[data-feature="fragile"] .radio-group,
#commande .feature-card[data-feature="ouverture"] .radio-group {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
}

#commande .radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.45);
  background: rgba(255,255,255,.30);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}
#commande .radio-group input[type="radio"] {
  width: 14px;
  height: 14px;
}

/* Modern selects (Gouvernorat / Délégation) */
#commande select {
  -webkit-appearance: none;
  appearance: none;
  background-color: rgba(255,255,255,.40) !important;
  border: 1px solid rgba(255,255,255,.55) !important;
  border-radius: 14px !important;
  padding: 12px 44px 12px 14px !important;
  line-height: 1.15;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.18),
    0 10px 22px rgba(15,23,42,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color .2s ease, box-shadow .2s ease;

  /* caret */
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(15,23,42,.55) 50%),
    linear-gradient(135deg, rgba(15,23,42,.55) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

#commande select:focus {
  outline: none;
  border-color: rgba(59,130,246,.65) !important;
  box-shadow:
    0 0 0 4px rgba(59,130,246,.20),
    inset 0 0 0 1px rgba(255,255,255,.18);
}

/* Modern product search input */
#commande .search-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

#commande #produitInput {
  flex: 1;
  min-width: 220px;
  background: rgba(255,255,255,.40) !important;
  border: 1px solid rgba(255,255,255,.55) !important;
  border-radius: 16px !important;
  padding: 12px 14px 12px 44px !important; /* icon space */
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.18),
    0 10px 22px rgba(15,23,42,.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color .2s ease, box-shadow .2s ease;
}

#commande .search-wrap {
  position: relative;
}
#commande .search-wrap::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  opacity: .65;
  background: currentColor;
  color: rgba(15,23,42,.65);
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35"/></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35"/></svg>');
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

#commande #produitInput:focus {
  outline: none;
  border-color: rgba(59,130,246,.65) !important;
  box-shadow:
    0 0 0 4px rgba(59,130,246,.20),
    inset 0 0 0 1px rgba(255,255,255,.18);
}

#commande #btnAjouterProduit {
  border-radius: 999px !important;
  padding: 10px 14px !important;
  background: rgba(99, 102, 241, .85) !important;
  border: 1px solid rgba(255,255,255,.35) !important;
  color: #fff !important;
  box-shadow: 0 14px 30px rgba(99,102,241,.25);
  transition: transform .12s ease, box-shadow .18s ease;
}
#commande #btnAjouterProduit:hover { transform: translateY(-1px); }
#commande #btnAjouterProduit:active { transform: translateY(0); box-shadow: 0 10px 22px rgba(99,102,241,.22); }


/* ================================
   V4 OVERRIDES — iOS toggles row + modern selects/search
   Objectif:
   - Afficher فقط: "Échange" + سويتش iOS (بدون Oui/Non وبدون Activé/Désactivé)
   - نفس الشيء لـ "Livraison gratuite"
   - الزوز جنب بعضهم
   ================================ */

/* 1) Layout: Échange + Livraison gratuite side-by-side */
#commande .radio-line{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 980px){
  #commande .radio-line{ grid-template-columns: 1fr; }
}

/* 2) One row inside each card: label left, switch right */
#commande .radio-box{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
}
#commande .radio-title{
  margin:0;
  font-weight: 800;
  font-size: 15px;
}
#commande .switch-ctrl{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 10px;
  margin:0;
}

/* 3) Hide the badge texts (Activé/Désactivé) */
#commande .state-badge,
#commande .switch-badge{ display:none !important; }

/* 4) Hide radios UI but keep them in DOM (no break JS/submit) */
#box-echange .radio-options,
#box-livraison-gratuite .radio-options{ display:none !important; }

/* 5) Proper iOS-like toggle (smooth + clear knob) */
#commande .ios-switch{
  width: 54px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.40);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.22);
  position: relative;
  cursor: pointer;
  transition: background .22s cubic-bezier(.2,.9,.2,1),
              box-shadow .22s cubic-bezier(.2,.9,.2,1),
              transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
#commande .ios-switch:active{ transform: scale(0.98); }

#commande .ios-switch .knob{
  position: absolute;
  top: 50%;
  left: 5px;
  width: 20px;
  height: 20px;
  transform: translate(0, -50%);
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  box-shadow:
    0 6px 16px rgba(0,0,0,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  transition: transform .24s cubic-bezier(.2,.9,.2,1);
}

#commande .ios-switch.is-on{
  background: linear-gradient(135deg, rgba(92,132,255,0.95), rgba(150,83,255,0.92));
  box-shadow:
    0 12px 30px rgba(92,132,255,0.20),
    inset 0 0 0 1px rgba(255,255,255,0.22);
}
#commande .ios-switch.is-on .knob{
  transform: translate(22px, -50%);
}

#commande .ios-switch:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 4px rgba(92,132,255,0.25),
    0 12px 30px rgba(0,0,0,0.10),
    inset 0 0 0 1px rgba(255,255,255,0.22);
}

/* 6) Modern selects + inputs (gouvernorat / délégation / recherche produit) */
#commande select,
#commande input[type="text"],
#commande input[type="tel"],
#commande input[type="number"],
#commande input[list],
#commande textarea{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.50);
  background: rgba(255,255,255,0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  padding: 10px 12px;
  color: #0f172a;
  outline: none;
}

#commande select{
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

#commande textarea{ min-height: 92px; resize: vertical; }

#commande select:focus,
#commande input:focus,
#commande textarea:focus{
  border-color: rgba(92,132,255,0.65);
  box-shadow:
    0 0 0 4px rgba(92,132,255,0.20),
    0 10px 25px rgba(0,0,0,0.06);
}

/* 7) Product search line (input + button align) */
#commande #produitInput{
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position: 12px center;
}

#commande #btnAjouterProduit{
  border-radius: 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,0.55);
  background: linear-gradient(135deg, rgba(92,132,255,0.92), rgba(150,83,255,0.90));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 30px rgba(92,132,255,0.22);
  transition: transform .12s ease, box-shadow .22s ease;
}
#commande #btnAjouterProduit:hover{ transform: translateY(-1px); }
#commande #btnAjouterProduit:active{ transform: translateY(0); }
/*6666666666666666666666666666666666666666666666666666
6666666666666666666666666666666666666666666666666666
6666666666666666666666666666666666666666666666666666 */

/* ===============================
   Stylish Glass v5 — Commande UI
   (PASTE AT END OF css/menu.css)
================================= */

:root{
  --glass-bg: rgba(255,255,255,.32);
  --glass-bg-strong: rgba(255,255,255,.42);
  --glass-border: rgba(255,255,255,.40);
  --shadow: 0 12px 40px rgba(15, 23, 42, .14);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, .10);

  --text: #0b1220;
  --muted: rgba(11, 18, 32, .62);

  --accent: #5b6cff;     /* iOS-ish blue/purple */
  --accent-2: #7c3aed;   /* violet */
  --add: #2563eb;        /* add btn */
  --danger: #ef4444;
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

/* Background image */
body.app-shell{
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: url("/src/bck.jpg") center / cover no-repeat fixed;
}

/* soft overlay to keep text readable */
body.app-shell::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(255,255,255,.55), rgba(255,255,255,.25) 60%, rgba(255,255,255,.12)),
    linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,.10));
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 0;
}

.app-header,
.sidebar.topnav,
.app-main,
.content{
  position: relative;
  z-index: 1;
}

/* Header glass */
.app-header{
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.app-brand .brand-text{
  font-weight: 700;
  letter-spacing: .2px;
}
.app-hint{ color: var(--muted); font-weight: 600; }

/* Topnav glass + animated indicator */
.sidebar.topnav{
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 10px 12px;
  margin: 14px 18px;
  overflow: hidden;
}

.sidebar.topnav button{
  position: relative;
  border: 0;
  background: transparent;
  color: rgba(11,18,32,.78);
  padding: 12px 14px;
  border-radius: 18px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.sidebar.topnav button:hover{
  background: rgba(255,255,255,.35);
  transform: translateY(-1px);
}

.sidebar.topnav button.active{
  color: var(--text);
}

.sidebar.topnav .topnav-indicator{
  position: absolute;
  top: 8px;
  height: 44px;
  border-radius: 18px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 14px 28px rgba(15,23,42,.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transform: translateX(0);
  width: 120px;
  opacity: 0;
  transition: transform .32s cubic-bezier(.2,.9,.2,1), width .32s cubic-bezier(.2,.9,.2,1), opacity .22s ease;
  z-index: 0;
}

.sidebar.topnav button,
.sidebar.topnav .sidebar-footer{
  z-index: 1;
}

/* Commande layout */
#commande{
  max-width: 1220px;
  margin: 0 auto;
}

/* Glass card sections */
#commande .section{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#commande h3{
  margin: 0 0 14px 0;
  font-size: 20px;
  letter-spacing: .2px;
}

#commande h4{
  margin: 14px 0 10px;
  font-size: 15px;
  color: rgba(11,18,32,.86);
}

/* Inputs / textarea / selects */
#commande input,
#commande textarea,
#commande select{
  width: 100%;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.42);
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  outline: none;
  transition: box-shadow .18s ease, border-color .18s ease, transform .12s ease, background .18s ease;
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}

#commande textarea{
  min-height: 100px;
  resize: vertical;
}

#commande input:focus,
#commande textarea:focus,
#commande select:focus{
  border-color: rgba(91,108,255,.55);
  box-shadow: 0 12px 28px rgba(91,108,255,.18);
  background: rgba(255,255,255,.54);
}

/* Select: modern arrow */
#commande select{
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(11,18,32,.65) 50%),
    linear-gradient(135deg, rgba(11,18,32,.65) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 50%,
    calc(100% - 16px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* Spacing fix: give breathing room */
#commande .section > input,
#commande .section > textarea,
#commande .section > select{
  margin-top: 10px;
}
#commande label{
  display:block;
  margin-bottom: 6px;
  font-weight: 700;
  color: rgba(11,18,32,.78);
}

/* Buttons */
#commande button{
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  padding: 11px 16px;
  font-weight: 800;
  letter-spacing: .2px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease;
}

#commande button:active{ transform: scale(.98); }

/* Analyze button with icon + loading */
#btnAnalyze{
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 14px 28px rgba(91,108,255,.22);
}

#btnAnalyze .btn-ico{
  width: 18px; height: 18px; display:inline-block;
}

#btnAnalyze.is-loading{
  opacity: .92;
  pointer-events: none;
}
#btnAnalyze.is-loading .spinner{
  display:inline-block;
}
#btnAnalyze .spinner{
  display:none;
  width: 16px; height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to{ transform: rotate(360deg);} }

/* Add product row */
#commande .form-row input#produitInput{
  height: 44px !important;
  border-radius: 18px;
  padding-left: 40px !important;
}
#commande button[onclick*="ajouterProduitBase"]{
  height: 44px !important;
  background: rgba(255,255,255,.50);
  border: 1px solid rgba(255,255,255,.65);
  color: rgba(11,18,32,.86);
  box-shadow: 0 12px 22px rgba(15,23,42,.10);
}
#commande button[onclick*="ajouterProduitBase"]:hover{
  background: rgba(255,255,255,.62);
}

#commande button[onclick*="ajouterProduitBase"].btn-add{
  background: linear-gradient(135deg, var(--add), #60a5fa);
  color: #fff;
  border: 0;
}

/* Table panier modern */
#tableProduits{
  border-collapse: separate;
  border-spacing: 0 10px;
}
#tableProduits thead th{
  text-align: left;
  font-size: 13px;
  color: rgba(11,18,32,.72);
  font-weight: 800;
  padding: 6px 10px;
}
#tableProduits tbody tr{
  background: rgba(255,255,255,.40);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
}
#tableProduits tbody td{
  padding: 12px 10px;
  vertical-align: top;
}
#tableProduits tbody tr td:first-child{
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}
#tableProduits tbody tr td:last-child{
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

.prod-cell{
  display:flex;
  gap: 12px;
  align-items:flex-start;
}
.prod-thumb{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.60);
  box-shadow: 0 10px 18px rgba(15,23,42,.10);
}
.prod-name{
  font-weight: 900;
  line-height: 1.15;
}
.prod-sub{
  font-size: 12px;
  color: rgba(11,18,32,.70);
  margin-top: 4px;
}
#tableProduits input[type="number"]{
  height: 40px;
  border-radius: 14px;
  box-shadow: none;
}

/* delete btn */
#tableProduits button{
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.70);
}
#tableProduits button:hover{
  background: rgba(255,255,255,.70);
}
#tableProduits button.btn-del{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.25);
}

/* Toggles row */
.radio-line{
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.radio-box{
  flex: 1 1 240px;
  background: rgba(255,255,255,.35);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 18px;
  padding: 14px 14px;
  box-shadow: 0 12px 22px rgba(15,23,42,.07);
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

/* hide "Désactivé/Activé" text */
.state-badge{ display:none !important; }

/* label + icon */
#box-echange .radio-title,
#box-livraison-gratuite .radio-title{
  display:flex;
  align-items:center;
  gap: 10px;
  font-weight: 900;
}
#box-echange .radio-title::before{
  content:"";
  width: 18px; height: 18px;
  display:inline-block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 7h11l-2-2 1.4-1.4L22.8 9l-5.4 5.4L16 13l2-2H7V7Zm10 10H6l2 2-1.4 1.4L1.2 15l5.4-5.4L8 11l-2 2h11v4Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 7h11l-2-2 1.4-1.4L22.8 9l-5.4 5.4L16 13l2-2H7V7Zm10 10H6l2 2-1.4 1.4L1.2 15l5.4-5.4L8 11l-2 2h11v4Z'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: .9;
}
#box-livraison-gratuite .radio-title::before{
  content:"";
  width: 18px; height: 18px;
  display:inline-block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 7h11v10H3V7Zm12 2h3l3 3v5h-6V9Zm-9 9a2 2 0 1 0 0 4a2 2 0 0 0 0-4Zm12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4Z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M3 7h11v10H3V7Zm12 2h3l3 3v5h-6V9Zm-9 9a2 2 0 1 0 0 4a2 2 0 0 0 0-4Zm12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4Z'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: .9;
}

/* iOS switch */
.ios-switch{
  width: 56px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.60);
  background: rgba(120,120,130,.22);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.04);
  transition: background .22s ease, box-shadow .22s ease;
}
.ios-switch .knob{
  position:absolute;
  top: 2px;
  left: 2px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 10px 18px rgba(15,23,42,.22);
  transition: transform .22s cubic-bezier(.2,.9,.2,1);
}
.ios-switch.is-on{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 30px rgba(91,108,255,.18);
}
.ios-switch.is-on .knob{
  transform: translateX(22px);
}
.ios-switch:active .knob{
  transform: translateX(0) scale(.98);
}
.ios-switch.is-on:active .knob{
  transform: translateX(22px) scale(.98);
}

/* recap */
#recapCommande{
  background: rgba(255,255,255,.38) !important;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 18px !important;
  box-shadow: 0 12px 22px rgba(15,23,42,.07);
}

/* validate button */
#btnValidate.validate{
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #111827, #334155);
  color:#fff;
  box-shadow: 0 18px 32px rgba(15,23,42,.20);
}
#btnValidate.validate:hover{ opacity:.96; }

/* Suggest dropdown (with images) */
.suggest-box{
  position:absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  background: rgba(255,255,255,.56);
  border: 1px solid rgba(255,255,255,.70);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15,23,42,.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 8px;
  display:none;
  z-index: 50;
  max-height: 320px;
  overflow:auto;
}

.suggest-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background .14s ease, transform .14s ease;
}
.suggest-item:hover,
.suggest-item.is-active{
  background: rgba(255,255,255,.72);
  transform: translateY(-1px);
}

.suggest-item img{
  width: 34px; height: 34px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 10px 16px rgba(15,23,42,.10);
}

.suggest-title{
  font-weight: 900;
  line-height: 1.15;
}
.suggest-meta{
  font-size: 12px;
  color: rgba(11,18,32,.70);
  margin-top: 3px;
}

.suggest-pill{
  margin-left:auto;
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(91,108,255,.12);
  border: 1px solid rgba(91,108,255,.18);
  color: rgba(11,18,32,.85);
}
/* =========================================================
   Stylish Glass v5 — REST OF APP (all pages)
   Paste at END of css/menu.css
========================================================= */

/* -------- Global page spacing -------- */
.page{
  padding: 20px;
}
.page .section{
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Make content not overflow on 13" */
.app-main .content{
  max-width: 1400px;
  margin: 0 auto;
}

/* -------- Generic buttons (if you use .btn) -------- */
.btn{
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 800;
  letter-spacing: .2px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: 0 12px 22px rgba(15,23,42,.10);
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease;
}
.btn:hover{ background: rgba(255,255,255,.68); }
.btn:active{ transform: scale(.98); }

.btn.ghost,
.btn.btn-ghost{
  background: rgba(255,255,255,.28);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 10px 18px rgba(15,23,42,.07);
}
.btn.primary,
.btn.btn-primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border: 0;
  box-shadow: 0 18px 32px rgba(91,108,255,.22);
}
.btn.danger{
  background: rgba(239,68,68,.14);
  border: 1px solid rgba(239,68,68,.30);
}

/* -------- Searchbox / Selectbox blocks -------- */
.searchbox{
  position: relative;
  display:flex;
  align-items:center;
  gap: 10px;
  background: rgba(255,255,255,.38);
  border: 1px solid rgba(255,255,255,.60);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
}
.searchbox .search-icon{
  position: static;
  opacity: .75;
  font-size: 15px;
}
.searchbox input{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 6px 6px !important;
  width: 100%;
  font-weight: 700;
  color: var(--text);
}

.selectbox select{
  width: 100%;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.42);
  color: var(--text);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}

/* -------- Tables: modern glass -------- */
.orders-table,
.bl-table,
.prod-table,
.table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.orders-table thead th,
.bl-table thead th,
.prod-table thead th,
.table thead th{
  text-align: left;
  font-size: 13px;
  color: rgba(11,18,32,.72);
  font-weight: 900;
  padding: 6px 10px;
  white-space: nowrap;
}

.orders-table tbody tr,
.bl-table tbody tr,
.prod-table tbody tr,
.table tbody tr{
  background: rgba(255,255,255,.40);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
}

.orders-table tbody td,
.bl-table tbody td,
.prod-table tbody td,
.table tbody td{
  padding: 12px 10px;
  vertical-align: middle;
}

.orders-table tbody tr td:first-child,
.bl-table tbody tr td:first-child,
.prod-table tbody tr td:first-child,
.table tbody tr td:first-child{
  border-top-left-radius: 16px;
  border-bottom-left-radius: 16px;
}
.orders-table tbody tr td:last-child,
.bl-table tbody tr td:last-child,
.prod-table tbody tr td:last-child,
.table tbody tr td:last-child{
  border-top-right-radius: 16px;
  border-bottom-right-radius: 16px;
}

/* Table wrappers (avoid horizontal scroll on desktop, allow on mobile) */
.bl-table-container,
.prod-table-wrap,
.table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
}

/* Small text */
.muted{ color: rgba(11,18,32,.62); }

/* =========================================================
   PAGE: Liste colis
========================================================= */
#liste_colis h3{
  margin: 0 0 12px 0;
  font-size: 20px;
}

.orders-tools{
  display:flex;
  gap: 12px;
  align-items:center;
  flex-wrap: wrap;
  margin: 12px 0 12px 0;
}

.orders-tools form button{
  border: 0;
  cursor: pointer;
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 900;
  background: rgba(255,255,255,.50);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: 0 12px 22px rgba(15,23,42,.10);
}
.orders-tools form button:hover{ background: rgba(255,255,255,.66); }

#paginationColis{
  margin-top: 14px;
}
#paginationColis button{
  margin: 0 4px;
  border: 1px solid rgba(255,255,255,.65);
  background: rgba(255,255,255,.45);
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 900;
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(15,23,42,.07);
}
#paginationColis button:hover{ background: rgba(255,255,255,.62); }
#paginationColis button.active{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  border: 0;
}

/* Popup historique */
.popup{
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index: 999;
}
.popup-content{
  width: min(820px, calc(100% - 26px));
  max-height: min(82vh, 680px);
  overflow:auto;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(15,23,42,.25);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 18px 18px 16px;
}
.popup-close{
  float: right;
  cursor:pointer;
  font-size: 26px;
  font-weight: 900;
  opacity: .75;
}
.popup-close:hover{ opacity: 1; }

/* =========================================================
   PAGE: Bons de livraison
========================================================= */
#bonsLivraison .bl-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
#bonsLivraison .bl-header h2{
  margin: 0;
  font-size: 22px;
}
#btnNouveauBon{
  border: 0;
  cursor:pointer;
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  box-shadow: 0 18px 32px rgba(91,108,255,.22);
}
#btnNouveauBon:hover{ opacity: .96; }

#bonsLivraison .bl-search-row{
  margin: 10px 0 14px;
}
#searchBonInput{
  width: 100%;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.42);
  border-radius: 18px;
  padding: 12px 14px;
  box-shadow: 0 10px 18px rgba(15,23,42,.08);
  outline: none;
}
#searchBonInput:focus{
  border-color: rgba(91,108,255,.55);
  box-shadow: 0 18px 32px rgba(91,108,255,.18);
}

/* Detail Bon */
#detailBonLivraison .section{
  margin-top: 10px;
}
#detailBonLivraison h2{
  margin: 10px 0 12px;
}
#detailBonLivraison button{
  border-radius: 16px;
  padding: 10px 14px;
  font-weight: 900;
  cursor:pointer;
}
#imprimerBonBtn{
  margin-top: 12px;
  border-radius: 16px !important;
  box-shadow: 0 16px 30px rgba(0,123,255,.20);
}

/* =========================================================
   PAGE: Liste produits (catalog)
========================================================= */
#liste_produits .prod-header{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
#liste_produits .prod-header h2{
  margin: 0;
  font-size: 22px;
}
#liste_produits .prod-actions-right{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
}

#liste_produits .prod-filters{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
  margin: 12px 0 12px;
}
#liste_produits .prod-filters select,
#liste_produits .prod-filters input{
  min-width: 160px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.42);
  padding: 10px 12px;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}
#liste_produits .prod-filters .searchbox{
  flex: 1 1 280px;
  min-width: 260px;
}

/* Bulk bar */
.bulk-bar{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 10px;
  background: rgba(255,255,255,.32);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 12px 22px rgba(15,23,42,.07);
}
.bulk-bar .bulk-right{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items:center;
}
.bulk-bar select,
.bulk-bar input{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.42);
  padding: 9px 10px;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}

/* Product table specifics */
#tableProduitsCatalog th,
#tableProduitsCatalog td{
  white-space: nowrap;
}
#tableProduitsCatalog td img{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.70);
  box-shadow: 0 12px 20px rgba(15,23,42,.10);
}
#prodPagination{
  margin-top: 14px;
  display:flex;
  justify-content:center;
  gap: 8px;
  flex-wrap: wrap;
}
#prodPagination button{
  border: 1px solid rgba(255,255,255,.65);
  background: rgba(255,255,255,.45);
  border-radius: 14px;
  padding: 8px 12px;
  font-weight: 900;
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(15,23,42,.07);
}
#prodPagination button:hover{ background: rgba(255,255,255,.62); }
#prodPagination button.active{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  border: 0;
}

/* =========================================================
   PAGE: Ajout produit
========================================================= */
#ajoutProduit h2{ margin: 0 0 10px; }
.card-like{
  background: rgba(255,255,255,.32);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 18px;
  padding: 14px 14px;
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.form-produit{
  margin-top: 12px;
  background: rgba(255,255,255,.30);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 14px 26px rgba(15,23,42,.10);
}

.form-compact{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.form-compact .field label{
  display:block;
  font-weight: 900;
  font-size: 13px;
  color: rgba(11,18,32,.78);
  margin-bottom: 6px;
}
.form-compact .field input,
.form-compact .field select{
  width:100%;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.42);
  border-radius: 16px;
  padding: 11px 12px;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
  outline:none;
}

.form-compact .full{
  grid-column: 1 / -1;
}

.add-row{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  margin-top: 6px;
}
.add-row input{
  flex: 1 1 320px;
}
.actions{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
#submitBtn.btn.primary,
#submitBtn.btn.primary{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color:#fff;
  border:0;
}

/* =========================================================
   PAGE: Inventaire (stats-page)
========================================================= */
.stats-page .stats-header{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.stats-page .stats-header h1{
  margin: 0;
  font-size: 22px;
}
.stats-page .subtitle{
  margin: 6px 0 0;
  color: rgba(11,18,32,.62);
  font-weight: 600;
}

.stats-page .filters{
  background: rgba(255,255,255,.30);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
  margin-bottom: 12px;
}
.stats-page .filter-row{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.stats-page .filters .field label{
  display:block;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 6px;
  color: rgba(11,18,32,.78);
}
.stats-page .filters .field input,
.stats-page .filters .field select{
  width:100%;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.42);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
  outline:none;
}

/* KPI cards */
.stats-page .kpis{
  display:grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.stats-page .kpi{
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
  display:flex;
  gap: 12px;
  align-items:center;
}
.stats-page .kpi-icon{
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.70);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 10px 18px rgba(15,23,42,.10);
}
.stats-page .kpi-label{
  margin: 0;
  font-size: 12px;
  color: rgba(11,18,32,.62);
  font-weight: 800;
}
.stats-page .kpi-value{
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 950;
}

/* Grid cards */
.stats-page .grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.stats-page .card{
  background: rgba(255,255,255,.32);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
}
.stats-page .card h3{ margin: 0 0 10px; }
.stats-page .span-2{ grid-column: span 2; }

.stats-page .table-head{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.stats-page .table-head .search{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.38);
  border: 1px solid rgba(255,255,255,.60);
  box-shadow: 0 10px 18px rgba(15,23,42,.07);
}
.stats-page .table-head .search input{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  padding: 4px 6px !important;
  font-weight: 700;
}

/* =========================================================
   PAGE: Stat Vente
========================================================= */
.sv-mount{
  background: rgba(255,255,255,.22);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 16px 32px rgba(15,23,42,.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.sv-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sv-title h2{ margin: 0; font-size: 22px; }
.sv-sub{ margin: 6px 0 0; color: rgba(11,18,32,.62); font-weight: 600; }

.sv-filters.card{
  background: rgba(255,255,255,.32);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
}

.sv-grid{
  display:grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.sv-grid .field label{
  display:block;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 6px;
  color: rgba(11,18,32,.78);
}
.sv-grid .field input,
.sv-grid .field select{
  width:100%;
  border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.42);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
  outline:none;
}
.sv-grow{ grid-column: span 2; }

.sv-buttons{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.sv-kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.sv-kpis .kpi.card{
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 12px 22px rgba(15,23,42,.08);
}
.sv-kpis .kpi-label{ color: rgba(11,18,32,.62); font-weight: 900; font-size: 12px; }
.sv-kpis .kpi-value{ font-size: 18px; font-weight: 950; margin-top: 6px; }
.sv-kpis .kpi-sub{ margin-top: 6px; color: rgba(11,18,32,.62); font-weight: 700; font-size: 12px; }

.sv-charts{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.sv-chart .card-head{ font-weight: 950; margin-bottom: 8px; }

.sv-table .card-head{
  font-weight: 950;
  margin-bottom: 10px;
}
.sv-table .table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* =========================================================
   Responsive tweaks
========================================================= */
@media (max-width: 1100px){
  #commande{ grid-template-columns: 1fr !important; }
  .stats-page .kpis{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-page .grid{ grid-template-columns: 1fr; }
  .stats-page .span-2{ grid-column: auto; }
  .stats-page .filter-row{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .form-compact{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-grow{ grid-column: auto; }
  .sv-kpis{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sv-charts{ grid-template-columns: 1fr; }
}

@media (max-width: 640px){
  .page{ padding: 14px; }
  .orders-tools{ flex-direction: column; align-items: stretch; }
  .selectbox{ width: 100% !important; }
  .bulk-bar{ align-items: stretch; }
  .bulk-bar .bulk-right{ width: 100%; }
  .stats-page .kpis{ grid-template-columns: 1fr; }
  .form-compact{ grid-template-columns: 1fr; }
  .sv-kpis{ grid-template-columns: 1fr; }
}

