/* Catalogue Pièces – front. Toutes les couleurs/tailles viennent des variables --cp-*
   générées depuis WP Admin > Catalogue Pièces > Apparence. */
.cp-app, .cp-app * { box-sizing: border-box; }
.cp-app {
  --cp-row-h-cur: var(--cp-row-h);
  font-family: var(--cp-font);
  color: var(--cp-text);
  background: var(--cp-bg);
  display: flex; flex-direction: column;
  gap: calc(var(--cp-gap) * .75);
  padding: var(--cp-gap);
  height: 100vh; height: 100dvh;
  min-height: 360px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
/* dans un thème : bord à bord de l'écran */
.cp-app.cp-in-theme { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
body.cp-fullscreen { margin: 0; overflow: hidden; background: var(--cp-bg); }

/* ------------------------------------------------------------ recherche */
.cp-bar { position: relative; flex: none; display: flex; }
.cp-has-bell .cp-bar { padding-right: calc(var(--cp-search-h) + 10px); }
.cp-search {
  position: relative; flex: none;
  width: min(100%, var(--cp-search-w, 100%));
  margin-left: var(--cp-search-ml, auto); margin-right: var(--cp-search-mr, auto);
}
.cp-search .cp-ico {
  position: absolute; left: calc(var(--cp-search-h) * .32); top: 50%; transform: translateY(-50%);
  width: calc(var(--cp-search-fs) * 1.15); height: calc(var(--cp-search-fs) * 1.15);
  color: var(--cp-muted); pointer-events: none; transition: color .15s;
}
.cp-input {
  display: block; width: 100%; margin: 0;
  height: var(--cp-search-h);
  padding: 0 calc(var(--cp-search-h) * .9) 0 calc(var(--cp-search-h) * .32 + var(--cp-search-fs) * 1.9);
  font: 500 var(--cp-search-fs)/1 var(--cp-font);
  color: var(--cp-text);
  background: var(--cp-surface);
  border: var(--cp-border-w) solid var(--cp-line);
  border-radius: var(--cp-radius);
  outline: none; -webkit-appearance: none; appearance: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .15s, box-shadow .15s;
}
.cp-input::placeholder { color: var(--cp-muted); font-weight: 400; opacity: 1; text-overflow: ellipsis; }
.cp-input::-webkit-search-cancel-button { display: none; }
.cp-input:focus { outline: none; }
.cp-upper .cp-input { text-transform: uppercase; }
.cp-upper .cp-input::placeholder { text-transform: none; }

/* ---------- 6 styles du champ (Apparence > Champ de recherche > Style)
   « actif » = champ en cours d'utilisation, ou toujours si l'option « mis en avant » est cochée */
.cp-search:focus-within .cp-ico, .cp-focus-always .cp-search .cp-ico { color: var(--cp-accent); }

/* 1 · Halo */
.cp-ss-halo .cp-input:hover { border-color: var(--cp-accent-a40, #f0a57a); }
.cp-ss-halo .cp-input:focus, .cp-ss-halo.cp-focus-always .cp-input {
  border-color: var(--cp-accent); border-width: var(--cp-focus-w);
  box-shadow: 0 0 0 calc(var(--cp-focus-w) * 2) var(--cp-accent-a16, rgba(232,89,12,.16));
}
/* 2 · Ligne nette */
.cp-ss-line .cp-input:hover { border-color: var(--cp-accent-a40, #f0a57a); }
.cp-ss-line .cp-input:focus, .cp-ss-line.cp-focus-always .cp-input {
  border-color: var(--cp-accent); border-width: calc(var(--cp-focus-w) * .75); box-shadow: none;
}
/* 3 · Bleu nuit sobre (par défaut) */
.cp-ss-navy .cp-input:hover { border-color: var(--cp-head-bg); }
.cp-ss-navy .cp-input:focus, .cp-ss-navy.cp-focus-always .cp-input {
  border-color: var(--cp-head-bg); border-width: calc(var(--cp-focus-w) * .75); box-shadow: none;
}
/* 4 · Barre d'accent */
.cp-ss-bar .cp-input { border-radius: 4px; border-left-width: 4px; }
.cp-ss-bar .cp-input:hover { border-left-color: var(--cp-accent-a40, #f0a57a); }
.cp-ss-bar .cp-input:focus, .cp-ss-bar.cp-focus-always .cp-input { border-left-color: var(--cp-accent); box-shadow: none; }
.cp-ss-bar .cp-search .cp-ico { color: var(--cp-head-bg) !important; }
/* 5 · Soulignement */
.cp-ss-under .cp-input { border-width: 0 0 2px; border-radius: 0; background: transparent; box-shadow: none; }
.cp-ss-under .cp-input:focus, .cp-ss-under.cp-focus-always .cp-input { border-bottom-color: var(--cp-accent); border-bottom-width: 2.5px; }
.cp-ss-under .cp-search .cp-ico { left: 4px; }
.cp-ss-under .cp-input { padding-left: calc(var(--cp-search-fs) * 1.9); }
/* 6 · Bouton intégré */
.cp-go { display: none; }
.cp-ss-button .cp-input { padding-right: calc(var(--cp-search-fs) * 7.5); }
.cp-ss-button .cp-input:hover { border-color: var(--cp-head-bg); }
.cp-ss-button .cp-input:focus, .cp-ss-button.cp-focus-always .cp-input {
  border-color: var(--cp-head-bg); border-width: calc(var(--cp-focus-w) * .75); box-shadow: none;
}
.cp-ss-button .cp-search .cp-ico { color: var(--cp-head-bg) !important; }
.cp-ss-button .cp-go {
  display: inline-flex; align-items: center; gap: 6px;
  position: absolute; right: 5px; top: 5px; bottom: 5px; padding: 0 calc(var(--cp-search-fs) * 1);
  border: 0; border-radius: max(4px, calc(var(--cp-radius) - 4px)); background: var(--cp-accent); color: #fff;
  font: 600 calc(var(--cp-search-fs) * .8) var(--cp-font); cursor: pointer; transition: filter .15s, transform .1s;
}
.cp-ss-button .cp-go:hover { filter: brightness(.92); }
.cp-ss-button .cp-go:active { transform: scale(.97); }
.cp-ss-button .cp-go svg { width: 16px; height: 16px; }
.cp-ss-button .cp-clear { right: calc(var(--cp-search-fs) * 6.6); }
@media (max-width: 700px) {
  .cp-ss-button .cp-go span { display: none; }
  .cp-ss-button .cp-input { padding-right: calc(var(--cp-search-h) * 1.5); }
  .cp-ss-button .cp-clear { right: calc(var(--cp-search-h) * 1); }
}

.cp-clear {
  position: absolute; right: calc(var(--cp-search-h) * .2); top: 50%; transform: translateY(-50%);
  width: calc(var(--cp-search-h) * .6); height: calc(var(--cp-search-h) * .6);
  border: 0; border-radius: 50%; background: transparent; color: var(--cp-muted);
  font-size: calc(var(--cp-search-fs) * 1.2); line-height: 1; cursor: pointer; display: none;
}
.cp-clear:hover { background: var(--cp-text-a7, rgba(20,23,28,.07)); color: var(--cp-text); }
.cp-search.has-text .cp-clear { display: block; }
.cp-search:not(.has-text) .cp-input { padding-right: 14px; }
.cp-ss-button .cp-search:not(.has-text) .cp-input { padding-right: calc(var(--cp-search-fs) * 7.5); }

/* ---------------------------------------------------- cloche nouveautés */
.cp-bell-wrap { position: absolute; right: 0; top: 0; }
.cp-app:not(.cp-has-bell) .cp-bell-wrap { display: none; }
.cp-bell {
  position: relative; display: grid; place-items: center;
  width: var(--cp-search-h); height: var(--cp-search-h); margin: 0; padding: 0;
  border: var(--cp-border-w) solid var(--cp-line); border-radius: var(--cp-radius);
  background: var(--cp-surface); color: var(--cp-text); cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: border-color .15s, color .15s, box-shadow .15s;
}
.cp-bell svg { width: calc(var(--cp-search-fs) * 1.25); height: calc(var(--cp-search-fs) * 1.25); }
.cp-bell:hover, .cp-bell[aria-expanded="true"] { border-color: var(--cp-accent); color: var(--cp-accent); }
.cp-bell[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--cp-accent-a16, rgba(232,89,12,.16)); }
.cp-bell.ring svg { animation: cp-ring 1.6s ease-in-out 2; transform-origin: 50% 8%; }
@keyframes cp-ring { 0%,60%,100% { transform: rotate(0); } 10% { transform: rotate(16deg); } 20% { transform: rotate(-14deg); } 30% { transform: rotate(10deg); } 40% { transform: rotate(-6deg); } 50% { transform: rotate(3deg); } }
.cp-bell-n {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  background: var(--cp-accent); color: #fff; font: 700 11px/20px var(--cp-font); text-align: center;
  box-shadow: 0 0 0 2px var(--cp-bg);
}
.cp-bell-n[hidden] { display: none; }

.cp-notif {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 50;
  width: 360px; max-width: calc(100vw - 24px);
  background: var(--cp-surface); border: 1px solid var(--cp-line); border-radius: 16px;
  box-shadow: 0 22px 56px rgba(15, 23, 42, .18), 0 4px 12px rgba(15, 23, 42, .07);
  overflow: hidden; transform-origin: top right; animation: cp-pop .22s cubic-bezier(.2,.9,.3,1.15);
}
.cp-notif[hidden] { display: none; }
@keyframes cp-pop { from { opacity: 0; transform: translateY(-8px) scale(.96); } }
.cp-notif-h {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 16px;
  background: var(--cp-head-bg); color: var(--cp-head-fg); position: relative; overflow: hidden;
}
.cp-notif-h::after { content: ""; position: absolute; right: -30px; top: -50px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, var(--cp-accent-a40, rgba(232,89,12,.45)), transparent 70%); animation: cp-glow 6s ease-in-out infinite alternate; }
@keyframes cp-glow { to { transform: translate(-30px, 14px) scale(1.15); } }
.cp-notif-ti { position: relative; z-index: 1; display: grid; line-height: 1.25; }
.cp-notif-ti b { font-size: 14px; }
.cp-notif-ti small { font-size: 11.5px; opacity: .72; }
.cp-notif-h .cp-notif-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--cp-accent); color: #fff; display: grid; place-items: center; position: relative; z-index: 1; flex: none; box-shadow: 0 4px 12px var(--cp-accent-a40, rgba(232,89,12,.45)); }
.cp-notif-h .cp-notif-ic svg { width: 16px; height: 16px; }
.cp-notif-h .cp-notif-x { margin-left: auto; position: relative; z-index: 1; background: none; border: 0; color: inherit; opacity: .65; cursor: pointer; font-size: 19px; line-height: 1; padding: 3px 7px; border-radius: 7px; transition: .15s; }
.cp-notif-h .cp-notif-x:hover { opacity: 1; background: rgba(255,255,255,.12); }
.cp-notif-list { max-height: min(400px, 60vh); overflow-y: auto; padding: 6px; }
.cp-notif-it {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 11px; position: relative;
  animation: cp-in .32s ease both; animation-delay: calc(var(--i, 0) * 45ms); transition: background .15s;
}
.cp-notif-it + .cp-notif-it { margin-top: 2px; }
.cp-notif-it:hover { background: var(--cp-zebra); }
.cp-notif-it.new { background: var(--cp-accent-a8, rgba(232,89,12,.07)); }
.cp-notif-it.new:hover { background: var(--cp-accent-a14, rgba(232,89,12,.12)); }
@keyframes cp-in { from { opacity: 0; transform: translateX(10px); } }
.cp-notif-av {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  font: 700 12.5px var(--cp-font); flex: none; letter-spacing: .4px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 3px 8px rgba(15,23,42,.14); transition: transform .2s;
}
.cp-notif-it:hover .cp-notif-av { transform: scale(1.07) rotate(-3deg); }
.cp-notif-av svg { width: 16px; height: 16px; }
.cp-notif-tx { min-width: 0; flex: 1; }
.cp-notif-tx .l1 { display: flex; align-items: baseline; gap: 6px; font-size: 13.5px; color: var(--cp-text); white-space: nowrap; overflow: hidden; }
.cp-notif-tx .l1 b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cp-notif-tx .l1 .n { flex: none; color: var(--cp-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.cp-notif-tx .l1 .n strong { color: var(--cp-text); font-weight: 650; }
.cp-notif-tx .l2 { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 11.5px; color: var(--cp-muted); white-space: nowrap; overflow: hidden; }
.cp-notif-tx .l2 i { font-style: normal; opacity: .5; }
.cp-notif-tag { display: inline-block; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; line-height: 17px; background: var(--cp-head-a8, rgba(15,42,68,.08)); color: var(--cp-text); }
.cp-notif-tag.o { background: var(--cp-accent-a14, rgba(232,89,12,.14)); color: var(--cp-accent); }
.cp-notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cp-accent); flex: none; animation: cp-pulse 1.8s ease-out infinite; }
@keyframes cp-pulse { 0% { box-shadow: 0 0 0 0 var(--cp-accent-a40, rgba(232,89,12,.45)); } 70%, 100% { box-shadow: 0 0 0 7px rgba(0,0,0,0); } }
.cp-notif-empty { padding: 30px 20px; text-align: center; color: var(--cp-muted); font-size: 13px; }
.cp-notif-empty svg { width: 30px; height: 30px; color: var(--cp-line); display: block; margin: 0 auto 8px; }
.cp-notif-f { padding: 8px 16px; font-size: 11px; color: var(--cp-muted); border-top: 1px solid var(--cp-line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cp-notif-f .live { display: inline-flex; align-items: center; gap: 6px; }
.cp-notif-f .live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22a55b; box-shadow: 0 0 0 3px rgba(34,165,91,.18); }
.cp-notif-f button { background: none; border: 0; padding: 0; color: var(--cp-accent); font: 650 11.5px var(--cp-font); cursor: pointer; }

/* alerte nouvelle disponibilité */
.cp-toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 99999; width: 340px; max-width: calc(100vw - 24px);
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  background: var(--cp-head-bg); color: var(--cp-head-fg); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .28); font-family: var(--cp-font); cursor: pointer;
  animation: cp-toast-in .35s cubic-bezier(.2,.9,.3,1.2);
}
.cp-toast.out { opacity: 0; transform: translateY(16px); transition: .3s; }
@keyframes cp-toast-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.cp-toast .ic { width: 34px; height: 34px; border-radius: 11px; background: var(--cp-accent); display: grid; place-items: center; flex: none; color: #fff; }
.cp-toast .ic svg { width: 19px; height: 19px; }
.cp-toast b { display: block; font-size: 14px; }
.cp-toast span { display: block; font-size: 12.5px; opacity: .8; margin-top: 2px; line-height: 1.4; }
.cp-toast .x { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; font-size: 18px; cursor: pointer; padding: 0 2px; line-height: 1; }

/* -------------------------------------------------------------- tableau */
.cp-wrap {
  position: relative; flex: 1 1 auto; min-height: 0;
  background: var(--cp-surface);
  border: 1px solid var(--cp-line);
  border-radius: var(--cp-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
}
.cp-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; margin: 0; font-size: var(--cp-table-fs); }
.cp-table th, .cp-table td { border: 0; margin: 0; }
.cp-table thead th {
  height: var(--cp-head-h);
  padding: 0 var(--cp-cell-px);
  background: var(--cp-head-bg); color: var(--cp-head-fg);
  font-size: var(--cp-head-fs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-table td {
  height: var(--cp-row-fill, var(--cp-row-h-cur));
  padding: 0 var(--cp-cell-px);
  border-bottom: 1px solid var(--cp-line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  vertical-align: middle; color: var(--cp-text); background: transparent;
}
.cp-table tbody tr:nth-child(even) td { background: var(--cp-zebra); }
.cp-table tbody tr:hover td { background: var(--cp-hover); }
.cp-table td.cp-r { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-weight: 600; letter-spacing: .01em; }
.cp-table td.cp-d { font-weight: 500; }
.cp-table .cp-m span {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;
  padding: .2em .6em; border-radius: 6px; font-size: .88em; font-weight: 600;
  background: var(--cp-head-a8, rgba(15,42,68,.08)); color: var(--cp-text);
}
.cp-table td.cp-p { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-table th.cp-p { text-align: right; }
.cp-table th.cp-sortable { cursor: pointer; user-select: none; }
.cp-table th .cp-arrow { display: inline-flex; vertical-align: -2px; margin-left: 6px; opacity: .55; }
.cp-table th.cp-sorted .cp-arrow { opacity: 1; color: var(--cp-accent); filter: brightness(1.25); }
.cp-table .cp-p small { font-weight: 500; color: var(--cp-muted); margin-left: .25em; font-size: .8em; }
.cp-table td.cp-f { color: var(--cp-text); font-weight: 500; }
.cp-table th.cp-f, .cp-table td.cp-f { padding-left: calc(var(--cp-cell-px) * 2); }
.cp-table td.cp-dt { color: var(--cp-muted); font-variant-numeric: tabular-nums; }
.cp-table .cp-x {
  display: inline-block; margin-left: .5em; padding: .1em .45em; border-radius: 5px; font: 700 .72em var(--cp-font);
  background: var(--cp-accent-a14, rgba(232,89,12,.14)); color: var(--cp-accent); vertical-align: middle;
}
.cp-table mark { background: var(--cp-mark); color: inherit; padding: 0 .05em; border-radius: 3px; }
.cp-sub { display: none; }

.cp-loading { position: absolute; left: 0; right: 0; top: var(--cp-head-h); height: 2px; overflow: hidden; z-index: 2; }
.cp-loading.on::after {
  content: ""; position: absolute; left: -35%; width: 35%; height: 100%; background: var(--cp-accent);
  animation: cp-load .9s ease-in-out infinite;
}
@keyframes cp-load { to { left: 100%; } }

.cp-empty {
  position: absolute; left: 0; right: 0; top: var(--cp-head-h); bottom: 0;
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 6px;
  color: var(--cp-muted); text-align: center; padding: 20px; font-size: var(--cp-table-fs);
}
.cp-empty b { color: var(--cp-text); font-size: 1.1em; }
.cp-empty.on { display: flex; }

/* ----------------------------------------------------------- pagination */
.cp-pager { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.cp-count { color: var(--cp-muted); font-size: .9em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-count b { color: var(--cp-text); }
.cp-pages { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.cp-pages button {
  min-width: 34px; height: 34px; padding: 0 9px; margin: 0;
  border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--cp-text);
  font: 600 13px/1 var(--cp-font); font-variant-numeric: tabular-nums; cursor: pointer;
  display: inline-grid; place-items: center;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.cp-pages button:hover:not(:disabled):not(.on) { background: var(--cp-accent-a14, rgba(232,89,12,.14)); color: var(--cp-accent); }
.cp-pages button:active:not(:disabled) { transform: scale(.94); }
.cp-pages button.on { background: var(--cp-accent); color: #fff; cursor: default; box-shadow: 0 3px 10px var(--cp-accent-a40, rgba(232,89,12,.4)); }
.cp-pages button.cp-nav-btn { border-color: var(--cp-line); background: var(--cp-surface); font-size: 16px; padding: 0; width: 34px; }
.cp-pages button.cp-nav-btn:hover:not(:disabled) { border-color: var(--cp-accent); background: var(--cp-surface); }
.cp-pages button:disabled { opacity: .35; cursor: default; }
.cp-pages .cp-dots { color: var(--cp-muted); padding: 0 3px; letter-spacing: 1px; }
.cp-pages .cp-pos { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 10px; color: var(--cp-text); }

/* ------------------------------------------------- écrans moyens */
@media (max-width: 1100px) {
  .cp-table thead th, .cp-table td { padding-left: calc(var(--cp-cell-px) * .6); padding-right: calc(var(--cp-cell-px) * .6); }
  .cp-table td.cp-r { font-size: .93em; letter-spacing: 0; }
}

/* --------------------------------------------------------------- mobile */
@media (max-width: 700px) {
  .cp-search { width: 100%; }
  .cp-input { font-size: min(var(--cp-search-fs), 16px); }
  .cp-toast { right: 12px; left: 12px; top: 12px; bottom: auto; width: auto; }
  .cp-app { padding: calc(var(--cp-gap) * .6); gap: calc(var(--cp-gap) * .5); }
  .cp-count { font-size: .82em; }
  .cp-pages button { min-width: 38px; height: 38px; } .cp-pages button.cp-nav-btn { width: 38px; }
}

/* Mobile – tableau complet avec défilement horizontal (par défaut) */
.cp-app.cp-scroll .cp-wrap {
  overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--cp-text-a25, rgba(20,23,28,.25)) transparent;
}
.cp-app.cp-scroll .cp-table { table-layout: auto; width: auto; min-width: 100%; }
.cp-app.cp-scroll .cp-table th, .cp-app.cp-scroll .cp-table td { overflow: visible; text-overflow: clip; max-width: none; }
.cp-app.cp-scroll .cp-table td.cp-r { min-width: 120px; }
.cp-app.cp-scroll .cp-table td.cp-d { min-width: 220px; }
.cp-app.cp-scroll .cp-wrap::-webkit-scrollbar { height: 6px; }
.cp-app.cp-scroll .cp-wrap::-webkit-scrollbar-thumb { background: var(--cp-text-a25, rgba(20,23,28,.25)); border-radius: 9px; }

/* Mobile – mode compact (2 colonnes, option dans Apparence) */
.cp-app.cp-compact { --cp-row-h-cur: var(--cp-row-h-m); }
.cp-app.cp-compact .cp-table td { white-space: normal; padding-top: 6px; padding-bottom: 6px; }
.cp-app.cp-compact .cp-table td.cp-p { white-space: nowrap; padding-left: 4px; }
.cp-app.cp-compact .cp-table td.cp-d > .cp-line {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; white-space: normal;
}
.cp-app.cp-compact .cp-sub {
  display: block; margin-top: 3px; font-size: .84em; font-weight: 500; color: var(--cp-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cp-app.cp-compact .cp-sub .cp-r { color: var(--cp-text); font-family: ui-monospace, "SF Mono", Consolas, monospace; font-weight: 600; }

/* Accès réservé aux abonnés */
.cp-denied { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; text-align: center; color: var(--cp-text, #14171c); }
.cp-denied svg { color: #e8590c; }
.cp-denied b { font-size: 17px; }
.cp-denied span { color: #6b7280; font-size: 14px; max-width: 420px; }
.cp-denied .cp-denied-btn { margin-top: 6px; display: inline-block; background: #e8590c; color: #fff !important; padding: 10px 22px; border-radius: 9px; font-weight: 700; text-decoration: none !important; }
.cp-denied .cp-denied-btn:hover { background: #d24f0a; }

/* ===================================================== carte du fournisseur */
.cp-table tbody tr[data-i] { cursor: pointer; }
.cp-table tbody tr[data-i]:focus-visible { outline: 2px solid var(--cp-accent); outline-offset: -2px; }
.cp-table tbody tr.cp-sel td { background: var(--cp-accent-a8, rgba(232,89,12,.07)) !important; }
.cp-table tbody tr.cp-sel td:first-child { box-shadow: inset 3px 0 0 var(--cp-accent); }

.cp-fc {
  position: fixed; z-index: 99990; width: 340px; max-width: calc(100vw - 20px);
  background: var(--cp-surface, #fff); color: var(--cp-text, #14171c); font-family: var(--cp-font);
  border: 1px solid var(--cp-line, #e5e7eb); border-radius: 14px; overflow: hidden; text-align: left;
  box-shadow: 0 24px 48px -16px rgba(15,42,68,.35), 0 4px 12px rgba(15,42,68,.08);
}
.cp-fc[hidden], .cp-fc-veil[hidden] { display: none; }
.cp-fc.in { animation: cp-fc-in .18s ease-out; }
@keyframes cp-fc-in { from { opacity: 0; transform: translateY(4px); } }
.cp-fc svg { width: 15px; height: 15px; flex: none; }

.cp-fc-h { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--cp-head-bg, #0F2A44); color: var(--cp-head-fg, #fff); }
.cp-fc-av { width: 42px; height: 42px; border-radius: 11px; background: var(--cp-accent, #E8590C); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; letter-spacing: .02em; }
.cp-fc-ti { min-width: 0; flex: 1; display: grid; gap: 3px; }
.cp-fc-ti b { font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-fc-ti small { display: flex; align-items: center; gap: 5px; font-size: 12px; opacity: .78; white-space: nowrap; }
.cp-fc-ti small svg { width: 13px; height: 13px; }
.cp-fc-ti small i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; margin: 0 3px; }
.cp-fc-x { display: none; background: none; border: 0; color: inherit; opacity: .7; font-size: 22px; line-height: 1; padding: 2px 6px; border-radius: 7px; cursor: pointer; }
.cp-fc-x:hover { opacity: 1; background: rgba(255,255,255,.12); }
.cp-fc.pinned .cp-fc-x { display: block; }

.cp-fc-p { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--cp-accent-a8, rgba(232,89,12,.07)); border-bottom: 1px solid var(--cp-line, #e5e7eb); font-size: 12.5px; }
.cp-fc-p svg { color: var(--cp-accent); }
/* la pièce s'affiche en entier : référence sur une ligne, désignation complète en dessous */
.cp-fc-p { align-items: flex-start; }
.cp-fc-p > svg { margin-top: 2px; }
.cp-fc-p b { margin-top: 1px; }
.cp-fc-pt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.cp-fc-pr { font-weight: 700; color: var(--cp-text, #14171c); font-family: ui-monospace, Consolas, Menlo, monospace; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.cp-fc-pd { color: var(--cp-text, #14171c); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.cp-fc-p b { font-size: 14px; white-space: nowrap; }
.cp-fc-p b small { font-size: 10.5px; margin-left: 2px; color: var(--cp-muted, #6b7280); font-weight: 600; }

.cp-fc-b { margin: 0; padding: 6px 16px; }
.cp-fc-b > div { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 10px; min-height: 40px; border-bottom: 1px solid var(--cp-line, #eef0f3); }
.cp-fc-b > div:last-child { border-bottom: 0; }
.cp-fc-b dt { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cp-muted, #6b7280); font-weight: 600; }
.cp-fc-b dt svg { color: var(--cp-accent); }
.cp-fc-b dd { margin: 0; display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13.5px; }
.cp-fc-v { flex: 1; min-width: 0; color: var(--cp-text, #14171c) !important; font-weight: 600; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.cp-fc-v:hover { color: var(--cp-accent) !important; }
.cp-fc-mail { letter-spacing: -.01em; }
.cp-fc-addr { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 2.7em; font-weight: 500; line-height: 1.35; margin: 5px 0; padding: 0; }
.cp-fc-na { color: var(--cp-muted, #9ca3af); font-size: 12.5px; font-style: italic; }
.cp-fc-acts { display: flex; gap: 4px; flex: none; }
.cp-fc-acts a, .cp-fc-acts button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--cp-line, #e5e7eb); background: transparent; color: var(--cp-muted, #6b7280) !important; display: grid; place-items: center; cursor: pointer; padding: 0; transition: .15s; }
.cp-fc-acts a:hover { color: #1FA855 !important; border-color: #1FA855; }
.cp-fc-acts button:hover { color: var(--cp-accent) !important; border-color: var(--cp-accent); }
.cp-fc-acts button.ok { color: #fff !important; background: #1FA855; border-color: #1FA855; }
.cp-fc-acts svg { width: 14px; height: 14px; }

.cp-fc-f { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 14px; border-top: 1px solid var(--cp-line, #e5e7eb); }
.cp-fc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; border-radius: 9px; font-size: 13px; font-weight: 700; text-decoration: none !important; border: 1px solid var(--cp-line, #e5e7eb); color: var(--cp-text, #14171c) !important; transition: .15s; white-space: nowrap; }
.cp-fc-btn:hover { border-color: var(--cp-accent); color: var(--cp-accent) !important; }
.cp-fc-btn.on { background: var(--cp-accent); border-color: var(--cp-accent); color: #fff !important; }
.cp-fc-btn.on:hover { filter: brightness(.94); color: #fff !important; }
.cp-fc-btn.off { opacity: .4; pointer-events: none; }

/* mobile / tactile : feuille fixée en bas de l'écran */
.cp-fc-veil { position: fixed; inset: 0; z-index: 99989; background: rgba(10,25,41,.35); }
@media (hover: none), (pointer: coarse), (max-width: 700px) {
  .cp-fc { left: 10px !important; right: 10px; top: auto !important; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; max-width: 560px; margin: 0 auto; }
  .cp-fc.in { animation: cp-fc-up .22s ease-out; }
  .cp-fc .cp-fc-x { display: block; }
  /* rien n'est coupé : les textes longs passent à la ligne, et la carte défile au doigt si elle dépasse */
  .cp-fc { display: flex; flex-direction: column; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); }
  .cp-fc[hidden] { display: none; }
  .cp-fc-h, .cp-fc-f { flex: none; }
  .cp-fc-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .cp-fc-p { align-items: flex-start; padding: 12px 16px; }
  .cp-fc-p > svg { margin-top: 2px; }
  .cp-fc-pt { display: grid; gap: 3px; overflow: visible; }
  .cp-fc-pr, .cp-fc-pd { white-space: normal; overflow: visible; text-overflow: clip; max-width: none; word-break: break-word; overflow-wrap: anywhere; line-height: 1.4; }
  .cp-fc-pr { font-size: 12.5px; }
  .cp-fc-pd { font-size: 13px; color: var(--cp-text, #14171c); }
  .cp-fc-p b { margin-top: 1px; }
  .cp-fc-v { white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.35; padding: 6px 0; }
  .cp-fc-addr { -webkit-line-clamp: unset; max-height: none; display: block; }
  .cp-fc-v.cp-fc-mail { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; word-break: normal; font-size: clamp(11px, 3.4vw, 13.5px); }
  .cp-fc-b > div { grid-template-columns: 104px 1fr; min-height: 46px; }
  .cp-fc-acts a, .cp-fc-acts button { width: 34px; height: 34px; }
  .cp-fc-btn { height: 44px; font-size: 14px; }
}
@keyframes cp-fc-up { from { opacity: 0; transform: translateY(20px); } }
@media (prefers-reduced-motion: reduce) { .cp-fc.in { animation: none; } }

/* ===================================================== liste « Fournisseur » */
.cp-ff { display: none; }
.cp-has-ff .cp-ff { display: block; position: relative; flex: 0 0 var(--cp-ff-w, 280px); width: var(--cp-ff-w, 280px); z-index: 30; }
.cp-has-ff .cp-search { flex: 0 1 auto; min-width: 0; }
.cp-ff-apres .cp-ff { margin-left: 10px; }
.cp-ff-avant .cp-ff { order: -1; margin-right: 10px; }
.cp-ff-droite .cp-ff { margin-left: auto; padding-left: 10px; }
.cp-ff-droite .cp-search { margin-right: 0; }
.cp-has-ff.cp-ff-apres .cp-search, .cp-has-ff.cp-ff-avant .cp-search { margin-left: 0; margin-right: 0; }
.cp-has-ff.cp-ff-apres .cp-bar, .cp-has-ff.cp-ff-avant .cp-bar { justify-content: var(--cp-ff-justify, flex-start); }

.cp-ff-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: var(--cp-search-h); margin: 0;
  padding: 0 12px 0 calc(var(--cp-search-h) * .26); cursor: pointer; text-align: left;
  font: 600 calc(var(--cp-search-fs) * .82)/1.2 var(--cp-font); color: var(--cp-text);
  background: var(--cp-surface); border: var(--cp-border-w) solid var(--cp-line); border-radius: var(--cp-radius);
  box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: border-color .15s, box-shadow .15s;
}
.cp-ff-btn:hover { border-color: var(--cp-accent-a40, #f0a57a); }
.cp-ff.open .cp-ff-btn, .cp-ff-btn:focus-visible { outline: none; border-color: var(--cp-accent); box-shadow: 0 0 0 3px var(--cp-accent-a16, rgba(232,89,12,.16)); }
.cp-ff-ic { flex: none; width: calc(var(--cp-search-h) * .58); height: calc(var(--cp-search-h) * .58); max-width: 36px; max-height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--cp-accent-a14, rgba(232,89,12,.12)); color: var(--cp-accent); transition: .15s; }
.cp-ff-ic svg { width: 18px; height: 18px; }
.cp-ff-btn.on .cp-ff-ic { background: var(--cp-accent); color: #fff; }
.cp-ff-lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cp-muted); font-weight: 500; }
.cp-ff-btn.on .cp-ff-lbl { color: var(--cp-text); font-weight: 700; }
.cp-ff-x { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 18px; line-height: 1; color: var(--cp-muted); }
.cp-ff-x:hover { background: var(--cp-accent-a14, rgba(232,89,12,.12)); color: var(--cp-accent); }
.cp-ff-x[hidden] { display: none; }
.cp-ff-chev { flex: none; display: grid; color: var(--cp-muted); transition: transform .2s; }
.cp-ff-chev svg { width: 17px; height: 17px; }
.cp-ff.open .cp-ff-chev { transform: rotate(180deg); color: var(--cp-accent); }

.cp-ff-pop {
  position: absolute; top: calc(100% + 8px); right: 0; width: max(100%, 340px); z-index: 99980;
  background: var(--cp-surface, #fff); border: 1px solid var(--cp-line); border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 48px -16px rgba(15,42,68,.32), 0 4px 12px rgba(15,42,68,.08);
  animation: cp-ff-in .16s ease-out; font-family: var(--cp-font);
}
.cp-ff-avant .cp-ff-pop { right: auto; left: 0; }
.cp-ff-pop[hidden] { display: none; }
@keyframes cp-ff-in { from { opacity: 0; transform: translateY(-6px); } }
.cp-ff-s { position: relative; padding: 10px; border-bottom: 1px solid var(--cp-line); }
.cp-ff-s svg { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--cp-muted); pointer-events: none; }
.cp-ff-s input {
  display: block; width: 100%; height: 40px; margin: 0; padding: 0 12px 0 36px; box-sizing: border-box;
  font: 500 14px/1 var(--cp-font); color: var(--cp-text); background: var(--cp-bg, #f6f8fa);
  border: 1px solid transparent; border-radius: 10px; outline: none; transition: .15s;
}
.cp-ff-s input:focus { background: var(--cp-surface, #fff); border-color: var(--cp-accent); box-shadow: 0 0 0 3px var(--cp-accent-a16, rgba(232,89,12,.16)); }
.cp-ff-list { list-style: none; margin: 0; padding: 6px; max-height: calc(8 * 46px + 12px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--cp-line) transparent; }
.cp-ff-list::-webkit-scrollbar { width: 8px; }
.cp-ff-list::-webkit-scrollbar-thumb { background: var(--cp-line); border-radius: 8px; border: 2px solid var(--cp-surface, #fff); }
.cp-ff-list li { position: relative; display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px 0 10px; border-radius: 10px; cursor: pointer; font-size: 13.5px; color: var(--cp-text); margin: 0 0 2px; transition: background-color .12s; }
.cp-ff-list li::before, .cp-ff-list li::marker { content: none; }
.cp-ff-list li.all { margin-bottom: 6px; }
.cp-ff-list li.all::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -4px; height: 1px; background: var(--cp-line); }
.cp-ff-list li.act { background: var(--cp-accent-a8, rgba(232,89,12,.07)); }
.cp-ff-list li.sel { background: var(--cp-accent-a8, rgba(232,89,12,.07)); }
/* icône unique et simple pour tous les fournisseurs, aux couleurs du thème */
.cp-ff-av { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--cp-accent-a14, rgba(232,89,12,.12)); color: var(--cp-accent); transition: background-color .12s, color .12s; }
.cp-ff-av svg { width: 17px; height: 17px; }
.cp-ff-list li.sel .cp-ff-av { background: var(--cp-accent); color: #fff; }
.cp-ff-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; letter-spacing: .01em; }
.cp-ff-list li.sel .cp-ff-n { color: var(--cp-accent); }
.cp-ff-n mark { background: none; color: var(--cp-accent); font-weight: 800; padding: 0; }
.cp-ff-c { flex: none; font-size: 12px; font-weight: 600; color: var(--cp-muted); font-variant-numeric: tabular-nums; }
.cp-ff-ok { flex: none; width: 18px; display: grid; color: var(--cp-accent); visibility: hidden; }
.cp-ff-ok svg { width: 17px; height: 17px; }
.cp-ff-list li.sel .cp-ff-ok { visibility: visible; }
.cp-ff-none { justify-content: center; color: var(--cp-muted) !important; cursor: default !important; height: auto !important; padding: 18px 10px !important; text-align: center; font-size: 13px; }
@media (max-width: 700px) { .cp-has-ff .cp-ff { display: none; } }
@media (prefers-reduced-motion: reduce) { .cp-ff-pop { animation: none; } .cp-ff-chev { transition: none; } }

/* ===================================================== bandeau « En direct » */
.cp-live { display: none; }
.cp-has-live .cp-live:not([hidden]) {
  display: flex; align-items: center; gap: 12px; flex: 1 1 0; min-width: 260px; height: var(--cp-search-h); margin-left: 12px;
  padding: 0 14px 0 12px; background: var(--cp-surface); border: var(--cp-border-w) solid var(--cp-line); border-radius: var(--cp-radius);
  box-shadow: 0 1px 2px rgba(16,24,40,.04); font-family: var(--cp-font); overflow: hidden;
}
.cp-has-live .cp-search { flex: 0 1 auto; min-width: 0; margin-left: 0; margin-right: 0; }
.cp-has-live.cp-ff-droite .cp-ff { margin-left: 12px; padding-left: 0; }
.cp-has-live.cp-ff-avant .cp-live { order: 2; }
.cp-live-tag { flex: none; display: inline-flex; align-items: center; gap: 8px; padding-right: 12px; border-right: 1px solid var(--cp-line); font-size: 12.5px; font-weight: 700; color: #16884a; white-space: nowrap; letter-spacing: .01em; }
.cp-live-tag i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.cp-live-tag i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22c55e; opacity: 0; animation: cp-live-ping 2s ease-out infinite; }
@keyframes cp-live-ping { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.cp-live-view { position: relative; flex: 1; min-width: 0; height: 100%; }
.cp-live-msg { position: absolute; inset: 0; display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--cp-text); font-size: calc(var(--cp-search-fs) * .8); line-height: 1.3; }
.cp-live-msg.in { animation: cp-live-in .45s cubic-bezier(.2,.8,.2,1) both; }
.cp-live-msg.out { animation: cp-live-out .45s cubic-bezier(.4,0,.6,1) both; }
@keyframes cp-live-in { from { opacity: 0; transform: translateY(70%); } }
@keyframes cp-live-out { to { opacity: 0; transform: translateY(-70%); } }
.cp-live-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--cp-accent-a14, rgba(232,89,12,.12)); color: var(--cp-accent); }
.cp-live-ic svg { width: 15px; height: 15px; }
.cp-live-txt { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--cp-text); }
.cp-live-txt b { font-weight: 700; }
.cp-live-txt .sep { color: var(--cp-muted); margin: 0 2px; }
.cp-live-msg.rtl .cp-live-txt { font-family: "Segoe UI", "Noto Sans Arabic", "Noto Kufi Arabic", Tahoma, var(--cp-font); font-size: 1.04em; font-weight: 600; unicode-bidi: plaintext; }
.cp-live-t { flex: none; font-size: .88em; color: var(--cp-muted); white-space: nowrap; }
.cp-live-go { flex: none; display: grid; color: var(--cp-accent); opacity: 0; transform: translateX(-4px); transition: .2s; }
.cp-live-go svg { width: 15px; height: 15px; }
.cp-live-msg.link { cursor: pointer; }
.cp-live-msg.link:hover .cp-live-txt b:first-child { color: var(--cp-accent); }
.cp-live-msg.link:hover .cp-live-go, .cp-live-msg.link:focus-visible .cp-live-go { opacity: 1; transform: none; }
.cp-live-msg:focus-visible { outline: 2px solid var(--cp-accent); outline-offset: 2px; border-radius: 6px; }
.cp-live-dots { flex: none; display: flex; gap: 4px; }
.cp-live-dots:empty { display: none; }
.cp-live-dots i { width: 5px; height: 5px; border-radius: 99px; background: var(--cp-line); transition: .3s; }
.cp-live-dots i.on { width: 14px; background: var(--cp-accent); }
@media (max-width: 1100px) { .cp-has-live .cp-live:not([hidden]) { display: none; } }
@media (prefers-reduced-motion: reduce) { .cp-live-tag i::after { animation: none; } .cp-live-msg.in, .cp-live-msg.out { animation: none; } }
.cp-ff-apres .cp-ff { order: 1; }
.cp-ff-apres .cp-live { order: 2; }
