/* ==========================================================================
   PORTAIL CLIENTS — design system
   Navy #00142E structure · Or #DFAF33 action & montants · Cyan #33B5C5 info
   Violet #967EB7 catégories/données · Corail #EE7571 destructif/refus
   ========================================================================== */

:root {
  --navy: #00142e;
  --navy-2: #0a2547;          /* surfaces relevées sur navy */
  --navy-3: #123258;          /* hover sur navy */
  --gold: #dfaf33;
  --gold-strong: #c99a1d;
  --gold-ink: #7a5e0a;
  --gold-soft: rgba(223, 175, 51, .12);
  --cyan: #33b5c5;
  --cyan-ink: #12707d;
  --cyan-soft: rgba(51, 181, 197, .12);
  --purple: #967eb7;
  --purple-ink: #5e4b7a;
  --purple-soft: rgba(150, 126, 183, .14);
  --coral: #ee7571;
  --coral-ink: #ab2f2b;
  --coral-soft: rgba(238, 117, 113, .12);
  --green: #3fa15a;
  --green-ink: #1f7a3d;
  --green-soft: rgba(63, 161, 90, .12);

  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #00142e;
  --text-soft: #3a4658;
  --muted: #5b6678;
  --muted-light: #8a95a6;
  --border: #e5e9f0;
  --border-strong: #d3dae4;

  /* Polices locales : aucun appel à un fournisseur de fontes. */
  --font-display: ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;


  --r-sm: 9px;
  --r: 13px;
  --r-lg: 17px;
  --shadow: 0 1px 2px rgba(0, 20, 46, .05), 0 8px 24px rgba(0, 20, 46, .05);
  --shadow-lift: 0 4px 10px rgba(0, 20, 46, .07), 0 18px 44px rgba(0, 20, 46, .10);
  --sidebar-w: 252px;

  /* compat anciens noms (styles inline des templates) */
  --portal-cyan: var(--cyan);
  --portal-gold: var(--gold);
  --portal-purple: var(--purple);
  --portal-red: var(--coral);
  --portal-muted: var(--muted);
  --portal-muted-light: var(--muted-light);
  --portal-sidebar: var(--navy);
  --portal-border: var(--border);
  --portal-text: var(--text);
  --portal-text-soft: var(--text-soft);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
input, select, textarea, button { font: inherit; color: inherit; }
a { color: inherit; }
::placeholder { color: #9aa6b8; }
img { max-width: 100%; }

h1, h2, h3, h4, .header-title, .db-kpi-value, .ca-stat-value {
  font-family: var(--font-display);
}
h2 { margin: 10px 0 8px; font-size: 24px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
h3 { margin: 22px 0 10px; font-size: 17px; letter-spacing: -.01em; font-weight: 700; }
p { color: var(--muted); line-height: 1.6; }

.num, .product-price, .cart-line-total, .cart-total strong, .db-kpi-value,
.order-ref, .express-total, .ca-stat-value, .internal-kpi-card strong,
.approval-line-card > strong, .order-qty-badge, .db-col-num {
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================================================
   BOUTONS
   ========================================================================== */

.filters button[type="submit"], .button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--gold);
  border-radius: var(--r-sm);
  background: var(--gold);
  color: var(--navy);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 20, 46, .08);
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
}
.filters button[type="submit"]:hover, .button-primary:hover {
  background: var(--gold-strong);
  border-color: var(--gold-strong);
  box-shadow: 0 4px 14px rgba(223, 175, 51, .35);
}
.filters button[type="submit"]:active, .button-primary:active { transform: translateY(1px); }

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: none;
  transition: border-color .15s, background .15s, transform .08s;
}
.button-secondary:hover { border-color: var(--navy); background: var(--surface-2); box-shadow: none; }
.button-secondary:active { transform: translateY(1px); }

.button-danger {
  border: 1px solid var(--coral);
  background: var(--coral);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: filter .15s, transform .08s;
}
.button-danger:hover { filter: brightness(.93); box-shadow: none; }
.button-danger-outline {
  border: 1.5px solid var(--coral);
  color: var(--coral-ink);
  background: none;
  border-radius: var(--r-sm);
  padding: 7px 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.button-danger-outline:hover { background: var(--coral); color: #fff; box-shadow: none; }

.btn-sm { padding: 7px 13px; font-size: 13px; white-space: nowrap; }

/* ==========================================================================
   PAGE PUBLIQUE (login / home)
   ========================================================================== */

.portal-public {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, .95fr) minmax(360px, 1.05fr);
  background: var(--surface);
}
.public-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 44px 34px;
  color: #fff;
  background: var(--navy);
}
.hero-bubbles { display: none; }

/* fond navy nu : titre + carte de France + signature */
.hero-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3vh, 34px);
  width: 100%;
  text-align: center;
}
.hero-welcome,
.hero-signature {
  margin: 0;
  text-transform: uppercase;
  font-family: var(--font-display);
  letter-spacing: .06em;
  line-height: 1.35;
  text-wrap: balance;
}
.hero-welcome {
  font-size: clamp(21px, 2.5vw, 34px);
  font-weight: 700;
  color: #fff;
}
.hero-welcome-brand { color: var(--gold); }
.hero-signature {
  font-size: clamp(16px, 1.8vw, 24px);
  font-weight: 700;
  letter-spacing: .05em;
  color: #fff;
}
.hero-signature-brand { color: var(--cyan); }
/* le wrapper porte le ratio du SVG (1/1) : les marqueurs se placent en %
   du viewBox 1500×1500, donc ils suivent la carte à toutes les tailles */
.hero-map-wrap {
  position: relative;
  width: min(100%, 860px, 64vh);
  aspect-ratio: 1 / 1;
}
.hero-map { display: block; width: 100%; height: 100%; }

/* itinéraire Biarritz → Metz : « S » adouci, en pointillé blanc */
.hero-route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-route path {
  fill: none;
  stroke: #fff;
  stroke-opacity: .7;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 16 24;
}
/* Le camion reste droit sur toute la courbe (pas de rotation sur la tangente) :
   un pictogramme penché se lit mal. */
.hero-truck {
  filter: drop-shadow(0 3px 7px rgba(0, 20, 46, .55));
}
@media (prefers-reduced-motion: reduce) {
  .hero-truck { display: none; }
}

/* marqueurs départ/arrivée, style CircleMarker Leaflet */
.hero-pin {
  position: absolute;
  width: clamp(11px, 2.9%, 20px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
/* Biarritz (43.48 N, 1.56 O) */
.hero-pin--start {
  left: 27%;
  top: 75.3%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .2), 0 2px 7px rgba(0, 20, 46, .55);
}
/* Metz (49.12 N, 6.18 E) */
.hero-pin--end {
  left: 74.9%;
  top: 24.3%;
  background: var(--cyan);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 0 6px rgba(51, 181, 197, .28), 0 2px 7px rgba(0, 20, 46, .55);
}

.public-content { display: flex; align-items: center; justify-content: center; padding: 42px; }
.public-content main { width: min(100%, 880px); }
.login-screen .public-content main { width: min(100%, 430px); }

.login-card {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.login-logo { display: block; height: 58px; width: auto; max-width: 100%; object-fit: contain; margin: 0 auto 20px; }
.login-card .login-logo { height: 290px; }
.home-login-panel .login-logo { height: 174px; }
.login-card h2 { margin-top: 12px; font-size: 26px; }
.login-form { display: grid; gap: 16px; margin-top: 24px; }
.login-submit { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }

.form-field { display: grid; gap: 7px; }

/* Personnalisation accueil (marketing) */
.hero-settings-form { max-width: 640px; }
.hero-color-row { display: flex; gap: 14px; }
.hero-color-row .form-field { flex: 1; }
.hero-settings-form input[type="color"] {
  width: 100%;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
}
.hero-preview { margin: 16px 0 4px; display: grid; gap: 6px; }
.hero-preview-bar {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  text-align: center;
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid var(--border);
}
.cta-preview-btn {
  display: inline-flex;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  background: var(--cta-bg, var(--gold));
  color: var(--cta-fg, var(--navy));
  transition: background .15s, color .15s;
}
.cta-preview-btn:hover { background: var(--cta-fg, var(--navy)); color: var(--cta-bg, var(--gold)); }

.mkt-category-settings { margin-top: 24px; }
.mkt-category-settings > .section-heading { margin-bottom: 14px; }
.mkt-category-settings > .section-heading p { margin: 5px 0 0; color: var(--muted); }
.mkt-category-guidance {
  max-width: 900px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}
.mkt-category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.mkt-category-card { display: grid; align-content: start; gap: 14px; padding: 16px; }
.mkt-category-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mkt-category-card h4 { margin: 0; font-size: 17px; }
.mkt-category-client { color: var(--muted); font-size: 12px; }
.mkt-category-status {
  flex: none;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}
.mkt-category-status.is-active { background: var(--cyan-soft); color: var(--cyan-ink); }
.mkt-category-status.is-inactive { background: var(--coral-soft); color: var(--coral-ink); }
.mkt-category-preview {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.mkt-category-preview img { width: 100%; height: 100%; object-fit: cover; }
.mkt-category-preview [data-category-fallback] {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted-light);
  font-size: 12px;
}
.mkt-category-preview [data-category-fallback][hidden] { display: none; }
.mkt-category-form { display: grid; gap: 12px; }
.mkt-category-form input[type="file"] { padding: 9px; font-size: 12px; }
.mkt-category-remove {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
}
.mkt-category-remove input { margin-top: 2px; }
.mkt-category-form .button-secondary { justify-content: center; }

/* ── CRUD articles (marketing) ── */
.mkt-products-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.mkt-products-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.mkt-stat strong { color: var(--text); font-size: 15px; }
.mkt-stat--ok strong { color: var(--cyan-ink); }
.mkt-stat--off strong { color: var(--coral-ink); }
.mkt-products-actions { display: flex; gap: 10px; align-items: center; }
.mkt-search input {
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); outline: none; min-width: 240px;
}
.mkt-search input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }

