﻿/* =============================================
   SoftFil  Design System 2026
   Modern iOS-inspired, borderless, airy
   ============================================= */

:root {
  --primary:        #ff6900;
  --primary-end:    #ff8a3d;
  --primary-gradient: linear-gradient(135deg, var(--primary), var(--primary-end));
  --primary-gradient-90: linear-gradient(90deg, var(--primary), var(--primary-end));
  --primary-dim:    rgba(255,105,0,.08);
  --primary-light:  rgba(255,105,0,.15);
  --primary-shadow: 0 4px 14px rgba(255,105,0,.25);
  --bg:       #f5f5f7;
  --surface:  #ffffff;
  --border:   rgba(0,0,0,.06);
  --divider:  rgba(0,0,0,.08);
  --text:     #1d1d1f;
  --text-2:   #86868b;
  --text-3:   #aeaeb2;
  --nav-h:    68px;
  --bottom-nav-space: calc(92px + env(safe-area-inset-bottom));
  --r:        20px;
  --r-sm:     14px;
  --r-xs:     10px;
  --r-pill:   999px;
  --shadow:     0 1px 8px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --shadow-lg:  0 8px 30px rgba(0,0,0,.08);
  --ease:       cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

#app {
  min-height: 100%;
  padding-bottom: var(--bottom-nav-space);
}

.container {
  max-width: 600px;
  margin: 0 auto;
  /* add 10px extra padding per request */
  padding: 18px 30px 18px;
}

/* =============================================
   PAGE HEADER  iOS 2026 — frosted glass, fluid
   ============================================= */

.page-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(245,245,247,.72);
  -webkit-backdrop-filter: saturate(200%) blur(28px);
  backdrop-filter: saturate(200%) blur(28px);
  border-bottom: .5px solid transparent;
  transition: border-color .35s var(--ease),
              box-shadow .35s var(--ease),
              background .35s var(--ease);
}

.ph-inner {
  max-width: 600px;
  margin: 0 auto;
  padding: 10px 20px 0;
}

.ph-title-row {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  min-height: 52px;
}

.ph-left  { grid-column: 1; grid-row: 1; display:flex; align-items:center; justify-content:flex-start; z-index: 2; }
.ph-right { grid-column: 3; grid-row: 1; display:flex; align-items:center; justify-content:flex-end;   z-index: 2; }

/* --- header nav buttons — iOS 2026 borderless style --- */
.ph-left .btn,
.ph-right .btn {
  width: 38px; height: 38px;
  padding: 0;
  border-radius: 50%;
  font-weight: 600;
  border: none;
  transition: background .2s var(--ease), transform .12s, opacity .12s;
}

.btn-back {
  background: transparent;
  color: var(--primary);
  box-shadow: none;
  border: none;
}
.btn-back i { font-size: 18px; }
.btn-back:active { background: var(--primary-dim); }

.btn-add {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,105,0,.3);
  border: none;
}
.btn-add i { font-size: 15px; }
.btn-add:active { transform: scale(.92); }

.ph-title {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  text-align: center;
  max-width: calc(100% - 110px);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 1;
  pointer-events: none;
}

/* filter row — CSS grid collapse trick */
.ph-filters-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .35s var(--ease),
              padding .35s var(--ease),
              opacity .25s var(--ease);
  padding-bottom: 10px;
}

.ph-filters-inner { overflow: hidden; min-height: 0; }

.ph-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 6px;
}

/* --- condensed state (scroll > 60px) --- */
.page-header.condensed {
  border-bottom-color: rgba(0,0,0,.08);
  box-shadow: 0 1px 12px rgba(0,0,0,.04);
  background: rgba(245,245,247,.92);
}

/* title stays 28px — no size reduction on scroll */

.page-header.condensed .ph-filters-wrap {
  grid-template-rows: 0fr;
  padding-bottom: 0;
  opacity: 0;
}

.page-header.condensed .ph-inner { padding-bottom: 4px; }

/* =============================================
   BUTTONS  unified system
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .12s, opacity .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); opacity: .85; }

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

.btn-ghost {
  background: var(--bg);
  color: var(--text-2);
  box-shadow: none;
  border: 1px solid var(--divider);
}

.btn.icon-btn {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--text-2);
  background: var(--surface);
  box-shadow: none;
  border: 1px solid rgba(0,0,0,.09);
}

/* Remove blue tap / focus highlight on touch devices for all buttons
   Keep focus-visible for keyboard users to preserve accessibility */
