/* ============================================================
   MIZAN DESIGN SYSTEM — composants Web (couche .ds-)
   Noms de classes préfixés .ds-* pour adoption progressive :
   les écrans existants (styles.css) continuent de fonctionner.
   ============================================================ */

/* ---------- Base ---------- */
.ds-btn,
.ds-icon-btn,
.ds-chip,
.ds-badge {
  font-family: var(--ds-font);
}

/* ---------- Boutons ---------- */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--ds-sp-2);
  min-height: var(--ds-control-h); padding: 10px var(--ds-sp-4);
  border-radius: var(--ds-r-m); border: var(--ds-border-w) solid transparent;
  font: var(--ds-t-button); cursor: pointer; user-select: none;
  transition: background-color .13s ease, border-color .13s ease,
    box-shadow .13s ease, transform .05s ease;
  text-decoration: none; white-space: nowrap;
}
.ds-btn:active { transform: translateY(1px); }
.ds-btn:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--ds-primary-soft);
  border-color: var(--ds-primary);
}
.ds-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.ds-btn--primary { background: var(--ds-primary); color: var(--ds-on-primary);
  box-shadow: 0 1px 2px rgba(16, 24, 20, .18); }
.ds-btn--primary:hover:not(:disabled) { background: var(--ds-primary-hover);
  box-shadow: 0 2px 4px rgba(16, 24, 20, .22); }
.ds-btn--primary:active:not(:disabled) { background: var(--ds-primary-pressed);
  box-shadow: none; transform: translateY(1px); }
.ds-btn--primary:active:not(:disabled) { background: var(--ds-primary-pressed); }

.ds-btn--secondary { background: var(--ds-secondary); color: var(--ds-on-secondary); }
.ds-btn--secondary:hover:not(:disabled) { background: var(--ds-secondary-hover); }

.ds-btn--ghost {
  background: var(--ds-surface); color: var(--ds-ink);
  border-color: var(--ds-line);
}
.ds-btn--ghost:hover:not(:disabled) { background: var(--ds-surface-2); }

.ds-btn--soft { background: var(--ds-primary-soft); color: var(--ds-primary); }
.ds-btn--soft:hover:not(:disabled) { background: var(--ds-primary-line); }

.ds-btn--danger { background: var(--ds-error); color: #fff; }
.ds-btn--danger:hover:not(:disabled) { background: #991B1B; }

.ds-btn--block { width: 100%; }
.ds-btn--lg { min-height: var(--ds-control-h-lg); font-size: 16px; }
.ds-btn--sm { min-height: var(--ds-control-h-sm); padding: 6px var(--ds-sp-3);
  font-size: 13px; border-radius: var(--ds-r-s); }

/* ---------- IconButton ---------- */
.ds-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--ds-touch-min); height: var(--ds-touch-min);
  border-radius: var(--ds-r-m); border: var(--ds-border-w) solid var(--ds-line);
  background: var(--ds-surface); color: var(--ds-ink); cursor: pointer;
  transition: background-color .13s ease;
}
.ds-icon-btn:hover:not(:disabled) { background: var(--ds-surface-2); }
.ds-icon-btn.ghost { border-color: transparent; background: transparent; }
.ds-icon-btn.ghost:hover:not(:disabled) { background: var(--ds-surface-2); }
.ds-icon-btn:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--ds-primary-soft);
}
.ds-icon-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Champs ---------- */
.ds-field label {
  display: block; font: var(--ds-t-label); color: var(--ds-ink-2);
  margin-bottom: 5px;
}
.ds-field .hint { font: var(--ds-t-caption); color: var(--ds-muted); margin-top: 4px; }
.ds-field .error-text { font: var(--ds-t-caption); color: var(--ds-error); margin-top: 4px; }