body.bc-sync-busy { overflow: hidden; cursor: wait; }
.bc-sync-modal { cursor: wait; }
.bc-sync-modal-box { max-width: 460px; text-align: center; }
.bc-sync-spinner {
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border: 4px solid var(--cyan-soft);
  border-top-color: var(--cyan-ink);
  border-radius: 50%;
  animation: bc-sync-spin .8s linear infinite;
}
.bc-sync-progress {
  height: 8px;
  margin: 4px 0 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.bc-sync-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  animation: bc-sync-progress 1.25s ease-in-out infinite alternate;
}
.bc-sync-wait { margin: 0; color: var(--muted); font-size: 13px; }
@keyframes bc-sync-spin { to { transform: rotate(360deg); } }
@keyframes bc-sync-progress { from { transform: translateX(-15%); } to { transform: translateX(155%); } }

@media (prefers-reduced-motion: reduce) {
  .bc-sync-spinner, .bc-sync-progress span { animation: none; }
  .bc-sync-progress span { width: 100%; }
}

.mkt-product-list { padding: 6px 8px; }
.mkt-product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 90px 110px 210px;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
}
.mkt-product-row:last-child { border-bottom: none; }
.mkt-product-row--head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-light); }
.mkt-product-row.is-off { opacity: .58; }
/* Assortiment : mêmes lignes, mais l'état porte un libellé long
   (« En attente de synchronisation ») et n'a pas de vignette. */
.mkt-assortment-list .mkt-product-row { grid-template-columns: minmax(0, 1fr) 130px 220px minmax(0, 200px) 110px; }
.mkt-product-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mkt-product-thumb {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: var(--r-sm);
  overflow: hidden; background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted-light);
}
.mkt-product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mkt-product-name { font-weight: 700; font-size: 14px; }
.mkt-product-sku { font-size: 12px; color: var(--muted); }
.mkt-product-cat { font-size: 13px; color: var(--muted); }
.mkt-col-actions { text-align: right; }
.mkt-product-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.mkt-product-actions form { margin: 0; }
.mkt-btn-sm { padding: 7px 12px; font-size: 12.5px; }

.mkt-product-form { max-width: 760px; }
.mkt-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mkt-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mkt-image-cell { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); }
.mkt-image-label { font-size: 12px; font-weight: 700; color: var(--muted-light); }
.mkt-image-preview { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.mkt-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.mkt-checkbox { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; cursor: pointer; }
.mkt-form-submit { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 720px) {
  .mkt-product-row { grid-template-columns: 1fr; gap: 6px; }
  .mkt-product-row--head { display: none; }
  .mkt-col-actions, .mkt-product-actions { text-align: left; justify-content: flex-start; }
  .mkt-form-grid, .mkt-image-grid { grid-template-columns: 1fr; }
}
.form-field label { color: var(--text-soft); font-size: 13px; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-field textarea { resize: vertical; line-height: 1.55; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.field-hint { color: var(--muted-light); font-size: 12px; font-weight: 500; }
.form-error {
  padding: 12px 14px;
  border: 1px solid rgba(238, 117, 113, .4);
  border-radius: var(--r-sm);
  background: var(--coral-soft);
  color: var(--coral-ink);
  font-weight: 600;
  font-size: 13.5px;
}

/* Login "home" */
.home-login-panel { padding: 24px 40px 48px; max-width: 400px; margin: 0 auto; width: 100%; }
.home-login-form { display: grid; gap: 16px; margin-top: 6px; }
.home-login-btn {
  width: 100%;
  margin-top: 6px;
  padding: 13px;
  border-radius: var(--r-sm);
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 20, 46, .08);
  transition: background .15s, box-shadow .15s, transform .08s;
}
.home-login-btn:hover { background: var(--gold-strong); box-shadow: 0 4px 14px rgba(223, 175, 51, .35); }
.home-login-btn:active { transform: translateY(1px); }

/* ==========================================================================
   COQUILLE APPLICATIVE — sidebar + header
   ========================================================================== */

.app-shell { min-height: 100vh; display: flex; background: var(--bg); }

.sidebar {
  position: sticky;
  top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: var(--navy);
  color: #fff;
}
.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.01em;
}
.sidebar .portal-brand {
  margin: 0 2px 18px;
  padding: 12px 14px;
  background: #fff;
  border-radius: var(--r-sm);
  justify-content: center;
}
.portal-client-logo { height: 34px; width: auto; max-width: 170px; object-fit: contain; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-link, .nav-action {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: rgba(255, 255, 255, .64);
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.nav-link:hover, .nav-action:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link.is-active { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: var(--gold);
}
/* Trait actif : couleurs du thème en alternance selon l'entrée (le doré reste en 1re) */
.sidebar-nav .nav-link:nth-child(4n+2).is-active::before { background: var(--purple); }
.sidebar-nav .nav-link:nth-child(4n+3).is-active::before { background: var(--cyan); }
.sidebar-nav .nav-link:nth-child(4n+4).is-active::before { background: var(--coral); }
.nav-icon { flex-shrink: 0; opacity: .9; }
.nav-link--fav .nav-icon { color: var(--gold); }
.nav-badge {
  margin-left: auto;
  min-width: 21px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.sidebar-user { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px 12px; min-width: 0; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, var(--cyan), var(--purple));
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11.5px; color: rgba(255, 255, 255, .5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .nav-action { font-size: 13px; color: rgba(255, 255, 255, .55); }
.sidebar .nav-action:hover { color: var(--coral); background: rgba(238, 117, 113, .08); }
/* Raccourci « Sécurité » dans le bloc utilisateur : même discrétion que la
   déconnexion, sans sa couleur d'avertissement. */
.sidebar .nav-link--compact { font-size: 13px; color: rgba(255, 255, 255, .55); }

.app-frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 32px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-title { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.header-subtitle { margin-top: 1px; color: var(--muted-light); font-size: 12.5px; }
.header-brand { display: inline-flex; align-items: center; }
.header-logo { height: 66px; width: auto; max-width: 220px; object-fit: contain; display: block; transform: scale(1.5); transform-origin: left center; }
.header-actions { display: flex; align-items: center; gap: 12px; }

.cart-icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.cart-icon-btn:hover { border-color: var(--navy); color: var(--navy); }
.cart-icon-btn--active { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-ink); }
.cart-icon-btn--active:hover { border-color: var(--gold-strong); color: var(--navy); }
.cart-icon-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
@keyframes badge-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.badge-pulse { animation: badge-pulse .22s ease; }

.app-main { flex: 1; padding: 26px 32px 80px; }
.app-content { width: min(100%, 1200px); margin: 0 auto; }
.app-main--fullbleed { padding: 0; display: flex; flex-direction: column; }
.app-main--fullbleed .app-content { max-width: 100%; width: 100%; display: flex; flex-direction: column; flex: 1; }

/* ==========================================================================
   COMPOSANTS GÉNÉRIQUES
   ========================================================================== */

.panel, .card, .product-card, .data-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.panel { padding: 24px; }

.eyebrow, .env-badge, .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.eyebrow { background: var(--cyan-soft); color: var(--cyan-ink); }
.cat-chip { background: var(--cat-color, var(--purple)); color: #fff !important; letter-spacing: .02em; }
.env-badge { margin-bottom: 12px; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid rgba(223, 175, 51, .35); }
.badge { padding: 3px 10px; letter-spacing: .02em; text-transform: none; }
.badge-opex { background: var(--cyan-soft); color: var(--cyan-ink); }
.badge-capex { background: var(--gold-soft); color: var(--gold-ink); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 14px; }
.card {
  display: block;
  padding: 20px;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: var(--shadow-lift); }
.card strong { display: block; margin-bottom: 6px; font-size: 15.5px; font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.card span { color: var(--muted); font-size: 13.5px; }

.list { display: grid; gap: 10px; padding: 0; list-style: none; }
.list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 13px 15px; }

.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
}
.back:hover { color: var(--text); }

.empty-state { text-align: center; padding: 46px 20px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty-state p { margin: 0; max-width: 420px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Bandeau compact en tête de page */
.page-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
  padding: 20px 24px;
}
.page-band h2 { margin: 6px 0 4px; font-size: 22px; }
.page-band p { margin: 0; font-size: 13.5px; }
.page-band-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 130px;
  padding: 14px 22px;
  border-radius: var(--r);
  background: var(--navy);
  color: #fff;
  text-align: center;
}
.page-band-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.page-band-stat span { color: rgba(255, 255, 255, .65); font-weight: 600; font-size: 12px; }
.page-band-stat .fav-count-chip { margin-top: 6px; }

/* Messages / callouts */
.message-stack { display: grid; gap: 10px; margin-bottom: 16px; }
.message-card {
  border: 1px solid rgba(51, 181, 197, .32);
  border-radius: var(--r-sm);
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  padding: 12px 14px;
  font-weight: 600;
  font-size: 13.5px;
}
.message-card--error { border-color: rgba(238, 117, 113, .4); background: var(--coral-soft); color: var(--coral-ink); }
.info-callout {
  margin: 8px 0 16px;
  border: 1px solid rgba(51, 181, 197, .28);
  border-radius: var(--r);
  background: var(--cyan-soft);
  padding: 14px 16px;
}
.info-callout.is-warning { border-color: rgba(223, 175, 51, .4); background: var(--gold-soft); }
.info-callout strong { display: block; margin-bottom: 4px; }
.info-callout p { margin: 0; font-size: 13.5px; }
.field-error { display: block; color: var(--coral-ink); font-size: 11px; margin-top: 4px; font-weight: 600; }

/* Pastilles de statut */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 11px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .75; }
.status-submitted { background: var(--gold-soft); color: var(--gold-ink); }
.status-draft { background: #edf1f6; color: var(--muted); }
.status-approved { background: var(--cyan-soft); color: var(--cyan-ink); }
.status-rejected { background: var(--coral-soft); color: var(--coral-ink); }
.status-processed { background: var(--purple-soft); color: var(--purple-ink); }
.status-adjusted { background: var(--gold-soft); color: var(--gold-ink); }
.status-adjusted::before { display: none; }
.status-received { background: var(--green-soft); color: var(--green-ink); }
.status-received::before { display: none; }
.status-received-partial { background: var(--gold-soft); color: var(--gold-ink); }
.status-received-partial::before { display: none; }
/* Avancement chez le fournisseur : une pastille à part, jamais confondue avec
   le statut de la demande — la décision est interne, la livraison ne l'est pas. */
.status-bc-waiting { background: #edf1f6; color: var(--muted); }
.status-bc-progress { background: var(--cyan-soft); color: var(--cyan-ink); }
.status-bc-done { background: var(--green-soft); color: var(--green-ink); }
/* Date du relevé : une information sur l'information, qui ne doit pas peser
   autant que la valeur qu'elle date. */
.bc-checked-note { display: block; color: var(--muted-light); font-size: 11.5px; font-weight: 500; }

/* ==========================================================================
   FILTRES & FORMULAIRES DE LISTE
   ========================================================================== */

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.catalog-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(160px, .8fr) minmax(160px, .8fr);
  gap: 12px;
  align-items: end;
}
.catalog-filters--2col {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.catalog-filters--2col .search-field { flex: 0 1 510px; }
.catalog-filters--2col .filter-field { flex: 0 1 190px; }
.catalog-filters--2col .filter-actions { flex: 0 0 auto; padding-bottom: 1px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.search-field, .filter-field { display: grid; gap: 6px; }
.search-field label, .filter-field label,
.submit-order-form label, .quantity-form label, .approval-action-form label, .cart-dai-field label {
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.search-field input, .filter-field input, .filter-field select,
.filters input, .filters select, .filters textarea,
.submit-order-form select, .submit-order-form input,
.quantity-form input, .approval-action-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  outline: none;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.search-field input:focus, .filter-field input:focus, .filter-field select:focus,
.filters input:focus, .filters select:focus,
.submit-order-form select:focus, .submit-order-form input:focus,
.quantity-form input:focus, .approval-action-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-soft);
}
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; justify-content: flex-end; }

/* ==========================================================================
   CATALOGUE
   ========================================================================== */

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 16px;
}
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.product-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-lift); }
.product-card-rich { border-radius: var(--r); }

.thumb {
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 30% 25%, rgba(51, 181, 197, .07), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(150, 126, 183, .08), transparent 55%),
    var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-light);
  font-size: 12.5px;
  overflow: hidden;
  flex-shrink: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb { aspect-ratio: 1 / .78; border-bottom: 1px solid var(--border); position: relative; }

/* Navigation photos sur la carte catalogue */
.card-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 20, 46, .28);
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, opacity .15s;
}
.card-nav:hover { background: rgba(0, 20, 46, .55); }
.card-nav-prev { left: 8px; }
.card-nav-next { right: 8px; }
.card-nav::before {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
}
.card-nav-prev::before { transform: rotate(-135deg); margin-left: 3px; }
.card-nav-next::before { transform: rotate(45deg); margin-right: 3px; }
.card-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 2;
}
.card-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 2px rgba(0, 20, 46, .4); }
.card-dot.is-active { background: #fff; }

.product-body { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 14px; }
.product-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.product-card-rich strong { font-size: 15px; letter-spacing: -.01em; line-height: 1.3; font-weight: 700; }
.product-card-rich p { margin: 0; font-size: 13.5px; }
.sku-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 2px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.card-cta { margin-top: auto; color: var(--cyan-ink); font-weight: 700; font-size: 13.5px; }
.product-price {
  display: block;
  margin-top: auto;
  padding-top: 4px;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  text-align: left;
}

/* Favori (étoile en overlay) */
.fav-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  right: auto;
  z-index: 3;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, .92) url("../img/icon-fav-off.19ce79e8808c.svg") center / 19px no-repeat;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 20, 46, .10);
  transition: transform .18s;
}
.fav-btn:hover { transform: scale(1.12); }
.fav-btn.is-fav { background-image: url("../img/icon-fav-on.bb4b34937d13.svg"); border-color: rgba(223, 175, 51, .5); }
.nav-link--fav { color: rgba(255, 255, 255, .64); }