.btn, .btn * {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
.btn:focus { outline: none; }
.btn:focus:not(:focus-visible) { outline: none; }

/* orphaned .ph-add-btn removed — template uses .btn .btn-primary .btn-add */

/* =============================================
   SEARCH INPUT
   ============================================= */

.search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrap::before {
  content: '\f002';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 14px;
  color: var(--text-3);
  font-size: 13px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.09);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-shadow: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-input::placeholder { color: var(--text-3); }

/* =============================================
   FILTER PILLS
   ============================================= */

.filter-pills {
  display: flex;
  gap: 8px;
  padding: 8px 0 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.09);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.filter-pill:active { transform: scale(.96); }
.filter-pill:hover {
  background: var(--primary-dim);
  border-color: rgba(255,105,0,.25);
  color: var(--primary);
}
.filter-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.filter-pill i { font-size: 11px; }

/* =============================================
   PRODUCT LIST  iOS grouped style
   ============================================= */

.products-list {
  list-style: none;
  margin: 20px 0 0;
  padding: 10;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.product-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  transition: background .12s;
  position: relative;
}

.product-row:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; bottom: 0;
  height: .5px;
  background: var(--divider);
}

.product-row:active { background: rgba(0,0,0,.02); }

.product-row.low-stock { background: rgba(255,105,0,.03); }

.product-main { flex: 1; min-width: 0; }

.product-info strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-info .subtitle {
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle-row { margin-top: 6px; }

.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.stock-badge i { font-size: 9px; }

/* --- empty stock (rupture) pill --- */
.stock-empty {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff3b30, #ff5c4d);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.stock-empty i { font-size: 10px; }

/* Price badge (visual, rounded) */
.price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--primary);
  box-shadow: none;
}

/* Stock pill for normal stock */
.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--primary);
}

.stock-pill,
.stock-pill:link,
.stock-pill:visited {
  text-decoration: none;
}

.stock-pill:hover {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  text-decoration: none;
}

/* Offer pill — compact indicator on product list */
.offre-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #30d158;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

/* Smaller inline variant used next to price on product rows */
.offre-pill--inline {
  font-size: 9px;
  padding: 1px 6px;
  gap: 3px;
  vertical-align: middle;
  margin-left: 6px;
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* =============================================
   CARDS & LISTS (generic)
   ============================================= */

.card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}

/* Form helpers (product form) */
.card--wide { max-width: 760px; margin: 18px auto; }
.card-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--divider); }
.card-title { margin:0; font-size:18px; font-weight:700; color:var(--text); }
/* slightly more breathing room inside cards for forms */
.card-body { padding:20px; }

/* Ensure header action buttons are pill-shaped like the +Ajouter header button */
.card-header .btn { border-radius: 999px; }

.form-row { margin-top:12px; }
.form-label { display:flex; flex-direction:column; gap:6px; }
.label-text { font-size:13px; color:var(--text-2); font-weight:600; }

/* Inputs within card-body get the app form look */
.card-body input, .card-body select, .card-body textarea { width:100%; padding:10px 12px; border-radius: var(--r-sm); border:1px solid var(--divider); background:var(--surface); font-size:15px; color:var(--text); }

.form-actions { display:flex; gap:8px; justify-content:center; margin-top:28px; }

/* make primary action slightly larger on mobile for easier tapping */
.form-actions .btn-primary { padding: 10px 26px; }

.list { list-style: none; padding: 0; margin: 0; }

/* =============================================
   BOTTOM NAVIGATION BAR  (user likes this  kept as-is)
   ============================================= */

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  pointer-events: none;
  padding: 0 16px calc(12px + env(safe-area-inset-bottom));
}

.bottom-nav-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 460px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
  padding: 0 8px;
  position: relative;
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  color: var(--text-3);
  text-decoration: none;
  transition: color .18s;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav .icon-wrap { display: flex; align-items: center; justify-content: center; }
.bottom-nav .icon-wrap i { font-size: 20px; }
.bottom-nav .nav-label { font-size: 10px; font-weight: 600; letter-spacing: .01em; }

.bottom-nav .nav-item.active { color: var(--primary); }
.bottom-nav .nav-item.active .nav-label { font-weight: 700; }