.ds-input,
input.ds-input, select.ds-input, textarea.ds-input {
  width: 100%; min-height: var(--ds-control-h); padding: 10px var(--ds-sp-3);
  font: var(--ds-t-body); color: var(--ds-ink);
  background: var(--ds-surface); border: var(--ds-border-w) solid var(--ds-line-input, var(--ds-line));
  border-radius: var(--ds-r-m); transition: border-color .12s, box-shadow .12s;
}
.ds-input::placeholder { color: var(--ds-faint); }
.ds-input:focus {
  outline: none; border-color: var(--ds-primary);
  box-shadow: 0 0 0 3px var(--ds-primary-soft);
}
.ds-input:disabled { background: var(--ds-surface-2); color: var(--ds-muted); cursor: not-allowed; }
.ds-input[aria-invalid="true"] { border-color: var(--ds-error); }
.ds-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--ds-error-soft); }

.ds-search { position: relative; }
.ds-search .ds-icon {
  position: absolute; inset-inline-start: var(--ds-sp-3); top: 50%;
  transform: translateY(-50%); color: var(--ds-faint); pointer-events: none;
}
.ds-search input { padding-inline-start: 40px; }
[dir="rtl"] .ds-search input { padding-inline-start: var(--ds-sp-3); padding-inline-end: 40px; }
[dir="rtl"] .ds-search .ds-icon { inset-inline-start: auto; inset-inline-end: var(--ds-sp-3); }

/* Select custom-look natif conservé (accessibilité) : on cible le select */
.ds-select { appearance: none; padding-inline-end: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ds-muted) 50%),
    linear-gradient(135deg, var(--ds-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
[dir="rtl"] .ds-select {
  background-position: 18px 50%, 13px 50%;
}

/* ---------- Checkbox / Radio / Switch ---------- */
.ds-check, .ds-radio { display: inline-flex; align-items: center; gap: var(--ds-sp-2);
  font: var(--ds-t-body); cursor: pointer; min-height: var(--ds-touch-min); }
.ds-check input, .ds-radio input { width: 18px; height: 18px; accent-color: var(--ds-primary); }

.ds-switch { position: relative; display: inline-flex; align-items: center; gap: var(--ds-sp-2);
  font: var(--ds-t-body); cursor: pointer; min-height: var(--ds-touch-min); }
.ds-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ds-switch .track {
  width: 44px; height: 26px; border-radius: var(--ds-r-pill);
  background: var(--ds-surface-3); border: var(--ds-border-w) solid var(--ds-line);
  position: relative; transition: background .15s; flex: none;
}
.ds-switch .track::after {
  content: ""; position: absolute; top: 2px; inset-inline-start: 2px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: var(--ds-sh-1); transition: transform .15s;
}
.ds-switch input:checked + .track { background: var(--ds-primary); border-color: var(--ds-primary); }
.ds-switch input:checked + .track::after { transform: translateX(18px); }
[dir="rtl"] .ds-switch input:checked + .track::after { transform: translateX(-18px); }
.ds-switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--ds-primary-soft); }
.ds-switch input:disabled + .track { opacity: .5; }

/* ---------- Badge / StatusBadge ---------- */
.ds-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px var(--ds-sp-3); border-radius: var(--ds-r-pill);
  font: var(--ds-t-caption); font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
}
.ds-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; }
.ds-badge.no-dot::before { display: none; }
.ds-badge--ok    { background: var(--ds-success-soft);  color: var(--ds-success); }
.ds-badge--warn  { background: var(--ds-warning-soft); color: var(--ds-warning); }
.ds-badge--bad   { background: var(--ds-error-soft);   color: var(--ds-error); }
.ds-badge--info  { background: var(--ds-info-soft);    color: var(--ds-info); }
.ds-badge--acc   { background: var(--ds-primary-soft); color: var(--ds-primary); }
.ds-badge--warm  { background: var(--ds-secondary-soft); color: var(--ds-secondary-strong); }
.ds-badge--muted { background: var(--ds-surface-3);    color: var(--ds-muted-strong); }

/* ---------- Card ---------- */
.ds-card {
  background: var(--ds-surface); border: var(--ds-border-w) solid var(--ds-line);
  border-radius: var(--ds-r-l); box-shadow: var(--ds-sh-1);
}
.ds-card-pad { padding: var(--ds-sp-5); }
.ds-card-h { font: var(--ds-t-h3); margin-bottom: var(--ds-sp-3); }
.ds-card-sub { font: var(--ds-t-caption); color: var(--ds-muted); }