/* Stepper quantité */
.stepper-zone {
  margin-top: 8px;
  padding: 8px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: default;
  transition: border-color .15s, background .15s;
}
.product-stepper { display: flex; align-items: center; justify-content: center; gap: 8px; }
.stepper-zone:has(.product-stepper.is-active) { border-color: var(--navy); }
.stepper-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--navy);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: background .15s, transform .1s;
  user-select: none;
}
.stepper-btn:hover:not(:disabled) { background: var(--navy-3); }
.stepper-btn:active:not(:disabled) { transform: scale(.88); }
.stepper-btn:disabled { opacity: .45; cursor: default; }
.stepper-minus { background: #e8edf3; color: var(--text); }
.stepper-minus:hover:not(:disabled) { background: #dbe2ec; }
.stepper-count {
  min-width: 30px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--navy);
  display: inline-block;
  font-variant-numeric: tabular-nums;
}
@keyframes stepper-up {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes stepper-down {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.stepper-anim-up { animation: stepper-up .16s ease; }
.stepper-anim-down { animation: stepper-down .16s ease; }
.stepper-reset-btn {
  width: 18px;
  height: 18px;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  background: url("../img/icon-trash.b86ddb1673be.svg") center / contain no-repeat;
  transition: transform .1s;
}
.stepper-reset-btn:hover { background-image: url("../img/icon-trash-hover.2b2d3e164aa5.svg"); }
.stepper-reset-btn:active { transform: scale(.86); }
/* Masquée mais garde sa place : la carte ne se déforme pas à l'ajout */
.stepper-reset-btn[hidden] { display: block; visibility: hidden; }

/* Barre de commande express (signature) */
.express-bar {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 32px 18px;
  pointer-events: none;
}
.express-bar[hidden] { display: none; }
.express-bar-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 11px 12px 11px 24px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 10px 34px rgba(0, 20, 46, .35);
  border: 1px solid rgba(255, 255, 255, .08);
}
.express-count { font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .75); }
.express-count b { color: #fff; font-weight: 800; font-variant-numeric: tabular-nums; }
.express-total {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--gold);
  white-space: nowrap;
}
.express-total[hidden] { display: none; }
.express-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 13.5px;
  text-decoration: none;
  transition: background .15s;
}
.express-cta:hover { background: var(--gold-strong); }

/* ==========================================================================
   FICHE ARTICLE
   ========================================================================== */

/* Bandeau coloré (couleur de la catégorie) que la carte visuels vient chevaucher. */
.pd {
  --pd-overlap: clamp(28px, 4.5vw, 66px);
  --pd-cols: minmax(0, 1.02fr) minmax(0, 1fr);
  --pd-gap: clamp(16px, 2vw, 28px);
}
.pd-hero {
  border-radius: var(--r-lg);
  /* padding bas volontairement court : la référence se cale sur la séparation du bandeau */
  padding: 14px clamp(18px, 2.4vw, 34px) 14px;
  color: #fff;
  background: var(--pd-accent);
  /* mélange avec le navy : le texte blanc reste lisible même sur une catégorie claire */
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--pd-accent) 90%, var(--navy)),
    color-mix(in srgb, var(--pd-accent) 55%, var(--navy)));
}
.pd-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  opacity: .88;
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
}
.pd-back:hover { opacity: 1; }
.pd-hero-grid { display: grid; grid-template-columns: var(--pd-cols); gap: var(--pd-gap); }
.pd-head { display: flex; flex-direction: column; min-height: clamp(74px, 7.2vw, 106px); padding-top: 6px; }
.pd-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(21px, 2.35vw, 33px);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
  color: #fff;
  text-wrap: balance;
}
.pd-ref {
  margin-top: auto;
  padding-top: 10px;
  text-align: right;
  font-weight: 700;
  font-size: clamp(13.5px, 1.1vw, 16px);
  color: rgba(255, 255, 255, .92);
  font-variant-numeric: tabular-nums;
}

.pd-layout {
  display: grid;
  grid-template-columns: var(--pd-cols);
  gap: var(--pd-gap);
  align-items: start;
  margin-top: calc(-1 * var(--pd-overlap));
}

.pd-media {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-lift);
  padding: clamp(14px, 1.6vw, 22px);
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.pd-rail { display: flex; flex-direction: column; align-items: center; gap: 8px; width: clamp(62px, 6vw, 92px); flex-shrink: 0; }
.pd-rail-arrow { border: none; background: none; padding: 4px; border-radius: 6px; color: var(--muted); line-height: 0; cursor: pointer; }
.pd-rail-arrow:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.pd-rail-arrow:disabled { opacity: .3; cursor: default; }
.pd-rail-items { display: flex; flex-direction: column; gap: 8px; width: 100%; overflow-y: auto; }
.pd-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .08s;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pd-thumb:hover { border-color: var(--border-strong); }
.pd-thumb:active { transform: scale(.95); }
.pd-thumb.is-active { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.pd-stage {
  flex: 1;
  min-width: 0;
  min-height: clamp(260px, 30vw, 430px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.4vw, 20px);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted-light);
  font-size: 12.5px;
  overflow: hidden;
}
.pd-stage img { max-width: 100%; max-height: clamp(240px, 28vw, 400px); object-fit: contain; }