/* Center home logo */
.bottom-nav .logo {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.bottom-nav .logo .logo-wrap {
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--primary-shadow);
  transition: transform .15s;
}
.bottom-nav .logo:active .logo-wrap { transform: scale(.92); }
.bottom-nav .logo .logo-wrap img { width: 24px; height: 24px; }

/* =============================================
   HOME DASHBOARD
   ============================================= */

.home { padding-top: 8px; }

/* ── hero greeting ── */
.home-hero {
  background: var(--primary-gradient);
  border-radius: var(--r);
  padding: 22px 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(255,105,0,.25);
}

.home-hero h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}

.home-hero p {
  font-size: 14px;
  opacity: .85;
  margin: 0;
}

.home-hero-cta {
  flex-shrink: 0;
  background: #fff !important;
  color: var(--primary) !important;
  font-size: 13px !important;
  padding: 10px 16px !important;
  border-radius: var(--r-pill) !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* ── stat cards row ── */
.home-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.home-stat-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}

.home-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.home-stat-data { display: flex; flex-direction: column; }
.home-stat-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.home-stat-label { font-size: 12px; color: var(--text-2); margin-top: 2px; font-weight: 500; }

/* ── quick shortcuts ── */
.home-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.home-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  transition: transform .15s var(--ease), box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}

.home-shortcut:active { transform: scale(.95); }

.home-shortcut-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-dim);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ── alerts strip ── */
.home-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.home-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: transform .12s;
  -webkit-tap-highlight-color: transparent;
}

.home-alert:active { transform: scale(.98); }

.home-alert i:first-child { font-size: 16px; flex-shrink: 0; }
.home-alert span { flex: 1; }
.home-alert i:last-child { font-size: 12px; opacity: .5; }

.home-alert--danger {
  background: rgba(255,59,48,.08);
  color: #ff3b30;
  border: 1px solid rgba(255,59,48,.15);
}

.home-alert--warn {
  background: rgba(255,149,0,.08);
  color: #ff9500;
  border: 1px solid rgba(255,149,0,.15);
}

/* ── recent section ── */
.home-recent { margin-bottom: 20px; }

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.home-section-head h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.home-section-head h2 i {
  color: var(--primary);
  margin-right: 6px;
}

.home-see-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.home-see-all i { margin-left: 4px; font-size: 11px; }

/* =============================================
   WIZARD  multi-step order flow  iOS 2026
   ============================================= */

/* --- progress bar --- */
.wiz-progress {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 18px 24px 12px;
}

.wiz-step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
  transition: all .35s var(--ease);
  position: relative;
}

.wiz-step-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,105,0,.3);
  transform: scale(1.15);
}

.wiz-step-dot.done {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.wiz-step-line {
  flex: 1;
  height: 2px;
  background: var(--divider);
  transition: background .35s var(--ease);
}

.wiz-step-line.done { background: var(--primary); }

/* --- panels --- */
.wiz-panels {
  position: relative;
  overflow: hidden;
}

.wiz-panel {
  display: none;
  animation: wizFadeIn .35s var(--ease);
}

.wiz-panel.active { display: block; }

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

/* --- step titles --- */
.wiz-step-header {
  background: var(--primary-gradient);
  border-radius: var(--r);
  padding: 16px 18px;
  margin-bottom: 20px;
  color: #fff;
}

.wiz-step-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: #fff;
  margin: 0 0 2px;
  display: flex;
  align-items: center;
}

.wiz-step-title i { margin-right: 8px; }

.wiz-step-sub {
  font-size: 14px;
  color: rgba(255,255,255,.85);
  margin: 0;
}

/* --- client picker --- */
.wiz-client-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.wiz-tab {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  box-shadow: var(--shadow);
  transition: all .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.wiz-tab.active {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.wiz-tab:active { transform: scale(.97); }

.wiz-client-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  border: 1.5px solid transparent;
  box-shadow: var(--shadow);
  transition: all .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.wiz-client-card:not(:last-child) { margin-bottom: 10px; }

.wiz-client-card.selected {
  background: var(--primary-dim);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.wiz-client-card:active { transform: scale(.98); }

.wiz-client-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}

.wiz-client-info { flex: 1; min-width: 0; }
.wiz-client-info strong { display: block; font-size: 15px; }
.wiz-client-info .subtitle { font-size: 13px; color: var(--text-2); }

.wiz-client-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s var(--ease);
  color: transparent;
  font-size: 11px;
}

.wiz-client-card.selected .wiz-client-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* --- product picker (card style) --- */
.wiz-card-list { display: flex; flex-direction: column; gap: 10px; }

.wiz-product-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s var(--ease), border-left .2s;
  border-left: 4px solid transparent;
}

