/* Lynxnet : feuille de style unique, d'après la charte Lynx Custom. */

:root {
  /* Couleurs officielles et dérivées */
  --bg: #202219;
  --deep: #191b13;
  --raise: #282a20;
  --raise-2: #313427;
  --secondary: #46493C;
  --line: #34372b;
  --line-2: #5b5e4e;
  --text: #F6EDDD;
  --thread: #DDD7CE;
  --muted: #b0ae9e;
  --danger: #f0a58b;

  /* Couleurs des étapes */
  --step-nouvelle: #F6EDDD;
  --step-devis: #9DB3C8;
  --step-maquette: #D8B46A;
  --step-prototype: #D39A7A;
  --step-payee: #A3BC8C;
  --step-production: #BCA9D2;
  --step-expediee: #9A9E8B;
  --step-livree: #8DBDB4;

  --display: 'Big Shoulders', 'Big Shoulders Display', 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --radius: 12px;
  --radius-lg: 16px;
  --sidebar: 256px;
  --gutter: clamp(16px, 4vw, 44px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* Texture sergé, très discrète, comme sur le formulaire */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(135deg, rgba(246, 237, 221, .022) 0 1px, transparent 1px 5px);
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Écusson du logo : bordure brodée, tissu sergé, surpiqûre ---------- */
.badge {
  --s: 56px;
  width: var(--s);
  height: var(--s);
  flex: none;
  display: block;
  border-radius: 50%;
  padding: calc(var(--s) * .075);
  background: repeating-conic-gradient(from 4deg, #5c5f50 0deg 2.2deg, #3a3d31 2.2deg 4.5deg);
  box-shadow: 0 0 0 1px #15170f, 0 12px 28px -16px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .05);
}
.badge--sm { --s: 38px; }
.badge--lg { --s: 108px; }
.badge__cloth {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .035) 0 1.5px, transparent 1.5px 3.5px),
    radial-gradient(circle at 35% 30%, #34372b, #25271e 70%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45);
}
.badge__cloth::after {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 1.5px dashed rgba(246, 237, 221, .32);
}
.badge--sm .badge__cloth::after { border-width: 1px; }
.badge__cloth img { width: 54%; height: auto; }

/* ---------- Boutons et champs ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--thread); }
.btn--primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn--primary:hover { background: var(--thread); border-color: var(--thread); }
.btn--block { width: 100%; }

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover { color: var(--text); }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field__label { font-weight: 600; font-size: 15px; }
.input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--deep);
  font-size: 16px; /* 16px minimum : évite le zoom automatique sur iPhone */
}
.input:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(246, 237, 221, .12); }

.alert {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px dashed var(--danger);
  color: var(--danger);
  background: rgba(240, 165, 139, .06);
  font-size: 15px;
}

/* ---------- Page de connexion ---------- */
.auth {
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.auth__card {
  width: 100%;
  max-width: 420px;
  padding: clamp(28px, 6vw, 44px);
  border-radius: var(--radius-lg);
  background: var(--raise);
  border: 1px solid var(--line);
  position: relative;
}
/* Surpiqûre intérieure, comme la couture d'un écusson */
.auth__card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 10px;
  border: 1px dashed rgba(246, 237, 221, .14);
  pointer-events: none;
}
.auth__card--center { display: grid; justify-items: center; gap: 14px; text-align: center; }
.auth__card--center .btn { margin-top: 12px; }
.auth__head { display: grid; justify-items: center; text-align: center; margin-bottom: 28px; }
.auth__head .badge { margin-bottom: 18px; }
.auth__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 52px;
  line-height: .95;
}
.auth__sub { margin-top: 6px; color: var(--muted); }
.auth .form { position: relative; z-index: 1; }
.auth .btn--primary { margin-top: 6px; }