.pd-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding-top: calc(var(--pd-overlap) + 10px); }
.pd-tags { display: flex; align-items: center; gap: 12px; }
.pd-cat {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: var(--r-sm);
  background: var(--pd-accent);
  background: color-mix(in srgb, var(--pd-accent) 85%, var(--navy));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(0, 20, 46, .12);
}
.pd-fav { position: static; margin-left: auto; width: 38px; height: 38px; background-size: 21px; flex-shrink: 0; }
.pd-desc { margin: 0; color: var(--text-soft); line-height: 1.62; text-wrap: pretty; }
.pd-specs { margin: 0; display: grid; gap: 4px; }
.pd-specs > div { display: flex; gap: 6px; flex-wrap: wrap; }
.pd-specs dt { font-weight: 700; color: var(--text); }
.pd-specs dd { margin: 0; color: var(--text-soft); }
.pd-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-top: 4px;
  padding: 16px 20px;
  border: 1.5px solid var(--navy);
  border-radius: var(--r);
  background: var(--surface);
}
.pd-buy-price span { display: block; color: var(--muted); font-size: 13px; }
.pd-buy-price strong { font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pd-stepper { gap: 12px; }
.pd-stepper .stepper-btn { width: 38px; height: 38px; border-radius: 10px; font-size: 20px; }
.pd-stepper .stepper-count { min-width: 34px; font-size: 19px; }
.pd-stepper .stepper-reset-btn { width: 20px; height: 20px; }
.pd-note { margin: 0; color: var(--muted); font-size: 13.5px; }

@media (max-width: 900px) {
  .pd { --pd-overlap: 0px; }
  .pd-hero { padding-bottom: 22px; }
  .pd-hero-grid { grid-template-columns: 1fr; }
  .pd-hero-spacer { display: none; }
  .pd-head { min-height: 0; }
  .pd-ref { text-align: left; }
  .pd-layout { grid-template-columns: 1fr; margin-top: 14px; }
  .pd-side { padding-top: 0; }
}

/* ==========================================================================
   PANIER
   ========================================================================== */

.cart-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); gap: 16px; align-items: start; }
.section-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.section-heading h3 { margin-top: 10px; }
.cart-line-list, .submit-order-form, .order-card-grid { display: grid; gap: 12px; }
.cart-line-card {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 16px;
}
.cart-line-main { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.cart-line-info { flex: 1; min-width: 0; }
.cart-line-main h4 { margin: 6px 0 4px; font-size: 15.5px; letter-spacing: -.01em; }
.cart-line-ref { margin: 0 0 4px; color: var(--muted); font-size: 12.5px; }
.cart-line-main p { margin: 0; }
.cart-line-price { color: var(--muted); font-size: 13px; }
.cart-line-total { color: var(--navy); }
.cart-line-controls { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 80px; }
.cart-qty-input {
  width: 72px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.cart-qty-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.cart-qty-hint { color: var(--muted-light); font-size: 11px; font-weight: 600; }
.cart-remove-btn {
  width: 19px;
  height: 19px;
  border: none;
  padding: 0;
  cursor: pointer;
  background: url("../img/icon-trash.b86ddb1673be.svg") center / contain no-repeat;
  transition: transform .1s;
}
.cart-remove-btn:hover { background-image: url("../img/icon-trash-hover.2b2d3e164aa5.svg"); }
.cart-remove-btn:active { transform: scale(.86); }

.cart-dai-field { margin-top: 10px; }
.cart-dai-field label { display: block; margin-bottom: 5px; color: var(--coral-ink); }
.cart-dai-field input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--coral-ink);
  border-radius: var(--r-sm);
  background: rgba(238, 117, 113, .5);
  color: var(--navy);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.cart-dai-field input::placeholder { color: rgba(0, 20, 46, .55); }
.cart-dai-field input:focus { border-color: var(--coral-ink); box-shadow: 0 0 0 3px var(--coral-soft); }
.required-mark { color: var(--coral); }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 14px 0;
  margin: 14px 0;
  font-size: 14px;
  color: var(--muted);
}
.cart-total strong { font-size: 20px; color: var(--navy); font-family: var(--font-display); letter-spacing: -.01em; }
.delivery-address-reminder {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.delivery-address-reminder[hidden] { display: none; }
.delivery-address-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-light);
  margin-bottom: 3px;
}
.delivery-address-value {
  display: block;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-line;
}
.delivery-address-value.is-empty { color: var(--muted); font-style: italic; }
.cart-submit-panel { position: sticky; top: 86px; }
.submit-order-button { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.submit-order-button:disabled { opacity: .5; cursor: not-allowed; }

/* Article désactivé par le marketing alors qu'il est au panier */
.cart-line-card.is-unavailable { border-color: var(--coral); background: var(--coral-soft); }
.cart-line-unavailable {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}
.cart-unavailable-note {
  margin: 12px 0;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--coral-soft);
  border: 1px solid var(--coral);
  color: var(--coral-ink);
  font-size: 13px;
  font-weight: 600;
}
.order-line-total { margin-left: auto; font-weight: 700; color: var(--navy); white-space: nowrap; }
.quantity-form { min-width: 220px; display: grid; gap: 7px; }
.quantity-form div { display: flex; gap: 8px; align-items: center; }
.quantity-form input { max-width: 82px; }
.quantity-form small { color: var(--muted-light); font-weight: 600; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 46, .5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-backdrop[hidden] { display: none; }
.modal-box {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 30px 28px 22px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 24px 60px rgba(0, 20, 46, .25);
}
.modal-title { margin: 0 0 10px; font-size: 18px; }
.modal-body { margin: 0 0 22px; color: var(--text-soft); line-height: 1.5; }
.modal-box .form-field { margin: 18px 0 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-box--wide { max-width: 560px; max-height: 88vh; overflow-y: auto; }

/* Réception de commande (modale liste + panneau détail) */
.receive-lines { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.receive-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.receive-line-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.receive-line-info strong { font-size: 13.5px; }
.receive-line-info span { font-size: 12.5px; color: var(--muted); }
.receive-line-info .receive-line-already { color: var(--green-ink); font-weight: 700; }
.receive-line-done { flex-shrink: 0; font-size: 12.5px; font-weight: 700; color: var(--green-ink); }
.receive-line-qty {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-soft);
}
.receive-line-qty input {
  width: 70px;
  padding: 7px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 13px;
  text-align: center;
}
.receive-line-qty span { color: var(--muted); font-weight: 600; }
.receive-totals { display: flex; flex-direction: column; gap: 6px; margin: 16px 0 20px; }
.receive-totals > div { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.receive-totals strong { color: var(--navy); font-variant-numeric: tabular-nums; }
.receive-panel-hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.cart-total--sub { padding: 6px 0; margin: 0; border-top: none; }
.cart-total--sub strong { font-size: 15px; }
.line-received-note { color: var(--green-ink) !important; font-weight: 600; }

/* ==========================================================================
   LISTES DE COMMANDES (tableaux)
   ========================================================================== */

.orders-list { overflow: hidden; padding: 10px 0 4px; }
.orders-list-head, .orders-list-row {
  display: grid;
  grid-template-columns: 76px 1fr 1.4fr 1.2fr 100px 110px;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
}
.orders-list-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-light);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.orders-list-row { border-top: 1px solid var(--border); font-size: 13.5px; }
.orders-list-row:first-of-type { border-top: none; }
.orders-list-row:hover { background: var(--surface-2); }
.orders-list--approver { grid-template-columns: 70px 1fr 1.2fr 1.2fr 110px 100px 190px; gap: 20px; }
.orders-list--requester { grid-template-columns: 60px 1.4fr 1fr 100px 100px 95px 95px 195px; gap: 12px; }
.order-amount { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); white-space: nowrap; }
.orders-list-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.quick-decision-form { display: contents; }
.quick-decision-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.quick-approve-btn { background: var(--green-soft); border-color: rgba(63, 161, 90, .35); color: var(--green-ink); }
.quick-approve-btn:hover { background: var(--green); border-color: var(--green); color: #fff; }
.quick-reject-btn { background: var(--coral-soft); border-color: rgba(238, 117, 113, .35); color: var(--coral-ink); }
.quick-reject-btn:hover { background: var(--coral); border-color: var(--coral); color: #fff; }
.orders-list--history { grid-template-columns: 70px 1fr 140px 1.2fr 110px 100px; gap: 28px; }
.orders-list--adv { grid-template-columns: 76px 1.2fr 1fr 1.3fr 1fr 110px 120px; }
.orders-list-row--link { text-decoration: none; color: inherit; display: grid; cursor: pointer; }
.order-ref { font-weight: 800; color: var(--navy); font-family: var(--font-display); font-size: 13px; }
.order-date { color: var(--muted); font-variant-numeric: tabular-nums; }

/* Détail commande / demande */
.order-detail-layout { display: grid; gap: 16px; }
.order-qty-badge { font-size: 15px; font-weight: 800; color: var(--muted); white-space: nowrap; align-self: center; }
.order-meta-list, .approval-meta-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.order-meta-list div, .approval-meta-list div {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 11px 13px;
}
.order-meta-list dt, .approval-meta-list dt {
  color: var(--muted-light);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.order-meta-list dd, .approval-meta-list dd { margin: 4px 0 0; color: var(--text); font-weight: 650; }
.order-line-preview { border-top: 1px solid var(--border); padding-top: 14px; }
.order-line-preview ul { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.order-line-preview li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 9px 12px;
  color: var(--text-soft);
}
.order-line-preview b { color: var(--text); }
.order-reorder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--border);
  margin-top: 18px;
  padding-top: 16px;
}
.order-reorder-hint { flex: 1; min-width: 240px; margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.reorder-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.reorder-empty { margin: 0; color: var(--muted); font-size: 13.5px; }
.reorder-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 16px; }

.order-card-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.order-card { display: grid; gap: 16px; }
.order-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.order-card-header h3 { margin-top: 10px; }

/* ==========================================================================
   APPROBATEUR
   ========================================================================== */

.approval-detail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 16px; align-items: start; }
.approval-detail-main h2 { font-size: clamp(22px, 3vw, 28px); }
.approval-meta-wide { margin: 20px 0; }
.approval-detail-lines { display: grid; gap: 10px; }
.approval-line-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 15px;
}
.approval-line-card h4 { margin: 8px 0 4px; font-size: 15.5px; }
.approval-line-card p { margin: 0; font-size: 13px; }
.approval-line-card > strong { font-size: 19px; color: var(--navy); font-family: var(--font-display); white-space: nowrap; }
.approval-line-card--removed, .cart-line-card--removed { opacity: .55; }
.approval-line-card--removed h4, .cart-line-card--removed h4 { text-decoration: line-through; }
.approval-line-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 10px; }
.approval-line-qty-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.approval-line-qty-field input {
  width: 68px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}