.wiz-product-row.has-qty {
  border-left-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.wiz-product-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px 0;
}

.wiz-product-body {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 14px;
}

.wiz-product-info { flex: 1; min-width: 0; }
.wiz-product-info strong { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }

.wiz-product-pills {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Ensure pills don't grow and keep layout stable when product title wraps */
.wiz-product-pills .stock-pill,
.wiz-product-pills .offre-pill,
.wiz-product-pills .price-badge {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px; /* prevent pills from pushing layout */
}

/* gift tag — inline below qty ctrl */
.wiz-qty-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.wiz-gift-tag {
  display: none;
  animation: wizFadeIn .25s var(--ease);
}
.wiz-gift-tag.visible { display: block; }
.wiz-gift-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.wiz-gift-badge i { font-size: 8px; }

.wiz-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border-radius: var(--r-pill);
  border: 1px solid var(--divider);
  overflow: hidden;
  flex-shrink: 0;
}

.wiz-qty-btn {
  width: 36px; height: 36px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}

.wiz-qty-btn:active { background: var(--primary-dim); }

.wiz-qty-val {
  width: 36px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  border: none;
  background: transparent;
  -moz-appearance: textfield;
  -webkit-appearance: none;
}

.wiz-qty-val::-webkit-inner-spin-button,
.wiz-qty-val::-webkit-outer-spin-button { -webkit-appearance: none; }

/* --- payment method cards --- */
.wiz-pay-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  border: 1.5px solid transparent;
  box-shadow: var(--shadow);
  transition: all .2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.wiz-pay-option:not(:last-child) { margin-bottom: 10px; }

.wiz-pay-option.selected {
  background: var(--primary-dim);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.wiz-pay-option:active { transform: scale(.98); }

.wiz-pay-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
  box-shadow: var(--shadow);
}

.wiz-pay-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.wiz-pay-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--divider);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .2s var(--ease);
  color: transparent;
  font-size: 11px;
}

.wiz-pay-option.selected .wiz-pay-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* --- recap (now uses .commande-receipt styles from detail page) --- */
/* (kept for backward compat but no longer primary) */
.wiz-recap-section {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.wiz-recap-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 10px;
}

.wiz-recap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 15px;
}

.wiz-recap-row:not(:last-child) {
  border-bottom: .5px solid var(--divider);
}

.wiz-recap-row .label { color: var(--text); font-weight: 500; }
.wiz-recap-row .value { color: var(--text-2); text-align: right; }

.wiz-recap-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--primary-gradient);
  border-radius: var(--r);
  margin-top: 12px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,105,0,.25);
}

.wiz-recap-total .label { font-size: 16px; font-weight: 600; }
.wiz-recap-total .value { font-size: 22px; font-weight: 800; }

/* --- success --- */
.wiz-success {
  text-align: center;
  padding: 40px 20px;
}

.wiz-success-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34c759, #30d158);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(52,199,89,.3);
  animation: wizPop .5s var(--ease);
}

@keyframes wizPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.wiz-success h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.wiz-success p { color: var(--text-2); font-size: 15px; margin-bottom: 24px; }

/* --- bottom nav bar for wizard --- */
.wiz-nav {
  display: flex;
  gap: 10px;
  padding: 20px 0 0;
}

.wiz-nav .btn { flex: 1; justify-content: center; padding: 14px; font-size: 16px; border-radius: var(--r); }

/* --- client search in wizard --- */
.wiz-search {
  position: relative;
  margin-bottom: 12px;
}

.wiz-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border-radius: var(--r-pill);
  border: 1px solid var(--divider);
  background: var(--surface);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
}

.wiz-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.wiz-search::before {
  content: '\f002';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 13px;
  pointer-events: none;
}