/* ---------- Tableau de bord : structure ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 16px 20px;
  border-right: 1px solid var(--line);
  background: var(--bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand--full { padding: 0 8px 30px; }
.brand__name {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
}
.brand__tag { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }

.nav { display: grid; gap: 6px; }
.nav__link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav__link:hover { color: var(--text); background: var(--raise); }
.nav__link.is-active { color: var(--text); background: var(--raise-2); font-weight: 600; }

.me {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 8px 0;
  border-top: 1px dashed var(--line-2);
}
.me__avatar {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--secondary);
  font-weight: 600;
  font-size: 15px;
}
.me__name { display: block; font-weight: 600; }
.me form { margin: 0; }

.main {
  padding: clamp(24px, 4vw, 44px) var(--gutter) 64px;
  min-width: 0;
}

.topbar { display: none; }

/* ---------- Contenu des pages ---------- */
.page-head { margin-bottom: 28px; }
.page-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(42px, 5vw, 60px);
  line-height: .95;
}
.page-sub { margin-top: 8px; color: var(--muted); }

.empty {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
  padding: clamp(40px, 8vw, 72px) 24px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--line-2);
  background: rgba(40, 42, 32, .5);
}
.empty__title { font-family: var(--display); font-weight: 800; font-size: 28px; }
.empty__text { color: var(--muted); max-width: 44ch; }

/* ---------- Éléments communs ---------- */
.muted { color: var(--muted); }
.num { font-family: var(--display); font-weight: 800; font-size: 1.35em; line-height: 1; }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  background: var(--raise-2);
  color: var(--thread);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.tag--muted { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--text); }
.back .icon { width: 18px; height: 18px; }

.card {
  padding: clamp(20px, 3vw, 30px);
  border-radius: var(--radius-lg);
  background: var(--raise);
  border: 1px solid var(--line);
}
.card__kicker { color: var(--muted); font-size: 14px; }
.card__title { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1.05; }
.card__note { margin-top: 18px; color: var(--muted); font-size: 14px; }
.card__text { margin: 12px 0 18px; color: var(--thread); max-width: 70ch; }
.settings { display: grid; gap: 20px; max-width: 820px; }
.settings__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.files.files--list { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }

.kv { margin: 16px 0 0; display: grid; gap: 10px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; }

/* ---------- Catalogue : liste ---------- */
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pcard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  background: var(--raise);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.pcard:hover { border-color: var(--line-2); background: #2c2e23; }
.pcard.is-hidden { opacity: .65; }
.pcard__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--deep);
  border: 1px dashed var(--line-2);
  color: var(--thread);
}
.pcard__icon .picon { width: 32px; height: 32px; }
.pcard__icon--lg { width: 76px; height: 76px; }
.pcard__icon--lg .picon { width: 44px; height: 44px; }
.pcard__body { display: grid; gap: 2px; min-width: 0; }
.pcard__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.1;
}
.pcard__tagline { color: var(--muted); }
.pcard__meta { display: grid; gap: 2px; justify-items: end; text-align: right; color: var(--muted); font-size: 14px; }
.pcard__meta strong { color: var(--text); }

/* ---------- Catalogue : fiche produit ---------- */
.page-head--product { display: flex; align-items: center; gap: 20px; }

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.product-grid__main { display: grid; gap: 20px; }
.product-grid__side { grid-column: 2; grid-row: 1; position: sticky; top: 24px; }

.fields { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.fblock {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--deep);
  border: 1px dashed var(--line-2);
}
.fblock__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.fblock__label { font-weight: 600; font-size: 17px; }
.fblock__type { color: var(--muted); font-size: 14px; }
.fblock__type .is-required { color: var(--thread); }
.fblock__when, .opt__when {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--step-maquette);
  font-size: 14px;
}
.fblock__when .icon, .opt__when .icon { width: 17px; height: 17px; margin-top: 2px; }
.fblock__info {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--raise);
  border-left: 3px solid var(--line-2);
}
.fblock__line { display: flex; gap: 12px; font-size: 15px; }
.fblock__line .k { flex: none; width: 118px; color: var(--muted); }
.fblock__line--soft { color: var(--muted); }
.fblock__note { color: var(--muted); font-size: 14px; font-style: italic; }

.opts { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.opt {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: 2px 16px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--raise);
}
.opt__value { font-weight: 500; }
.opt__hint { color: var(--muted); font-size: 15px; }
.opt__when { grid-column: 1 / -1; }