.approval-line-remove {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--coral-ink);
  cursor: pointer;
}
.line-removed-note { color: var(--coral-ink) !important; font-weight: 600; }
.line-adjusted-note { color: var(--gold-ink) !important; font-weight: 600; }
.approval-decision-panel { position: sticky; top: 86px; display: grid; gap: 14px; }
.approval-action-form { display: grid; gap: 9px; }
.approval-approve-button, .approval-reject-button { width: 100%; justify-content: center; }
.approval-reject-button { border-color: rgba(238, 117, 113, .5); color: var(--coral-ink); }
.approval-reject-button:hover { border-color: var(--coral); background: var(--coral-soft); }
.approval-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.approval-card, .approval-history-card { display: grid; gap: 16px; }
.approval-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.approval-card-header h3 { margin-top: 10px; }
.approval-line-preview { border-top: 1px solid var(--border); padding-top: 14px; }
.approval-line-preview ul { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.approval-line-preview li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 9px 12px;
  color: var(--text-soft);
}
.approval-line-preview b { color: var(--text); }
.approval-card-cta { display: inline-flex; justify-content: center; text-decoration: none; }
.approval-timeline { display: grid; gap: 14px; }
.approval-recent-list { display: grid; gap: 10px; }
.approval-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 13px 15px;
}
.approval-recent-row strong { display: block; }
.approval-recent-row span:not(.status-pill) { display: block; margin-top: 4px; color: var(--muted); }

/* Dashboard approbateur */
.db-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.db-kpi-card { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; }
.db-kpi-card--main { background: var(--navy); border-color: var(--navy); color: #fff; }
.db-kpi-card--main .db-kpi-label { color: rgba(255, 255, 255, .6); }
.db-kpi-card--main .db-kpi-value { color: var(--gold); }
.db-kpi-card--main .db-kpi-sub { color: rgba(255, 255, 255, .5); }
.db-kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-light); }
.db-kpi-value {
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.05;
  margin: 4px 0 2px;
}
.db-kpi-value--pending { color: var(--gold-ink); }
.db-kpi-value--approved { color: var(--cyan-ink); }
.db-kpi-value--rejected { color: var(--coral-ink); }
.db-kpi-value--na { color: var(--muted-light); }
.db-kpi-unit { font-size: .55em; font-weight: 600; letter-spacing: 0; color: var(--muted); }
.db-kpi-sub { font-size: 12px; color: var(--muted); }
.db-chart-panel { margin-bottom: 16px; }
.db-chart-header { margin-bottom: 16px; }
.db-chart-header h3 { margin-top: 4px; font-size: 16px; }
.db-chart-wrap { position: relative; }
.db-chart-wrap--agency { height: 220px; }
.db-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.db-top-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.db-top-table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted-light);
  padding: 0 10px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.db-top-table tbody td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.db-top-table tbody tr:last-child td { border-bottom: none; }

.db-rank { font-weight: 800; color: var(--purple); width: 28px; font-family: var(--font-display); }
.db-product-name { color: var(--text); font-weight: 600; }
.db-col-num { text-align: right !important; color: var(--muted); white-space: nowrap; }
.db-empty { color: var(--muted); font-size: 14px; padding: 16px 0; }

/* ==========================================================================
   ESPACES INTERNES (ADV, marketing, direction)
   ========================================================================== */

.internal-toolbar { margin-bottom: 16px; padding: 16px; }
.internal-filter-form, .internal-export-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.internal-filter-form .filter-field, .internal-export-form .filter-field { min-width: 180px; }
.internal-filter-form .filter-field--wide { min-width: 260px; }
.internal-export-panel { display: flex; justify-content: space-between; gap: 22px; align-items: end; margin-top: 16px; }
.internal-export-panel h3 { margin-top: 10px; }
.internal-export-panel p { margin-bottom: 0; font-size: 13.5px; }
.internal-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.internal-kpi-card { display: grid; gap: 14px; justify-items: start; padding: 18px 20px; }
.internal-kpi-card strong {
  display: block;
  font-size: 34px;
  letter-spacing: -.03em;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
}
/* Marketing — chiffre d'affaires */
.mkt-ca-grid { grid-template-columns: repeat(4, 1fr); }
.mkt-ca-up { color: var(--green-ink); }
.mkt-ca-down { color: var(--coral-ink); }
.mkt-ca-panel { margin-bottom: 16px; }

/* Jauge du CA cumulé face à l'objectif annuel */
.mkt-goal-card { align-items: center; text-align: center; }
.mkt-goal-gauge { position: relative; width: 100%; max-width: 176px; margin-top: 6px; }
.mkt-goal-arc { display: block; width: 100%; height: auto; overflow: visible; }
.mkt-goal-track, .mkt-goal-fill { fill: none; stroke-width: 11; stroke-linecap: round; }
.mkt-goal-track { stroke: var(--border); }
.mkt-goal-fill {
  stroke: var(--gold);
  /* Longueur de l'arc : le tracé n'est visible que jusqu'à l'offset posé en ligne. */
  stroke-dasharray: 201.06;
  transition: stroke-dashoffset .5s ease;
}
.mkt-goal-percent {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.mkt-goal-percent-unit { font-size: .5em; font-weight: 700; margin-left: 2px; color: var(--muted); }
.mkt-goal-scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 168px;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--muted-light);
}
.mkt-goal-value { margin-top: 10px; font-size: clamp(20px, 2vw, 25px); }
@media (prefers-reduced-motion: reduce) {
  .mkt-goal-fill { transition: none; }
}

/* Les deux jauges d'objectif annuel côte à côte, à la largeur des cartes CA. */
.mkt-goal-grid { grid-template-columns: repeat(2, 1fr); }

/* Courbe des commandes par mois : tracé calculé côté vue, aucun script. */
.mkt-chart { display: block; width: 100%; height: auto; }
.mkt-chart-grid { stroke: var(--border); }
.mkt-chart-ytick, .mkt-chart-xtick {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--muted-light);
}
.mkt-chart-ytick { text-anchor: end; }
.mkt-chart-xtick { text-anchor: middle; }
/* Mois pas encore écoulés : gradués mais non tracés. */
.mkt-chart-xtick.is-future { fill: var(--border-strong); }
.mkt-chart-area { fill: var(--cyan-soft); }
.mkt-chart-line {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.mkt-chart-dot { fill: var(--surface); stroke: var(--cyan); stroke-width: 2; }
.mkt-chart-dot.is-selected { fill: var(--navy); stroke: var(--navy); }
.mkt-chart-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
/* Les montants restent en or, comme partout ailleurs dans le portail. */
.mkt-chart--amount .mkt-chart-area { fill: var(--gold-soft); }
.mkt-chart--amount .mkt-chart-line,
.mkt-chart--amount .mkt-chart-dot { stroke: var(--gold-strong); }
.mkt-chart--amount .mkt-chart-dot.is-selected { fill: var(--navy); stroke: var(--navy); }
.mkt-ca-header { margin-bottom: 16px; }
.mkt-ca-header h3 { margin: 10px 0 0; }
.mkt-month-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.mkt-month-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 12px 13px;
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.mkt-month-card:hover { border-color: var(--cyan); background: var(--cyan-soft); }
.mkt-month-card.is-selected { border-color: var(--navy); background: var(--navy); }
.mkt-month-card.is-selected .mkt-month-label { color: rgba(255, 255, 255, .6); }
.mkt-month-card.is-selected .mkt-month-value { color: var(--gold); }
.mkt-month-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-light); }
.mkt-month-value { font-size: 17px; font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mkt-center-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mkt-center-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 15px 16px;
}
.mkt-center-name { font-weight: 650; font-size: 14px; }
.mkt-center-code { color: var(--muted-light); font-weight: 500; font-size: 12px; }
.mkt-center-value { font-size: 26px; font-family: var(--font-display); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.mkt-center-sub { font-size: 12px; color: var(--muted); }

/* Marketing — top 10 agences */
.mkt-top-list { list-style: none; display: grid; gap: 4px; margin: 0; padding: 0; }
.mkt-top-row {
  display: grid;
  grid-template-columns: 28px minmax(120px, 1.4fr) minmax(60px, 2fr) auto auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 10px 2px;
}
.mkt-top-row:last-child { border-bottom: none; }
.mkt-top-ident { min-width: 0; }
.mkt-top-code { display: block; font-size: 14px; font-weight: 700; }
.mkt-top-name { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-top-bar { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.mkt-top-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--purple); }
.mkt-top-amount { font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--gold-ink); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.mkt-top-orders { font-size: 12px; color: var(--muted); white-space: nowrap; text-align: right; min-width: 52px; }
/* Un classement en quantités : l'or est réservé aux montants. */
.mkt-top-list--count .mkt-top-amount { color: var(--text); }
.mkt-top-list--count .mkt-top-bar-fill { background: var(--cyan); }

.internal-ranking-panel { margin-top: 16px; }
.internal-ranking-list { display: grid; gap: 10px; }
.internal-ranking-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  padding: 13px 15px;
}
.internal-ranking-row strong { display: block; }
.internal-ranking-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.internal-ranking-row b { font-size: 22px; color: var(--navy); font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.internal-card-list { display: grid; gap: 14px; margin-bottom: 16px; }
.internal-order-card { display: grid; gap: 16px; }
.internal-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.internal-card-header h3 { margin-top: 10px; }
.internal-meta-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.internal-meta-list div { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface-2); padding: 11px; }
.internal-meta-list dt { color: var(--muted-light); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.internal-meta-list dd { margin: 4px 0 0; color: var(--text); font-weight: 650; }

/* ==========================================================================
   ADMIN CLIENT — utilisateurs
   ========================================================================== */

.ca-topbar { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ca-topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.ca-search-wrap { position: relative; }
.ca-search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted-light); }
.ca-search-input {
  padding: 9px 13px 9px 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 13px;
  width: 220px;
  outline: none;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.ca-search-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.ca-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.ca-new-btn:hover { background: var(--navy-3); box-shadow: none; }
.ca-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all .15s;
  flex-shrink: 0;
}
.ca-icon-btn:hover { border-color: var(--cyan); color: var(--cyan-ink); background: var(--cyan-soft); }