/* ---------- KPI card ---------- */
.ds-kpi .k-label { font: var(--ds-t-caption); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ds-muted); }
.ds-kpi .k-value { font: var(--ds-t-display); margin-top: var(--ds-sp-2);
  font-variant-numeric: tabular-nums; }
.ds-kpi .k-sub { font: var(--ds-t-caption); color: var(--ds-muted); margin-top: var(--ds-sp-1); }
.ds-kpi .k-ic {
  width: 40px; height: 40px; border-radius: var(--ds-r-m);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--ds-primary-soft); color: var(--ds-primary);
}
.ds-kpi .k-ic.warm { background: var(--ds-secondary-soft); color: var(--ds-secondary-strong); }
.ds-kpi .k-ic.ok { background: var(--ds-success-soft); color: var(--ds-success); }
.ds-kpi .k-ic.bad { background: var(--ds-error-soft); color: var(--ds-error); }

/* ---------- Table ---------- */
.ds-table-wrap { border: var(--ds-border-w) solid var(--ds-line);
  border-radius: var(--ds-r-m); overflow: auto; background: var(--ds-surface); }
.ds-table { width: 100%; border-collapse: collapse; }
.ds-table th {
  text-align: start; font: var(--ds-t-caption); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ds-muted);
  background: var(--ds-surface-2); padding: 10px var(--ds-sp-4);
  white-space: nowrap; position: sticky; top: 0;
}
.ds-table td { padding: var(--ds-sp-3) var(--ds-sp-4);
  border-top: var(--ds-border-w) solid var(--ds-line-2);
  font: var(--ds-t-body-sm); vertical-align: middle; }
.ds-table tbody tr:hover td { background: var(--ds-surface-2); }
.ds-table .num { font-variant-numeric: tabular-nums; text-align: end; }

/* ---------- Chips ---------- */
.ds-chip {
  display: inline-flex; align-items: center; gap: var(--ds-sp-2);
  min-height: 40px; padding: 8px var(--ds-sp-4); border-radius: var(--ds-r-pill);
  border: var(--ds-border-w) solid var(--ds-line); background: var(--ds-surface);
  color: var(--ds-ink-2); font: var(--ds-t-body-sm); font-weight: 650;
  cursor: pointer; white-space: nowrap;
  transition: background-color .13s ease, border-color .13s ease, color .13s ease;
}
.ds-chip:hover { background: var(--ds-surface-2); }
.ds-chip.on { background: var(--ds-primary); border-color: var(--ds-primary); color: var(--ds-on-primary, #fff); }
.ds-chip.soft-on { background: var(--ds-primary-soft); border-color: var(--ds-primary-line); color: var(--ds-primary); }
.ds-chip.warm-on { background: var(--ds-secondary-soft); border-color: var(--ds-secondary-line); color: var(--ds-secondary-strong); }

/* ---------- Tabs ---------- */
.ds-tabs { display: flex; gap: var(--ds-sp-1); border-bottom: var(--ds-border-w) solid var(--ds-line); }
.ds-tabs button {
  background: none; border: none; padding: var(--ds-sp-2) var(--ds-sp-4);
  color: var(--ds-muted); font: var(--ds-t-button); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  min-height: var(--ds-touch-min);
}
.ds-tabs button:hover { color: var(--ds-ink); }
.ds-tabs button.active { color: var(--ds-primary); border-bottom-color: var(--ds-primary); }
.ds-tabs button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-primary-soft); border-radius: var(--ds-r-s); }

/* ---------- Dialog / Modal ---------- */
.ds-overlay {
  position: fixed; inset: 0; background: var(--ds-overlay);
  display: flex; align-items: center; justify-content: center;
  z-index: var(--ds-z-modal); padding: var(--ds-sp-5);
}
.ds-dialog {
  background: var(--ds-surface); border-radius: var(--ds-r-l);
  width: 100%; max-width: 560px; max-height: 90vh; overflow: auto;
  padding: var(--ds-sp-6); box-shadow: var(--ds-sh-3);
}
.ds-dialog h3 { font: var(--ds-t-h2); margin: 0 0 var(--ds-sp-2); }
.ds-dialog .actions { display: flex; justify-content: flex-end; gap: var(--ds-sp-3);
  margin-top: var(--ds-sp-5); }