/* ---------- Actions et états ---------- */
form.inline { display: inline-flex; margin: 0; }
.btn .icon { width: 18px; height: 18px; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 15px; }
.btn--danger { color: var(--danger); border-color: rgba(240, 165, 139, .45); }
.btn--danger:hover { border-color: var(--danger); background: rgba(240, 165, 139, .08); }
.btn--dashed { border-style: dashed; color: var(--thread); justify-self: start; }
.btn--dashed:hover { background: rgba(246, 237, 221, .04); }

.tools { display: flex; align-items: center; gap: 4px; flex: none; }
.iconbtn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.iconbtn .icon { width: 18px; height: 18px; }
.iconbtn:hover { color: var(--text); border-color: var(--line-2); background: var(--raise-2); }
.iconbtn--danger:hover { color: var(--danger); border-color: rgba(240, 165, 139, .45); }
.iconbtn.is-off { visibility: hidden; }

.tag--pref { min-height: 20px; margin-left: 6px; padding: 0 8px; font-size: 12px; background: rgba(163, 188, 140, .14); color: var(--step-payee); }
.tag--draft { background: rgba(216, 180, 106, .14); color: var(--step-maquette); }

.flash {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px dashed rgba(163, 188, 140, .6);
  background: rgba(163, 188, 140, .07);
  color: var(--step-payee);
}
.alert { margin-bottom: 20px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.draftbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 20px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1.5px dashed var(--step-maquette);
  background: rgba(216, 180, 106, .07);
}
.draftbar__title { font-weight: 600; color: var(--step-maquette); }
.draftbar__text { color: var(--thread); font-size: 15px; }
.draftbar__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pubstate { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; color: var(--muted); font-size: 15px; }
.pubstate .icon { width: 18px; height: 18px; color: var(--step-payee); }

.page-head--split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head--split .page-head__actions { align-items: center; }
.page-head__text { flex: 1; min-width: 0; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.page-title--md { font-size: clamp(34px, 4vw, 48px); }
.page-foot { margin-top: 16px; color: var(--muted); font-size: 14px; }

.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card .btn--dashed { margin-top: 14px; }

/* Liste : flèches d'ordre à côté de chaque produit */
.prow { display: flex; align-items: stretch; gap: 8px; }
.prow .pcard { flex: 1; min-width: 0; }
.prow__order { display: flex; flex-direction: column; justify-content: center; gap: 4px; }

.fblock__titles { display: grid; gap: 2px; min-width: 0; }
.fblock__head { align-items: flex-start; }

.addpage { display: grid; gap: 8px; }
.addpage__row { display: flex; gap: 10px; }
.addpage__row .input { flex: 1; }

/* ---------- Formulaires du catalogue ---------- */
.form--wide { max-width: 820px; gap: 24px; }
.form__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-2);
}
fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }
legend.field__label { padding: 0; margin-bottom: 7px; }
.field__hint { color: var(--muted); font-size: 14px; }
.field--short { max-width: 280px; }
.optional { margin-left: 6px; color: var(--muted); font-weight: 400; font-size: 14px; }
select.input { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat; }
textarea.input { resize: vertical; min-height: 96px; }
.input--sm { min-height: 42px; padding: 8px 12px; font-size: 15px; }
.input--soft { background: transparent; }
.input--short { max-width: 220px; }

/* Case à cocher, dessinée comme sur le formulaire de la boutique */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  width: 24px;
  height: 24px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1.5px solid var(--line-2);
  background: var(--deep);
  color: transparent;
}
.check__box .icon { width: 16px; height: 16px; }
.check input:checked + .check__box { background: var(--text); border-color: var(--text); color: var(--bg); }
.check input:focus-visible + .check__box { outline: 2px solid var(--text); outline-offset: 2px; }
.check__label { display: block; font-weight: 500; }
.check__hint { display: block; color: var(--muted); font-size: 14px; }
.check--sm { padding: 4px 10px 4px 4px; gap: 8px; align-items: center; font-size: 15px; }
.check--sm .check__box { width: 20px; height: 20px; }

.radio { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.radio input { width: 18px; height: 18px; margin: 0; accent-color: var(--text); flex: none; }
.radio--block {
  align-items: flex-start;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--deep);
}
.radio--block input { margin-top: 3px; }
.segmented { display: grid; gap: 8px; }