.ca-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ca-stat { flex: 1; min-width: 120px; display: flex; flex-direction: column; padding: 18px 20px; }
.ca-stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-light); margin-bottom: 8px; }
.ca-stat-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }

.ca-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.ca-table-head {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1.8fr 100px;
  padding: 12px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.ca-table-head span { font-size: 11px; font-weight: 700; color: var(--muted-light); letter-spacing: .05em; text-transform: uppercase; }
.ca-table-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1.8fr 100px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background .12s;
}
.ca-table-row:last-child { border-bottom: none; }
.ca-table-row:hover { background: var(--surface-2); }
.ca-empty { padding: 40px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ca-empty p { margin: 0; }

.ca-user-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ca-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.ca-avatar--requester { background: var(--cyan-soft); color: var(--cyan-ink); }
.ca-avatar--approver { background: var(--purple-soft); color: var(--purple-ink); }
.ca-avatar--client_admin { background: var(--gold-soft); color: var(--gold-ink); }
.ca-user-info { min-width: 0; }
.ca-user-info strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-user-email { display: block; font-size: 12px; color: var(--muted-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Signale un compte qui n'a pas encore terminé son enrôlement au second facteur. */
.ca-mfa-flag { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 700; color: var(--coral-ink); }
.ca-modal-note { margin: 0 0 18px; color: var(--text-soft); font-size: 13.5px; line-height: 1.55; }

.ca-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ca-pill--requester { background: var(--cyan-soft); color: var(--cyan-ink); }
.ca-pill--approver { background: var(--purple-soft); color: var(--purple-ink); }
.ca-pill--client_admin { background: var(--gold-soft); color: var(--gold-ink); }
.ca-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ca-dot--requester { background: var(--cyan); }
.ca-dot--approver { background: var(--purple); }
.ca-dot--client_admin { background: var(--gold); }
.ca-cell-muted { font-size: 13px; color: var(--text-soft); }

.ca-actions-cell { display: flex; align-items: center; justify-content: center; }
.ca-action-group { display: flex; gap: 6px; }
.ca-action-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all .15s;
  flex-shrink: 0;
}
.ca-action-btn--edit:hover { border-color: var(--cyan); color: var(--cyan-ink); background: var(--cyan-soft); }
.ca-action-btn--mfa:hover:enabled { border-color: var(--gold); color: var(--gold-ink); background: var(--gold-soft); }
.ca-action-btn--mfa:disabled { opacity: .35; cursor: default; }
.ca-action-btn--suspend:hover { border-color: var(--coral); color: var(--coral-ink); background: var(--coral-soft); }
.ca-action-btn--activate:hover { border-color: var(--cyan); color: var(--cyan-ink); background: var(--cyan-soft); }
/* Confirmation d'une bascule d'accès : deux icônes, à la place des boutons d'action
   (la cellule ne fait que 100px — un libellé « Confirmer » y déborderait). */
.ca-toggle-confirm { display: flex; align-items: center; justify-content: center; gap: 6px; }
.ca-toggle-cancel { border-color: var(--coral); color: var(--coral-ink); background: var(--coral-soft); }
.ca-toggle-cancel:hover { border-color: var(--coral); color: #fff; background: var(--coral); }
.ca-toggle-ok { border-color: var(--green); color: var(--green-ink); background: var(--green-soft); }
.ca-toggle-ok:hover { border-color: var(--green); color: #fff; background: var(--green); box-shadow: none; }

.ca-filter { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.ca-filter-btn {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.ca-filter-btn:first-child { border-left: none; }
.ca-filter-btn:hover { background: var(--surface-2); color: var(--text); }
.ca-filter-btn.is-on { background: var(--navy); color: #fff; }

/* Compte désactivé : toute la ligne passe en grisé */
.ca-table-row--suspended .ca-user-cell,
.ca-table-row--suspended .ca-pill,
.ca-table-row--suspended .ca-cell-muted { opacity: .5; }
.ca-table-row--suspended .ca-user-info strong,
.ca-table-row--suspended .ca-user-email { color: var(--muted); }

.ca-modal-overlay { position: fixed; inset: 0; background: rgba(0, 20, 46, .5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ca-modal-box {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 30px 32px;
  width: 520px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 20, 46, .25);
}
.ca-modal-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.ca-modal-title { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.02em; margin: 0; font-family: var(--font-display); }
.ca-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.ca-modal-close:hover { background: var(--border); }
.ca-modal-error { background: var(--coral-soft); border: 1px solid rgba(238, 117, 113, .4); border-radius: 8px; padding: 10px 14px; color: var(--coral-ink); font-size: 13px; margin-bottom: 16px; }
.ca-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.ca-modal-full { margin-bottom: 14px; }
.ca-mlabel { display: block; font-size: 13px; font-weight: 700; color: var(--text-soft); margin-bottom: 6px; }
.ca-mlabel-hint { font-weight: 400; color: var(--muted-light); font-size: 12px; }
.ca-role-locked { display: block; margin-top: 6px; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.ca-minput {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 14px;
  outline: none;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.ca-minput:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
.ca-minput--err { border-color: var(--coral-ink); }
.ca-role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ca-role-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  transition: all .15s;
}
.ca-pwd-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all .15s;
  flex-shrink: 0;
}
.ca-pwd-btn:hover { border-color: var(--cyan); color: var(--cyan-ink); background: var(--cyan-soft); }
.ca-modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.ca-cancel-btn {
  padding: 11px 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-soft);
  transition: border-color .15s;
}
.ca-cancel-btn:hover { border-color: var(--text); }
.ca-save-btn {
  padding: 11px 20px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.ca-save-btn:hover { background: var(--navy-3); box-shadow: none; }

/* ==========================================================================
   ACCUEIL (my space)
   ========================================================================== */

.myspace-hero {
  position: relative;
  overflow: hidden;
  min-height: clamp(340px, 28vw, 640px);
  background: var(--navy);
  display: flex;
  align-items: stretch;
}
.myspace-hero::before {
  content: "";
  position: absolute;
  left: 44%;
  top: -46%;
  width: 58%;
  height: 200%;
  border-radius: 50%;
  background: var(--gold);
}
.myspace-hero::after {
  content: "";
  position: absolute;
  left: 38%;
  top: -46%;
  width: 58%;
  height: 200%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .25);
}
.myspace-hero--img { background-size: cover; background-position: center; background-repeat: no-repeat; }
.myspace-hero--img::before, .myspace-hero--img::after { display: none; }
.myspace-hero--img .myspace-hero-visual { display: none; }
.myspace-hero-body { position: relative; z-index: 2; display: flex; width: 100%; align-items: center; }
.myspace-hero-left {
  max-width: 560px;
  padding: 64px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.myspace-hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 800;
  color: #fff;
  line-height: 1.08;
  letter-spacing: -.02em;
  margin: 0 0 16px;
}
.myspace-hero-title em { font-style: normal; color: var(--gold); }
.myspace-hero-sub {
  font-size: 15px;
  color: rgba(255, 255, 255, .75);
  line-height: 1.6;
  margin: 0 0 30px;
  max-width: 380px;
}
.myspace-hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.myspace-btn-primary {
  background: var(--cta-bg, var(--gold));
  color: var(--cta-fg, var(--navy));
  border: none;
  border-radius: var(--r-sm);
  padding: 14px 26px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1.15;
  transition: background .15s, color .15s, transform .08s;
}
.myspace-btn-primary:hover { background: var(--cta-fg, var(--navy)); color: var(--cta-bg, var(--gold)); }
.myspace-btn-primary:active { transform: translateY(1px); }
.myspace-btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .8);
  border-radius: var(--r-sm);
  padding: 13px 22px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: border-color .15s, background .15s, color .15s;
}
.myspace-btn-outline:hover { border-color: #fff; background: #fff; color: var(--navy); }
.myspace-hero-visual { flex: 1; display: flex; align-items: center; justify-content: flex-end; padding: 40px 54px 40px 0; }
.myspace-vis-grid { display: flex; flex-wrap: wrap; gap: 14px; max-width: 360px; justify-content: flex-end; }
.myspace-vis-card {
  background: rgba(255, 255, 255, .3);
  border: 1px solid rgba(255, 255, 255, .5);
  backdrop-filter: blur(3px);
  border-radius: var(--r);
  width: 148px;
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 20, 46, .55);
}
.myspace-vis-card:nth-child(2) { height: 122px; }
.myspace-vis-card:nth-child(4) { height: 114px; }

.myspace-infobar {
  background: var(--cyan);
  padding: 13px 60px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.myspace-infobar--scrolling {
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
  padding-left: 0;
  padding-right: 0;
}
.myspace-infobar--scrolling span { display: inline-block; animation: infobar-scroll 25s linear infinite; }
@keyframes infobar-scroll {
  0% { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

.myspace-catalog-section { background: var(--surface); padding: 56px 60px; }
.myspace-section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -.01em;
  margin: 0 0 8px;
  color: var(--text);
}
.myspace-section-sub {
  text-align: center;
  margin: 0 auto 34px;
  max-width: 480px;
  font-size: 14px;
}
.myspace-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 980px;
  margin: 0 auto;
}
.myspace-cat-card {
  position: relative;
  border: 1px solid var(--cat-color, var(--border));
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  /* Couleur de catégorie visible en permanence (anneau coloré au repos) */
  box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--cat-color, var(--purple)) 22%, transparent);
  transition: transform .15s, box-shadow .2s, border-color .15s;
  display: block;
}
.myspace-cat-card:hover {
  transform: translateY(-4px);
  border-color: var(--cat-color, var(--border-strong));
  /* Survol : on accentue en halo lumineux */
  box-shadow:
    var(--shadow-lift),
    0 0 0 4px color-mix(in srgb, var(--cat-color, var(--purple)) 45%, transparent),
    0 0 28px 4px color-mix(in srgb, var(--cat-color, var(--purple)) 38%, transparent);
}
.myspace-cat-visual {
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted-light);
  font-size: 12px;
  font-weight: 500;
  background:
    radial-gradient(circle at 30% 25%, rgba(51, 181, 197, .08), transparent 55%),
    radial-gradient(circle at 75% 80%, rgba(150, 126, 183, .09), transparent 55%),
    var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.myspace-cat-visual img { width: 100%; height: 100%; object-fit: cover; }
.myspace-cat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  font-family: var(--font-display);
  letter-spacing: -.01em;
  transition: background .18s, color .18s;
}
.myspace-cat-label::after {
  content: "→";
  color: var(--gold-strong);
  font-family: var(--font-body);
  transition: transform .15s, color .18s;
}
.myspace-cat-card:hover .myspace-cat-label {
  background: var(--cat-color, var(--purple));
  color: #fff;
}
.myspace-cat-card:hover .myspace-cat-label::after {
  color: #fff;
  transform: translateX(4px) scale(1.5);
}

.myspace-inner-section { padding: 40px 60px; max-width: 1200px; margin: 0 auto; }

.myspace-footer { background: var(--navy); color: rgba(255, 255, 255, .75); padding: 48px 60px 40px; margin-top: auto; }
.myspace-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 40px; }
.myspace-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
  font-family: var(--font-display);
}
.myspace-footer-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}
.myspace-footer-copy { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .45); }
.myspace-footer-heading {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.myspace-footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.myspace-footer-links li { font-size: 13.5px; color: rgba(255, 255, 255, .75); }
.myspace-footer-links li:hover { color: #fff; }
.myspace-footer a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.myspace-footer-contact { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .75); line-height: 1.8; }

/* ==========================================================================
   TOAST
   ========================================================================== */

.fav-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 9999;
  white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 20, 46, .3);
}
.fav-toast--show { opacity: 1; transform: translateX(-50%) translateY(0); }

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