/* inline new client form toggle */
.wiz-new-client-form {
  background: var(--surface);
  border-radius: var(--r);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.wiz-new-client-form .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wiz-new-client-form .form-row { margin-top: 12px; }

.wiz-new-client-form input,
.wiz-new-client-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--divider);
  background: var(--bg);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.wiz-new-client-form input:focus,
.wiz-new-client-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* product search in wizard */
.wiz-product-search {
  position: relative;
  margin-bottom: 12px;
}

.wiz-product-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  border-radius: var(--r-pill);
  border: 1px solid var(--divider);
  background: var(--surface);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
}

.wiz-product-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.wiz-product-search::before {
  content: '\f002';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 13px;
  pointer-events: none;
}

/* floating total bar */
.wiz-floating-total {
  position: sticky;
  bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: var(--r);
  padding: 14px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  margin-top: 16px;
  border-left: 4px solid var(--primary);
}

.wiz-floating-total .label { font-size: 15px; font-weight: 600; color: var(--text-2); }
.wiz-floating-total .value { font-size: 22px; font-weight: 800; color: var(--primary); }

/* =============================================
   PRODUITS PAGE — action cards + gamme blocks
   ============================================= */

/* Action buttons row */
.produits-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.produits-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform .12s var(--ease), box-shadow .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.produits-action-card:active {
  transform: scale(.97);
  box-shadow: var(--shadow-lg);
}
.produits-action-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.produits-action-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.produits-action-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.produits-action-text span {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Gamme block */
.gamme-block {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.gamme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
}
.gamme-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.gamme-icon {
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
}
.gamme-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gamme-count {
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}
.gamme-header-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.gamme-header-actions .icon-btn {
  font-size: 12px;
}

/* Product rows inside gamme */
.gamme-products {
  padding: 0;
}
.gamme-product-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--divider);
  transition: background .1s;
}
.gamme-product-row:last-child {
  border-bottom: none;
}
.gamme-product--warn {
  border-left: 4px solid var(--primary);
}
.gamme-product--danger {
  border-left: 4px solid #ff3b30;
}
.gamme-product-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.gamme-product-ref {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gamme-product-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.gamme-product-center {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.gamme-stock-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.gamme-stock-badge i {
  margin-right: 3px;
  font-size: 10px;
}
.gamme-stock--ok {
  background: #e8f5e9;
  color: #2e7d32;
}
.gamme-stock--warn {
  background: #fff3e0;
  color: #e65100;
}
.gamme-stock--danger {
  background: #ffebee;
  color: #c62828;
}
.gamme-stock-reserved {
  font-size: 10px;
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}
.gamme-product-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.gamme-product-actions .icon-btn {
  font-size: 12px;
  width: 28px; height: 28px;
}
.gamme-empty {
  color: var(--text-2);
  text-align: center;
  padding: 16px;
  font-size: 13px;
  margin: 0;
}

/* Wizard gamme blocks */
.wiz-gamme-block {
  margin-bottom: 12px;
}
.wiz-gamme-block .gamme-header {
  border-radius: var(--r) var(--r) 0 0;
}
.wiz-gamme-block .gamme-products {
  border-radius: 0 0 var(--r) var(--r);
}

/* Reset the old card-style wiz-product-row when inside gamme blocks */
.wiz-gamme-block .wiz-product-row {
  flex-direction: row;
  align-items: center;
  padding: 10px 16px;
  gap: 10px;
  border-radius: 0;
  box-shadow: none;
  border-left: none;
  background: transparent;
}
.wiz-gamme-block .wiz-product-row:last-child {
  border-bottom: none;
}
.wiz-gamme-block .wiz-product-row.has-qty {
  background: rgba(var(--primary-rgb, 232, 121, 34), .05);
  border-left: 3px solid var(--primary);
}
.wiz-gamme-block .wiz-product-row .gamme-product-left {
  flex: 1 1 0;
  min-width: 0;
}
.wiz-gamme-block .wiz-product-row .gamme-product-center {
  flex: 0 0 auto;
}
.wiz-gamme-block .wiz-product-row .wiz-qty-wrap {
  flex: 0 0 auto;
}

/* (gift styling is now inline via .wiz-gift-tag for hors-gamme) */

/* ── Offer banner (gamme-level) ── */
.wiz-offer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 12px 4px;
  padding: 6px 12px;
  background: var(--primary-dim);
  border-radius: var(--r-xs);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  animation: wizFadeIn .25s var(--ease);
}
.wiz-offer-banner-left {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wiz-offer-banner-left i { font-size: 11px; }
.wiz-offer-remaining-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}

/* ── Inline gift controls on product rows ── */
.wiz-gift-inline {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--primary-dim);
  border-radius: var(--r-pill);
  border: 1px solid rgba(255,105,0,.18);
  overflow: hidden;
  flex-shrink: 0;
  animation: wizFadeIn .25s var(--ease);
}
.wiz-gi-icon {
  font-size: 9px;
  color: var(--primary);
  padding-left: 8px;
  flex-shrink: 0;
}
.wiz-gi-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s;
}
.wiz-gi-btn:active {
  background: rgba(255,105,0,.15);
}
.wiz-gi-val {
  min-width: 20px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

/* Receipt gamme blocks (commande detail) */
.receipt-gamme-block {
  margin-bottom: 8px;
}
.receipt-gamme-block:last-child {
  margin-bottom: 0;
}
.receipt-gamme-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 4px;
  padding-top: 4px;
}