/* Choix de l'icône */
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.iconpick__item { position: relative; cursor: pointer; }
.iconpick__item input { position: absolute; opacity: 0; }
.iconpick__art {
  display: grid;
  place-items: center;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--deep);
  color: var(--muted);
}
.iconpick__art .picon { width: 36px; height: 36px; }
.iconpick__label { display: block; margin-top: 4px; text-align: center; font-size: 13px; color: var(--muted); }
.iconpick__item input:checked + .iconpick__art { border: 1.5px dashed var(--text); color: var(--text); background: var(--raise-2); }
.iconpick__item input:focus-visible + .iconpick__art { outline: 2px solid var(--text); outline-offset: 2px; }

/* Lignes répétables */
.rows { display: grid; gap: 10px; }
.rows__list { display: grid; gap: 8px; }
.orow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed var(--line-2);
  background: var(--deep);
}
.orow__main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.orow__main--pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
.orow .tools { flex-direction: column; }

/* Condition */
.cond { display: grid; gap: 8px; }
.cond__mode { display: grid; gap: 6px; padding-left: 4px; font-size: 15px; }
.cond__values { display: flex; flex-wrap: wrap; gap: 4px 8px; }

/* Choix du type de champ */
.typelist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.typecard {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--raise);
  text-decoration: none;
}
a.typecard:hover { border-color: var(--line-2); background: #2c2e23; }
.typecard__name { font-weight: 600; font-size: 17px; }
.typecard__help { color: var(--muted); font-size: 15px; }
.typecard.is-off { opacity: .5; }

/* ---------- Aperçu ---------- */
.pv { display: grid; gap: 20px; max-width: 820px; }
.pv-fixed { color: var(--thread); }
.pv-fields { display: grid; gap: 22px; margin-top: 18px; }
.pv-field { display: grid; gap: 8px; }
.pv-label { font-weight: 600; }
.pv-hint { color: var(--muted); font-size: 14px; margin-top: -4px; }
.pv-info { padding: 12px 16px; border-radius: 10px; border: 1px dashed var(--line-2); background: var(--deep); color: var(--thread); }
.pv-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-choices--cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pv-choice {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--deep);
  cursor: pointer;
}
.pv-choices--cards .pv-choice { border-radius: 12px; padding: 14px 16px; border-style: dashed; }
.pv-choice input { position: absolute; opacity: 0; }
.pv-choice.is-on { border: 1.5px solid var(--text); background: var(--raise-2); }
.pv-choice:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.pv-choice__label { font-weight: 500; }
.pv-choice__hint { color: var(--muted); font-size: 14px; }
.pv-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.pv-size { display: grid; gap: 4px; text-align: center; font-weight: 600; }
.pv-size .input { text-align: center; }
.pv-total { color: var(--thread); }
.pv-extra { display: grid; gap: 8px; padding-left: 36px; }

/* ---------- Étapes : pastille et libellé, jamais la couleur seule ---------- */
.stage--nouvelle { --stage: var(--step-nouvelle); }
.stage--devis { --stage: var(--step-devis); }
.stage--maquette { --stage: var(--step-maquette); }
.stage--prototype { --stage: var(--step-prototype); }
.stage--payee { --stage: var(--step-payee); }
.stage--production { --stage: var(--step-production); }
.stage--expediee { --stage: var(--step-expediee); }
.stage--livree { --stage: var(--step-livree); }
.stage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 12px 0 10px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--stage) 12%, transparent);
  color: var(--stage);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}
.stage__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--stage, currentColor); }

.nav__count {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 600;
}

.btn.is-disabled { opacity: .45; cursor: not-allowed; }
.ok { color: var(--step-payee); }
.section-title { font-family: var(--display); font-weight: 800; font-size: 28px; margin-bottom: 14px; }

/* ---------- Liste des demandes ---------- */
.search { position: relative; display: flex; align-items: center; width: 340px; }
.search .icon { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 44px; }

.demobar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px dashed var(--line-2);
  color: var(--muted);
  font-size: 15px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  color: var(--thread);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.chip:hover { border-color: var(--thread); }