@media (max-width: 900px) {
  .portal-public { grid-template-columns: 1fr; }
  .public-hero { min-height: auto; padding: 34px 28px; }
  .hero-map-wrap { width: min(100%, 460px, 44vh); }
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-link.is-active::before { display: none; }
  .sidebar-user { display: none; }
  .app-header { position: static; padding: 14px 20px; }
  .app-main { padding: 22px 16px 90px; }
  .panel { padding: 20px; }
  .page-band { flex-direction: column; align-items: flex-start; }
  .page-band-stat { align-self: stretch; }
  .catalog-filters { grid-template-columns: 1fr; }
  .catalog-filters--2col .search-field,
  .catalog-filters--2col .filter-field,
  .catalog-filters--2col .filter-actions { flex: 1 1 100%; }
  .express-bar { left: 0; padding: 0 16px 14px; }
  .express-bar-inner { width: 100%; justify-content: space-between; gap: 12px; padding-left: 18px; }
  .myspace-hero-body { flex-direction: column; }
  .myspace-hero-left { padding: 42px 28px; max-width: 100%; }
  .myspace-hero-visual { display: none; }
  .myspace-infobar { padding: 12px 20px; }
  .myspace-catalog-section { padding: 36px 20px; }
  .myspace-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .myspace-inner-section { padding: 28px 20px; }
  .myspace-footer { padding: 36px 20px 28px; }
  .myspace-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cart-layout, .approval-detail-layout { grid-template-columns: 1fr; }
  .cart-submit-panel, .approval-decision-panel { position: static; }
  .cart-line-main, .approval-line-card, .internal-export-panel { display: grid; }
  .internal-meta-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quantity-form { min-width: 0; }
  .db-kpi-grid, .mkt-ca-grid { grid-template-columns: repeat(2, 1fr); }
  .mkt-month-grid { grid-template-columns: repeat(4, 1fr); }
  .db-row { grid-template-columns: 1fr; }
  .orders-list-head { display: none; }
  .orders-list-row, .orders-list--approver, .orders-list--history, .orders-list--adv, .orders-list--requester {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 6px;
    padding: 14px 16px;
  }
}

@media (max-width: 620px) {
  .public-content { padding: 24px 16px; }
  .grid { grid-template-columns: 1fr; }
  .filters, .internal-filter-form, .internal-export-form { flex-direction: column; align-items: stretch; }
  .filters input, .filters select, .filters button,
  .internal-filter-form .filter-field, .internal-filter-form button, .internal-filter-form a,
  .internal-export-form .filter-field, .internal-export-form button { width: 100%; }
  .internal-meta-list { grid-template-columns: 1fr; }
  .myspace-cat-grid { grid-template-columns: 1fr; }
  .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .db-kpi-grid, .mkt-ca-grid { grid-template-columns: 1fr; }
  .mkt-month-grid { grid-template-columns: repeat(2, 1fr); }
  /* La barre de proportion saute en premier : le montant prime sur l'échelle. */
  .mkt-top-row { grid-template-columns: 24px 1fr auto; }
  .mkt-top-bar { display: none; }
  .mkt-top-orders { grid-column: 2 / -1; text-align: left; }
  .express-total { display: none; }
}

/* ==========================================================================
   JOURNAL D'ACTIONS
   ========================================================================== */