/* offered line — subtle distinct style */
.receipt-line--offered {
  background: var(--primary-dim);
  border-radius: var(--r-xs);
  padding: 8px 10px;
  margin: 2px 0;
  border-bottom: none;
  font-size: 14px;
  color: var(--text-2);
  align-items: center;
}
.receipt-line--offered:last-child { border-bottom: none; }
.receipt-line--offered + .receipt-line { border-top: none; }
.receipt-offert-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1;
}
.receipt-offert-badge i { font-size: 9px; }

/* =============================================
   ENTITY LIST — unified cards for products/clients
   ============================================= */

.entity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 0;
}

.entity-card {
  display: block;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .12s var(--ease), box-shadow .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.entity-card--link { cursor: pointer; }
.entity-card--link:active,
.entity-card:active { transform: scale(.98); box-shadow: var(--shadow-lg); }

/* subtle left accent for stock states */
.entity-card--warn  { border-left: 5px solid var(--primary); }
.entity-card--danger { border-left: 5px solid #ff3b30; }

.entity-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 0;
}

.entity-ref {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.client-detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 3px solid rgba(255,255,255,.35);
}

.entity-card-body {
  padding: 10px 16px 0;
}

.entity-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entity-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.entity-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.entity-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 14px;
}

.entity-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* danger status variant (for rupture) */
.order-status--danger {
  background: #ffebee;
  color: #c62828;
}

/* warning status variant (modified after payment) */
.order-status--warning {
  background: #fff3e0;
  color: #e65100;
}

/* =============================================
   COMMANDES LIST — order cards
   ============================================= */

.order-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-bottom: 0;
}

.order-card {
  display: block;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .12s var(--ease), box-shadow .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.order-card:active {
  transform: scale(.98);
  box-shadow: var(--shadow-lg);
}

/* top row */
.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 0;
}

.order-numero {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.order-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
}

.order-status--pending {
  background: #fff3e0;
  color: #e65100;
}

.order-status--done {
  background: #e8f5e9;
  color: #2e7d32;
}

/* body */
.order-card-body {
  padding: 12px 16px 0;
}

.order-client {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.order-client-info {
  flex: 1;
  min-width: 0;
}

.order-client-info strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.order-meta {
  font-size: 13px;
  color: var(--text-2);
}

/* footer row */
.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 14px;
}

.order-date {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 5px;
}

.order-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -.3px;
}

/* =============================================
   COMMANDE DETAIL — receipt style
   ============================================= */

.commande-receipt {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 16px;
}

.receipt-header {
  background: var(--primary-gradient);
  padding: 24px 20px;
  color: #fff;
  text-align: center;
}

.receipt-header .numero { font-size: 14px; font-weight: 600; opacity: .85; margin-bottom: 4px; }
.receipt-header .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.2);
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.receipt-body { padding: 20px; }

.receipt-section { margin-bottom: 20px; }
.receipt-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 10px;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: .5px solid var(--divider);
  font-size: 14px;
  gap: 8px;
}

.receipt-line:last-child { border-bottom: none; }
.receipt-line > span:last-child { white-space: nowrap; flex-shrink: 0; }

.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--r-sm);
  margin-top: 8px;
}

.receipt-total .label { font-size: 16px; font-weight: 600; }
.receipt-total .value { font-size: 22px; font-weight: 800; color: var(--primary); }