[dir="rtl"] .ds-dialog .actions { justify-content: flex-start; }

/* ---------- Toast / Snackbar ---------- */
.ds-toast-root {
  position: fixed; bottom: var(--ds-sp-5); inset-inline-end: var(--ds-sp-5);
  z-index: var(--ds-z-toast); display: flex; flex-direction: column; gap: var(--ds-sp-2);
}
.ds-toast {
  display: flex; align-items: center; gap: var(--ds-sp-2);
  background: var(--ds-ink); color: #fff; padding: var(--ds-sp-3) var(--ds-sp-4);
  border-radius: var(--ds-r-m); box-shadow: var(--ds-sh-3);
  font: var(--ds-t-body-sm); font-weight: 650;
}
.ds-toast.ok { background: var(--ds-success); }
.ds-toast.err { background: var(--ds-error); }
.ds-toast .ds-icon { font-size: 18px; }

/* ---------- États : loading / empty / error / skeleton ---------- */
.ds-empty {
  padding: var(--ds-sp-12) var(--ds-sp-8); text-align: center;
  color: var(--ds-muted); background: var(--ds-surface);
  border: var(--ds-border-w-strong) dashed var(--ds-line);
  border-radius: var(--ds-r-l);
}
.ds-empty .e-ic { font-size: 32px; margin-bottom: var(--ds-sp-3); opacity: .5; display: block; }
.ds-empty .e-title { font: var(--ds-t-h3); color: var(--ds-ink); margin-bottom: var(--ds-sp-1); }
.ds-empty .e-sub { font: var(--ds-t-body-sm); }

.ds-error-box {
  background: var(--ds-error-soft); color: var(--ds-error);
  border: var(--ds-border-w) solid #F3C1C1; border-radius: var(--ds-r-m);
  padding: var(--ds-sp-3) var(--ds-sp-4); font: var(--ds-t-body-sm);
  display: flex; gap: var(--ds-sp-2); align-items: flex-start;
}
.ds-notice {
  background: var(--ds-primary-soft); color: var(--ds-primary);
  border-radius: var(--ds-r-m); padding: var(--ds-sp-3) var(--ds-sp-4);
  font: var(--ds-t-body-sm); display: flex; gap: var(--ds-sp-2); align-items: center;
}
.ds-warn-box {
  background: var(--ds-warning-soft); color: var(--ds-warning);
  border-radius: var(--ds-r-m); padding: var(--ds-sp-3) var(--ds-sp-4);
  font: var(--ds-t-body-sm); display: flex; gap: var(--ds-sp-2); align-items: flex-start;
}

.ds-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--ds-line); border-top-color: var(--ds-primary);
  animation: ds-spin .7s linear infinite; flex: none;
}
@keyframes ds-spin { to { transform: rotate(360deg); } }

.ds-skeleton {
  border-radius: var(--ds-r-s);
  background: linear-gradient(90deg, var(--ds-surface-2) 25%, var(--ds-surface-3) 50%, var(--ds-surface-2) 75%);
  background-size: 200% 100%; animation: ds-sk 1.2s infinite;
}
@keyframes ds-sk { to { background-position: -200% 0; } }