.audit-panel { padding: 8px 20px; }
.audit-list { list-style: none; display: grid; margin: 0; padding: 0; }
.audit-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(0, 210px);
  align-items: start;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  padding: 13px 2px;
}
.audit-row:last-child { border-bottom: none; }
.audit-when { display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.audit-when strong { font-size: 13px; font-weight: 700; }
.audit-when span { font-size: 12px; color: var(--muted); }
.audit-main { display: grid; gap: 5px; min-width: 0; }
.audit-action {
  justify-self: start;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--surface-2);
  color: var(--muted);
}
/* Les seules actions qu'on veut repérer d'un coup d'œil dans une longue liste. */
.audit-action--login_failed { background: var(--coral-soft); color: var(--coral-ink); }
.audit-action--order_approved { background: var(--green-soft); color: var(--green-ink); }
.audit-action--order_rejected { background: var(--coral-soft); color: var(--coral-ink); }
.audit-action--user_created,
.audit-action--user_deactivated,
.audit-action--user_activated,
.audit-action--password_changed { background: var(--purple-soft); color: var(--purple-ink); }
.audit-summary { font-size: 14px; }
.audit-details { font-size: 12.5px; color: var(--muted); }
.audit-details summary { cursor: pointer; color: var(--cyan-ink); font-weight: 600; }
.audit-details dl {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  gap: 2px 12px;
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.audit-details dt { font-weight: 600; color: var(--text-soft); }
.audit-details dd { margin: 0; overflow-wrap: anywhere; }
.audit-who { display: grid; gap: 2px; text-align: right; font-size: 12.5px; min-width: 0; }
.audit-who strong { font-size: 13.5px; overflow-wrap: anywhere; }
.audit-who span { color: var(--muted); }
.audit-ip { font-variant-numeric: tabular-nums; color: var(--muted-light) !important; }
.audit-pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.audit-export { margin-left: auto; }

@media (max-width: 980px) {
  .audit-row { grid-template-columns: 1fr; gap: 8px; }
  .audit-who { text-align: left; }
}

/* Confidentialité, cookies et footer global. */
.legal-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; padding: 18px 24px; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 12.5px; text-align: center; }
.legal-footer a { color: var(--navy); font-weight: 650; text-underline-offset: 3px; }
.privacy-page { min-height: 100vh; background: var(--bg); }
.privacy-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px max(24px, calc((100vw - 1120px) / 2)); border-bottom: 1px solid var(--border); background: var(--surface); color: var(--navy); }
.privacy-header img { display: block; width: auto; height: 48px; }
.privacy-header a { color: inherit; font-weight: 650; text-underline-offset: 3px; }
.privacy-main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 46px 0 64px; }
.privacy-intro { padding: clamp(24px, 4vw, 44px); border-radius: var(--r-lg); background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.privacy-intro h1 { margin: 0 0 12px; font-size: clamp(29px, 4vw, 43px); line-height: 1.08; }
.privacy-intro p { max-width: 820px; margin: 0; color: rgba(255, 255, 255, .82); }
.privacy-updated { display: block; margin-top: 18px; color: rgba(255, 255, 255, .65); font-size: 12.5px; }
.privacy-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; margin-top: 28px; align-items: start; }
.privacy-content { display: grid; gap: 22px; min-width: 0; }
.privacy-section { padding: clamp(22px, 3vw, 34px); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); }
.privacy-section h2 { margin-top: 0; }
.privacy-section h3 { margin-top: 26px; }
.legal-details { display: grid; gap: 0; margin: 0; }
.legal-details > div { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.legal-details > div:last-child { border-bottom: 0; }
.legal-details dt { color: var(--muted); font-weight: 700; }
.legal-details dd { margin: 0; color: var(--text-soft); }
.privacy-toc { position: sticky; top: 20px; padding: 20px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.privacy-toc strong { display: block; margin-bottom: 10px; }
.privacy-toc a { display: block; padding: 5px 0; color: var(--muted); text-decoration: none; font-size: 13px; }
.privacy-toc a:hover { color: var(--navy); text-decoration: underline; }
.privacy-table-wrap { overflow-x: auto; margin-top: 16px; }
.privacy-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.privacy-table th, .privacy-table td { padding: 12px 13px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.privacy-table th { background: var(--surface-2); color: var(--navy); }
.privacy-table td { color: var(--text-soft); }
.privacy-badge { display: inline-block; padding: 3px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); font-size: 11.5px; font-weight: 750; white-space: nowrap; }
.privacy-note { padding: 14px 16px; border-left: 4px solid var(--cyan); background: var(--cyan-soft); color: var(--text-soft); }
@media (max-width: 800px) { .privacy-layout { grid-template-columns: 1fr; } .privacy-toc { position: static; order: -1; } .privacy-header { padding: 14px 18px; } }
@media (max-width: 620px) { .privacy-main { padding-top: 24px; } .legal-details > div { grid-template-columns: 1fr; gap: 4px; } }
.terms-highlight {
  padding: 14px 16px;
  border-left: 4px solid var(--cyan);
  background: var(--surface-2);
  color: var(--navy);
  font-weight: 650;
}
.terms-list { padding-left: 22px; }
.terms-list li + li { margin-top: 8px; }
.contact-main { width: min(860px, calc(100% - 32px)); }
.contact-card, .contact-confirmation { margin-top: 28px; }
.contact-required-note { margin-top: -2px; font-size: 13px; }
.contact-form { display: grid; gap: 18px; margin-top: 24px; }
.contact-field { display: grid; gap: 7px; }
.contact-field label { color: var(--navy); font-weight: 700; }
.contact-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
}
textarea.contact-input { min-height: 150px; resize: vertical; }
.contact-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); outline: 0; }
.contact-field--error .contact-input { border-color: var(--coral-ink); }
.contact-field-errors { color: var(--coral-ink); font-size: 13px; }
.contact-field-errors p, .contact-alert p { margin: 0; color: inherit; }
.contact-alert { margin: 18px 0; padding: 12px 14px; border-radius: var(--r-sm); }
.contact-alert--error { border-left: 4px solid var(--coral-ink); background: var(--coral-soft); color: var(--coral-ink); }
.contact-honeypot { position: fixed; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-submit { justify-self: start; }
.contact-privacy-note { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; }
.contact-privacy-note a { color: var(--navy); font-weight: 700; text-underline-offset: 3px; }
.contact-confirmation h2 { color: var(--green-ink); }
.contact-confirmation .button-secondary { margin-top: 8px; }

@media print {
  @page { margin: 16mm; }
  body, .privacy-page { background: #fff !important; color: #000 !important; }
  .privacy-header, .privacy-toc, .legal-footer { display: none !important; }
  .privacy-main { width: 100%; margin: 0; padding: 0; }
  .privacy-intro {
    padding: 0 0 14px;
    border-bottom: 2px solid #000;
    border-radius: 0;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none;
  }
  .privacy-intro h1 { font-size: 25pt; }
  .privacy-intro p, .privacy-updated { color: #000 !important; }
  .privacy-layout { display: block; margin-top: 16px; }
  .privacy-content { display: block; }
  .privacy-section {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    background: #fff !important;
    box-shadow: none;
    break-inside: avoid-page;
  }
  .privacy-section h2 { margin: 18px 0 6px; font-size: 14pt; break-after: avoid; }
  .privacy-section p, .privacy-section li { color: #000 !important; }
  .terms-highlight { padding: 8px 10px; border-color: #000; background: #fff !important; }
  .privacy-section a { color: #000 !important; text-decoration: underline; }
}

/* ==========================================================================
   AUTHENTIFICATION À DEUX FACTEURS
   Parcours de connexion (public) et page Sécurité (dans la coquille applicative).
   ========================================================================== */

.auth-card {
  width: min(100%, 460px);
  margin: 0 auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.auth-card--wide { width: min(100%, 620px); }
.auth-card h2 { margin: 10px 0 0; font-size: 24px; }
.auth-lead { margin: 10px 0 20px; color: var(--text-soft); line-height: 1.55; }
.auth-form { display: grid; gap: 16px; margin-top: 18px; }
.auth-submit { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.auth-alt { margin: 18px 0 0; font-size: 14px; color: var(--text-soft); }
.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.45;
  cursor: pointer;
}
.auth-check input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--cyan); flex: none; }

/* Étapes de l'enrôlement */
.auth-steps { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 26px; }
.auth-steps > li::marker { color: var(--gold-strong); font-weight: 700; }
.auth-steps h3 { margin: 0 0 10px; font-size: 15px; }

.mfa-qr {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  width: fit-content;
  max-width: 100%;
}
/* Le SVG produit par qrcode porte sa taille en millimètres : on la reprend. */
.mfa-qr svg { display: block; width: 208px; height: 208px; max-width: 100%; }

.mfa-manual { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 12px 0 0; font-size: 14px; }
.mfa-manual dt { color: var(--muted); font-weight: 700; }
.mfa-manual dd { margin: 0; color: var(--text); }
.mfa-key {
  display: inline-block;
  padding: 5px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 14px;
  letter-spacing: 1.4px;
  word-break: break-all;
}

/* Codes de récupération */
.mfa-codes {
  list-style: none;
  margin: 18px 0;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.mfa-codes code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
  letter-spacing: 1.2px;
  color: var(--text);
}

/* Page Sécurité */
.mfa-settings { display: grid; gap: 18px; max-width: 760px; }
.mfa-settings-head h2 { margin: 0; font-size: 22px; }
.mfa-settings-head p { margin: 6px 0 0; color: var(--muted); }
.mfa-panel h3 { margin: 0 0 6px; font-size: 16px; }
.mfa-panel-lead { margin: 10px 0 14px; color: var(--text-soft); font-size: 14px; line-height: 1.55; }
.mfa-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; font-size: 14px; }
.mfa-facts dt { color: var(--muted); font-weight: 700; }
.mfa-facts dd { margin: 0; }
.mfa-inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.mfa-inline-form button { white-space: nowrap; }
.mfa-panel-actions { margin-top: 14px; }

.mfa-browsers { list-style: none; margin: 0 0 4px; padding: 0; border-top: 1px solid var(--border); }
.mfa-browsers li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.mfa-browsers > li > div { display: grid; gap: 3px; min-width: 0; }
.mfa-browser-name { font-weight: 700; font-size: 14px; }
.mfa-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--cyan-ink);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}

@media (max-width: 720px) {
  .auth-card { padding: 24px 20px; }
  .mfa-inline-form { grid-template-columns: 1fr; }
  .mfa-browsers li { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media print {
  /* Impression des codes de récupération : la page tient sur une feuille. */
  .auth-actions, .auth-alt { display: none !important; }
  .auth-card { border: 0; box-shadow: none; padding: 0; width: 100%; }
}

/* Page « Sécurité des comptes » (admin IT) */
.mfa-admin { display: grid; gap: 18px; max-width: 900px; }
.mfa-admin-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.mfa-admin-search { display: flex; gap: 10px; align-items: center; }
.mfa-admin-search input[type="search"] {
  min-width: 260px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
}
.mfa-admin-search input[type="search"]:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); outline: none; }
.mfa-admin-list { list-style: none; margin: 0; padding: 0; }
.mfa-admin-list > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.mfa-admin-state { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.mfa-admin-action { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.mfa-admin-empty { display: block !important; padding: 18px 0 !important; border-bottom: 0 !important; }
.mfa-admin-list > li:last-child { border-bottom: 0; }
.mfa-admin-user { display: grid; gap: 3px; min-width: 0; }
.mfa-badge--off { background: var(--coral-soft); color: var(--coral-ink); }
.mfa-admin-pages { display: flex; gap: 12px; align-items: center; justify-content: center; }

@media (max-width: 900px) {
  .mfa-admin-list > li { grid-template-columns: 1fr; }
  .mfa-admin-action { justify-content: flex-start; }
  .mfa-admin-toolbar { flex-direction: column; align-items: stretch; }
  .mfa-admin-search { flex-direction: column; align-items: stretch; }
  .mfa-admin-search input[type="search"] { min-width: 0; }
}

/* Accueil d'un compte interne sans rôle métier : les écrans d'administration
   plutôt qu'un « aucun rôle » qui n'aide personne. */
.internal-home { max-width: 820px; margin: 0 auto; padding: 8px 0 24px; }
.internal-home h2 { margin: 0 0 6px; font-size: 22px; }
.internal-home > p { margin: 0 0 22px; color: var(--muted); }
.internal-home-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.internal-home-card {
  display: grid;
  gap: 7px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, transform .08s, box-shadow .15s;
}
.internal-home-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.internal-home-card svg { color: var(--gold-strong); }
.internal-home-title { font-weight: 700; font-size: 15px; }
.internal-home-desc { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