.chip.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip__n { color: var(--muted); font-weight: 400; }
.chip.is-on .chip__n { color: var(--secondary); }

.rtable-wrap { border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--raise); overflow-x: auto; }
.rtable { width: 100%; border-collapse: collapse; }
.rtable th {
  padding: 14px 16px;
  text-align: left;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
.rtable td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable tbody tr { position: relative; transition: background .12s; }
.rtable tbody tr:hover { background: #2c2e23; }
.rowlink { color: inherit; text-decoration: none; }
.rowlink::after { content: ""; position: absolute; inset: 0; }
.rowlink:focus-visible { outline: none; }
.rtable tr:has(.rowlink:focus-visible) { outline: 2px solid var(--text); outline-offset: -2px; }
.rtable__number { font-family: var(--display); font-weight: 800; font-size: 24px; white-space: nowrap; }
.rtable__number .tag { display: flex; width: fit-content; min-height: 20px; margin-top: 2px; padding: 0 8px; font-size: 12px; }
.rtable__client { max-width: 240px; }
.rtable__products { min-width: 170px; }
.rtable__org, .rtable__name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtable__org { font-weight: 600; }
.rtable__name { color: var(--muted); font-size: 14px; }
.rtable__qty .num { font-size: 26px; }
.rtable__unit { display: none; }
.rtable__date { color: var(--muted); white-space: nowrap; }
.rtable__contact { color: var(--muted); font-size: 15px; }
.channel { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.channel .icon { width: 18px; height: 18px; }
/* Nouvelles demandes : liseré crème à gauche et numéro mis en avant */
.rtable tr.is-new td:first-child { box-shadow: inset 3px 0 0 var(--text); }
.rtable tr.is-new .rtable__org { color: var(--text); }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; }
.pager__buttons { display: flex; gap: 10px; }

/* ---------- Fiche d'une demande ---------- */
.request-title { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.page-sub a { color: var(--text); }

.card--tracker { margin-bottom: 20px; }
.tracker { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.tracker__step { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; }
/* Le fil entre deux étapes : plein si franchi, en pointillés (surpiqûre) sinon */
.tracker__step:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 19px;
  right: calc(50% + 24px);
  width: calc(100% - 48px);
  border-top: 1.5px dashed var(--line-2);
}
.tracker__step.is-done::before, .tracker__step.is-current::before { border-top-style: solid; border-color: var(--thread); }
.tracker__dot {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px dashed var(--line-2);
  color: var(--muted);
  font-family: var(--display);
  font-weight: 800;
  font-size: 18px;
}
.tracker__dot .icon { width: 18px; height: 18px; }
.is-done .tracker__dot { border: 1.5px solid var(--thread); color: var(--text); }
.is-current .tracker__dot { border: 0; background: var(--text); color: var(--bg); }
.tracker__label { color: var(--muted); font-size: 15px; line-height: 1.25; }
.is-done .tracker__label, .is-current .tracker__label { color: var(--text); }
.is-current .tracker__label { font-weight: 600; }
.tracker__note { color: var(--step-maquette); font-size: 13px; line-height: 1.3; }
.tracker__note.is-over { color: var(--danger); }

.request-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.request-grid__main, .request-grid__side { display: grid; gap: 20px; min-width: 0; }
.card__empty { margin-top: 12px; }
.card__link { display: inline-block; margin-top: 16px; color: var(--text); }
.client__name { margin-top: 14px; font-weight: 600; font-size: 18px; }
.message { margin-top: 14px; white-space: pre-line; font-size: 17px; line-height: 1.6; }

.items { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.item { padding: 16px 18px; border-radius: var(--radius); border: 1px dashed var(--line-2); background: var(--deep); }
.item__main { display: flex; align-items: center; gap: 16px; }
.item__text { flex: 1; min-width: 0; }
.item__name { font-weight: 600; font-size: 17px; }
.item__summary { color: var(--muted); }
.item__qty { display: grid; justify-items: end; line-height: 1; }
.item__qty .num { font-size: 40px; }
.item__qty span:last-child { color: var(--muted); font-size: 14px; margin-top: 4px; }
.item__details { margin-top: 12px; }
.item__details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.kv--compact { gap: 6px; font-size: 15px; }

.files { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--deep); }
.file__ext {
  min-width: 44px;
  height: 48px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1.5px solid var(--thread);
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
}
.file__text { flex: 1; min-width: 0; display: grid; }
.file__thumb {
  width: 64px;
  height: 64px;
  flex: none;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  /* Damier discret : les images à fond transparent restent lisibles */
  background: repeating-conic-gradient(#2c2e23 0 25%, #34372b 0 50%) 0 0 / 14px 14px;
}
.file__thumb img { width: 100%; height: 100%; object-fit: contain; }
.file__thumb:hover { border-color: var(--thread); }
.item__files { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.item__files .files { margin-top: 0; }
.kv dd .address { display: inline-block; text-align: right; line-height: 1.4; }
.form__stack { display: grid; gap: 14px; }
.form__cols--zip { grid-template-columns: 160px minmax(0, 1fr); }
.file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file__size { color: var(--muted); font-size: 14px; }

/* ---------- Fiche : actions ---------- */
.tracker__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed var(--line-2);
}
.tracking { font-size: 15px; }
.tracking a { color: var(--text); }
.tracking__edit { margin-left: 8px; color: var(--muted) !important; font-size: 14px; }
.stagechange { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 15px; }
.stagechange .input { width: auto; min-width: 180px; }

.stack { display: grid; gap: 10px; margin-top: 14px; }
.stack .btn, .quote .btn { justify-self: start; }
.card .link { margin-top: 10px; }

.quote { display: grid; gap: 10px; margin-top: 16px; }
.quote__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.money { display: inline-flex; align-items: center; gap: 8px; }
.money .input { width: 130px; text-align: right; }
.quote .check { padding: 4px 0; }
.quote__pdf { display: grid; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.quote__pdf--alone { margin-top: 14px; padding-top: 0; border-top: 0; }
.quote__rule { margin-top: 10px; font-size: 15px; }
.quote__margin { padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 17px; }
.quote__margin strong { font-family: var(--display); font-weight: 800; font-size: 26px; color: var(--step-payee); }
.quote__margin strong.is-negative { color: var(--danger); }
.input--date { width: 170px; color-scheme: dark; }
.quote__pdf .files { margin-top: 0; grid-template-columns: minmax(0, 1fr); }
.upload { display: grid; gap: 6px; }
.upload__label { position: relative; cursor: pointer; border-style: dashed; }
.upload__label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload__label:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.upload__label.is-busy { opacity: .6; pointer-events: none; }

.counter { margin-top: 12px; }
.counter .num { font-size: 36px; margin-right: 6px; }
.counter__warn { color: var(--danger); }

.history-add { display: flex; gap: 8px; margin-top: 14px; }
.history-add .input { flex: 1; min-width: 0; }
.timeline { list-style: none; margin: 18px 0 0; padding: 0; display: grid; }
.timeline__item { position: relative; padding: 0 0 16px 28px; }
/* Le fil de l'historique, en surpiqûre */
.timeline__item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 16px;
  bottom: -2px;
  border-left: 1.5px dashed var(--line-2);
}
.timeline__item:last-child::before { display: none; }
.timeline__item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--raise);
}
.timeline__item:first-child::after { background: var(--text); border-color: var(--text); }
.timeline__text { font-weight: 500; }
.timeline__detail { color: var(--thread); font-style: italic; }
.timeline__when { color: var(--muted); font-size: 14px; }

/* ---------- Formulaire « Ajouter une demande » ---------- */
.form__section {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  padding-top: 8px;
}
.form__section:not(:first-of-type) { border-top: 1px dashed var(--line-2); padding-top: 22px; }
.form__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.segmented--row { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.orow__main--item { grid-template-columns: minmax(0, 1.2fr) 110px; }
.orow__wide { grid-column: 1 / -1; }

/* ---------- Téléphone et petite tablette ---------- */
@media (max-width: 1099px) {
  .request-grid { grid-template-columns: minmax(0, 1fr); }
  .tracker { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 22px; }
  .tracker__step:nth-child(5)::before { display: none; }
}

/* Tableau → cartes sur petits écrans */
@media (max-width: 799px) {
  .rtable-wrap { border: 0; background: none; overflow: visible; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody { display: block; }
  .rtable tbody { display: grid; gap: 10px; }
  .rtable tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--raise);
  }
  .rtable td { padding: 0; border: 0; }
  .rtable tr.is-new td:first-child { box-shadow: none; }
  .rtable tr.is-new { border-left: 3px solid var(--text); }
  .rtable__number { grid-column: 1; font-size: 22px; }
  .rtable__date { grid-column: 2; grid-row: 1; text-align: right; font-size: 14px; }
  .rtable__client, .rtable__products, .rtable__contact { grid-column: 1 / -1; max-width: none; }
  .rtable__products { color: var(--thread); }
  .rtable__qty { grid-column: 1; }
  .rtable__qty .num { font-size: 20px; }
  .rtable__unit { display: inline; color: var(--muted); }
  .rtable__channel { grid-column: 2; grid-row: 4; justify-self: end; color: var(--muted); font-size: 14px; }
  .rtable__stage { grid-column: 1 / -1; }
  .rtable--clients .rtable__qty { grid-column: 1; }
  .rtable--clients .rtable__date { grid-row: 1; }
}

@media (max-width: 1099px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); }
  .product-grid__side { grid-column: auto; grid-row: auto; position: static; }
}