/* LanguageToggle — FR/AR */
.ds-lang-toggle {
  display: inline-flex; border: var(--ds-border-w) solid var(--ds-line);
  border-radius: var(--ds-r-pill); overflow: hidden; background: var(--ds-surface);
}
.ds-lang-toggle button {
  border: 0; background: transparent; font: var(--ds-t-caption); font-weight: 700;
  padding: 6px var(--ds-sp-3); cursor: pointer; color: var(--ds-muted);
  min-height: 32px;
}
.ds-lang-toggle button.on { background: var(--ds-primary); color: var(--ds-on-primary, #fff); }

/* ---------- Divers ---------- */
.ds-divider { height: 1px; background: var(--ds-line); border: none; margin: var(--ds-sp-4) 0; }
.ds-num { font-variant-numeric: tabular-nums; font-family: var(--ds-font-num); }
.ds-muted { color: var(--ds-muted); }
.ds-faint { color: var(--ds-faint); }
.ds-eyebrow { font: var(--ds-t-caption); font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--ds-primary); }
.ds-ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .ds-num { unicode-bidi: isolate; }

/* ============================================================
   COMPOSANTS SPÉCIFIQUES POS (cibles tactiles ≥ 44px web,
   48dp côté Android — voir Theme.kt)
   ============================================================ */

/* ProductTile — tuile produit du catalogue POS */
.ds-product-tile {
  display: flex; flex-direction: column; align-items: stretch;
  background: var(--ds-surface); border: var(--ds-border-w) solid var(--ds-line);
  border-radius: var(--ds-r-m); overflow: hidden; cursor: pointer;
  transition: border-color .12s, box-shadow .12s, transform .05s;
  min-height: 132px; text-align: start; padding: 0; font: inherit; color: inherit;
}
.ds-product-tile:hover { border-color: var(--ds-primary-line); box-shadow: var(--ds-sh-1); }
.ds-product-tile:active { transform: translateY(1px); }
.ds-product-tile:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ds-primary-soft); }
.ds-product-tile .thumb {
  height: 64px; display: flex; align-items: center; justify-content: center;
  background: var(--ds-surface-2); color: var(--ds-primary);
  font-size: 26px; font-weight: 700; position: relative;
}
.ds-product-tile .thumb .ds-icon { font-size: 28px; }
.ds-product-tile .body { padding: var(--ds-sp-2) var(--ds-sp-3) var(--ds-sp-3); flex: 1; }
.ds-product-tile .name { font: var(--ds-t-body-sm); font-weight: 650;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: line-clamp;
  overflow: hidden; line-height: 1.3; }
.ds-product-tile .price { font: var(--ds-t-label); color: var(--ds-primary);
  margin-top: var(--ds-sp-1); font-variant-numeric: tabular-nums; font-weight: 750; }
.ds-product-tile.out { opacity: .55; }
.ds-product-tile.out::after {
  content: attr(data-stock-label); position: absolute; inset-block-start: 6px;
  inset-inline-end: 6px; background: var(--ds-ink); color: var(--ds-bg, #fff);
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--ds-r-pill);
}

/* QuantityControl — stepper − qté + */
.ds-qty {
  display: inline-flex; align-items: center; gap: 0;
  border: var(--ds-border-w) solid var(--ds-line); border-radius: var(--ds-r-m);
  background: var(--ds-surface); overflow: hidden;
}
.ds-qty button {
  width: 44px; height: 44px; border: none; background: transparent;
  color: var(--ds-ink); font-size: 20px; cursor: pointer; line-height: 1;
}
.ds-qty button:hover:not(:disabled) { background: var(--ds-surface-2); }
.ds-qty button:disabled { opacity: .4; cursor: not-allowed; }
.ds-qty .val { min-width: 44px; text-align: center; font: var(--ds-t-body);
  font-weight: 700; font-variant-numeric: tabular-nums; }

/* CartLine — ligne de panier */
.ds-cart-line {
  display: flex; align-items: center; gap: var(--ds-sp-3);
  padding: var(--ds-sp-3) 0; border-bottom: var(--ds-border-w) solid var(--ds-line-2);
}
.ds-cart-line:last-child { border-bottom: none; }
.ds-cart-line .info { flex: 1; min-width: 0; }
.ds-cart-line .info .n { font: var(--ds-t-body-sm); font-weight: 650; }
.ds-cart-line .info .p { font: var(--ds-t-caption); color: var(--ds-muted);
  font-variant-numeric: tabular-nums; }
.ds-cart-line .line-total { font: var(--ds-t-body-sm); font-weight: 750;
  font-variant-numeric: tabular-nums; white-space: nowrap; }

/* TotalPanel — récapitulatif + CTA encaissement */
.ds-total-panel {
  background: var(--ds-surface); border-top: var(--ds-border-w) solid var(--ds-line);
  padding: var(--ds-sp-4); display: flex; flex-direction: column; gap: var(--ds-sp-2);
}
.ds-total-panel .row-line { display: flex; justify-content: space-between;
  font: var(--ds-t-body-sm); color: var(--ds-ink-2); }