.receipt-actions {
  padding: 0 20px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.receipt-actions .btn { justify-content: center; font-size: 14px; }
.receipt-actions-row { display: flex; gap: 8px; width: 100%; }
.receipt-actions-row .btn,
.receipt-actions-row form { flex: 1; }
.receipt-actions-row form { display: flex; }
.receipt-actions-row form .btn { flex: 1; }
.receipt-actions-full { display: flex; width: 100%; }
.receipt-actions-full form { flex: 1; display: flex; }
.receipt-actions-full form .btn { flex: 1; padding: 14px; font-size: 15px; }

/* =============================================
   PROFILE PAGE
   ============================================= */

.profil-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--primary-gradient);
  border-radius: var(--r);
  padding: 24px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(255,105,0,.18);
}

.profil-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 3px solid rgba(255,255,255,.35);
  flex-shrink: 0;
}

.profil-hero-info h1 {
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 2px;
}

.profil-username,
.profil-email {
  color: rgba(255,255,255,.8);
  font-size: 13px;
  margin: 2px 0;
}

.profil-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* shortcuts */
.profil-shortcuts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.profil-shortcut-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  transition: transform .15s, box-shadow .15s;
}
.profil-shortcut-card:active { transform: scale(.98); }

.profil-shortcut-card--admin {
  border: 1.5px solid rgba(255,59,48,.2);
}

.profil-shortcut-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.profil-shortcut-arrow {
  margin-left: auto;
  color: var(--text-3);
  font-size: 13px;
}

/* client list in profile */
.profil-client-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profil-client-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--r);
  padding: 12px 14px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform .15s;
}
.profil-client-card:active { transform: scale(.98); }

.profil-client-info {
  flex: 1;
  min-width: 0;
}
.profil-client-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}
.profil-client-meta {
  display: block;
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profil-section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 2px;
}

/* =============================================
   AUTH PAGES (login / password)
   ============================================= */

.auth-body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff5ec 0%, #ffe0c2 50%, #ffd1a3 100%);
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
}

.auth-wrapper {
  width: 100%;
  max-width: 400px;
}

.auth-card {
  background: var(--card, #fff);
  border-radius: 20px;
  padding: 36px 28px 32px;
  box-shadow: 0 8px 40px rgba(255,105,0,.12), 0 2px 8px rgba(0,0,0,.04);
  width: 100%;
  max-width: 420px;
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(255,105,0,.2);
}
.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-logo-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: var(--primary-gradient, linear-gradient(135deg, #ff6900, #ff8c33));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  box-shadow: 0 4px 12px rgba(255,105,0,.25);
}

.auth-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text, #1a1a2e);
  margin: 0 0 4px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-2, #8e8e93);
  margin: 0;
}

.auth-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff5f5;
  color: #ff3b30;
  border: 1px solid rgba(255,59,48,.15);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--divider);
  background: var(--surface);
  font-size: 15px;
  color: var(--text);
  box-sizing: border-box;
}