@media (max-width: 599px) {
  .pcard { grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 16px; }
  .pcard__meta { grid-column: 2; justify-items: start; text-align: left; }
  .pcard__icon { width: 48px; height: 48px; }
  .pcard__icon .picon { width: 28px; height: 28px; }
  .pcard__name { font-size: 23px; }
  .page-head--product { gap: 14px; }
  .pcard__icon--lg { width: 60px; height: 60px; }
  .pcard__icon--lg .picon { width: 34px; height: 34px; }
  .fblock { padding: 14px; }
  .fblock__line { flex-direction: column; gap: 0; }
  .fblock__line .k { width: auto; font-size: 13px; }
  .opt { grid-template-columns: minmax(0, 1fr); }
  .page-head--product { flex-wrap: wrap; }
  .page-head__actions { width: 100%; }
  .prow__order { gap: 0; }
  .orow { padding: 10px; }
  .orow__main--pair { grid-template-columns: minmax(0, 1fr); }
  .addpage__row { flex-direction: column; }
  .form__actions .btn { flex: 1; }
  .draftbar__actions { width: 100%; }
  .draftbar__actions form, .draftbar__actions .btn { flex: 1; }
  .search { min-width: 0; width: 100%; }
  /* Filtres : une seule ligne qui défile au doigt */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 18px; padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .page-head__actions > .btn { flex: 1; }
  .form__cols { grid-template-columns: minmax(0, 1fr); }
  .orow__main--item { grid-template-columns: minmax(0, 1fr) 90px; }
  .tracker { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .tracker__step { grid-template-columns: 40px minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; column-gap: 14px; row-gap: 0; }
  .tracker__step::before { display: none; }
  .tracker__note { grid-column: 2; }
  .item__main { flex-wrap: wrap; }
  .item__qty .num { font-size: 32px; }
}

/* ---------- Téléphone et petite tablette : structure ---------- */
@media (max-width: 899px) {
  .shell { grid-template-columns: minmax(0, 1fr); align-content: start; }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand__name { font-size: 24px; }
  .topbar__toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--line-2);
    background: transparent;
    cursor: pointer;
  }
  .topbar__toggle .icon { width: 22px; height: 22px; }
  .when-open { display: none; }
  .menu-open .when-open { display: block; }
  .menu-open .when-closed { display: none; }

  /* Le menu devient un panneau qui glisse sous la barre du haut */
  .sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    z-index: 20;
    height: calc(100dvh - 64px);
    padding: 16px 16px 24px;
    border-right: 0;
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s, transform .18s, visibility .18s;
  }
  .menu-open .sidebar { transform: none; opacity: 1; visibility: visible; }
  .menu-open { overflow: hidden; }
  .brand--full { display: none; }
  .nav__link { min-height: 52px; font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