.ds-total-panel .row-line.grand { font: var(--ds-t-h1); font-weight: 800;
  color: var(--ds-ink); padding-top: var(--ds-sp-2);
  border-top: var(--ds-border-w) solid var(--ds-line); }
.ds-total-panel .row-line .num { font-variant-numeric: tabular-nums; }

/* PrimarySaleAction — bouton de validation de vente (grand) */
.ds-sale-action {
  min-height: var(--ds-control-h-lg); font-size: 17px; font-weight: 750;
  border-radius: var(--ds-r-m);
}

/* NetworkStatusIndicator / SyncStatusIndicator */
.ds-status-dot { display: inline-flex; align-items: center; gap: 6px;
  font: var(--ds-t-caption); font-weight: 650; color: var(--ds-muted); }
.ds-status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ds-success); }
.ds-status-dot.offline::before { background: var(--ds-warning); }
.ds-status-dot.error::before { background: var(--ds-error); }
.ds-status-dot.sync::before { background: var(--ds-info); }

/* ============================================================
   COMPOSANTS WEB (sidebar claire, topbar, page header, filter bar)
   ============================================================ */

/* Sidebar claire — décision PO P11.3 */
.ds-sidebar {
  width: var(--ds-sidebar-w); background: var(--ds-surface);
  border-inline-end: var(--ds-border-w) solid var(--ds-line);
  display: flex; flex-direction: column; padding: var(--ds-sp-4) var(--ds-sp-3);
  position: sticky; top: 0; height: 100vh; flex: none;
}
.ds-sidebar .brand { font: var(--ds-t-h2); font-weight: 800; padding: var(--ds-sp-2) var(--ds-sp-3);
  display: flex; align-items: center; gap: var(--ds-sp-2); }
.ds-sidebar .brand .logo-mark {
  width: 30px; height: 30px; border-radius: var(--ds-r-s);
  background: var(--ds-primary); color: var(--ds-on-primary, #fff); display: inline-flex;
  align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.ds-sidebar .brand .logo-mark svg { width: 19px; height: 19px; display: block; }
.ds-sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-top: var(--ds-sp-4); }
.ds-sidebar nav a {
  display: flex; align-items: center; gap: var(--ds-sp-3);
  padding: 10px var(--ds-sp-3); border-radius: var(--ds-r-m);
  color: var(--ds-ink-2); font: var(--ds-t-body-sm); font-weight: 600;
  text-decoration: none; transition: background .12s, color .12s;
}
.ds-sidebar nav a:hover { background: var(--ds-surface-2); color: var(--ds-ink); }
.ds-sidebar nav a.active { background: var(--ds-primary-soft); color: var(--ds-primary); }
.ds-sidebar nav a .ds-icon { font-size: 20px; }
.ds-sidebar .who { margin-top: auto; padding: var(--ds-sp-3);
  border-top: var(--ds-border-w) solid var(--ds-line-2);
  font: var(--ds-t-caption); color: var(--ds-muted); }

/* Topbar */
.ds-topbar {
  height: var(--ds-topbar-h); display: flex; align-items: center;
  gap: var(--ds-sp-3); padding: 0 var(--ds-sp-6);
  background: var(--ds-surface); border-bottom: var(--ds-border-w) solid var(--ds-line);
  position: sticky; top: 0; z-index: var(--ds-z-sticky);
}
.ds-topbar .spacer { flex: 1; }

/* PageHeader */
.ds-page-header { display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--ds-sp-4); margin-bottom: var(--ds-sp-6); flex-wrap: wrap; }
.ds-page-header h1 { font: var(--ds-t-h1); margin: 0; }
.ds-page-header .sub { font: var(--ds-t-body-sm); color: var(--ds-muted); margin-top: var(--ds-sp-1); }
.ds-page-header .actions { display: flex; gap: var(--ds-sp-2); }