.auth-password-wrap {
  position: relative;
}
.auth-password-wrap input {
  width: 100%;
  padding-right: 44px;
  box-sizing: border-box;
}
.auth-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3, #c7c7cc);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}
.auth-toggle-pw:hover { color: var(--primary, #ff6900); }

.auth-submit {
  margin-top: 6px;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  justify-content: center;
}

.auth-footer {
  text-align: center;
  color: var(--text-3, #c7c7cc);
  font-size: 12px;
  margin-top: 20px;
}

.auth-success-icon {
  font-size: 56px;
  color: #34c759;
}

.field-error {
  display: block;
  color: #ff3b30;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 520px) {
  .home-hero { flex-direction: column; text-align: center; }
  .home-hero-cta { width: 100%; text-align: center; }
  .home-shortcuts { grid-template-columns: repeat(2, 1fr); }

  /* Produits action cards — stack vertically */
  .produits-actions { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
  .produits-action-card { padding: 12px 14px; gap: 12px; }
  .produits-action-icon { width: 36px; height: 36px; font-size: 15px; border-radius: 10px; }
  .produits-action-text strong { font-size: 13px; }

  /* Gamme header — compact */
  .gamme-header { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
  .gamme-header-left { gap: 6px; }
  .gamme-title { font-size: 13px; }
  .gamme-count { font-size: 10px; padding: 2px 6px; }

  /* Product rows — stack vertically */
  .gamme-product-row {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 6px;
  }
  .gamme-product-left {
    flex: 1 1 auto;
    min-width: 0;
  }
  .gamme-product-center {
    flex: 0 0 auto;
    margin-left: auto;
  }
  .gamme-product-actions {
    flex: 0 0 auto;
  }
  .gamme-product-ref { font-size: 12px; }
  .gamme-product-price { font-size: 11px; }
  .gamme-stock-badge { font-size: 10px; padding: 2px 6px; }
  .gamme-stock-reserved { font-size: 9px; }

  /* Wizard product rows — compact */
  .wiz-gamme-block .wiz-product-row { padding: 8px 12px; gap: 8px; }
  .wiz-gamme-block .gamme-product-center { display: none; }
  .wiz-qty-ctrl { gap: 0; }
  .wiz-qty-btn { width: 30px; height: 30px; font-size: 14px; }
  .wiz-qty-val { width: 30px; font-size: 13px; }
  .wiz-gi-btn { width: 24px; height: 24px; font-size: 11px; }
  .wiz-gi-val { font-size: 11px; min-width: 16px; }
  .wiz-gi-icon { font-size: 8px; padding-left: 6px; }
  .wiz-offer-banner { margin: 0 8px 2px; padding: 5px 10px; font-size: 11px; }
}

@media (max-width: 480px) {
  .ph-title { font-size: 24px; }
  .bottom-nav { padding: 0 12px calc(10px + env(safe-area-inset-bottom)); }
  .bottom-nav-inner { max-width: 100%; }
  .bottom-nav .nav-label { display: none; }
  .bottom-nav .icon-wrap i { font-size: 22px; }
  .bottom-nav .logo .logo-wrap { width: 40px; height: 40px; border-radius: var(--r-xs); }
  .bottom-nav .logo .logo-wrap img { width: 22px; height: 22px; }
  .product-info .subtitle { white-space: normal; }
  /* add 10px extra padding on small screens as well */
  .container { padding: 18px 26px 18px; }

  /* Produits — further compact on very small screens */
  .gamme-product-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 8px 12px;
  }
  .gamme-product-left { flex-direction: row; gap: 8px; align-items: baseline; }
  .gamme-product-center { margin-left: 0; }
  .gamme-product-actions { align-self: flex-end; margin-top: -20px; }

  /* Wizard product rows — very small */
  .wiz-gamme-block .wiz-product-row { padding: 8px 10px; gap: 6px; }
  .wiz-qty-btn { width: 28px; height: 28px; }
  .wiz-qty-val { width: 28px; font-size: 12px; }
}


/* =============================================
   WIZARD — Remise & Manual Offers step
   ============================================= */

.wiz-section-block {
  background: var(--surface);
  border-radius: var(--r);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}

/* Manual offer rows: highlight when has quantity */
.manual-offer-row.has-qty {
  background: rgba(156, 39, 176, .06);
  border-radius: var(--r-sm);
}

/* =============================================
   RECEIPT — Payment history & status enhancements
   ============================================= */

.receipt-actions-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.receipt-actions-full {
  width: 100%;
}

.receipt-actions-full .btn-primary {
  width: 100%;
}


/* =============================================
   INTL-TEL-INPUT — Integration overrides
   ============================================= */

.iti-wrap {
  width: 100%;
}

/* Make the iti container full-width */
.iti--fullwidth,
.iti {
  width: 100% !important;
  display: block !important;
}

.iti input,
.iti input[type="tel"] {
  width: 100% !important;
  padding: 10px 12px 10px 90px !important;
  border-radius: var(--r-sm, 8px);
  border: 1px solid var(--divider, #eee);
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
}

.iti input:focus {
  outline: none;
  border-color: var(--primary, #ff6900);
  box-shadow: 0 0 0 3px rgba(255, 105, 0, .12);
}

.iti__selected-dial-code {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #1a1a2e);
}

.iti__country-list {
  border-radius: var(--r-sm, 8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  max-height: 200px;
  font-size: 14px;
  z-index: 100;
}

.iti__country {
  padding: 8px 12px;
}

.iti__country--highlight {
  background: rgba(255, 105, 0, .08);
}