/* FilterBar */
.ds-filter-bar {
  display: flex; gap: var(--ds-sp-3); flex-wrap: wrap; align-items: flex-end;
  padding: var(--ds-sp-4); background: var(--ds-surface);
  border: var(--ds-border-w) solid var(--ds-line); border-radius: var(--ds-r-m);
  margin-bottom: var(--ds-sp-4);
}
.ds-filter-bar .field { min-width: 150px; }
.ds-filter-bar .field label { margin-bottom: 3px; }

/* ============================================================
   COMPOSANTS CLIENT (catalogue, panier, bottom nav)
   ============================================================ */

.ds-product-card {
  background: var(--ds-surface); border: var(--ds-border-w) solid var(--ds-line);
  border-radius: var(--ds-r-l); overflow: hidden; display: flex;
  flex-direction: column; transition: box-shadow .15s;
}
.ds-product-card:hover { box-shadow: var(--ds-sh-2); }
.ds-product-card .thumb {
  aspect-ratio: 4/3; background: var(--ds-surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ds-primary); font-size: 40px; position: relative;
}
.ds-product-card .body { padding: var(--ds-sp-3); flex: 1;
  display: flex; flex-direction: column; gap: var(--ds-sp-1); }
.ds-product-card .cat { font: var(--ds-t-caption); color: var(--ds-muted);
  text-transform: uppercase; letter-spacing: .05em; }
.ds-product-card .name { font: var(--ds-t-body); font-weight: 650; }
.ds-product-card .price { font: var(--ds-t-body-lg); font-weight: 800;
  color: var(--ds-primary); font-variant-numeric: tabular-nums; margin-top: auto; }
.ds-product-card .add {
  margin-top: var(--ds-sp-2); min-height: 40px;
}

/* ProductImageFallback — initiales/pictogramme */
.ds-img-fallback {
  width: 100%; height: 100%; display: flex; align-items: center;
  justify-content: center; font-weight: 800; color: var(--ds-primary);
  background: var(--ds-primary-soft); user-select: none;
}
.ds-img-fallback.ph::before { font-family: var(--ds-font-icon); content: "inventory_2";
  font-size: inherit; font-weight: 400; }

/* StoreHeader */
.ds-store-header { padding: var(--ds-sp-6); color: var(--ds-on-primary, #fff);
  background: linear-gradient(135deg, var(--ds-primary) 0%, var(--ds-primary-hover) 100%);
  border-radius: var(--ds-r-l); }
.ds-store-header h2 { font: var(--ds-t-h1); margin: 0; }
.ds-store-header .meta { font: var(--ds-t-body-sm); opacity: .85; margin-top: var(--ds-sp-1); }

/* CategoryChip — réutilise .ds-chip */

/* BasketSummary */
.ds-basket-summary {
  position: sticky; bottom: 0; background: var(--ds-surface);
  border-top: var(--ds-border-w) solid var(--ds-line); padding: var(--ds-sp-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--ds-sp-4);
  box-shadow: 0 -4px 16px rgba(20,30,25,.06);
}
.ds-basket-summary .total { font: var(--ds-t-h2); font-weight: 800;
  font-variant-numeric: tabular-nums; }

/* BottomNavigation */
.ds-bottom-nav {
  display: flex; background: var(--ds-surface);
  border-top: var(--ds-border-w) solid var(--ds-line);
  padding: var(--ds-sp-1) 0 calc(var(--ds-sp-1) + env(safe-area-inset-bottom));
}
.ds-bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: var(--ds-sp-2) 0; color: var(--ds-muted);
  text-decoration: none; font: var(--ds-t-caption); font-weight: 650;
  min-height: 56px; justify-content: center;
}
.ds-bottom-nav a.active { color: var(--ds-primary); }
.ds-bottom-nav a .ds-icon { font-size: 24px; }

/* P14.4 — dark-theme contrast fixes for components using semantic bgs */
[data-theme="dark"] .ds-btn--danger { background: #DC2626; }
[data-theme="dark"] .ds-toast { background: #0B0F0D; color: #E6EBE7; }
[data-theme="dark"] .ds-toast.ok { background: var(--ds-success); color: #06231F; }
[data-theme="dark"] .ds-toast.err { background: #DC2626; color: #fff; }
[data-theme="dark"] .ds-switch .track::after { background: #fff; }
