/* ============================================================================
   ShelfIQ — Layout & components
   ============================================================================ */

@import url('tokens.css');

/* ------------------------------------------------- Ruptures en cours (65166) */
.current-oos-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  min-width: 0;
}
.current-oos-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.current-oos-title-logo {
  height: 26px;
  width: 26px;
  flex: none;
}
/* Le sous-titre garde 24px ailleurs. Ici les onglets suivent tout de suite,
   et le gap de la page suffit. */
.current-oos-page .page-subtitle {
  margin-bottom: 0;
}
.current-oos-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  /* Le `gap` de `.current-oos-page` suffit au-dessus : on resserre la barre
     contre la carte des filtres dont elle dépend. */
  margin-top: -6px;
}
/* `.btn-primary:disabled` met un curseur occupé. Ici le PDF est souvent
   inactif avant tout clic (liste pas encore chargée, recherche, export
   Excel). Le curseur occupé n'apparaît que pendant la génération du PDF. */
.current-oos-actions > .btn-primary:disabled {
  cursor: not-allowed;
}
.current-oos-actions > .btn-primary.is-busy:disabled {
  cursor: progress;
}
.current-oos-schedule-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.current-oos-infos {
  position: relative;
}
.current-oos-infos-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(320px, 80vw);
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 12px 14px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  text-align: left;
}
.current-oos-infos-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.current-oos-infos-head strong {
  margin-right: auto;
  font-size: 14px;
}
.current-oos-infos-head button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--niq-700);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.current-oos-infos-hint {
  margin: 6px 0 10px;
  color: var(--gray-500);
  font-size: 12px;
  line-height: 1.4;
}
.current-oos-infos-group {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
}
.current-oos-infos-group h4 {
  margin: 0;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.current-oos-infos-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.current-oos-schedule-button svg,
.current-oos-schedule-title-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modal.current-oos-schedule-modal {
  width: min(650px, calc(100vw - 48px));
  max-height: min(860px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.current-oos-schedule-modal .current-oos-schedule-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.current-oos-groups-hint,
.current-oos-groups-empty {
  margin: 0 0 12px;
  color: var(--gray-500);
  font-size: 13px;
}
.current-oos-group-editor {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.current-oos-group-editor label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.current-oos-group-editor textarea {
  width: 100%;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 12px;
}
.current-oos-groups-error {
  margin: 10px 0 0;
  color: var(--danger, #b42318);
  font-size: 13px;
}
.modal.current-oos-exclusion-modal {
  width: min(960px, calc(100vw - 48px));
  max-height: min(860px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.current-oos-exclusion-modal .current-oos-schedule-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}
.current-oos-exclusion-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 10px;
  padding: 8px 0;
  background: white;
}
.current-oos-exclusion-toolbar .input { flex: 1; min-width: 0; }
.current-oos-exclusion-summary {
  margin: 0;
  color: var(--gray-500);
  font-size: 12px;
  white-space: nowrap;
}
.btn-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--niq-600, #2f6df6);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.btn-link:hover { text-decoration: underline; }
.current-oos-exclusion-table-wrap {
  max-height: min(480px, 56vh);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.current-oos-exclusion-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.current-oos-exclusion-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: var(--gray-50, #f8fafc);
  border-bottom: 1px solid var(--border);
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: left;
}
.current-oos-exclusion-th-check { width: 36px; }
.current-oos-exclusion-th-n { width: 90px; text-align: right; }
.current-oos-exclusion-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--gray-100, #f1f5f9);
  vertical-align: middle;
}
.current-oos-exclusion-table tr:last-child td { border-bottom: 0; }
.current-oos-exclusion-td-check { width: 36px; }
.current-oos-exclusion-td-n {
  width: 90px;
  text-align: right;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}
.current-oos-exclusion-row-cat {
  background: var(--gray-50, #f8fafc);
  font-weight: 650;
}
.current-oos-exclusion-row-cat.is-checked,
.current-oos-exclusion-row-sub.is-checked {
  background: var(--niq-50, #eef4ff);
}
.current-oos-exclusion-row-sub td:nth-child(3) { padding-left: 26px; }
.current-oos-exclusion-whole {
  color: var(--gray-500);
  font-style: italic;
  font-weight: 500;
}
.current-oos-exclusion-missing {
  margin-left: 6px;
  color: var(--gray-500);
  font-size: 11px;
  font-style: italic;
}
.current-oos-schedule-head,
.current-oos-schedule-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}
.current-oos-schedule-head { border-bottom: 1px solid var(--border); }
.current-oos-schedule-head > div:nth-child(2) { flex: 1; min-width: 0; }
.current-oos-schedule-head h3 { margin: 0; font-size: 18px; }
.current-oos-schedule-head p {
  margin: 3px 0 0;
  color: var(--gray-500);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-oos-schedule-title-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary, #2f6df6);
  background: #eef4ff;
}
.current-oos-schedule-title-icon svg { width: 21px; height: 21px; }
.current-oos-schedule-body {
  padding: 4px 20px 20px;
  overflow: auto;
}
.current-oos-schedule-loading {
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gray-500);
}
.current-oos-schedule-enabled {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 2px;
  padding: 12px;
  border-radius: 10px;
  background: var(--gray-50, #f8fafc);
}
.current-oos-schedule-enabled input { margin-top: 3px; }
.current-oos-schedule-enabled span { display: grid; gap: 2px; }
.current-oos-schedule-enabled small { color: var(--gray-500); }
.current-oos-schedule-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.current-oos-schedule-section:last-of-type { border-bottom: 0; }
.current-oos-schedule-section h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--gray-700);
}
.current-oos-schedule-section .muted { margin: 8px 0 0; font-size: 12px; }
.current-oos-schedule-formats {
  display: flex;
  gap: 10px;
}
.current-oos-schedule-formats label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.current-oos-schedule-recipients {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.current-oos-schedule-recipient {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  border-radius: 999px;
  color: #173f9d;
  background: #eef4ff;
  font-size: 12px;
}
.current-oos-schedule-recipient button {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.current-oos-schedule-recipient-input { display: flex; gap: 8px; }
.current-oos-schedule-recipient-input .input { flex: 1; }
.current-oos-schedule-days {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(7, 1fr);
}
.current-oos-schedule-days button {
  padding: 7px 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--gray-600);
  background: white;
  cursor: pointer;
  font-size: 12px;
}
.current-oos-schedule-days button.selected {
  border-color: #2f6df6;
  color: #173f9d;
  background: #eef4ff;
  font-weight: 700;
}
.current-oos-schedule-time-input {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}
.current-oos-schedule-time-input label {
  display: grid;
  gap: 4px;
  color: var(--gray-600);
  font-size: 12px;
}
.current-oos-schedule-time-input select {
  width: 96px;
  min-width: 96px;
}
.current-oos-schedule-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--gray-500);
  font-size: 12px;
}
.current-oos-schedule-shortcuts button {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--gray-600);
  background: white;
  cursor: pointer;
  font-size: 12px;
}
.current-oos-schedule-shortcuts button:disabled {
  opacity: 0.4;
  cursor: default;
}
.current-oos-schedule-error {
  margin: 12px 0 0;
  color: var(--danger, #d92d20);
  font-size: 13px;
}
.current-oos-schedule-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
@media (max-width: 650px) {
  .current-oos-schedule-days { grid-template-columns: repeat(4, 1fr); }
}
.current-oos-tab-icon {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger, #d92d20);
}
.current-oos-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
/* Cartes côte à côte espacées par `gap` : le margin-top global des `.card`
   adjacentes décalerait les 2e et 3e vers le bas. */
.current-oos-kpis .card + .card { margin-top: 0; }
.current-oos-kpi-loader {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--gray-500);
  font-size: 13px;
}
.current-oos-kpi {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  overflow: hidden;
}
.current-oos-kpi-title {
  margin: 0;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
}
.current-oos-kpi-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px 16px;
}
.current-oos-kpi-scope {
  justify-self: start;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 650;
}
.current-oos-kpi-label {
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 650;
  color: var(--gray-800);
}
.current-oos-kpi-value {
  margin: 0;
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}
.current-oos-kpi-gauge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.current-oos-kpi-donut {
  position: relative;
  width: 104px;
  height: 104px;
  flex: 0 0 auto;
}
.current-oos-kpi-donut svg {
  width: 100%;
  height: 100%;
  /* Le tracé part de midi, sinon l'arc démarre à 3 h. */
  transform: rotate(-90deg);
}
.current-oos-kpi-donut circle {
  fill: none;
  stroke-width: 8;
}
.current-oos-kpi-donut-track { stroke: var(--gray-200); }
.current-oos-kpi-donut-value {
  stroke: #ea580c;
  stroke-linecap: round;
}
.current-oos-kpi-donut-rate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-800);
}
.current-oos-kpi-gauge-counts {
  display: grid;
  justify-items: center;
  gap: 2px;
}
.current-oos-kpi-gauge-counts strong {
  font-size: 24px;
  font-weight: 800;
}
.current-oos-kpi-gauge-counts span {
  font-size: 12px;
  color: var(--gray-500);
}
.current-oos-kpi-split {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  /* Aligné sur la jauge du dessus, pas sur toute la carte : une barre pleine
     largeur se lisait comme un réglage manipulable. */
  width: min(100%, 220px);
  justify-self: center;
}
.current-oos-kpi-split-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--gray-200);
}
.current-oos-kpi-split-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  min-width: 10px;
  border-radius: 999px;
  background: #7c3aed;
}
.current-oos-kpi-split-pct {
  position: absolute;
  top: 50%;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.current-oos-kpi-split-pct.is-inside {
  transform: translate(-100%, -50%);
  padding-right: 8px;
  color: white;
}
.current-oos-kpi-split-pct.is-outside {
  transform: translateY(-50%);
  padding-left: 7px;
  color: #7c3aed;
}
.current-oos-kpi-split-legend {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--gray-600);
}
.current-oos-kpi-split-legend > span {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.current-oos-kpi-split-legend > span::before {
  content: "";
  align-self: center;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}
.current-oos-kpi-split-legend strong {
  font-size: 13px;
  color: var(--gray-900);
}
.current-oos-kpi-split-long { color: #7c3aed; }
.current-oos-kpi-split-short { color: var(--gray-400); }
.current-oos-kpi-split-legend > span > span:last-child { color: var(--gray-600); }
.current-oos-kpi-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.current-oos-kpi-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-100);
}
.current-oos-kpi-list li:last-child { border-bottom: 0; }
.current-oos-kpi-list-labels {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.current-oos-kpi-list-labels strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-oos-kpi-list-labels small {
  font-size: 11px;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-oos-kpi-list-value {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
}
.current-oos-kpi-empty {
  margin: 0;
  padding: 12px 0;
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
}
@media (max-width: 900px) {
  .current-oos-kpis { grid-template-columns: minmax(0, 1fr); }
}
.current-oos-filter-card { padding: 16px; }
.current-oos-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.current-oos-filter {
  display: grid;
  gap: 6px;
  flex: 1 1 150px;
  min-width: max-content;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 650;
}
.current-oos-filter > span { white-space: nowrap; }
.current-oos-filter-store { flex: 1.6 1 240px; }
.current-oos-wine-colors { flex: 1.4 1 280px; }
.current-oos-wine-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.current-oos-wine-modes .btn.active {
  background: var(--niq-500, #2D6DF6);
  border-color: var(--niq-500, #2D6DF6);
  color: #fff;
}
.current-oos-wine-badge.is-rouge { background: #9f1239; color: #fff; }
.current-oos-wine-badge.is-blanc {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}
.current-oos-wine-badge.is-rose { background: #fb7185; color: #fff; }
.current-oos-wine-badge.is-effervescent { background: #fef3c7; color: #92400e; }
.current-oos-wine-badge.is-region { background: #e0e7ff; color: #312e81; }
.current-oos-wine-edit {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-200, #e5e7eb);
}
.current-oos-wine-edit-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--gray-600);
}
.current-oos-wine-field { display: grid; gap: 4px; }
.current-oos-wine-edit .current-oos-multi-control {
  height: auto;
  min-height: 34px;
  flex-wrap: wrap;
  overflow: visible;
  padding-top: 4px;
  padding-bottom: 4px;
}
.cb-menu.current-oos-wine-popover {
  position: fixed;
  z-index: 200;
  right: auto;
  max-height: 220px;
}
.current-oos-filter-group { flex: 1.4 1 220px; }
.current-oos-filter-aisle { flex: 1.2 1 200px; }
.current-oos-aisle-group {
  margin-left: 6px;
  color: var(--gray-500, #6b7280);
  font-size: 11px;
  font-weight: 500;
}
.current-oos-filter .cb {
  display: block;
  width: 100%;
  min-width: 0;
}
.current-oos-filter .cb-input { min-width: 0; }
.current-oos-filter .cb:not(.current-oos-multi) .cb-menu {
  width: max-content;
  min-width: 100%;
  max-width: min(420px, 80vw);
}
.current-oos-filter-type { flex: 2.2 1 320px; }
.current-oos-filter-source { flex: 0 0 auto; }
.current-oos-filter-sort { flex: 1.5 1 220px; }
.current-oos-filter .input {
  width: 100%;
  height: 38px;
  min-width: 0;
}
.current-oos-stock-menu {
  display: grid;
  gap: 10px;
  padding: 10px;
  overflow: visible;
}
.current-oos-stock-operators {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}
.current-oos-stock-operators .btn {
  min-width: 0;
  height: 38px;
  padding: 0;
  justify-content: center;
  gap: 0;
  border-color: var(--gray-300);
  color: var(--gray-700);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}
.current-oos-stock-operators .btn.active {
  border-color: var(--niq-500);
  background: var(--niq-500);
  color: white;
  box-shadow: 0 0 0 3px rgb(45 109 246 / 12%);
}
.current-oos-stock-value {
  display: grid;
  gap: 6px;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 650;
}
.current-oos-stock-value .input { min-width: 0; }
.current-oos-stock-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.current-oos-multi {
  display: block;
  width: 100%;
}
.current-oos-multi-control {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  height: 38px;
  min-height: 38px;
  padding: 0 34px 0 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.current-oos-multi-control:hover { border-color: var(--gray-300); }
.current-oos-multi-control.open,
.current-oos-multi-control:focus,
.current-oos-multi-control:focus-within {
  border-color: var(--niq-400);
  box-shadow: 0 0 0 3px rgb(45 109 246 / 10%);
  outline: none;
}
.current-oos-multi-placeholder {
  overflow: hidden;
  color: var(--gray-500);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-oos-multi-input {
  flex: 1 1 36px;
  min-width: 36px;
  width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gray-900);
  font: inherit;
  font-weight: 500;
  outline: none;
}
.current-oos-multi-input::placeholder {
  color: var(--gray-500);
  font-weight: 500;
}
.current-oos-multi-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 3px 5px 3px 8px;
  border-radius: 6px;
  background: var(--niq-100);
  color: var(--niq-800);
  font-size: 12px;
  font-weight: 600;
}
.current-oos-multi-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-oos-multi-chip button {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--niq-700);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}
.current-oos-multi-chip button:hover { background: rgb(25 68 168 / 12%); }
.current-oos-multi .cb-menu { min-width: 100%; }
.current-oos-search-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto auto auto;
  gap: 8px;
  margin-top: 14px;
}
.current-oos-barcode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.current-oos-barcode-toggle input {
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.current-oos-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.current-oos-results-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
}
.current-oos-loading,
.current-oos-empty {
  padding: 32px;
  text-align: center;
  color: var(--gray-500);
}
.current-oos-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
/* Cartes fantômes : elles occupent la place des vraies lignes pendant la
   requête, donc la page ne saute pas quand les résultats arrivent. */
.current-oos-skeleton {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.current-oos-skeleton-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}
.current-oos-skeleton-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
}
.current-oos-skeleton-lines {
  display: grid;
  flex: 1 1 auto;
  gap: 10px;
}
.current-oos-list {
  display: grid;
  gap: 24px;
  transition: opacity .15s ease;
}
.current-oos-list.is-refreshing { opacity: .55; pointer-events: none; }
.current-oos-category-group,
.current-oos-subcategory-group,
.current-oos-aisle-group {
  display: grid;
}
.current-oos-category-group { gap: 14px; }
.current-oos-subcategory-group {
  gap: 12px;
  margin-left: 12px;
}
.current-oos-aisle-group {
  gap: 0;
  margin-left: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
}
.current-oos-category-head,
.current-oos-subcategory-head,
.current-oos-aisle-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
}
.current-oos-category-head {
  padding: 12px 14px;
  border: 1px solid #dfe7f6;
  border-left: 3px solid #77a0ee;
  border-radius: var(--radius-md);
  background: #f2f6fd;
  color: #26364d;
  font-size: 16px;
}
.current-oos-subcategory-head {
  padding: 9px 12px;
  border: 1px solid #e8ebf1;
  border-radius: var(--radius-md);
  background: #fafbfc;
  color: #536071;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .025em;
}
.current-oos-aisle-head {
  min-height: 44px;
  padding: 9px 14px;
  border-bottom: 1px solid #dfe4eb;
  background: #eef1f5;
  color: #354357;
  font-size: 14px;
}
.current-oos-group-count {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fde7e9;
  color: #c52236;
  font-size: 12px;
  font-weight: 750;
  text-transform: none;
  letter-spacing: 0;
}
.current-oos-aisle-articles {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: var(--gray-50);
}
.current-oos-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 650;
}
.current-oos-pagination-range {
  color: var(--gray-400);
  font-weight: 500;
}
.current-oos-pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.current-oos-pagination-page { min-width: 34px; justify-content: center; }
.current-oos-pagination-page.is-current {
  background: var(--niq-500);
  border-color: var(--niq-500);
  color: white;
}
.current-oos-pagination-gap { padding: 0 2px; color: var(--gray-400); }
.current-oos-pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.current-oos-pagination-jump input {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font: inherit;
  -moz-appearance: textfield;
}
.current-oos-pagination-jump input::-webkit-outer-spin-button,
.current-oos-pagination-jump input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.current-oos-card { overflow: hidden; padding: 0; }
.current-oos-card.is-price-error {
  border-color: var(--niq-500);
  box-shadow: 0 0 0 1px var(--niq-500);
}
.current-oos-card.is-price-error .current-oos-alert {
  background: var(--niq-50);
  color: var(--niq-700);
}
.current-oos-card.is-price-error .current-oos-duration {
  background: var(--niq-500);
}
.current-oos-card.is-facing {
  border-color: #d97706;
  box-shadow: 0 0 0 1px #d97706;
}
.current-oos-card.is-facing .current-oos-alert {
  background: #fffbeb;
  color: #b45309;
}
.current-oos-card.is-facing .current-oos-duration {
  background: #d97706;
}
/* Le batch envoie un portrait du slot. Une hauteur fixe de 190 px le réduit
   à une bande : la colonne prend la largeur, la photo garde son rapport. */
.current-oos-card.is-facing .current-oos-crop a {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  height: auto;
  background: #edf1f5;
}
.current-oos-card.is-facing .current-oos-crop img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 480px;
}
.current-oos-facing-note {
  margin: 5px 0;
  color: #b45309;
  font-size: 12px;
  font-weight: 650;
}
.current-oos-vlm {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
}
.current-oos-vlm.is-verified { background: #047857; color: #fff; }
.current-oos-vlm.is-rejected { background: #b91c1c; color: #fff; }
.current-oos-vlm-reason {
  margin: 4px 0 0;
  color: var(--gray-600);
  font-size: 12px;
  line-height: 1.35;
}
.current-oos-card.is-previous-product {
  border-color: #7c3aed;
  box-shadow: 0 0 0 1px #7c3aed;
}
.current-oos-card.is-previous-product .current-oos-alert {
  background: #f5f3ff;
  color: #6d28d9;
}
.current-oos-card.is-previous-product .current-oos-duration {
  background: #7c3aed;
}
.current-oos-previous-note {
  margin: 5px 0;
  color: #6d28d9;
  font-size: 12px;
  font-weight: 650;
}
.current-oos-reference-missing {
  color: var(--gray-500);
  font-size: 12px;
  font-style: italic;
}
.current-oos-source-badge {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.current-oos-card.is-previous-product .current-oos-source-badge.is-slot {
  color: #047857;
}
.current-oos-card.is-previous-product .current-oos-source-badge.is-position {
  color: #6d28d9;
}
.current-oos-duration {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  background: var(--niq-500);
  color: white;
  font-size: 14px;
  white-space: nowrap;
}
.current-oos-alert-badges {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
}
.current-oos-recoverable {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid #fdba74;
  border-radius: var(--radius-md);
  background: #fff7ed;
  color: #c2410c;
  font-size: 14px;
  white-space: nowrap;
}
.current-oos-recoverable-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: url("/static/icons/piggy-bank-light.png") center / contain no-repeat;
  mask: url("/static/icons/piggy-bank-light.png") center / contain no-repeat;
}
.current-oos-card-body {
  display: grid;
  grid-template-columns: minmax(330px, 1fr) minmax(0, 1.45fr) auto;
  gap: 16px;
  padding: 16px;
}
.current-oos-history {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.current-oos-crop {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--gray-50);
}
.current-oos-crop.is-now {
  border-color: var(--niq-200);
  background: var(--niq-50);
}
.current-oos-crop.is-now .current-oos-crop-label {
  border-bottom-color: var(--niq-200);
  background: var(--niq-50);
  color: var(--niq-700);
}
.current-oos-crop.is-now img { background: var(--niq-50); }
.current-oos-crop.is-now.is-stale {
  border-color: #f6c48a;
  background: #fff3e6;
}
.current-oos-crop.is-now.is-stale .current-oos-crop-label {
  border-bottom-color: #f6c48a;
  background: #fff3e6;
  color: #9a4d12;
}
.current-oos-crop.is-now.is-stale img { background: #fff3e6; }
.current-oos-crop.is-now.is-stale .current-oos-crop-received { color: #9a4d12; }
.current-oos-crop-label {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  background: white;
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 700;
}
.current-oos-crop a {
  position: relative;
  display: block;
  height: 190px;
  cursor: zoom-in;
}
/* Le conteneur reprend le rapport du crop : sans cela `object-fit: contain`
   laisserait des bandes et la boîte du slot tomberait à côté du produit. */
.current-oos-crop a.has-box {
  height: auto;
  aspect-ratio: var(--crop-ratio, 5 / 4);
}
.current-oos-crop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #edf1f5;
}
/* Zoom du contrôle de prix : même case que la vue globale, image contenue. */
.current-oos-crop a.is-fit {
  height: auto;
  aspect-ratio: var(--crop-ratio, 5 / 4);
}
.current-oos-crop a.has-box img {
  position: absolute;
  inset: 0;
  object-fit: fill;
}
.current-oos-crop-box {
  position: absolute;
  border: 1.5px solid #7ba4ea;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(31 41 55 / 22%);
  pointer-events: none;
}
.current-oos-crop.is-now .current-oos-crop-box { border-color: #ec6b7c; }
/* Contrôle de prix : le slot est souvent petit sur une photo large. */
.current-oos-crop.is-price .current-oos-crop-box { border-width: 3px; }
.current-oos-crop-received {
  margin: 0;
  padding: 7px 9px 8px;
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}
.current-oos-crop-missing {
  display: grid;
  place-items: center;
  height: 190px;
  padding: 16px;
  color: var(--gray-500);
  font-size: 12px;
  text-align: center;
}
.current-oos-product {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
}
.current-oos-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 10px 8px 12px;
  border-radius: var(--radius-md);
  background: #fff1f1;
  color: #cf202f;
  font-weight: 750;
}
.current-oos-alert-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.current-oos-product-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  align-items: start;
  gap: 12px;
}
.current-oos-product-copy { min-width: 0; }
.current-oos-product-copy h3 {
  margin: 0 0 6px;
  color: var(--gray-900);
  font-size: 20px;
  line-height: 1.15;
}
.current-oos-product-copy p {
  margin: 3px 0;
  font-size: 12px;
  line-height: 1.35;
}
.current-oos-barcode {
  width: min(100%, 250px);
  height: 46px;
  margin-top: 7px;
  padding: 3px 0;
  overflow: hidden;
  background: white;
}
.current-oos-barcode svg {
  display: block;
  width: 100%;
  height: 100%;
}
.current-oos-product-thumb {
  width: 104px;
  height: 104px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  cursor: zoom-in;
}
.current-oos-product-thumb:hover { border-color: var(--niq-300); }
.current-oos-product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.oos-lightbox { width: min(1040px, 94vw); }
.oos-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.oos-lightbox-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.oos-lightbox-title .muted { font-size: 12px; }
/* Même principe que les vignettes de la liste : le cadre reprend le rapport du
   crop pour que la boîte du slot reste alignée sur le produit. */
.oos-lightbox-figure {
  position: relative;
  margin: 0 auto;
  background: #edf1f5;
}
.oos-lightbox-figure.has-ratio {
  /* Quand 72vh devient la contrainte active, réduire aussi la largeur.
     Sinon la hauteur seule est plafonnée et l'image `fill` est écrasée. */
  width: min(100%, calc(72vh * var(--crop-ratio, 5 / 4)));
  aspect-ratio: var(--crop-ratio, 5 / 4);
  max-height: 72vh;
}
.oos-lightbox-figure img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 72vh;
  object-fit: contain;
}
.oos-lightbox-figure.has-box img {
  position: absolute;
  inset: 0;
  max-height: none;
  object-fit: fill;
}
.oos-lightbox-head-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.oos-lightbox-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
}
.oos-lightbox-zoom .btn {
  min-width: 32px;
  padding: 4px 8px;
  justify-content: center;
}
.oos-lightbox-zoom-level.btn {
  min-width: 58px;
  font-variant-numeric: tabular-nums;
}
.oos-lightbox-figure.is-zoomable {
  overflow: hidden;
  touch-action: none;
  user-select: none;
  cursor: zoom-in;
}
.oos-lightbox-figure.is-zoomed { cursor: grab; }
.oos-lightbox-figure.is-dragging { cursor: grabbing; }
.oos-lightbox-stage {
  position: relative;
  transform-origin: 0 0;
}
.oos-lightbox-figure.has-ratio .oos-lightbox-stage {
  position: absolute;
  inset: 0;
}
.oos-lightbox-figure:not(.is-dragging) .oos-lightbox-stage { transition: transform 0.12s ease-out; }
.oos-lightbox-stage img { -webkit-user-drag: none; }
.oos-lightbox-figure.is-product {
  padding: 18px;
  background: white;
}
.oos-lightbox-figure.is-product img { max-height: 42vh; }
.oos-lightbox-figure .current-oos-crop-box {
  border-color: #ec6b7c;
  border-width: calc(1.5px / var(--zoom-scale, 1));
}
/* Épaisseur ramenée à l'échelle : zoomé, le cadre ne masque pas l'étiquette. */
.oos-lightbox-figure.is-price .current-oos-crop-box { border-width: calc(4px / var(--zoom-scale, 1)); }
.oos-lightbox-linked-eans {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: white;
}
.oos-lightbox-linked-eans-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.oos-lightbox-linked-eans > p {
  margin: 4px 0;
  font-size: 12px;
}
.oos-lightbox-linked-ean-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
}
.oos-lightbox-linked-ean {
  /* Assez large pour afficher un EAN13 complet sans ellipse. */
  flex: 0 0 132px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
}
.oos-lightbox-linked-ean:hover { border-color: var(--niq-300); }
.oos-lightbox-linked-ean-open {
  display: grid;
  grid-template-rows: 84px auto;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.oos-lightbox-linked-ean-open img {
  width: 100%;
  height: 84px;
  object-fit: contain;
}
.oos-lightbox-linked-ean-adopt.btn {
  width: 100%;
  min-height: 28px;
  padding: 3px 4px;
  font-size: 10px;
  line-height: 1.2;
  white-space: normal;
}
.oos-lightbox-linked-ean-open span {
  overflow: hidden;
  color: var(--gray-700);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oos-lightbox-alternatives {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
}
.oos-lightbox-alternatives-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.oos-lightbox-alternatives-head p {
  margin: 2px 0 0;
  font-size: 12px;
}
.oos-lightbox-alternative-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(68px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
}
.oos-lightbox-alternative {
  position: relative;
  min-width: 68px;
  height: 86px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  cursor: pointer;
}
.oos-lightbox-alternative:hover { border-color: var(--niq-300); }
.oos-lightbox-alternative.is-selected {
  border-color: var(--niq-500);
  box-shadow: 0 0 0 2px var(--niq-100);
}
.oos-lightbox-alternative.is-loading {
  background: linear-gradient(100deg, #eef1f5 30%, #f8f9fb 50%, #eef1f5 70%);
  background-size: 220% 100%;
}
.oos-lightbox-alternative img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.oos-lightbox-alternative > span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgb(31 41 55 / 75%);
  color: white;
  font-size: 10px;
  font-weight: 750;
}
.oos-lightbox-feedback {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 650;
}
.oos-lightbox-feedback.is-success { color: #13834e; }
.oos-lightbox-feedback.is-error { color: var(--danger); }
.oos-lightbox-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}
.ean-studio-overlay { z-index: 120; }
.ean-studio-notices {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}
.ean-studio-notice {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 12px;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.ean-studio-notice.is-error { background: #7f1d1d; }
.ean-studio-notice-open,
.ean-studio-notice-close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.ean-studio-notice-open {
  flex: 1;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.ean-studio-notice-close {
  padding: 0 12px;
  font-size: 18px;
  line-height: 1;
}
.mobile-shelf-box.is-identifying {
  outline: 2px solid #2d6df6;
  outline-offset: 1px;
}
.ean-studio-progress {
  display: grid;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--gray-50, #f8fafc);
}
.ean-studio-progress strong { font-size: 13px; }
.ean-studio-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}
.ean-studio-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.25s ease;
}
.ean-studio-progress ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ean-studio-progress li {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-500, #667085);
  font-size: 12px;
}
.ean-studio-progress li > span:first-child {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #e5e7eb;
  font-size: 11px;
  font-weight: 700;
}
.ean-studio-progress li.is-active { color: #1d4ed8; font-weight: 700; }
.ean-studio-progress li.is-active > span:first-child { background: #dbeafe; color: #1d4ed8; }
.ean-studio-progress li.is-done { color: #166534; }
.ean-studio-progress li.is-done > span:first-child { background: #dcfce7; color: #166534; }
.ean-studio-progress li.is-error { color: #b91c1c; }
.ean-studio-progress li.is-error > span:first-child { background: #fee2e2; color: #b91c1c; }
.ean-studio { width: min(1040px, 94vw); }
.ean-studio .chip { gap: 6px; }
.ean-studio h4 {
  margin: 14px 0 6px;
  color: var(--gray-500, #667085);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ean-studio-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 18px;
}
.ean-studio-photo img,
.ean-studio-placeholder {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--gray-50, #f8fafc);
}
.ean-studio-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 4;
}
.ean-studio-main { min-width: 0; }
.ean-studio-product {
  display: grid;
  gap: 2px;
}
.ean-studio-product strong { font-size: 15px; }
.ean-studio-eans {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}
.ean-studio-ean {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.ean-studio-ean.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}
.ean-studio-ean-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ean-studio-ean .muted { font-size: 12px; }
.ean-studio-ean .chip.is-confirmed_carrefour_fr { background: #dcfce7; color: #166534; }
.ean-studio-ean .chip.is-likely_carrefour_fr { background: #dbeafe; color: #1e40af; }
.ean-studio-ean .chip.is-unverified { background: #fef3c7; color: #92400e; }
.ean-studio-ean-title { font-size: 13px; }
.ean-studio-ean-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.ean-studio-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ean-studio-description p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
}
.ean-studio-warnings {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #92400e;
  font-size: 12px;
}
.ean-studio-sources {
  margin-top: 10px;
  font-size: 12px;
}
.ean-studio-sources a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ean-studio-thumbs {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.ean-studio-thumb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 12px;
  margin-top: 10px;
}
.ean-studio-thumb {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  min-height: 180px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.ean-studio-thumb.is-selected {
  border-color: #16a34a;
  background: #f0fdf4;
}
.ean-studio-thumb img {
  width: 140px;
  height: 140px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
}
.ean-studio-thumb .muted {
  margin: 0;
  font-size: 12px;
  text-align: center;
}
@media (max-width: 760px) {
  .ean-studio-body { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .oos-lightbox-alternatives-head {
    align-items: stretch;
    flex-direction: column;
  }
  .oos-lightbox-alternative-grid {
    grid-template-columns: repeat(10, 74px);
  }
}
.current-oos-place {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  justify-items: stretch;
  align-self: stretch;
  gap: 8px;
  width: 168px;
}
.current-oos-dates {
  display: grid;
  gap: 2px;
  color: var(--gray-500);
  font-size: 10px;
  font-style: italic;
  line-height: 1.3;
  text-align: right;
}
.current-oos-locator {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 7px;
  border: 1px solid #d7dce4;
  border-radius: 8px;
  background: #f4f6f9;
}
/* La gondole occupe toute la hauteur laissée par les photos : les niveaux
   s'étirent au lieu de se tasser en bandes de quelques pixels. */
.current-oos-map {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 150px;
}
.current-oos-map-row {
  display: flex;
  flex: 1 1 0;
  gap: 3px;
  min-height: 11px;
  max-height: 30px;
}
.current-oos-map-row > span {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid #c3cbd7;
  border-radius: 1px;
  background: white;
}
.current-oos-camera {
  display: grid;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid #d7dce4;
}
.current-oos-camera-id {
  min-width: 0;
  overflow: hidden;
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-oos-camera-actions {
  display: grid;
  gap: 6px;
}
.current-oos-camera-actions .btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding: 5px 6px;
  font-size: 11px;
  white-space: nowrap;
}
.current-oos-map-row > span.is-active {
  border-color: #c52236;
  background: #e8384f;
  box-shadow: 0 0 0 1px #fbd5da;
}
.current-oos-map-row > span > button {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.current-oos-location {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: 100%;
  overflow: hidden;
  border: 2px solid #94a5bd;
  border-radius: 8px;
  background: #f7f9fc;
  color: #2f4057;
  box-shadow: 0 2px 5px rgb(42 57 78 / 8%);
}
.current-oos-location > span {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 5px 3px 6px;
}
.current-oos-location > span + span { border-left: 1px solid #ccd5e1; }
.current-oos-location small {
  color: #718096;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}
.current-oos-location strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
}
.current-oos-product-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.current-oos-product-chips .chip {
  background: var(--niq-50);
  color: var(--niq-700);
  font-weight: 650;
}
.current-oos-loss-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0;
}
.current-oos-loss-chips .chip {
  font-weight: 650;
}
.current-oos-loss-now {
  background: #fff7ed;
  color: #c2410c;
}
.current-oos-loss-close {
  background: #fef2f2;
  color: #b91c1c;
}
.current-oos-price {
  background: var(--niq-50);
  color: var(--niq-700);
}
.current-oos-views { margin: 0 0 16px; }
.current-oos-views .subtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.current-oos-view-icon,
.current-oos-view-icon svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.current-oos-camera-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.current-oos-camera-view,
.current-oos-camera-results,
.current-oos-camera-bucket {
  min-width: 0;
  max-width: 100%;
}
.current-oos-camera-results.is-refreshing { opacity: .55; pointer-events: none; }
.current-oos-camera-bucket {
  position: relative;
  margin: 0 0 22px;
}
.current-oos-camera-bucket.is-group-dragging { opacity: .45; }
.current-oos-camera-bucket.is-group-drop-before::before,
.current-oos-camera-bucket.is-group-drop-after::after {
  content: "";
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 999px;
  background: var(--niq-600);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(43, 98, 255, .25);
  pointer-events: none;
}
.current-oos-camera-bucket.is-group-drop-before::before { top: -11px; }
.current-oos-camera-bucket.is-group-drop-after::after { bottom: -11px; }
.current-oos-camera-bucket .photo-grid {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 12px;
  margin-top: 10px;
  padding: 0 0 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
}
.current-oos-camera-bucket .photo-card {
  flex: 0 0 clamp(240px, 18vw, 300px);
  scroll-snap-align: start;
}
.current-oos-camera-bucket .photo-card.is-camera-draggable { cursor: grab; }
.current-oos-camera-locked {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}
.current-oos-camera-context-menu {
  position: fixed;
  z-index: 1200;
  width: min(300px, calc(100vw - 16px));
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(25, 38, 59, .24);
}
.current-oos-camera-context-head {
  display: grid;
  gap: 2px;
  padding: 7px 9px 9px;
  border-bottom: 1px solid var(--border);
}
.current-oos-camera-context-head strong {
  color: var(--gray-900);
  font-size: 13px;
}
.current-oos-camera-context-head small {
  overflow: hidden;
  color: var(--gray-500);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-oos-camera-context-list {
  display: grid;
  gap: 2px;
  max-height: min(420px, 58vh);
  padding-top: 5px;
  overflow-y: auto;
}
.current-oos-camera-context-list button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--gray-800);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.current-oos-camera-context-list button:hover,
.current-oos-camera-context-list button:focus-visible {
  outline: none;
  background: var(--niq-50);
  color: var(--niq-700);
}
.current-oos-camera-bucket .photo-card.is-camera-dragging { opacity: .45; }
.current-oos-camera-bucket .photo-card.is-camera-drop-before,
.current-oos-camera-bucket .photo-card.is-camera-drop-after {
  position: relative;
}
.current-oos-camera-bucket .photo-card.is-camera-drop-before::before,
.current-oos-camera-bucket .photo-card.is-camera-drop-after::after {
  content: "";
  position: absolute;
  z-index: 6;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 999px;
  background: var(--niq-600);
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(43, 98, 255, .25);
  pointer-events: none;
}
.current-oos-camera-bucket .photo-card.is-camera-drop-before::before {
  left: -9px;
}
.current-oos-camera-bucket .photo-card.is-camera-drop-after::after {
  right: -9px;
}
.current-oos-camera-view .current-oos-filter-card { margin-bottom: 16px; }
.current-oos-camera-view .current-oos-filter .cb { display: block; width: 100%; }
.current-oos-camera-view .current-oos-filter .cb-input { width: 100%; min-width: 0; }
.current-oos-camera-search-row {
  grid-template-columns: minmax(240px, 1fr) auto auto auto auto auto;
}
.camera-health-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 10px 16px;
  border: 1px solid #e5e9f0;
  border-radius: 10px;
  background: #f8fafc;
}
.camera-health-pills,
.camera-health-skel {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.camera-health-skel-pill {
  width: 168px;
  height: 34px;
  border-radius: 8px;
}
.camera-health-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  flex-shrink: 0;
}
.camera-health-mark svg { width: 11px; height: 11px; }
.camera-health-mark.is-battery { background: #ffedd5; color: #c2410c; }
.camera-health-mark.is-offline { background: #fee2e2; color: #dc2626; }
.camera-health-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}
.camera-health-title svg { width: 15px; height: 15px; }
.camera-health-sep {
  width: 1px;
  height: 20px;
  background: #d8dee8;
}
.camera-health-preview {
  margin-left: auto;
  font-size: 12px;
  color: #94a3b8;
}
.camera-health-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border: 1px solid;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.camera-health-pill.is-battery { border-color: #fed7aa; --camera-health-accent: #ea580c; --camera-health-tint: #fff7ed; }
.camera-health-pill.is-offline { border-color: #fecaca; --camera-health-accent: #dc2626; --camera-health-tint: #fef2f2; }
.camera-health-pill:hover { box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08); }
.camera-health-pill.is-active {
  border-color: var(--camera-health-accent);
  background: var(--camera-health-tint);
  box-shadow: 0 0 0 1px var(--camera-health-accent);
}
.camera-health-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--camera-health-tint);
  color: var(--camera-health-accent);
}
.camera-health-icon svg { width: 14px; height: 14px; }
.camera-health-pill.is-active .camera-health-icon { background: #fff; }
.camera-health-count {
  margin-left: 4px;
  font-weight: 700;
  color: var(--camera-health-accent);
}
.camera-health-total { margin-left: -4px; font-size: 12px; color: #94a3b8; }
.camera-health-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.camera-health-badge { margin-left: 6px; }
.camera-health-badge.is-low { background: #ffedd5; color: #c2410c; }
.camera-health-badge.is-offline { background: #fee2e2; color: #dc2626; }
.current-oos-camera-search-row .current-oos-camera-create { grid-column: 1 / -1; }
.current-oos-camera-view .current-oos-camera-drag-hint { margin: 12px 0 0; }
.current-oos-camera-bucket.is-drop-bucket {
  outline: 2px solid var(--niq-600);
  outline-offset: 4px;
  border-radius: 12px;
}
.current-oos-category-head .current-oos-camera-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}
.current-oos-camera-group-handle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #c8d5e8;
  border-radius: 8px;
  background: #fff;
  color: var(--niq-700);
  font-size: 18px;
  line-height: 1;
  cursor: grab;
}
.current-oos-camera-group-handle:active { cursor: grabbing; }
.current-oos-camera-group-handle:disabled {
  cursor: default;
  opacity: .55;
}
.current-oos-camera-rename {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.current-oos-camera-rename .input {
  width: min(280px, 70vw);
  min-width: 160px;
}
.current-oos-camera-drop-empty {
  flex: 1 0 220px;
  margin: 0;
  padding: 28px 16px;
  border: 1px dashed #c5d0e0;
  border-radius: 12px;
  color: var(--gray-500);
  text-align: center;
  background: #f8fafc;
}
.current-oos-camera-create {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.current-oos-camera-create .input { min-width: 220px; }
.current-oos-camera-bucket .photo-card-media img { cursor: pointer; }
.photo-card-missing {
  margin: 0;
  max-width: 16em;
  color: var(--gray-500);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
.current-oos-price-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.current-oos-price-compare span {
  display: grid;
  min-width: 108px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--gray-50);
}
.current-oos-price-compare small {
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 650;
}
.current-oos-price-compare strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.current-oos-price-compare span.is-price-ok strong { color: #0aa689; }
.current-oos-price-compare span.is-price-wrong strong { color: #d97706; }
.current-oos-price-compare span.is-price-partial strong {
  color: #94a3b8;
  font-style: italic;
}
@media (max-width: 1100px) {
  .current-oos-filter,
  .current-oos-filter-type,
  .current-oos-filter-sort,
  .current-oos-filter-source { flex: 1 1 calc(50% - 12px); min-width: 0; }
  .current-oos-card-body { grid-template-columns: 1fr; }
  .current-oos-place {
    grid-auto-flow: column;
    grid-template-rows: none;
    justify-content: start;
    align-items: center;
    width: auto;
    gap: 14px;
  }
  .current-oos-dates { text-align: left; }
  .current-oos-location { width: 120px; }
  .current-oos-locator { width: 168px; }
}
@media (max-width: 700px) {
  .current-oos-filter,
  .current-oos-filter-type,
  .current-oos-filter-sort,
  .current-oos-filter-source { flex-basis: 100%; min-width: 0; }
  .current-oos-search-row { grid-template-columns: 1fr 1fr; }
  .current-oos-search-row .input { grid-column: 1 / -1; }
  .current-oos-barcode-toggle { grid-column: 1 / -1; }
  .current-oos-results-head { align-items: flex-start; }
  .current-oos-alert {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .current-oos-alert-badges {
    justify-content: flex-start;
    width: 100%;
  }
  .current-oos-subcategory-group,
  .current-oos-aisle-group { margin-left: 0; }
  .current-oos-history { grid-template-columns: 1fr; }
  .current-oos-crop a:not(.has-box),
  .current-oos-crop-missing { height: 220px; }
}

* { box-sizing: border-box; }

:root {
  --header-height: 64px;
  --sidebar-width: 252px;
  --sidebar-collapsed-width: 72px;
  /* Le header est le seul chrome horizontal sticky. */
  --sticky-chrome-h: var(--header-height);
}

html, body {
  margin: 0; padding: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--gray-800);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
body { overflow-x: hidden; }

button { font-family: inherit; cursor: pointer; }
a { color: var(--niq-600); text-decoration: none; }
a:hover { text-decoration: underline; }

[x-cloak] { display: none !important; }

/* ------------------------------------------------------------------ Header */

.header {
  position: sticky; top: 0; z-index: 80;
  background: white;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  width: 100%; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 24px;
  height: var(--header-height);
}
.header-nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  color: var(--gray-700);
}
.header-nav-toggle:hover,
.header-nav-toggle:focus-visible {
  border-color: var(--niq-300);
  background: var(--niq-50);
  color: var(--niq-700);
  outline: none;
}
.header-nav-toggle svg {
  width: 20px;
  height: 20px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  flex: 0 0 auto;
}
.logo-niq {
  height: 22px;
  width: auto;
  display: block;
}
.logo-niq path { fill: var(--niq-500); }
.logo-niq-brand {
  height: 18px;
}

.logo-vusion {
  height: 22px;
  width: 22px;
  display: block;
}
.logo-vusion path { fill: var(--vusion-500); }
.logo-vusion-brand {
  height: 28px;
  width: 28px;
}
.logo-vusion-text {
  font-size: 12px;
  font-weight: 700;
  color: var(--vusion-600);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.partner-vusion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-text {
  display: flex; flex-direction: column; line-height: 1.15;
}
.brand-name {
  font-weight: 700; font-size: 17px; color: var(--gray-900);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-tag {
  font-size: 11px; color: var(--gray-500); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}
.partners {
  display: flex; align-items: center; gap: 18px;
}

/* ─── Language switcher ─── */
/* ------------------------------------------------------------ Enseigne filter */
.enseigne-switch {
  position: relative;
}
.enseigne-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--niq-300);
  border-radius: var(--radius-md);
  background: var(--niq-50);
  color: var(--niq-700);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.enseigne-btn:hover {
  border-color: var(--niq-500);
  background: var(--niq-100);
}
.enseigne-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 4px;
  z-index: 50;
}
.enseigne-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  transition: background 0.1s;
}
.enseigne-item:hover { background: var(--gray-50); }
.enseigne-item.active {
  background: var(--niq-50);
  color: var(--niq-700);
  font-weight: 600;
}

.lang-switch {
  position: relative;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lang-btn:hover {
  border-color: var(--niq-300);
  background: var(--niq-50);
  color: var(--niq-700);
}
.lang-flag { line-height: 1; }
.lang-chev { color: var(--gray-500); }

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 160px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 4px;
  z-index: 50;
}
.lang-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-700);
  text-align: left;
}
.lang-item:hover {
  background: var(--gray-50);
}
.lang-item.active {
  background: var(--niq-50);
  color: var(--niq-700);
  font-weight: 600;
}
.lang-item .lang-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 28px;
  text-align: center;
}
.lang-item.active .lang-code {
  background: var(--niq-500);
  color: white;
}
.partner {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--gray-500); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.partner img { height: 22px; }
.partner-vusion { color: var(--vusion-600); }

/* ------------------------------------------------------ Global navigation */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  min-height: calc(100dvh - var(--header-height));
  transition: grid-template-columns 180ms ease;
}
.app-shell.nav-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}
.app-shell.portal-shell {
  display: block;
}
.site-sidebar {
  position: sticky;
  top: var(--header-height);
  z-index: 45;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100dvh - var(--header-height));
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: #fbfcfe;
}
.site-sidebar-head {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 7px 18px;
  border-bottom: 1px solid var(--gray-100);
}
.site-sidebar-title {
  flex: 1;
  overflow: hidden;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-sidebar-toggle {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--gray-500);
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.site-sidebar-toggle:hover,
.site-sidebar-toggle:focus-visible {
  border-color: var(--niq-100);
  background: var(--niq-50);
  color: var(--niq-700);
  outline: none;
}
.site-sidebar-toggle svg {
  width: 17px;
  height: 17px;
}
.site-sidebar-close { display: none; }
.site-nav {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px 12px 24px;
  scrollbar-color: var(--gray-300) transparent;
  scrollbar-width: thin;
}
.site-nav-group + .site-nav-group { margin-top: 15px; }
.site-nav-group-label {
  margin: 0 10px 5px;
  overflow: hidden;
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .09em;
  line-height: 20px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-nav-items {
  display: grid;
  gap: 3px;
}
.site-nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  transition: color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.site-nav-item::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--niq-500);
  content: "";
  opacity: 0;
  transform: scaleY(.5);
  transition: opacity 120ms ease, transform 120ms ease;
}
.site-nav-item:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}
.site-nav-item:focus-visible {
  box-shadow: 0 0 0 2px var(--niq-200);
  outline: none;
}
.site-nav-item.active {
  background: var(--niq-50);
  color: var(--niq-700);
  font-weight: 680;
}
.site-nav-item.active::before {
  opacity: 1;
  transform: scaleY(1);
}
.site-nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  color: var(--gray-500);
}
.site-nav-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}
.site-nav-item:hover .site-nav-icon { color: var(--gray-700); }
.site-nav-item.active .site-nav-icon { color: var(--niq-500); }
.site-nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-nav-badge {
  min-width: 21px;
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--gray-200);
  color: var(--gray-700);
  font-size: 10px;
  font-weight: 750;
  line-height: 15px;
  text-align: center;
}
.site-nav-badge.is-alert {
  background: #fee2e2;
  color: #b42318;
}
.app-shell.nav-collapsed .site-sidebar-head {
  justify-content: center;
  padding-inline: 8px;
}
.app-shell.nav-collapsed .site-sidebar-title,
.app-shell.nav-collapsed .site-nav-group-label,
.app-shell.nav-collapsed .site-nav-label {
  display: none;
}
.app-shell.nav-collapsed .site-nav {
  padding-inline: 8px;
}
.app-shell.nav-collapsed .site-nav-group + .site-nav-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
}
.app-shell.nav-collapsed .site-nav-item {
  width: 44px;
  min-height: 44px;
  justify-content: center;
  margin-inline: auto;
  padding: 10px;
}
.app-shell.nav-collapsed .site-nav-item::before {
  top: 10px;
  bottom: 10px;
}
.app-shell.nav-collapsed .site-nav-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  min-width: 8px;
  height: 8px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  font-size: 0;
}
.site-nav-backdrop { display: none; }

@media (max-width: 1024px) {
  .header-inner {
    gap: 14px;
    padding-inline: 16px;
  }
  .header-nav-toggle { display: grid; }
  .app-shell,
  .app-shell.nav-collapsed {
    display: block;
  }
  .site-sidebar {
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 70;
    width: min(292px, calc(100vw - 44px));
    height: auto;
    box-shadow: 18px 0 42px rgb(15 23 42 / 16%);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }
  .site-sidebar.mobile-open { transform: translateX(0); }
  .site-nav-backdrop {
    position: fixed;
    inset: var(--header-height) 0 0;
    z-index: 65;
    display: block;
    padding: 0;
    border: 0;
    background: rgb(15 23 42 / 38%);
    cursor: default;
  }
  .site-sidebar-close { display: grid; }
  .site-sidebar-collapse { display: none; }
  .app-shell.nav-collapsed .site-sidebar-head {
    justify-content: initial;
    padding: 8px 12px 7px 18px;
  }
  .app-shell.nav-collapsed .site-sidebar-title,
  .app-shell.nav-collapsed .site-nav-group-label,
  .app-shell.nav-collapsed .site-nav-label {
    display: initial;
  }
  .app-shell.nav-collapsed .site-nav {
    padding-inline: 12px;
  }
  .app-shell.nav-collapsed .site-nav-group + .site-nav-group {
    margin-top: 15px;
    padding-top: 0;
    border-top: 0;
  }
  .app-shell.nav-collapsed .site-nav-item {
    width: 100%;
    min-height: 40px;
    justify-content: flex-start;
    margin-inline: 0;
    padding: 8px 10px;
  }
  .app-shell.nav-collapsed .site-nav-badge {
    position: static;
    width: auto;
    min-width: 21px;
    height: auto;
    padding: 2px 6px;
    overflow: visible;
    color: var(--gray-700);
    font-size: 10px;
  }
  .app-shell.nav-collapsed .site-nav-badge.is-alert { color: #b42318; }
}

@media (max-width: 760px) {
  .header-right { gap: 8px; }
  .partners,
  .user-name { display: none; }
  .user-btn { padding-right: 6px; }
  .enseigne-btn {
    max-width: 150px;
  }
  .enseigne-btn > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .header-inner {
    gap: 8px;
    padding-inline: 10px;
  }
  .brand { gap: 7px; }
  .brand-tag { display: none; }
  .logo-niq-brand {
    width: 76px;
    height: auto;
  }
  .header-right { gap: 6px; }
  .enseigne-btn {
    max-width: 104px;
    padding-inline: 8px;
  }
  .lang-btn { padding-inline: 8px; }
  .user-btn .lang-chev { display: none; }
}

@media (max-width: 400px) {
  .logo-niq-brand { display: none; }
  .enseigne-btn { max-width: 92px; }
}

/* ------------------------------------------------------- Admin sub-tabs */

.subtabs {
  display: flex; gap: 4px;
  margin: 6px 0 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.subtab {
  padding: 9px 16px;
  border: none; background: none;
  font-size: 13.5px; font-weight: 500;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 120ms;
  cursor: pointer;
}
.subtab:hover { color: var(--niq-700); }
.subtab.active {
  color: var(--niq-700);
  border-bottom-color: var(--niq-500);
  font-weight: 600;
}
.admin-subtabs {
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: white;
}
.admin-subtabs .subtab {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  line-height: 1.25;
}
.admin-subtabs .subtab:hover {
  border-color: var(--gray-200);
  background: var(--gray-50);
}
.admin-subtabs .subtab.active {
  border-color: var(--niq-200);
  background: var(--niq-50);
}

/* Flags booléens dans le tableau magasins */
.mag-flag { font-weight: 700; }
.mag-flag-on  { color: var(--niq-600, #2563eb); }
.mag-flag-off { color: var(--gray-400, #9ca3af); }
.tbl td.captana-id-cell { cursor: default; }
.captana-id-text { user-select: text; cursor: text; }

/* Modal édition / création magasin */
.admin-mag-modal {
  width: 720px; max-width: 96vw;
  display: flex; flex-direction: column;
}
.admin-mag-modal.is-wide { width: min(1180px, 96vw); }
.admin-mag-modal-head .admin-mag-tabs {
  flex: none;
  margin: 0;
  border-bottom: none;
}
.admin-mag-page .breadcrumb { margin-top: 0; }
.admin-mag-crumb { justify-content: space-between; }
.admin-mag-crumb-path { display: flex; align-items: center; gap: 6px; min-width: 0; }
.admin-mag-steps {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.admin-mag-steps li { flex: 1; min-width: 0; }
.admin-mag-step {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.admin-mag-step:hover { border-color: var(--niq-400, #60a5fa); }
.admin-mag-step-num {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-600);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.admin-mag-step-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.admin-mag-step.is-done .admin-mag-step-num {
  background: var(--niq-50, #eef4ff);
  color: var(--niq-700, #1d4ed8);
}
.admin-mag-step.is-on {
  border-color: var(--niq-500, #3b82f6);
  background: var(--niq-50, #eef4ff);
  color: var(--niq-700, #1d4ed8);
}
.admin-mag-step.is-on .admin-mag-step-num {
  background: var(--niq-500, #3b82f6);
  color: #fff;
}
.admin-mag-sheet {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.admin-mag-wizard-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.admin-mag-warn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  background: #fffbeb;
  color: #78350f;
  font-size: 13px;
}
.admin-mag-warn .btn { flex: none; }
.admin-mag-warn-sub { display: block; margin-top: 2px; font-size: 12px; color: #92400e; }
.admin-mag-check { display: flex; flex-direction: column; gap: 12px; }
.admin-mag-check-intro { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; }
.admin-mag-check-group { display: flex; flex-direction: column; gap: 8px; }
.admin-mag-check-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}
.admin-mag-check-count {
  font-weight: 600;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--gray-400, #9ca3af);
}
.admin-mag-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.admin-mag-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  cursor: pointer;
}
.admin-mag-check-item.is-on {
  border-color: var(--niq-200, #bfdbfe);
  background: var(--niq-50, #eef4ff);
}
.admin-mag-check-item input[type=checkbox] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--niq-500);
}
.admin-mag-check-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.admin-mag-check-name { font-size: 13px; font-weight: 600; color: var(--gray-800); }
.admin-mag-check-hint { font-size: 12px; line-height: 1.4; color: var(--gray-500); }
@media (max-width: 900px) {
  .admin-mag-check-grid { grid-template-columns: 1fr; }
}
.admin-mag-gcal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 10px;
}
.admin-mag-gcal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-mag-gcal-nav strong {
  min-width: 9em;
  text-align: center;
  font-size: 13px;
}
.admin-mag-body.admin-mag-cal { padding: 0; }
.admin-cal-fit .admin-subtabs { margin-bottom: 10px; }
.admin-cal-fit .breadcrumb { margin-bottom: 8px; }
.admin-cal-fit .admin-mag-steps { margin-bottom: 10px; }
.admin-cal-fit .admin-mag-wizard-foot { margin-top: 8px; }
.admin-cal-fit .admin-mag-cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 12px;
  align-items: stretch;
}
.admin-mag-cal-main { min-width: 0; }
.admin-mag-cal-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--gray-50, #f9fafb);
}
.admin-mag-cal-side-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}
.admin-mag-cal-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.admin-mag-gcal-scroll { overflow-x: auto; }
.admin-mag-gcal {
  display: grid;
  grid-template-columns: 44px repeat(7, minmax(0, 1fr));
  column-gap: 6px;
  min-width: 0;
}
.admin-mag-gcal-corner,
.admin-mag-gcal-gutter {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
}
.admin-mag-gcal-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 4px 8px;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #fff;
}
.admin-mag-gcal-head .wd { font-size: 12px; font-weight: 700; }
.admin-mag-gcal-head .dt { font-size: 12px; color: var(--gray-500); font-variant-numeric: tabular-nums; }
.admin-mag-gcal-head.is-today,
.admin-mag-gcal-col.is-today { border-color: var(--niq-400, #60a5fa); }
.admin-mag-gcal-head.is-today { background: var(--niq-50, #eff6ff); }
.admin-mag-gcal-gutter { position: relative; }
.admin-mag-gcal-hour {
  position: absolute;
  right: 6px;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}
.admin-mag-gcal-col {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  background: #fff;
}
.admin-mag-gcal-col.is-today { background: #f8fbff; }
.admin-mag-gcal-band {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border);
  pointer-events: none;
}
.admin-mag-gcal-block {
  position: absolute;
  left: 3px;
  right: 3px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 3px 6px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  line-height: 1.2;
}
.admin-mag-gcal-block .when { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.admin-mag-gcal-block .kind {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-mag-gcal-block .kind::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.admin-mag-gcal-block.is-analyse {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
}
.admin-mag-gcal-block.is-analyse .kind::before { background: #2563eb; }
.admin-mag-gcal-block.is-highres {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #78350f;
}
.admin-mag-gcal-block.is-highres .kind::before { background: #d97706; }
.admin-mag-gcal-block.is-on { outline: 2px solid var(--gray-800, #1f2937); outline-offset: 1px; }
.admin-mag-cal-pick { margin: 0; }
.admin-mag-cal-editor {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0;
}
.admin-mag-cal-editor label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
}
.admin-mag-cal-editor .select,
.admin-mag-cal-editor .input { width: 100%; }
.admin-mag-cal-meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin: 0; font-size: 12px; color: var(--gray-600);
}
.admin-mag-cal-error { margin: 0 0 10px; color: var(--danger, #e5484d); font-size: 13px; }
.admin-mag-cal-days { display: flex; gap: 4px; }
.admin-mag-cal-day {
  width: 28px; height: 28px; padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 11px; font-weight: 700;
  color: var(--gray-600);
  cursor: pointer;
}
.admin-mag-cal-day.is-on {
  background: var(--niq-50, #eef4ff);
  border-color: var(--niq-400, #60a5fa);
  color: var(--niq-700, #1d4ed8);
}
.admin-mag-cal-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto; flex-wrap: wrap;
}
@media (max-width: 1100px) {
  .admin-cal-fit .admin-mag-cal-layout { grid-template-columns: 1fr; }
  .admin-mag-cal-side { max-height: none; }
}
.admin-mag-modal-head,
.admin-mag-modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 20px;
  flex-wrap: wrap;
}
.admin-mag-modal-head { border-bottom: 1px solid var(--border); }
.admin-mag-modal-head h3 { margin: 0; font-size: 16px; flex: 1; }
.admin-mag-modal-foot { border-top: 1px solid var(--border); }
.admin-mag-body { padding: 18px 20px 16px; }
.admin-mag-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.admin-mag-field { display: flex; flex-direction: column; gap: 5px; }
.admin-mag-field-wide { grid-column: 1 / -1; }
.admin-mag-field-label { font-size: 12px; font-weight: 600; color: var(--gray-600); }
.admin-mag-field .input { width: 100%; }
.admin-mag-field .input[readonly] { background: var(--gray-50, #f9fafb); color: var(--gray-500); }
.admin-mag-field .req { color: var(--danger, #e5484d); margin-left: 2px; }
.admin-mag-flags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 18px;
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.admin-mag-flag {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}
.admin-mag-flag-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}
.admin-mag-flag-name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--gray-800);
}
.admin-mag-flag input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--niq-500);
  cursor: pointer;
}
.admin-mag-help {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  background: #fff;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
  cursor: help;
}
.admin-mag-help:hover,
.admin-mag-help:focus-visible {
  z-index: 5;
  border-color: var(--niq-400);
  color: var(--niq-700);
  outline: none;
}
.admin-mag-help-tip {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--gray-900);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}
.admin-mag-help:hover .admin-mag-help-tip,
.admin-mag-help:focus-visible .admin-mag-help-tip {
  display: block;
}
@media (max-width: 640px) {
  .admin-mag-form,
  .admin-mag-flags { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------- Main */

.main {
  width: 100%;
  min-width: 0;
  max-width: 1600px; margin: 0 auto;
  padding: 28px 24px 80px;
}
.main:focus { outline: none; }
.main:has(.admin-cal-fit) { padding-bottom: 8px; }
@media (max-width: 640px) {
  .main { padding: 22px 16px 64px; }
}
.page-title {
  font-size: 24px; font-weight: 700; color: var(--gray-900);
  margin: 0 0 4px; letter-spacing: -0.01em;
}
.page-subtitle {
  font-size: 14px; color: var(--gray-500); margin: 0 0 24px;
}
.page-title-sub {
  font-weight: 500;
  color: var(--gray-500);
}

/* ----------------------------------------------------- Pills / Badges status */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
  text-transform: uppercase;
  line-height: 1.6;
}
.pill-niq {
  background: rgba(45, 109, 246, 0.12);
  color: var(--niq-700, #1a4cb8);
  border-color: rgba(45, 109, 246, 0.30);
}
.pill-warn {
  background: rgba(254, 200, 52, 0.18);
  color: #8a5a00;
  border-color: rgba(254, 200, 52, 0.55);
}

/* Sources données (ESL Vusion solo si blink only / IA patch / mobile) — même famille que .pill
 * Important : ne jamais mettre display:flex sur un <td> : ça remplace table-cell
 * et casse la grille du tableau + zones cliquables. Le flex vit dans .pill-stack-inner. */
.pill-stack {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tbl td.pill-stack-cell {
  vertical-align: middle;
}
.tbl td.pill-stack-cell .pill-stack-inner {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 220px;
}
/* ESL Vusion — accent charte Vusion */
.pill-sync-esl {
  background: rgba(254, 200, 52, 0.18);
  color: #8a5a00;
  border-color: rgba(254, 200, 52, 0.55);
}
.pill-sync-ia {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.4);
}
.pill-sync-agnostic {
  background: rgba(45, 109, 246, 0.12);
  color: var(--niq-700, #1944a8);
  border-color: rgba(45, 109, 246, 0.4);
}
.pill-sync-mobile {
  background: rgba(100, 116, 139, 0.14);
  color: #334155;
  border-color: rgba(100, 116, 139, 0.35);
}

/* ------------------------------------------------------------ Drapeau pays */
.flag {
  font-size: 16px;
  line-height: 1;
  margin-right: 4px;
}
.flag-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------------------------------------------- Carte d'identité magasin */
.store-identity {
  padding: 18px 22px;
  margin-bottom: 22px;
}
.store-identity .card-title {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
}
.identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px 24px;
  margin: 0;
}
.identity-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.identity-grid dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
}
.identity-grid dd {
  margin: 0;
  font-size: 14px;
  color: var(--gray-900);
  word-break: break-word;
}
.identity-grid dd a { color: var(--niq-700, #1a4cb8); text-decoration: none; }
.identity-grid dd a:hover { text-decoration: underline; }

/* ─────────────────────────── Icônes inline (SVG) ───────────────────────────
 * Utilisation : <span class="icon" x-html="iconCat()"></span>
 * Hérite de la couleur courante via `currentColor`.
 */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  line-height: 1;
  vertical-align: -0.18em;
  flex: 0 0 auto;
}
.icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}
.icon-cat,
.icon-subcat,
.icon-supplier,
.icon-camera,
.icon-store,
.icon-photo,
.icon-facing,
.icon-sku {
  color: var(--niq-500, #2D6DF6);
  font-size: 1.05em;
}
.icon-subcat   { color: var(--niq-700, #1a4cb8); }
.icon-supplier { color: var(--niq-500, #2D6DF6); }
.icon-camera   { color: var(--niq-500, #2D6DF6); }
.icon-store    { color: var(--niq-500, #2D6DF6); }
.icon-photo    { color: var(--niq-500, #2D6DF6); }
.icon-facing   { color: var(--niq-500, #2D6DF6); }
.icon-sku      { color: var(--niq-500, #2D6DF6); }
.icon-target   { color: var(--niq-500, #2D6DF6); }
.icon-admin    { color: var(--niq-500, #2D6DF6); }
/* Variantes de tailles courantes */
.icon-sm { font-size: 0.95em; }
.icon-md { font-size: 1.2em; }
.icon-lg { font-size: 1.45em; }
/* Espacement standard entre une icône et un libellé */
.icon + .icon-label,
.icon-label + .icon { margin-left: 6px; }

/* Libellé de ligne avec icône à gauche (drill-down) */
.row-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Chips à puce (catégorie / sous-catégorie) avec icône */
.chip .icon { margin-right: 6px; }
.chip { display: inline-flex; align-items: center; }

/* Page title avec icône à gauche : flex uniquement si une .icon est présente */
.page-title:has(> .icon) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.page-title .icon { color: var(--niq-500, #2D6DF6); }

/* KPI label avec icône */
.kpi-label .icon { margin-right: 6px; }

/* Card title avec icône */
.card-title .icon { margin-right: 6px; }

/* Champ de saisie avec icône préfixée */
.combo-icon { position: relative; }
.combo-icon-prefix {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 1.05em;
  color: var(--niq-500, #2D6DF6);
}
.input.has-icon { padding-left: 32px; }

/* Chip discret pour rappeler l'identifiant interne d'un magasin */
.store-id-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gray-100, #f1f5f9);
  color: var(--gray-500, #64748b);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 11px;
  letter-spacing: 0.02em;
  border: 1px solid var(--border, #e5e7eb);
}

/* Cellule de tableau sur 2 lignes (libellé principal + sub-label gris) */
.cell-2lines {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.25;
}
.cell-2lines .muted {
  font-size: 11px;
  color: var(--gray-500);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}

/* ---------------------------------------------------------------- KPI cards */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--niq-500);
}
.kpi-card.accent::before { background: var(--vusion-500); }
.kpi-label {
  font-size: 12px; font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.kpi-value {
  font-size: 28px; font-weight: 700; color: var(--gray-900);
  line-height: 1.1;
}
.kpi-hint {
  font-size: 12px; color: var(--gray-500); margin-top: 4px;
}

/* ------------------------------------------------------------- Skeletons */

@keyframes skeleton-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.skeleton {
  display: block;
  background: linear-gradient(
    90deg,
    var(--gray-100) 0%,
    var(--gray-200) 45%,
    var(--gray-100) 90%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
  border-radius: 6px;
}
.skeleton-kpi {
  height: 28px;
  width: 48%;
  margin-top: 2px;
}
.skeleton-line {
  height: 12px;
  width: 100%;
  border-radius: 4px;
}
.skeleton-line-sm {
  width: 48px;
  margin-left: auto;
}
.skeleton-row td {
  padding-top: 14px;
  padding-bottom: 14px;
}
.skeleton-row:hover td { background: transparent; cursor: default; }
/* Même ratio que .photo-card-media, sinon la grille saute quand les skeletons
   sont remplacés par les vraies cartes. */
.skeleton-photo {
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 0;
}
.photo-card-skeleton {
  pointer-events: none;
}
.photo-card-skeleton .photo-card-body {
  min-height: 72px;
}

/* ----------------------------------------------------------- Generic cards */

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
/* En grille (ex. overview Top stores / Top suppliers) les cartes sont côte à côte
   et l'espacement vient de `gap` : on annule le margin-top des siblings adjacents
   qui décalerait la 2e carte vers le bas. */
.grid-2 .card + .card { margin-top: 0; }
.card-title {
  font-size: 15px; font-weight: 700; color: var(--gray-900);
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.card-title .badge {
  font-size: 11px; font-weight: 600; color: var(--niq-700);
  background: var(--niq-50); padding: 2px 8px; border-radius: 999px;
}

.grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  align-items: stretch;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.card-flex {
  display: flex;
  flex-direction: column;
}
.card-flex .tbl { flex: 1 1 auto; }

/* Overview : aligne la hauteur des lignes des encarts Top stores / Top suppliers
   (les lignes magasin font 2 lignes, les fournisseurs 1) pour les mettre à niveau. */
.grid-2 .card-flex .tbl tbody td {
  height: 48px;
  vertical-align: middle;
}
.cell-icon-2lines {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cell-icon-2lines .icon { flex: 0 0 auto; }
.card-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  text-align: right;
}
.card-footer a {
  color: var(--niq-700);
  font-weight: 600;
  text-decoration: none;
}
.card-footer a:hover { text-decoration: underline; }

/* --------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: white;
  color: var(--gray-700);
  font-size: 13px; font-weight: 500;
  transition: all 120ms;
}
/* text-decoration : neutralise le `a:hover { underline }` global pour les
   boutons rendus en <a> (liens export, réalogramme ouvrable en nouvel onglet). */
.btn:hover { background: var(--bg-hover); border-color: var(--gray-300); text-decoration: none; }

.btn-primary {
  background: var(--niq-500); color: white; border-color: var(--niq-500);
}
.btn-primary:hover { background: var(--niq-600); border-color: var(--niq-600); }
.btn-primary:disabled { cursor: progress; }
.loader-on-primary {
  width: 14px; height: 14px; border-width: 2px; flex-shrink: 0;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

.btn-accent {
  background: var(--vusion-500); color: white; border-color: var(--vusion-500);
}
.btn-accent:hover { background: var(--vusion-600); border-color: var(--vusion-600); }

/* Spinner intégré à un bouton : hérite de la couleur du texte, donc lisible
   aussi bien sur un bouton blanc que sur un `.btn-primary` plein. */
.btn-spinner {
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  opacity: 0.85;
  animation: spin 700ms linear infinite;
  /* Couche de composition dédiée : l'animation reste fluide même quand le
     thread principal travaille (cf. `.loader`). */
  will-change: transform;
}

.btn-ghost { border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger {
  border-color: var(--danger, #e5484d);
  color: var(--danger, #e5484d);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger, #e5484d);
  color: #fff;
}
.shelf-pdf-btn {
  display: inline-grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  align-items: center;
  justify-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.shelf-pdf-btn:disabled {
  opacity: 0.88;
  cursor: wait;
}
/* Astuce: les 2 enfants occupent la même cellule grid → la cellule prend la
   largeur du plus large (le mesureur), et le label visible reste centré. */
.shelf-pdf-btn-label,
.shelf-pdf-btn-measure {
  grid-area: 1 / 1;
  white-space: nowrap;
  display: inline-block;
}
.shelf-pdf-btn-measure {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}
/* Anime « . », « .. », « ... » à la fin du label de chargement,
   sans changer la largeur du bouton (le mesureur réserve déjà la place). */
.shelf-pdf-btn:disabled .shelf-pdf-btn-label::after {
  content: "";
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: shelfPdfDots 1.2s steps(4, end) infinite;
}
@keyframes shelfPdfDots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: "..."; }
}

/* ----------------------------------------------------------------- Inputs */

.input, .select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  font-size: 13px;
  color: var(--gray-800);
  font-family: inherit;
  min-width: 140px;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--niq-500);
  box-shadow: 0 0 0 3px rgba(45, 109, 246, 0.18);
}

/* Selects natifs : on retire l'apparence OS et on ajoute un chevron cohérent. */
select.select, select.input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 32px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 11px;
}
select.select:hover, select.input:hover { border-color: var(--gray-300); }
select.select:focus, select.input:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%232d6df6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
select.select option { color: var(--gray-800); }

.filters {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}

/* Combo input + datalist : ajoute un caret pour indiquer le dropdown */
.combo { position: relative; display: inline-block; }
.combo input.input {
  padding-right: 28px;
  min-width: 220px;
}
.combo::after {
  content: "";
  position: absolute; right: 10px; top: 50%;
  width: 8px; height: 8px;
  border-right: 2px solid var(--gray-500);
  border-bottom: 2px solid var(--gray-500);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  opacity: 0.6;
}
.combo:focus-within::after { border-color: var(--niq-500); opacity: 1; }

/* Combobox Alpine searchable (vue SKU, etc.) */
.cb {
  position: relative;
  display: inline-block;
  vertical-align: top;
}
.cb-control { position: relative; }
.cb-input {
  width: 100%;
  min-width: 220px;
  padding-right: 44px !important;
}
.cb-control.has-value .cb-input { padding-right: 52px !important; }
.cb-prefix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
}
.cb-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--gray-500);
  border-bottom: 2px solid var(--gray-500);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  opacity: 0.65;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.cb-control.open .cb-caret {
  transform: translateY(-30%) rotate(225deg);
  border-color: var(--niq-500);
  opacity: 1;
}
.cb-clear {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--gray-500);
  font-size: 16px;
  line-height: 1;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cb-clear:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}
.cb-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 280px;
  overflow-y: auto;
}
.cb-option {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--gray-800);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cb-option:hover,
.cb-option.active {
  background: var(--niq-50);
  color: var(--niq-800);
}
.cb-option.selected {
  font-weight: 600;
}
.cb-option.selected::after {
  content: "✓";
  float: right;
  color: var(--niq-500);
  font-weight: 600;
  margin-left: 8px;
}
.cb-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--gray-500);
  text-align: center;
}

/* ------------------------------------------------------------------ Table */

.tbl {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.tbl th {
  text-align: left;
  padding: 10px 12px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  font-weight: 600; color: var(--gray-700);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  position: sticky; top: 0;
}
.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--gray-800);
}
.tbl tr:hover td { background: var(--bg-hover); cursor: pointer; }
.tbl tr.subrow td { background: var(--gray-50); font-size: 12.5px; color: var(--gray-700); }
.tbl tr.subrow:hover td { background: var(--niq-50); }
.tbl tr.substorerow td {
  background: #f7fafc; font-size: 12.5px; color: var(--gray-800);
}
.tbl tr.substorerow:hover td { background: var(--niq-50); }
.tbl tr.subcamrow td {
  background: #fbfdff; font-size: 12px; color: var(--gray-700);
}
.tbl tr.subcamrow:hover td { background: var(--niq-100); }
.tbl tr.loadingrow td {
  background: var(--gray-50); font-size: 12px; color: var(--gray-500);
  font-style: italic;
}
.tbl tr.loadingrow:hover td { background: var(--gray-50); cursor: default; }
.link-realogramme {
  margin-left: 10px;
  color: var(--niq-600);
  font-weight: 600;
  font-size: 11.5px;
}
.tbl tr.subcamrow:hover .link-realogramme { color: var(--niq-700); text-decoration: underline; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .pct-bar {
  display: inline-block; height: 6px;
  background: var(--niq-200);
  border-radius: 3px; vertical-align: middle;
  margin-right: 8px;
}

/* -------------------------------------------------------------- Photo grid */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.photo-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 150ms;
  display: flex;
  flex-direction: column;
}
.photo-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
/* Le ratio est porté par le conteneur, jamais par l'<img> : la hauteur réservée
   ne dépend donc ni du chargement ni d'une image cassée (les navigateurs
   dimensionnent leur placeholder « ? » à leur guise et ignorent l'aspect-ratio
   de l'image, ce qui décalait les cartes voisines). */
.photo-card-media {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  /* Les crops gondole sont portrait : un puits 4/5 les montre en entier
     sans les larges bandes d'un cadre 16/9. Le ratio reste sur le conteneur
     pour que la grille ne saute pas au chargement. */
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background:
    linear-gradient(180deg, var(--gray-100) 0%, var(--gray-50) 100%);
  overflow: hidden;
}
.photo-card-media img {
  /* L'élément suit le ratio réel de la photo : l'ombre et les coins
     entourent l'image, pas le vide autour. */
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 8px;
  background: white;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.06),
    0 8px 18px rgba(15, 23, 42, 0.08);
}
.photo-card.is-fridge {
  border-color: #7dd3fc;
}
.photo-card.is-frozen {
  border-color: #a5b4fc;
}
.photo-card.is-vins {
  border-color: #fda4af;
}
.photo-aisle-flags {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.photo-aisle-flags-menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.photo-fridge-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #64748b;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  cursor: pointer;
}
.photo-fridge-toggle .icon {
  font-size: 18px;
  color: inherit;
}
.photo-fridge-toggle .icon svg {
  fill: none;
}
.photo-fridge-toggle:hover {
  color: #0369a1;
  border-color: #7dd3fc;
}
.photo-fridge-toggle.is-on {
  background: #0284c7;
  border-color: #0369a1;
  color: #fff;
}
.photo-fridge-toggle.is-on:hover {
  background: #0369a1;
  color: #fff;
}
.photo-fridge-toggle.is-frozen.is-on,
.photo-fridge-toggle.is-frozen.is-on:hover {
  background: #4338ca;
  border-color: #3730a3;
  color: #fff;
}
.photo-fridge-toggle.is-vins.is-on,
.photo-fridge-toggle.is-vins.is-on:hover {
  background: #9f1239;
  border-color: #881337;
  color: #fff;
}
.photo-aisle-flags-main .icon svg {
  fill: currentColor;
}
.photo-aisle-flags-main.is-on .icon svg {
  fill: none;
}
.photo-aisle-flags-main.has-flag {
  color: #0f172a;
  border-color: #94a3b8;
}
.photo-aisle-flags-main.is-open {
  color: #0f172a;
  border-color: #64748b;
  background: #f8fafc;
}
.photo-aisle-flags-main.is-on.is-open {
  background: #0284c7;
  border-color: #0369a1;
  color: #fff;
}
.photo-aisle-flags-main.is-frozen.is-on.is-open {
  background: #4338ca;
  border-color: #3730a3;
  color: #fff;
}
.photo-aisle-flags-main.is-vins.is-on.is-open {
  background: #9f1239;
  border-color: #881337;
  color: #fff;
}
.photo-fridge-toggle.is-busy,
.photo-fridge-toggle:disabled {
  cursor: progress;
  opacity: 0.7;
}
.photo-card-body {
  padding: 12px 14px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.photo-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.photo-card-titlewrap {
  min-width: 0;
}
.photo-card-sub {
  font-size: 11px;
  color: var(--gray-500);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.photo-card-price {
  font-weight: 600;
  color: var(--gray-800);
}
.badge-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  background: var(--niq-50);
  color: var(--niq-700);
  border: 1px solid var(--niq-200);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-tab-disabled {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.store-disabled-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.store-disabled-toggle input {
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.photo-card-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--gray-900);
  margin-bottom: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px; color: var(--gray-500);
  margin-bottom: 10px;
}
.photo-card-meta-left {
  display: flex;
  gap: 12px;
  min-width: 0;
}
.photo-card-date {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
}
.photo-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  /* Colle les boutons en bas : les cartes d'une même ligne s'alignent même si
     un libellé passe sur deux lignes. */
  margin-top: auto;
}
.photo-card-actions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.photo-card-actions-row .btn {
  flex: 1 1 0;
  justify-content: center;
}

/* ---------------------------------------------------------- Compare drawer */

.compare-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60;
  background: var(--vusion-500); color: white;
  border: none; border-radius: 999px;
  padding: 12px 20px;
  font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-lg);
  transition: all 150ms;
}
.compare-fab:hover { background: var(--vusion-600); transform: translateY(-2px); }
.compare-fab .badge-count {
  background: white; color: var(--vusion-700);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px; font-weight: 700;
}

/* Signalement : icône seule, panneaux ancrés au même coin. */
.bug-report {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100vw - 24px);
}
.bug-report.is-raised { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
.bug-report-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--gray-500);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.bug-report-btn svg { width: 16px; height: 16px; }
.bug-report-btn:hover { color: var(--gray-800); background: white; }
.bug-report-card {
  width: min(280px, calc(100vw - 24px));
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.bug-report-card p { margin: 0 0 10px; font-size: 13px; color: var(--gray-800); }
.bug-report-form { width: min(380px, calc(100vw - 24px)); }
.bug-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.bug-report-head strong { font-size: 14px; }
.bug-report-x {
  border: 0;
  background: none;
  color: var(--gray-500);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.bug-report-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--gray-600);
}
.bug-report-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 88px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
}
.bug-report-error { margin: 0 0 8px; font-size: 12px; color: #b91c1c; }
.bug-report-thanks { margin: 0; font-size: 13px; color: var(--gray-800); }
.bug-report-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* File de traitement des signalements (Admin). */
.bug-inbox-filters { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.bug-inbox-layout {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
@media (max-width: 900px) {
  .bug-inbox-layout { grid-template-columns: 1fr; }
}
.bug-inbox-list { display: flex; flex-direction: column; gap: 4px; padding: 8px; }
.bug-inbox-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  padding: 8px;
  cursor: pointer;
}
.bug-inbox-row.active, .bug-inbox-row:hover { background: var(--gray-50, #f9fafb); }
.bug-inbox-row-top, .bug-inbox-row-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}
.bug-inbox-excerpt {
  font-size: 13px;
  color: var(--gray-700);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.bug-inbox-detail { padding: 14px; }
.bug-inbox-detail-head { display: flex; justify-content: space-between; gap: 8px; }
.bug-inbox-message { white-space: pre-wrap; font-size: 14px; }
.bug-inbox-shot {
  display: block;
  max-width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin: 8px 0;
  border-radius: var(--radius-md);
  background: var(--gray-100);
}
.bug-inbox-detail textarea {
  width: 100%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13px;
}
.bug-inbox-pre {
  max-height: 220px;
  overflow: auto;
  background: var(--gray-50, #f9fafb);
  padding: 8px;
  border-radius: var(--radius-md);
  font-size: 11px;
}
.bug-inbox details { margin-top: 10px; }
.bug-inbox summary { cursor: pointer; font-size: 13px; font-weight: 600; }

/* ----------------------------------------------------------- Compare grid */

.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 14px;
}
.compare-tile {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.compare-tile img {
  width: 100%; border-radius: var(--radius-md);
  background: var(--gray-100);
}

/* ---------------------------------------------------------------- Loading */

.loader {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--gray-300);
  border-top-color: var(--niq-500);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  /* Promotion sur une couche de composition dédiée : l'animation `transform`
     tourne alors côté compositeur (GPU) et reste fluide même quand le thread
     principal est bloqué (rendu d'une grosse liste, parsing JSON…). Sans ça, le
     spinner se figeait pendant l'attente de la réponse serveur. */
  will-change: transform;
}
/* translateZ(0) maintenu sur toute la boucle → la couche GPU n'est jamais
   abandonnée entre deux tours (sinon micro-freezes sous charge). */
@keyframes spin {
  from { transform: translateZ(0) rotate(0deg); }
  to   { transform: translateZ(0) rotate(360deg); }
}

/* Overlay de chargement : voile gris doux plein écran + pastille centrée. */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 44, 52, 0.22);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  pointer-events: auto;
}
.loading-toast {
  width: fit-content;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.sku-thumb-cell {
  position: relative;
  width: 48px;
  padding: 4px 8px;
}
.sku-row-loading {
  opacity: 0.72;
  pointer-events: none;
}
.sku-row-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  z-index: 2;
  border-top-color: var(--vusion-500);
}
.sku-thumb-loading {
  opacity: 0.35;
  filter: blur(1px);
}
.sku-detail-loader-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.empty {
  text-align: center; padding: 40px 20px;
  color: var(--gray-500); font-size: 13px;
}

/* ------------------------------------------------------------------- Utils */

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.spacer { flex: 1; }
.muted { color: var(--gray-500); }
.mono { font-family: var(--font-mono); }

/* Formulaires Admin : labels au-dessus des contrôles et colonnes stables. */
.admin-user-editor {
  margin-bottom: 16px;
  padding: 20px;
}
.admin-user-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 14px 16px;
}
.admin-user-toolbar > div:first-child { min-width: 180px; }
.admin-user-section-loader {
  min-height: 42px;
  justify-content: center;
}
.admin-user-load-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 12px;
}
.admin-user-search {
  width: min(300px, 100%);
  margin-left: auto;
}
.admin-user-page-size { white-space: nowrap; }
.admin-user-page-size .select { width: 76px; }
.admin-user-credential {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-color: var(--success);
  background: #ecfdf5;
}
.admin-user-credential p { margin: 3px 0 0; font-size: 11px; }
.admin-user-credential code {
  padding: 6px 8px;
  border-radius: 6px;
  background: white;
}
.admin-user-form-sections {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.admin-user-form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--gray-50);
}
.admin-user-section-head {
  display: grid;
  gap: 2px;
}
.admin-user-section-head strong { font-size: 13px; }
.admin-user-section-head span {
  color: var(--gray-500);
  font-size: 11px;
}
.admin-user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}
.admin-form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.admin-form-field > .muted:first-child {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.admin-form-field .input,
.admin-form-field .select {
  width: 100%;
  min-width: 0;
}
.admin-form-field-wide {
  grid-column: 1 / -1;
}
.admin-user-active {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}
.admin-user-field-help {
  color: var(--gray-500);
  font-size: 11px;
}
.admin-user-multipick {
  position: relative;
  display: grid;
  gap: 6px;
}
.admin-user-pill-list {
  display: flex;
  min-height: 34px;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white;
}
.admin-user-pill-list > .muted {
  padding: 0 4px;
  font-size: 11px;
}
.admin-user-pick-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px 3px 8px;
  border-radius: 999px;
  background: var(--niq-100);
  color: var(--niq-800);
  font-size: 11px;
  font-weight: 600;
}
.admin-user-pick-pill button {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.admin-user-pick-pill button:hover { background: rgba(0, 0, 0, .08); }
.admin-user-multipick .cb { width: 100%; }
.admin-user-multipick .cb-menu {
  width: 100%;
  max-height: 220px;
  overflow-y: auto;
}
.admin-user-scope-summary {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  border-radius: 7px;
  background: var(--niq-50);
  color: var(--niq-800);
  font-size: 12px;
  line-height: 1.45;
}
.admin-user-scope-summary > span:first-child {
  flex: none;
  font-weight: 700;
}
.admin-user-advanced-toggle { justify-self: start; }
.admin-user-scope-warning {
  padding: 8px 10px;
  border-radius: 6px;
  background: #fffbeb;
  color: var(--gray-700);
  font-size: 11px;
}
.admin-user-password {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 6px;
}
.admin-user-table-card {
  padding: 0;
  overflow-x: auto;
}
.admin-user-pager {
  display: flex;
  min-width: 680px;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.admin-form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.admin-role-manager {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 18px;
}
.admin-role-subtitle {
  margin: 4px 0 0;
  font-size: 12px;
}
.admin-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.admin-role-item {
  --role-rank: 1;
  display: flex;
  min-width: 150px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px 9px 12px;
  border: 1px solid color-mix(in srgb, var(--niq-400) calc((1 - var(--role-rank)) * 70%), var(--gray-200));
  border-left-width: 3px;
  border-left-color: color-mix(in srgb, var(--niq-700) calc((1 - var(--role-rank)) * 100%), var(--gray-300));
  border-radius: 9px;
  background: color-mix(in srgb, var(--niq-100) calc((1 - var(--role-rank)) * 72%), #fff);
  color: var(--gray-800);
  text-align: left;
}
.admin-role-item:hover {
  border-color: var(--niq-400);
}
.admin-role-item.is-current {
  box-shadow: inset 0 0 0 1px var(--niq-500);
}
.admin-role-item > span:first-child {
  display: grid;
  gap: 2px;
}
.admin-role-item small {
  color: var(--gray-500);
  font-size: 10px;
}
.admin-role-item.is-inactive { opacity: .55; }
.admin-role-editor {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.admin-role-form-grid {
  display: grid;
  grid-template-columns:
    minmax(125px, .8fr)
    minmax(135px, 1fr)
    105px
    minmax(190px, 1.7fr)
    auto;
  align-items: end;
  gap: 10px;
}
.admin-role-description { min-width: 0; }
.admin-role-active {
  min-height: 34px;
  margin-bottom: 1px;
  white-space: nowrap;
}
.admin-role-editor h4 {
  margin: 18px 0 10px;
  font-size: 13px;
}
.admin-role-permissions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
  align-items: start;
  gap: 7px;
}
.admin-role-permission-group {
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  background: var(--gray-50);
}
.admin-role-permission-group h5 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--gray-500);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.admin-role-group-icon {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  place-items: center;
  color: var(--niq-600);
  text-transform: none;
}
.admin-role-group-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}
.admin-role-permission-group > div {
  display: grid;
  gap: 3px;
}
.admin-role-permission-group label {
  position: relative;
  display: flex;
  min-height: 34px;
  align-items: flex-start;
  gap: 6px;
  padding: 4px 5px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
}
.admin-role-permission-group label:has(input:checked) {
  border-color: var(--niq-200);
  background: var(--niq-50);
}
.admin-role-permission-group label.is-inherited {
  border-style: dashed;
  cursor: default;
}
.admin-role-permission-group input {
  flex: 0 0 auto;
  margin: 1px 0 0;
}
.admin-role-permission-group span {
  display: grid;
  min-width: 0;
  gap: 1px;
}
.admin-role-permission-group strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}
.admin-role-permission-group small {
  display: block;
  overflow: hidden;
  color: var(--gray-500);
  font-size: 9px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-role-permission-group em {
  margin-left: auto;
  color: var(--niq-600);
  font-size: 8px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}
.admin-feature-toolbar {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
}
.admin-feature-toolbar .admin-form-field {
  width: min(360px, 100%);
}
.admin-feature-default {
  display: grid;
  gap: 6px;
}
.admin-feature-default > .muted {
  font-size: 12px;
  font-weight: 600;
}
.admin-feature-grid { align-items: start; }
.admin-feature-hint {
  margin: 4px 0 12px;
  font-size: 12px;
}
.admin-feature-rows {
  display: grid;
  gap: 6px;
}
.admin-feature-store-rows {
  max-height: 520px;
  overflow: auto;
}
.admin-feature-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}
.admin-feature-row:last-child { border-bottom: 0; }
.admin-feature-row > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.admin-feature-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-feature-row small {
  color: var(--gray-500);
  font-size: 11px;
}
.admin-feature-row .select {
  width: 122px;
  flex: 0 0 122px;
}
.admin-feature-store-head { margin-bottom: 8px; }
.admin-feature-store-head .input { width: 180px; }
@media (max-width: 700px) {
  .admin-feature-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-feature-store-head {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-feature-store-head .input { width: 100%; }
}
.brand-shelves-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 2fr) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.brand-shelves-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}
.shelf-list-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.shelf-list-tools .input {
  flex: 1 1 240px;
  min-width: 0;
}
.shelf-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.brand-shelf-row {
  cursor: pointer;
}
.brand-shelf-row td {
  height: 52px;
}
.brand-shelf-mark {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--gray-400);
  border-radius: 6px;
  background: white;
}
.brand-shelf-row.is-allowed {
  background: var(--niq-50, #eef4ff);
}
.brand-shelf-row.is-allowed .brand-shelf-mark {
  border-color: var(--niq-500, #2D6DF6);
  background: var(--niq-500, #2D6DF6);
}
.brand-shelf-row.is-allowed .brand-shelf-mark::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
@media (max-width: 760px) {
  .admin-user-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-user-search {
    width: 100%;
    margin-left: 0;
  }
  .admin-user-password {
    grid-template-columns: 1fr 1fr;
  }
  .admin-user-password .input {
    grid-column: 1 / -1;
  }
  .admin-user-form-grid,
  .admin-role-form-grid,
  .admin-role-permissions,
  .brand-shelves-toolbar {
    grid-template-columns: 1fr;
  }
  .admin-form-field-wide {
    grid-column: auto;
  }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .admin-role-form-grid {
    grid-template-columns: minmax(130px, 1fr) minmax(160px, 1.4fr) 105px auto;
  }
  .admin-role-description {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .admin-role-active {
    grid-column: 4;
    grid-row: 1;
  }
}
.chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--gray-100); color: var(--gray-700);
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.chip-niq    { background: var(--niq-50);    color: var(--niq-700); }
.chip-vusion { background: var(--vusion-100); color: var(--vusion-700); }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--gray-500);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--niq-600); }
.breadcrumb .sep { color: var(--gray-400); }

/* ------------------------------------------------------------------ Modal */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: grid; place-items: center;
  z-index: 100;
}
.modal {
  background: white;
  max-width: 95vw; max-height: 92vh;
  border-radius: var(--radius-lg);
  overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal img { display: block; max-width: 100%; }

/* ----------------------------------------------------- API doc snippets */

.snippet {
  background: var(--gray-900); color: #e5e7eb;
  padding: 14px 16px; border-radius: var(--radius-md);
  font-family: var(--font-mono); font-size: 12px;
  overflow-x: auto;
  position: relative;
}
.snippet pre { margin: 0; white-space: pre; }
.snippet .copy {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white; font-size: 11px;
  padding: 3px 8px; border-radius: var(--radius-sm);
}
.snippet .copy:hover { background: rgba(255, 255, 255, 0.2); }

.endpoint-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: white;
}
.endpoint-method {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  margin-right: 8px;
}
.method-get  { background: #dbeafe; color: #1e40af; }
.method-post { background: #d1fae5; color: #065f46; }
.endpoint-path {
  font-family: var(--font-mono); font-weight: 600; color: var(--gray-800);
}
.endpoint-desc { color: var(--gray-600); font-size: 13px; margin-top: 6px; }

/* Démarcation des groupes d'endpoints (standard vs admin) dans la vue API Docs */
.endpoint-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.endpoint-group-title {
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gray-700, #374151);
}
.endpoint-group-head--admin {
  margin-top: 26px;
  border-bottom-color: var(--danger, #e5484d);
}
.endpoint-group-head--admin .endpoint-group-title { color: var(--danger, #e5484d); }

/* Carte d'endpoint admin : accent latéral + fond légèrement teinté */
.endpoint-card--admin {
  border-left: 3px solid var(--danger, #e5484d);
  background: #fef5f5;
}

/* Chip « rôle admin requis » */
.chip-admin {
  background: #fdecec;
  color: var(--danger, #c0392b);
  border: 1px solid #f5c2c2;
}

/* ─────────────────────────────── Shelf viewer (réalogramme) ─────────────────────────────── */

.shelf-viewer {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shelf-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.shelf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .shelf-layout { grid-template-columns: 1fr; }
}

.shelf-canvas {
  position: relative;
  background: var(--gray-900);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
/* Zone scrollable : pan quand zoom > 100%. */
.shelf-viewport {
  display: block;
  width: 100%;
  overflow: auto;
  min-height: 220px;
  max-height: calc(100vh - 240px);
}
.shelf-viewport.can-pan { cursor: grab; }
.shelf-viewport.is-panning { cursor: grabbing; }
.shelf-viewport.is-panning * { pointer-events: none; }
.shelf-canvas-inner {
  position: relative;
  display: block;
  line-height: 0;
  width: calc(100% * var(--shelf-zoom, 1));
  box-sizing: border-box;
}
.shelf-canvas-inner img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.shelf-zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.62);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.shelf-zoom-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #f9fafb;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease;
}
.shelf-zoom-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.shelf-zoom-btn:disabled { opacity: 0.4; cursor: default; }
.shelf-zoom-level {
  min-width: 46px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
/* Bascule vignettes, posée dans la barre flottante au-dessus de l'image : la
   commande est là où se trouve son effet, plutôt que dans la barre d'outils. */
.shelf-thumbs-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}
.shelf-thumbs-btn .icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
}
.shelf-thumbs-btn .icon svg { width: 100%; height: 100%; }
/* Vignettes masquées : icône estompée + barre oblique, pour lire l'état sans
   dépendre du seul tooltip. */
.shelf-thumbs-btn.is-off { opacity: 0.5; }
.shelf-thumbs-btn.is-off::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transform: rotate(-45deg);
  border-radius: 1px;
}
.shelf-zoom-sep {
  width: 1px;
  height: 16px;
  margin: 0 2px;
  background: rgba(255, 255, 255, 0.28);
}
.shelf-canvas-skeleton {
  min-height: 320px;
  background: var(--gray-800);
}
/* Réserve une hauteur au tout premier chargement (pas d'ancienne image). */
.shelf-canvas.is-loading {
  min-height: 220px;
}
/* Badge « pilule » non-bloquant en haut de l'image : signale que la photo
   charge, SANS masquer le planogramme (déjà affiché par-dessus). */
.shelf-canvas-loader {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}
.shelf-canvas-loader .loader {
  width: 14px;
  height: 14px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}
.shelf-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.shelf-overlay .bbox {
  pointer-events: all;
}
/* Trait blanc en pointillés (repère 0..1 + non-scaling-stroke). */
.shelf-overlay .bbox {
  fill: none;
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 1.25px;
  stroke-dasharray: 5px 4px;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
  transition: stroke .15s ease, stroke-width .15s ease, stroke-opacity .15s ease;
}

/* ───────────── Compliance planogramme (POG HQ vs CV courante) ───────────── */
.shelf-subtabs { margin: -4px 0 0; }
.pogcmp-view { min-height: 320px; }
.pogcmp-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 190px)) minmax(220px, 1fr);
  gap: 10px;
  margin-bottom: 14px;
  align-items: stretch;
}
/* Cartes côte à côte : l'espacement vient de `gap`, on annule le margin-top
   des siblings `.card + .card` qui décalerait toutes les cartes sauf la 1re. */
.pogcmp-kpis .card + .card,
.pogcmp-layout .card + .card { margin-top: 0; }
/* Colonne : le libellé occupe 2 lignes dans toutes les cartes, donc les
   valeurs et les compteurs restent alignés même quand le libellé tient
   sur une seule ligne. */
.pogcmp-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
}
.pogcmp-kpi > span {
  min-height: 2.6em;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.pogcmp-kpi > strong {
  font-size: 24px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pogcmp-kpi > small { color: var(--gray-500); }
.pogcmp-kpi-main { border-color: #f59e0b; }
.pogcmp-map-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 3px;
  padding: 10px;
  text-align: right;
}
.pogcmp-layout {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.4fr) minmax(260px, .7fr);
  gap: 14px;
  align-items: stretch;
}
.pogcmp-plan,
.pogcmp-realogram,
.pogcmp-deviations {
  display: flex;
  flex-direction: column;
  padding: 14px;
  min-width: 0;
}
.pogcmp-plan h3,
.pogcmp-realogram h3,
.pogcmp-deviations h3 { margin: 0; font-size: 14px; }
.pogcmp-shelves {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 12px;
  min-height: 0;
  max-height: calc(100vh - 300px);
  overflow: auto;
}
.pogcmp-shelf-title {
  margin-bottom: 5px;
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.pogcmp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  gap: 4px;
}
.pogcmp-cell {
  position: relative;
  min-width: 0;
  height: 76px;
  padding: 15px 3px 3px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
}
.pogcmp-cell img { width: 100%; height: 100%; object-fit: contain; }
.pogcmp-pos {
  position: absolute; top: 2px; left: 5px;
  font-size: 10px; font-weight: 800;
}
.pogcmp-facing {
  position: absolute; right: 3px; bottom: 2px;
  padding: 1px 3px; border-radius: 3px;
  background: rgba(255,255,255,.88); font-size: 9px; font-weight: 800;
}
/* En-tête commun aux trois colonnes : même hauteur que le sélecteur et les
   boutons de zoom, donc les trois contenus démarrent à la même ligne. */
.pogcmp-pane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 10px;
}
.pogcmp-realogram { position: relative; }
/* Le zoom n'est plus posé sur la photo mais dans l'en-tête blanc : variante
   claire de la pilule sombre du réalogramme. */
.pogcmp-zoom {
  position: static;
  background: var(--gray-100);
  box-shadow: none;
}
.pogcmp-zoom .shelf-zoom-btn { color: var(--gray-700); }
.pogcmp-zoom .shelf-zoom-btn:hover:not(:disabled) { background: rgba(17, 24, 39, .08); }
.pogcmp-viewport {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 340px);
  border-radius: 7px;
  background: var(--gray-100);
}
.pogcmp-overlay { pointer-events: auto; }
.pogcmp-slot rect {
  fill: rgba(255,255,255,.05);
  stroke-width: 2px;
  cursor: pointer;
}
.pogcmp-slot.is-selected rect { stroke-width: 4px; filter: drop-shadow(0 0 3px #fff); }
.pogcmp-ok rect, .pogcmp-dot.pogcmp-ok { stroke: #16a34a; background: #16a34a; }
.pogcmp-wrong_position rect, .pogcmp-dot.pogcmp-wrong_position {
  stroke: #f59e0b; background: #f59e0b;
}
.pogcmp-wrong_shelf rect, .pogcmp-dot.pogcmp-wrong_shelf {
  stroke: #ea580c; background: #ea580c;
}
.pogcmp-missing rect, .pogcmp-dot.pogcmp-missing { stroke: #dc2626; background: #dc2626; }
.pogcmp-extra rect, .pogcmp-dot.pogcmp-extra { stroke: #7c3aed; background: #7c3aed; }
.pogcmp-cell.pogcmp-ok { border-color: #16a34a; }
.pogcmp-cell.pogcmp-wrong_position { border-color: #f59e0b; }
.pogcmp-cell.pogcmp-wrong_shelf { border-color: #ea580c; }
.pogcmp-cell.pogcmp-missing { border-color: #dc2626; background: #fff7f7; }
.pogcmp-cell.is-selected { box-shadow: 0 0 0 3px rgba(17,24,39,.24); }
.pogcmp-legend {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-top: 10px; font-size: 11px; color: var(--gray-600);
}
.pogcmp-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.pogcmp-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pogcmp-deviation-list {
  display: flex; flex-direction: column; flex: 1; gap: 6px;
  min-height: 0; max-height: calc(100vh - 350px); overflow: auto;
}
.pogcmp-deviation {
  display: grid; grid-template-columns: 1fr auto; gap: 3px 8px;
  width: 100%; padding: 9px 10px; border: 1px solid var(--border);
  border-left-width: 4px; border-radius: 7px; background: #fff;
  color: inherit; text-align: left; cursor: pointer;
}
.pogcmp-deviation small { grid-column: 1 / -1; color: var(--gray-500); }
.pogcmp-deviation.pogcmp-wrong_position { border-left-color: #f59e0b; }
.pogcmp-deviation.pogcmp-wrong_shelf { border-left-color: #ea580c; }
.pogcmp-deviation.pogcmp-missing { border-left-color: #dc2626; }
.pogcmp-deviation.pogcmp-extra { border-left-color: #7c3aed; }
.pogcmp-deviation.is-selected { background: #f3f4f6; box-shadow: 0 0 0 2px #9ca3af; }
.pogcmp-status { font-size: 10px; font-weight: 800; text-transform: uppercase; }
/* Page principale Compliance planogramme : POG au-dessus, photos en bande. */
.pog-report-page { display: grid; gap: 18px; }
.pog-report-controls {
  display: grid; gap: 14px; align-items: end; padding: 18px;
  grid-template-columns:
    minmax(180px, 1fr) minmax(200px, 1.2fr) minmax(200px, 1.2fr) auto auto;
}
.pog-report-controls label {
  display: grid; gap: 6px; color: var(--gray-700); font-size: 12px; font-weight: 700;
}
.pog-report-export { display: flex; gap: 8px; }
.pog-report-kpis {
  grid-template-columns: repeat(2, minmax(160px, 260px));
  margin-bottom: 16px;
}
/* Hauteurs figées du bandeau : sans elles chaque gondole dimensionne ses
   lignes selon son propre contenu et les photos ne démarrent pas à la même
   ordonnée — le rayon reconstitué « saute » d'une image à l'autre.
   `--pog-shelf-h`, `--pog-shelf-gap` et `--pog-ref-h` sont posés en ligne
   (cf. `pogBandStyle`) pour rester la seule source de vérité avec le JS. */
.pog-report-band {
  --pog-header-h: 30px;
  --pog-label-h: 18px;
  --pog-shelf-h: 44px;
  --pog-shelf-gap: 5px;
  --pog-ref-h: 220px;
  --pog-img-min-h: 140px;
  display: flex; gap: 0; overflow-x: auto; align-items: start;
  padding: 0 0 8px; scroll-snap-type: x proximity;
  /* Posé par `pogBandStyle` quand le bandeau dépasse l'écran. 1 = taille réelle. */
  zoom: var(--pog-zoom, 1);
}
/* `--pog-ratio` est posé en ligne depuis le ratio natif de la photo (cf.
   `pogSegmentRatio`). Il sert de `flex-grow` : les segments se partagent toute
   la largeur du bandeau au prorata de leur ratio, donc chaque photo retombe sur
   la même hauteur (largeur ÷ ratio) et le rayon se lit comme un panorama. */
.pog-report-segment {
  /* Plancher proportionnel : au-delà de quelques caméras le bandeau défile
     plutôt que de réduire les photos à une bande illisible. */
  flex: var(--pog-ratio, 1.333) 1 0;
  min-width: calc(var(--pog-ratio, 1.333) * var(--pog-img-min-h));
  display: grid;
  grid-template-rows:
    var(--pog-header-h) var(--pog-label-h)
    min(var(--pog-ref-h), 42vh)
    var(--pog-label-h) auto;
  border: 1px solid var(--gray-200);
  background: #fff; overflow: hidden; scroll-snap-align: start;
}
.pog-report-segment + .pog-report-segment { border-left: none; }
/* Une gondole étroite ne doit pas faire passer son en-tête sur deux lignes :
   la ligne de grille est fixe, le texte déborderait au lieu de l'agrandir. */
.pog-report-segment > header {
  display: flex; align-items: center; gap: 8px; padding: 0 10px;
  background: #111827; color: #fff; font-size: 12px;
  white-space: nowrap; overflow: hidden;
}
.pog-report-segment > header strong { flex: 0 0 auto; }
.pog-report-segment > header span {
  flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis;
  font-size: 10px; opacity: .72;
}
.pog-report-segment > header small {
  flex: 0 0 auto; margin-left: auto; color: #fec834;
  font-size: 11px; font-weight: 800;
}
.pog-report-label {
  display: flex; align-items: center; padding: 0 9px;
  color: var(--gray-500); background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200); font-size: 9px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
}
/* Étagère 1 en bas : les rangées se remplissent depuis le bas du bloc.
   Le padding vertical (8+8) et le gap sont comptés dans `pogBandReferenceHeight`. */
.pog-report-reference {
  display: flex; flex-direction: column; justify-content: flex-end;
  gap: var(--pog-shelf-gap, 5px);
  min-height: 0; height: 100%;
  padding: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
/* `flex: 1 1 0` borné par `max-height` : les étagères se partagent la hauteur
   du bloc, donc une gondole à 8 niveaux reste entièrement visible. */
.pog-report-reference-shelf {
  display: grid; grid-template-columns: 18px minmax(0, 1fr);
  flex: 1 1 0; min-height: 0; max-height: var(--pog-shelf-h);
}
.pog-report-reference-shelf > span {
  align-self: center; color: #64748b; font-size: 10px; font-weight: 700;
  text-align: center;
}
/* Les slots se partagent la largeur de la gondole (avec un plafond) au lieu
   de rester une rangée de 26px collée à gauche. */
.pog-report-reference-shelf > div {
  display: flex; align-items: stretch; gap: 4px;
  min-width: 0; padding: 0 1px 4px; overflow: hidden;
  border-bottom: 3px solid #94a3b8;
  background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(148,163,184,.16));
}
.pog-report-product {
  flex: 1 1 0; width: auto; min-width: 0; max-width: 68px; height: auto;
  padding: 0;
  border: 2px solid transparent; border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .08);
  cursor: pointer;
  min-height: 0;
  overflow: hidden;
  line-height: 0;
}
.pog-report-product.is-selected {
  box-shadow: 0 0 0 2px #111827;
}
.pog-report-product img {
  width: 100%; height: 100%; object-fit: contain; border-radius: 3px;
}
.pog-report-product.pogcmp-ok { border-color: #16a34a; background: #f0fdf4; }
.pog-report-product.pogcmp-wrong_position { border-color: #f59e0b; background: #fffbeb; }
.pog-report-product.pogcmp-wrong_shelf { border-color: #ea580c; background: #fff7ed; }
.pog-report-product.pogcmp-missing {
  border-color: #dc2626; background: #fef2f2;
}
/* `object-fit: fill` sans déformation : le cadre a le ratio natif de la photo,
   et remplir exactement garantit que l'overlay SVG reste calé dessus. */
.pog-report-image {
  min-height: 0;
  aspect-ratio: var(--pog-ratio, 1.333);
  background: #e8edf2;
  overflow: hidden;
  display: flex; align-items: flex-start; justify-content: flex-start;
}
.pog-report-frame {
  position: relative;
  width: 100%; height: 100%;
}
.pog-report-frame > img {
  display: block; width: 100%; height: 100%; object-fit: fill;
}
.pog-report-frame > svg {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.pog-report-frame .pogcmp-slot.is-hot rect {
  stroke: #fff;
  stroke-width: 3px;
  fill: rgba(255, 255, 255, .22);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .7));
}
.pog-report-legend { justify-content: center; padding: 10px; }
/* left/top = coin haut-gauche, calés par JS sur la case cliquée.
   Hors du bandeau : overflow et zoom le couperaient. */
.pog-report-tip {
  position: fixed;
  z-index: 80;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 10px 12px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
  visibility: hidden;
}
.pog-report-tip.is-placed { visibility: visible; }
.pog-report-tip::before,
.pog-report-tip::after {
  content: "";
  position: absolute;
  left: calc(50% + var(--pog-tip-arrow, 0px));
  transform: translateX(-50%);
  border: 8px solid transparent;
}
/* Pointe vers le bas : la bulle est au-dessus de la case. */
.pog-report-tip::before {
  bottom: -8px;
  border-top-color: #e5e7eb;
  border-bottom-width: 0;
}
.pog-report-tip::after {
  bottom: -7px;
  border-width: 7px;
  border-top-color: #fff;
  border-bottom-width: 0;
}
.pog-report-tip.is-below::before {
  bottom: auto;
  top: -8px;
  border-top-color: transparent;
  border-bottom: 8px solid #e5e7eb;
  border-top-width: 0;
}
.pog-report-tip.is-below::after {
  bottom: auto;
  top: -7px;
  border-width: 7px;
  border-top-color: transparent;
  border-bottom: 7px solid #fff;
  border-top-width: 0;
}
.pog-report-tip-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 108px;
}
.pog-report-tip-col img,
.pog-report-tip-missing {
  width: 76px;
  height: 76px;
  object-fit: contain;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}
.pog-report-tip-missing {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 22px;
  font-weight: 700;
  background:
    repeating-linear-gradient(-45deg, #fff, #fff 4px, #f8fafc 4px, #f8fafc 8px);
}
.pog-report-tip-label {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pog-report-tip-ean {
  max-width: 100%;
  color: #111827;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  text-align: center;
  word-break: break-all;
}
.pog-report-tip-sigma {
  max-width: 100%;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: center;
}
.pog-report-tip-sigma.is-shared { color: #047857; }
.pog-report-tip-sep {
  width: 1px;
  margin: 6px 8px;
  background: #e5e7eb;
}
@media (max-width: 900px) {
  .pog-report-controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .pog-report-controls { grid-template-columns: 1fr; }
  .pog-report-export { width: 100%; }
  .pog-report-export .btn { flex: 1; }
}
@media (max-width: 1280px) {
  .pogcmp-layout { grid-template-columns: minmax(250px, .8fr) minmax(420px, 1.2fr); }
  .pogcmp-deviations { grid-column: 1 / -1; }
  .pogcmp-deviation-list { max-height: 320px; }
}
@media (max-width: 850px) {
  .pogcmp-kpis { grid-template-columns: repeat(3, 1fr); }
  .pogcmp-map-meta { grid-column: 1 / -1; justify-content: flex-start; text-align: left; }
  .pogcmp-layout { grid-template-columns: 1fr; }
  .pogcmp-deviations { grid-column: auto; }
  .pogcmp-shelves, .pogcmp-deviation-list { max-height: none; }
}
.shelf-overlay .bbox:hover,
.shelf-overlay .bbox-hovered {
  stroke: rgba(255, 255, 255, 0.98);
  stroke-width: 1.75px;
  stroke-dasharray: 6px 4px;
}
.shelf-overlay .bbox-selected {
  stroke: #fff;
  stroke-width: 2px;
  stroke-dasharray: 4px 3px;
}
.shelf-overlay .bbox-tab-active {
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.25px;
  stroke-dasharray: 5px 5px;
}
/* Pilotage des états via attributs sur le <svg> (pas de rerender SVG). */
.shelf-overlay[data-hover-idx] .bbox[data-slot-idx]:not([data-hover-idx-match]) {
  /* placeholder — la règle utile est ci-dessous via sélecteur d'attribut dynamique */
}
.shelf-overlay .bbox[data-tab][data-slot-idx] {
  /* base déjà définie plus haut (.bbox) */
}
/* Hover via attribut data-hover-idx du parent : on cible la bbox dont data-slot-idx == data-hover-idx du parent.
   Comme CSS ne peut pas comparer deux attributs, on utilise un trick : on encode l'idx hover dans une classe sur le parent
   via JS minimal (cf. _applyShelfHoverIdx). À défaut on garde :hover natif. */
.shelf-overlay[data-hover-idx="-1"] .bbox-hovered { /* no-op */ }
/* Tablette active : on stylise toutes les bbox de la même tablette. */
.shelf-overlay[data-tab-active="1"] .bbox[data-tab="1"],
.shelf-overlay[data-tab-active="2"] .bbox[data-tab="2"],
.shelf-overlay[data-tab-active="3"] .bbox[data-tab="3"],
.shelf-overlay[data-tab-active="4"] .bbox[data-tab="4"],
.shelf-overlay[data-tab-active="5"] .bbox[data-tab="5"],
.shelf-overlay[data-tab-active="6"] .bbox[data-tab="6"],
.shelf-overlay[data-tab-active="7"] .bbox[data-tab="7"],
.shelf-overlay[data-tab-active="8"] .bbox[data-tab="8"],
.shelf-overlay[data-tab-active="9"] .bbox[data-tab="9"],
.shelf-overlay[data-tab-active="10"] .bbox[data-tab="10"],
.shelf-overlay[data-tab-active="11"] .bbox[data-tab="11"],
.shelf-overlay[data-tab-active="12"] .bbox[data-tab="12"] {
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.25px;
  stroke-dasharray: 5px 5px;
}
/* Pastille : ellipse rx≠ry (repère étiré) = cercle pixel-perfect ; masque = chiffres découpés. */
.shelf-overlay .bbox-badge-fill {
  fill: #fff;
  pointer-events: none;
}
.shelf-overlay .bbox-badge-ring {
  stroke: rgba(0, 0, 0, 0.14);
  stroke-width: 1px;
  pointer-events: none;
}
.shelf-overlay .bbox-badge-knockout {
  font-family: var(--font-sans);
  font-weight: 700;
  pointer-events: none;
}
/* Rupture longue potentielle : slot signalé par le pipeline OOS. Trait plein
   ambre (même palette que les ruptures partielles de la vue ruptures) + léger
   voile, pour ressortir sur les pointillés blancs des slots normaux. */
.shelf-overlay .bbox.bbox-rupture-pot {
  stroke: rgba(245, 158, 11, 0.95);
  stroke-width: 2px;
  stroke-dasharray: none;
  fill: rgba(245, 158, 11, 0.16);
}
.shelf-overlay .bbox.bbox-rupture-pot:hover,
.shelf-overlay .bbox.bbox-rupture-pot.bbox-hovered,
.shelf-overlay .bbox.bbox-rupture-pot.bbox-selected {
  stroke: rgb(217, 119, 6);
  stroke-width: 2.5px;
  fill: rgba(245, 158, 11, 0.26);
}
.shelf-overlay .bbox-badge-ring.is-rupture-pot {
  stroke: rgba(217, 119, 6, 0.9);
  stroke-width: 2px;
}
/* États sentinelles enrichis par EAN_REFERENCE. Ces règles suivent la règle
   ambre afin que bleu/violet priment si un ancien flag potentiel coexiste. */
.shelf-overlay .bbox.bbox-price-error {
  stroke: #2563eb;
  stroke-width: 2px;
  stroke-dasharray: none;
  fill: rgba(37, 99, 235, 0.16);
}
.shelf-overlay .bbox.bbox-price-error:hover,
.shelf-overlay .bbox.bbox-price-error.bbox-hovered,
.shelf-overlay .bbox.bbox-price-error.bbox-selected {
  stroke: #1d4ed8;
  stroke-width: 2.5px;
  fill: rgba(37, 99, 235, 0.26);
}
.shelf-overlay .bbox-badge-ring.is-price-error {
  stroke: #1d4ed8;
  stroke-width: 2px;
}
.shelf-overlay .bbox.bbox-previous-product {
  stroke: #7c3aed;
  stroke-width: 2px;
  stroke-dasharray: none;
  fill: rgba(124, 58, 237, 0.16);
}
.shelf-overlay .bbox.bbox-previous-product:hover,
.shelf-overlay .bbox.bbox-previous-product.bbox-hovered,
.shelf-overlay .bbox.bbox-previous-product.bbox-selected {
  stroke: #6d28d9;
  stroke-width: 2.5px;
  fill: rgba(124, 58, 237, 0.26);
}
.shelf-overlay .bbox-badge-ring.is-previous-product {
  stroke: #6d28d9;
  stroke-width: 2px;
}

/* Survol slot : panneau description ancré au slot survolé. */
.shelf-slot-hover-pop {
  overflow: visible;
  pointer-events: none;
}
.shelf-slot-hover-panel {
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.97);
  padding: 6px 8px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.shelf-slot-hover-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--gray-900);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6; /* Increased to allow more text lines */
  overflow: hidden;
  word-break: break-word;
}
.shelf-slot-hover-ean {
  margin-top: 3px;
  font-size: 10px;
  font-style: italic;
  color: var(--gray-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shelf-side {
  display: flex; flex-direction: column;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
}

.shelf-tabs-tree {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 78vh; overflow-y: auto;
  padding-right: 2px;
}
.shelf-tab-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}
.shelf-tab-card.current {
  border-color: var(--niq-500);
  box-shadow: 0 0 0 1px var(--niq-500);
}
.shelf-tab-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  user-select: none;
}
.shelf-tab-header:hover { background: var(--niq-50); }
.shelf-tab-card.current .shelf-tab-header { background: var(--niq-50); }
.tab-chev {
  width: 14px; text-align: center;
  color: var(--gray-500); font-size: 12px;
}
.tab-meta { font-size: 11.5px; }
.tab-spacer { flex: 1; }
.badge-current {
  background: var(--niq-500); color: white;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.btn-xs {
  padding: 3px 8px; font-size: 11px; line-height: 1;
  border: 1px solid var(--border); background: white;
  color: var(--niq-700); border-radius: 6px; cursor: pointer;
}
.btn-xs:hover { background: var(--niq-50); border-color: var(--niq-500); }
.shelf-tab-content {
  border-top: 1px solid var(--border);
  background: var(--gray-50);
  max-height: 40vh; overflow-y: auto;
}

/* legacy rules conservées pour compat (boutons simples) */
.shelf-tab-btn {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  text-align: left;
  cursor: pointer;
  gap: 2px;
  font-size: 13px;
}
.shelf-tab-btn:hover { background: var(--bg-hover); }
.shelf-tab-btn.active {
  background: var(--niq-50);
  border-color: var(--niq-500);
  color: var(--niq-700);
}
.shelf-tab-btn .muted { font-size: 11px; }

.shelf-slot-list {
  max-height: 60vh;
  overflow-y: auto;
}
.shelf-slot-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.shelf-slot-item:last-child { border-bottom: none; }
.shelf-slot-item:hover { background: var(--bg-hover); }
.shelf-slot-item.active {
  background: rgba(234, 88, 12, 0.08);
  box-shadow: inset 3px 0 0 rgb(234, 88, 12);
}
.shelf-slot-num {
  flex: 0 0 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: var(--gray-100);
  font-weight: 700; font-size: 12px;
  color: var(--gray-700);
}
.shelf-slot-item.active .shelf-slot-num {
  background: rgb(234, 88, 12); color: white;
}
.shelf-correct {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--gray-50, #f8fafc);
}
.shelf-correct.is-collapsed { gap: 0; padding: 8px 10px; }
.shelf-correct-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}
.shelf-correct-toggle:hover .shelf-correct-kicker { color: var(--gray-800, #1f2937); }
.shelf-correct-summary {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-correct-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shelf-correct-clear { flex: 0 0 auto; padding: 5px 8px; }
.shelf-correct-head {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.shelf-correct-head img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 40px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.shelf-correct-copy { min-width: 0; flex: 1; }
.shelf-correct-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500, var(--gray-600));
}
.shelf-correct-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shelf-correct-ean {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--gray-600);
  font-variant-numeric: tabular-nums;
}
.shelf-ean-copy {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
}
.shelf-ean-copy:hover { color: var(--niq-700, #1c4ed8); }
.shelf-ean-copy svg { width: 13px; height: 13px; display: block; }
.shelf-correct-row { display: flex; gap: 6px; align-items: center; }
.shelf-correct-preview {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 40px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.shelf-correct-input {
  flex: 1;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.shelf-usually { display: flex; flex-direction: column; gap: 6px; }
.shelf-usually-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.shelf-usually-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 76px;
  flex: 0 0 76px;
  min-height: 118px;
  box-sizing: border-box;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
}
.shelf-usually-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  cursor: pointer;
}
.shelf-usually-item strong {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.shelf-usually-item span {
  font-size: 10px;
  color: var(--gray-600);
}
.shelf-usually-item .shelf-usually-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-800, #1f2937);
  font-variant-numeric: tabular-nums;
}
.shelf-usually-skel {
  cursor: default;
  pointer-events: none;
}
.shelf-usually-skel-img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
}
.shelf-usually-skel .skeleton-line {
  height: 10px;
}
.shelf-correct-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--gray-500, var(--gray-600));
}
.shelf-correct-msg { margin: 0; font-size: 12px; }
.shelf-correct-msg.is-error { color: #b91c1c; }
.shelf-correct-msg.is-ok { color: #047857; }
.shelf-slot-body { flex: 1; min-width: 0; }
.shelf-slot-title {
  font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shelf-slot-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--gray-600);
  margin-top: 2px;
}
.badge-promo {
  background: var(--danger); color: white;
  padding: 1px 6px; border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
}
/* Badge « potentiel » : slot marqué rupture longue potentielle (même ambre que
   la bbox correspondante dans l'overlay). */
.badge-rupture-pot {
  background: rgba(245, 158, 11, 0.2);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.55);
  padding: 1px 6px; border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chip-rupture-pot {
  background: rgba(245, 158, 11, 0.2);
  color: #92400e;
}
.badge-slot-special {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-slot-special.is-price-error {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.45);
}
.badge-slot-special.is-previous-product {
  background: rgba(124, 58, 237, 0.14);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.45);
}
.shelf-slot-reference-missing {
  margin-top: 3px;
  color: var(--gray-500);
  font-size: 11px;
  font-style: italic;
}
/* Prix OCR (PRIXLU) vs master file (TBL_ARTICLE.PRIX) — même code couleur que
   l'onglet Admin › Compliance : vert = identiques, orange = divergents. */
.shelf-slot-price {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted, #6b7280);
  line-height: 1.2;
}
.shelf-slot-price.is-price-ok { color: #0aa689; }
.shelf-slot-price.is-price-wrong { color: #d97706; }
.shelf-slot-price.is-price-missing { color: #94a3b8; font-weight: 500; }
/* Prix partiellement lu (masque troué) : dégradé et jamais compté comme écart,
   la valeur affichée n'étant qu'une des hypothèses OCR. */
.shelf-slot-price.is-price-partial {
  color: #94a3b8;
  font-weight: 500;
  font-style: italic;
}
.shelf-price-prefix {
  font-weight: 500;
  color: inherit;
  opacity: 0.85;
  margin-right: 2px;
}
/* Marqueur de prix OCR partiellement lu (PRIX_MASK contient un « X »). */
.shelf-price-approx {
  margin-right: 1px;
  opacity: 0.7;
  cursor: help;
}
.shelf-price-sep {
  margin: 0 2px;
  opacity: 0.55;
  font-weight: 500;
}

/* ─────────────────────────────── EAN thumbs ─────────────────────────────── */

.shelf-slot-thumb {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
}
.sku-thumb-sm {
  width: 40px; height: 40px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  display: block;
}
.sku-thumb-lg {
  width: 120px; height: 120px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow-sm);
  flex: 0 0 120px;
}

/* ── Indicateur admin de source de vignette ────────────────────────────────
   Trait sous la vignette : BLEU = Azure Blob Storage (source par défaut),
   JAUNE = backup media.belive.ai. Visible uniquement pour les rôles admin
   (classe posée par thumbSrcClass()). Trait interne (inset) → pas de décalage
   de mise en page et respecte le border-radius de la vignette. */
img.thumb-src-blob   { box-shadow: inset 0 -4px 0 0 #2D6DF6; }
img.thumb-src-belive { box-shadow: inset 0 -4px 0 0 #FEC834; }
/* La grande vignette SKU a déjà une ombre portée : composer avec le trait. */
.sku-thumb-lg.thumb-src-blob   { box-shadow: var(--shadow-sm), inset 0 -4px 0 0 #2D6DF6; }
.sku-thumb-lg.thumb-src-belive { box-shadow: var(--shadow-sm), inset 0 -4px 0 0 #FEC834; }

/* Bouton admin « Belive → Azure » (visible si trait jaune). */
.thumb-with-src {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: 0 0 auto;
}
.thumb-with-src--sm { gap: 4px; }
.thumb-promote-btn {
  font-size: 11px;
  padding: 2px 8px;
  line-height: 1.3;
  background: #FEC834;
  border: 1px solid #e0b020;
  color: #1a1a1a;
  white-space: nowrap;
}
.thumb-promote-btn:hover:not(:disabled) {
  filter: brightness(0.95);
}
.thumb-promote-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ─────────────────────────────── Rupture viewer ─────────────────────────────── */
.rupture-viewer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rupture-head {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  flex-wrap: wrap;
}
.rupture-head-title {
  flex: 1 1 220px;
  min-width: 0;
}
.rupture-head-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.shelf-histo-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.shelf-histo-label {
  font-size: 12px;
  white-space: nowrap;
}
/* Barre d'outils du réalogramme : elle porte beaucoup de contrôles, donc on
   autorise le retour à la ligne et on interdit aux éléments de se comprimer.
   Sans ça, flex rétrécit les chips jusqu'à les rendre illisibles. */
.shelf-toolbar {
  /* La barre occupe toujours sa propre ligne, sur toute la largeur : la
     hauteur de l'en-tête ne dépend plus de la largeur des contrôles, donc
     l'affichage ne saute plus quand les données remplacent le skeleton. */
  flex: 1 1 100%;
  flex-wrap: wrap;
  justify-content: space-between;
  row-gap: 8px;
}
/* Deux colonnes : le contexte du rayon à gauche, les actions à droite. */
.shelf-toolbar-info,
.shelf-toolbar-actions {
  flex-wrap: wrap;
  row-gap: 8px;
}
.shelf-toolbar-info > *,
.shelf-toolbar-actions > * { flex: 0 0 auto; }
/* Les actions restent à droite même quand les deux groupes tombent chacun sur
   leur propre ligne : space-between n'aligne plus rien avec un seul groupe. */
.shelf-toolbar-actions { margin-left: auto; }

/* Bouton d'action réduit à son icône. Le libellé traduit vit dans
   title + aria-label : rien n'est perdu pour le lecteur d'écran. */
.btn-icon {
  justify-content: center;
  padding: 0;
  width: 30px;
  height: 30px;
}
.btn-icon .icon { font-size: 15px; }
.btn-icon[aria-pressed="true"] {
  background: var(--niq-50);
  border-color: var(--niq-500);
  color: var(--niq-700);
}

/* Relevé d'accuracy prix (« 45/50 ») dans la barre d'outils du réalogramme. */
.shelf-accuracy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative; /* ancre le tooltip d'erreur */
}
.shelf-accuracy-label {
  font-size: 12px;
  white-space: nowrap;
}
/* Input + bouton soudés : un seul contrôle visuel, bordure partagée. */
.shelf-accuracy-group {
  display: inline-flex;
  align-items: stretch;
}
.shelf-accuracy-input {
  width: 76px;
  min-width: 0;
  padding: 5px 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.shelf-accuracy-input:focus { z-index: 1; }
.shelf-accuracy-input.is-invalid {
  border-color: var(--danger, #e5484d);
}
.shelf-accuracy-input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.18);
}
.shelf-accuracy-btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-left: -1px;
  height: auto;
}
/* Message d'erreur hors du flux : il ne doit jamais élargir la barre d'outils. */
.shelf-accuracy-error {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 20;
  width: max-content;
  max-width: 260px;
  padding: 5px 9px;
  border-radius: var(--radius-md);
  background: var(--danger, #e5484d);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
.chip-accuracy {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip-histo {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.35);
}
.chip-histo-warn {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.45);
}
.dr-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 4px 0;
  border-top: 1px solid var(--gray-200, #e2e8f0);
  margin-top: 6px;
}

.rupture-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-left: auto;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, #fff);
  font-size: 13px;
}
.rupture-period-label {
  font-weight: 500;
  white-space: nowrap;
}

/* Date-range picker (store detail + ruptures) */
.dr {
  position: relative;
  display: inline-block;
}
.dr-trigger {
  min-width: 12.5rem;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.dr-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: 280px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #fff);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.12));
}
.dr-panel--end {
  left: auto;
  right: 0;
}
.dr-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.dr-month {
  font-weight: 600;
  font-size: 13px;
  text-transform: capitalize;
  color: var(--gray-800);
}
.dr-nav-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--gray-50, #f8fafc);
  color: var(--gray-700);
  font-size: 16px;
  line-height: 1;
}
.dr-nav-btn:hover { background: var(--gray-100, #f1f5f9); }
.dr-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
}
.dr-weeks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dr-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dr-day {
  box-sizing: border-box;
  width: 100%;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--gray-800);
  font-size: 13px;
  line-height: 32px;
  text-align: center;
}
.dr-day:hover:not(:disabled):not(.is-empty) { background: var(--gray-100, #f1f5f9); }
.dr-day.is-empty {
  color: transparent;
  background: transparent;
  cursor: default;
  pointer-events: none;
}
.dr-day.is-disabled {
  color: var(--gray-300);
  cursor: not-allowed;
}
.dr-day.is-inrange { background: rgba(254, 200, 52, 0.22); border-radius: 0; }
.dr-day.is-start,
.dr-day.is-end,
.dr-day.is-single {
  background: var(--niq-500);
  color: #111;
  font-weight: 600;
}
.dr-day.is-start { border-radius: 6px 0 0 6px; }
.dr-day.is-end { border-radius: 0 6px 6px 0; }
.dr-day.is-single { border-radius: 6px; }
.dr-day.is-today:not(.is-start):not(.is-end):not(.is-single):not(.is-inrange) {
  box-shadow: inset 0 0 0 1px var(--niq-500);
}
.dr-hint {
  margin: 8px 0 0;
  font-size: 12px;
}
.rupture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1100px) {
  .rupture-layout { grid-template-columns: 1fr; }
}
/* Colonne gauche : image + navigateur temporel collés, pour naviguer dans le
   temps sans jamais avoir à scroller par-dessus la photo. */
.rupture-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.rupture-canvas {
  position: relative;
  background: var(--gray-900);
  border-radius: 10px;
  overflow: hidden;
  padding: 8px;
}
/* Zone de défilement : centre la photo tant qu'elle rentre, puis laisse
   scroller (pan) quand elle est zoomée au-delà du cadre. `safe center` évite
   le rognage du haut/gauche impossible à atteindre quand le contenu déborde. */
.rupture-viewport {
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  overflow: auto;
  min-height: 224px;
  max-height: calc(56vh - 16px);
}
/* Glisser pour déplacer la photo une fois zoomée. */
.rupture-viewport.can-pan { cursor: grab; }
.rupture-viewport.is-panning { cursor: grabbing; }
.rupture-viewport.is-panning * { pointer-events: none; }
.rupture-viewport img {
  -webkit-user-drag: none;
  user-select: none;
}
/* Barre de zoom flottante (hors zone de scroll → reste fixe pendant le pan). */
.rupture-zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.62);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.rupture-zoom-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #f9fafb;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease;
}
.rupture-zoom-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.rupture-zoom-btn:disabled { opacity: 0.4; cursor: default; }
.rupture-zoom-level {
  min-width: 46px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
/* ── Navigateur temporel unifié (jours + heures) ── */
.rupture-timenav {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  bottom: 8px;
  z-index: 5;
}
.rupture-timenav-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rupture-timenav-label {
  flex: 0 0 auto;
  min-width: 42px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-500);
}
.rupture-nav-arrow {
  flex: 0 0 auto;
  padding: 4px 10px;
}
.rupture-strip {
  position: relative;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 2px;
  scroll-behavior: smooth;
}
.rupture-strip > * { flex: 0 0 auto; }
.rupture-frame-range {
  flex: 1 1 auto;
  min-width: 0;
}
.rupture-timenav-clock {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  margin-left: 2px;
}
.rupture-timenav-hours {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.rupture-timenav-empty { font-size: 12px; }
.rupture-days {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rupture-days-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rupture-days-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}
.rupture-days-controls input[type="range"] {
  width: 100%;
}
.rupture-days-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.rupture-day-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.rupture-day-chip.active {
  border-color: #fb923c;
  background: #fff7ed;
  color: #9a3412;
}
.rupture-canvas-inner {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
  max-height: 100%;
}
.rupture-frame-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(320px, 100%);
  min-height: min(220px, 62vh);
}
.rupture-image-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 24, 39, 0.6);
  z-index: 10;
  border-radius: 4px;
}
.rupture-image-loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  will-change: transform;
}
.rupture-canvas-inner img {
  width: auto;
  height: auto;
  max-width: calc(100% * var(--rupture-zoom, 1));
  max-height: calc(54vh * var(--rupture-zoom, 1));
  display: block;
  margin: 0 auto;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
.rupture-img-loading {
  opacity: 0.4;
  filter: blur(1px);
}
.rupture-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.15s ease-in-out;
}
.rupture-overlay-hidden {
  opacity: 0;
}
.rupture-empty {
  color: #e5e7eb;
  font-size: 14px;
  text-align: center;
  padding: 24px 12px;
}
.rupture-box {
  fill: rgba(255, 255, 255, 0.05);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
}
.rupture-shelf-box {
  fill: rgba(255, 255, 255, 0.02);
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 1px;
  stroke-dasharray: 4px 3px;
  vector-effect: non-scaling-stroke;
}
/* Inventory low : slot planogramme reporté sur la photo (carré jaune). */
.rupture-inventory-box {
  fill: rgba(250, 204, 21, 0.18);
  stroke: rgba(250, 204, 21, 0.95);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.rupture-box.status-open {
  stroke: rgba(220, 38, 38, 0.95);
  fill: rgba(220, 38, 38, 0.14);
}
.rupture-box.status-closed {
  stroke: rgba(22, 163, 74, 0.95);
  fill: rgba(22, 163, 74, 0.14);
}
.rupture-box.changed {
  stroke-width: 2.3px;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.65));
}
.rupture-box.hovered {
  stroke: #fff !important;
  stroke-width: 3px !important;
  fill: rgba(255, 255, 255, 0.7) !important;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.95));
}
.rupture-box.carryover {
  /* Carry-over : rupture toujours ouverte mais sans event sur la photo
     courante. Trait pointillé pour signaler le caractère hérité. */
  stroke-dasharray: 5px 4px;
  fill: rgba(220, 38, 38, 0.06);
}
.rupture-box.carryover.status-open {
  stroke: rgba(220, 38, 38, 0.75);
}
/* Rupture partielle (étagère partiellement vide) : ambre, pour la distinguer
   de la rupture totale (rouge). Ne s'applique qu'aux ruptures ouvertes ; une
   rupture fermée reste verte quel que soit son type. */
.rupture-box.status-open.rupture-partial {
  stroke: rgba(245, 158, 11, 0.95);
  fill: rgba(245, 158, 11, 0.16);
}
.rupture-box.carryover.status-open.rupture-partial {
  stroke: rgba(245, 158, 11, 0.8);
  fill: rgba(245, 158, 11, 0.07);
}
/* Légende de l'overlay ruptures (sous l'image) : rappel des couleurs des cadres
   dessinés sur la photo (rupture totale/partielle, changement de statut, etc.).
   Repliable via un bouton pour ne pas encombrer la vue par défaut. */
.rupture-legend-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.rupture-legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 5px 10px;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
  cursor: pointer;
}
.rupture-legend-toggle:hover {
  background: var(--gray-50, #f9fafb);
}
.rupture-legend-caret {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 10px;
  line-height: 1;
}
.rupture-legend-caret.open {
  transform: rotate(90deg);
}
.rupture-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 10px;
  background: var(--card, #fff);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--gray-600);
}
.rupture-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.rupture-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.rupture-legend-swatch.sw-total { border: 2px solid rgba(220, 38, 38, 0.95); background: rgba(220, 38, 38, 0.16); }
.rupture-legend-swatch.sw-partial { border: 2px solid rgba(245, 158, 11, 0.95); background: rgba(245, 158, 11, 0.18); }
.rupture-legend-swatch.sw-closed { border: 2px solid rgba(22, 163, 74, 0.95); background: rgba(22, 163, 74, 0.16); }
.rupture-legend-swatch.sw-carryover { border: 2px dashed rgba(220, 38, 38, 0.8); background: rgba(220, 38, 38, 0.08); }
.rupture-legend-swatch.sw-realogram { border: 1.5px dashed rgba(100, 116, 139, 0.9); background: rgba(148, 163, 184, 0.12); }
.rupture-legend-swatch.sw-low { border: 2px solid rgba(202, 138, 4, 0.9); background: rgba(250, 204, 21, 0.28); }
.rupture-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip-open { background: rgba(220, 38, 38, 0.12); color: #991b1b; }
.chip-closed { background: rgba(22, 163, 74, 0.13); color: #166534; }
.chip-change { background: rgba(245, 158, 11, 0.2); color: #92400e; }
.chip-total { background: rgba(220, 38, 38, 0.12); color: #991b1b; }
.chip-partial { background: rgba(245, 158, 11, 0.2); color: #92400e; }
.chip-carryover {
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  border: 1px dashed rgba(220, 38, 38, 0.55);
}
.chip-low {
  background: rgba(250, 204, 21, 0.22);
  color: #854d0e;
  border: 1px solid rgba(202, 138, 4, 0.55);
}
/* Section « niveau bas » du snapshot */
.rupture-low-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.rupture-low-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
}
.rupture-low-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: rgba(250, 204, 21, 0.85);
  border: 1.5px solid rgba(202, 138, 4, 0.9);
  flex-shrink: 0;
}
.rupture-item.low strong { color: #854d0e; }
.rupture-list {
  margin-top: 12px;
  max-height: 50vh;
  overflow-y: auto;
  border-top: 1px solid var(--border);
}
.rupture-item {
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.rupture-item-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.rupture-item-thumb {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  display: block;
}
.rupture-item-body {
  flex: 1 1 auto;
  min-width: 0;
}
.rupture-item-ean {
  display: block;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  line-height: 1.25;
  margin-bottom: 4px;
}
.rupture-item-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}
.rupture-item.open strong { color: #b91c1c; }
.rupture-item.closed strong { color: #166534; }
.rupture-item.changed { background: rgba(254, 243, 199, 0.35); }
.rupture-item.hovered {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.65), 0 2px 8px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 1;
}
.rupture-item.carryover {
  /* Reportée depuis une frame antérieure : visuellement plus discret. */
  opacity: 0.85;
  background: rgba(220, 38, 38, 0.04);
}
.rupture-item.carryover strong {
  border-bottom: 1px dashed rgba(220, 38, 38, 0.55);
}
.rupture-item-since {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
/* Bouton « aller au moment de la rupture » (redirige jour + frame du since). */
.rupture-since-jump {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.rupture-since-jump:hover {
  background: rgba(220, 38, 38, 0.16);
  border-color: rgba(220, 38, 38, 0.6);
}
.rupture-timeline {
  padding: 12px 14px;
}
.rupture-timeline-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}
.rupture-timeline-controls input[type="range"] {
  width: 100%;
}
.rupture-ticks {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}
.rupture-tick {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 82px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 12px;
}
.rupture-tick small {
  font-size: 10px;
  color: var(--gray-500);
}
.rupture-tick.active {
  border-color: #fb923c;
  background: #fff7ed;
}

/* ── Diagnostic REASON (admin) : cadres cliquables + panneau détaillé ── */
.rupture-overlay-admin .rupture-box { cursor: pointer; }
.rupture-item.has-reason { cursor: pointer; }
.rupture-item.selected {
  border-color: var(--niq-400, #93c5fd);
  box-shadow: 0 0 0 1px var(--niq-300, #bfdbfe) inset;
}
.rupture-reason-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--border, #e5e7eb);
  color: var(--gray-600, #4b5563);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.rupture-reason-caret { font-size: 9px; color: var(--gray-500, #6b7280); }
.rupture-reason {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--gray-50, #f9fafb);
  cursor: default;
  text-align: center;
}
.rupture-reason-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.4;
  color: var(--gray-700, #374151);
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 6px 8px;
  margin-bottom: 8px;
  word-break: break-word;
  text-align: center;
}
.rupture-reason-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  width: 100%;
}
.rupture-reason-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11.5px;
  padding: 4px 2px;
  border-bottom: 1px dotted var(--border, #e5e7eb);
  min-width: 0;
  text-align: center;
}
.rupture-reason-k {
  color: var(--gray-500, #6b7280);
  word-break: break-word;
  line-height: 1.25;
}
.rupture-reason-v {
  color: var(--gray-800, #1f2937);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}
.rupture-reason-raw {
  margin-top: 8px;
  font-size: 11px;
  text-align: left;
}
.rupture-reason-raw summary {
  cursor: pointer;
  color: var(--gray-500, #6b7280);
  user-select: none;
  text-align: center;
}
.rupture-reason-raw pre {
  margin: 6px 0 0;
  padding: 8px;
  max-height: 220px;
  overflow: auto;
  border-radius: 6px;
  background: var(--gray-900, #111827);
  color: #e5e7eb;
  font-size: 10.5px;
  line-height: 1.45;
  white-space: pre;
}

@media (max-width: 900px) {
  .rupture-viewport {
    max-height: calc(44vh - 16px);
  }
  .rupture-canvas-inner img {
    max-height: calc(42vh * var(--rupture-zoom, 1));
  }
  /* Le navigateur temporel reste collé en bas de l'écran sur mobile :
     l'image défile au-dessus, les barres jour/heure restent accessibles. */
  .rupture-timenav {
    bottom: 0;
    box-shadow: 0 -6px 18px rgba(17, 24, 39, 0.12);
  }
}

/* ─────────────────────────────── PROJECT DOCS ────────────────────────────── */
.docs { max-width: 1080px; }

.docs-brief {
  padding: 26px 28px;
  background:
    radial-gradient(120% 200% at 0% 0%, var(--niq-50) 0%, transparent 55%),
    radial-gradient(120% 200% at 100% 100%, #fff7e3 0%, transparent 55%),
    #ffffff;
  border-left: 4px solid var(--niq-500);
}
.docs-brief-tag { margin-bottom: 8px; }
.badge.badge-niq,
.badge.badge-vusion {
  background: var(--niq-500);
  color: #fff;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
  padding: 4px 10px;
}
.docs-brief-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  color: var(--niq-700, #1d4dbf);
}
.docs-brief-lede {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--gray-700);
}
.docs-h3 {
  margin: 18px 0 6px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-600);
}
.docs-quote {
  margin: 12px 0 4px;
  padding: 12px 16px;
  border-left: 3px solid #fec834;
  background: #fffaee;
  border-radius: 0 8px 8px 0;
  color: var(--gray-700);
  font-style: italic;
}
.docs-quote p { margin: 0 0 4px; }
.docs-quote cite {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: var(--gray-600);
}
.docs-brief-sources {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--gray-600);
}
.docs-brief-sources a {
  color: var(--niq-600, var(--niq-500));
  text-decoration: none;
}
.docs-brief-sources a:hover { text-decoration: underline; }

.docs-pipeline { padding: 22px 20px; }
.pipe-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.pipe-step {
  flex: 1 1 130px;
  min-width: 130px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pipe-step:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.pipe-step-source { background: linear-gradient(180deg, #f3f7ff 0%, #e8f0ff 100%); border-color: var(--niq-200); }
.pipe-step-storage { background: linear-gradient(180deg, #eef9ff 0%, #d8efff 100%); border-color: #b6dcff; }
.pipe-step-api { background: linear-gradient(180deg, #f0e9ff 0%, #e1d2ff 100%); border-color: #c4abff; }
.pipe-step-ui { background: linear-gradient(180deg, #fff8e0 0%, #ffeeb0 100%); border-color: var(--vusion-200); }

.pipe-icon { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.pipe-title { font-weight: 600; font-size: 13px; color: var(--gray-900); }
.pipe-meta { font-size: 11px; color: var(--gray-600); margin-top: 4px; }

.pipe-arrow {
  display: flex;
  align-items: center;
  font-size: 22px;
  color: var(--gray-400);
  font-weight: 600;
  flex: 0 0 auto;
}
@media (max-width: 880px) {
  .pipe-arrow { transform: rotate(90deg); flex-basis: 100%; justify-content: center; }
  .pipe-step { flex-basis: 100%; }
}

.docs-list {
  margin: 8px 0 4px;
  padding-left: 22px;
  line-height: 1.7;
}
.docs-list li { margin-bottom: 4px; }

.docs-callout {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--niq-50);
  border-left: 3px solid var(--niq-500);
  border-radius: 6px;
  font-size: 13px;
}

.docs-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.docs-grid-2 > div {
  padding: 12px 14px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.docs-grid-2 h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
}
@media (max-width: 720px) {
  .docs-grid-2 { grid-template-columns: 1fr; }
}

.docs-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.docs-fields .field {
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--gray-700);
}

.docs-glossary {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 18px;
  margin: 6px 0 0;
}
.docs-glossary dt {
  font-weight: 600;
  color: var(--niq-700);
}
.docs-glossary dd {
  margin: 0;
  color: var(--gray-700);
}
@media (max-width: 600px) {
  .docs-glossary { grid-template-columns: 1fr; }
  .docs-glossary dt { margin-top: 6px; }
}

/* ------------------------------------------------------------------ Login */

.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 18% 18%, rgba(254, 200, 52, 0.42) 0, transparent 34%),
    linear-gradient(135deg, #1f2933 0%, #111827 52%, #3a2a00 100%);
}
.login-card {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.32);
  padding: 48px 40px 36px;
  width: 380px;
  max-width: 92vw;
  text-align: center;
}
.login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}
.logo-niq-login {
  display: none;
}
.logo-vusion-login {
  width: 44px;
  height: 44px;
  display: block;
}
.logo-vusion-login path { fill: var(--vusion-500); }
.login-logo-text {
  font-size: 22px;
  font-weight: 750;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}
.login-title {
  margin: 0 0 2px;
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.login-subtitle {
  margin: 0 0 28px;
  font-size: 13px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.login-card > .login-title + .login-form {
  margin-top: 26px;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-input {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--gray-800);
  background: var(--bg-page);
  outline: none;
  transition: border-color 0.15s;
}
.login-input:focus {
  border-color: var(--vusion-500);
  box-shadow: 0 0 0 3px rgba(254, 200, 52, 0.22);
}
.login-input::placeholder { color: var(--gray-400); }
.login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  text-align: left;
}
.login-btn {
  padding: 12px 0;
  border: none;
  border-radius: 8px;
  background: var(--vusion-500);
  color: #1f2933;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
}
.login-btn:hover {
  background: var(--vusion-600);
  transform: translateY(-1px);
}
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-link {
  align-self: center;
  padding: 2px 4px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--gray-500);
  cursor: pointer;
  transition: color 0.15s;
}
.login-link:hover { color: var(--gray-900); text-decoration: underline; }
.login-link:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(254, 200, 52, 0.35);
}
.login-link-inline {
  display: inline;
  padding: 0;
  font-size: inherit;
  color: var(--gray-900);
  text-decoration: underline;
}
.login-view-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  color: var(--gray-900);
}
.login-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-500);
}
.login-notice {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}
.login-footer {
  margin: 24px 0 0;
  font-size: 12px;
  color: var(--gray-400);
}

/* ---------------------------------------------------------------- User menu */

.user-switch { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color 0.15s;
}
.user-btn:hover { border-color: var(--niq-400); }
.user-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--niq-500);
  color: white;
  font-weight: 700;
  font-size: 13px;
}
.user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  min-width: 220px;
  z-index: 100;
  overflow: hidden;
}
.user-menu-info {
  padding: 14px 16px 10px;
  display: flex; flex-direction: column; gap: 2px;
  border-bottom: 1px solid var(--border);
}
.user-menu-info strong { font-size: 14px; color: var(--gray-800); }
.user-menu-info .muted { font-size: 12px; }
.user-pays {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: var(--niq-50, #eef3fe);
  color: var(--niq-600);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.user-menu-logout {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--danger);
  cursor: pointer;
}
.user-menu-logout:hover {
  background: var(--bg-page);
}

/* ─── Toggle source ruptures (réservé à Tim) ─── */
.user-menu-devrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.user-menu-devrow-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.user-menu-devrow-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.user-menu-devrow-hint {
  font-size: 10px;
  color: var(--gray-500, #94a3b8);
}
.rupture-source-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}
.rupture-source-state {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500, #94a3b8);
  min-width: 30px;
  text-align: right;
}
.rupture-source-toggle.is-dev .rupture-source-state {
  color: var(--niq-600, #0aa689);
}
.rupture-source-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--gray-300, #cbd5e1);
  transition: background 0.15s;
}
.rupture-source-toggle.is-dev .rupture-source-track {
  background: var(--niq-500, #0aa689);
}
.rupture-source-knob {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: left 0.15s;
}
.rupture-source-toggle.is-dev .rupture-source-knob {
  left: 18px;
}

/* ----------------------------------------- Références cibles (liste d'alerte) */
.zone-badge {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px;
  white-space: nowrap;
  background: var(--gray-100); color: var(--gray-700);
}
.zone-badge.zone-embase { background: #fde2e2; color: #b91c1c; }   /* bas : à surveiller */
.zone-badge.zone-haut   { background: #fff1c2; color: #92600c; }   /* haut : à surveiller */
.zone-badge.zone-yeux   { background: #d7f5e6; color: #047857; }   /* hauteur des yeux : idéal */
.zone-badge.zone-milieu { background: var(--niq-50); color: var(--niq-700); }
.zone-badge.zone-unknown { background: var(--gray-100); color: var(--gray-500); }

.badge-alert {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: #fde2e2; color: var(--danger);
}
.badge-ok {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: #d7f5e6; color: #047857;
}
.tbl tr.row-alert td { background: #fff7f7; }
.tbl tr.row-alert:hover td { background: #ffecec; }
/* Cellule-lien (ex. EAN → fiche SKU) : ne déclenche pas l'action de la ligne. */
.tbl a.link-cell { color: var(--niq-600); font-weight: 600; }
.tbl a.link-cell:hover { color: var(--niq-700); text-decoration: underline; }

/* Cellule EAN : texte sélectionnable + bouton dédié vers la fiche SKU. */
.ean-cell { white-space: nowrap; cursor: default; }
.ean-cell .ean-text { user-select: text; cursor: text; }
.ean-sku-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 8px; padding: 2px 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm, 6px);
  background: white; color: var(--niq-600); cursor: pointer;
  vertical-align: middle;
}
.ean-sku-btn:hover { background: var(--niq-50); border-color: var(--niq-500); color: var(--niq-700); }
.ean-sku-btn .icon { width: 14px; height: 14px; display: inline-flex; }
.ean-sku-btn .icon svg { width: 14px; height: 14px; }

/* Pagination (affichage web). */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-top: 14px;
}
.pager .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----------------------------------------------------------- Admin Compliance */

.cmp-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}
.cmp-kpi-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}
.cmp-kpi-legends {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  width: 100%;
  margin: 4px 0 12px;
}
.cmp-kpi-legends--flat {
  padding: 0;
  background: transparent;
  border: none;
}
.cmp-kpi-legend-sep {
  color: var(--muted, #94a3b8);
  margin: 0 2px;
  font-weight: 600;
}
.cmp-kpi-legend-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #6b7280);
  white-space: nowrap;
  flex-shrink: 0;
}
.cmp-kpi-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted, #6b7280);
  white-space: nowrap;
}
.cmp-kpi-legend-chip .cmp-kpi-legend-val {
  min-width: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gray-700, #374151);
}
.cmp-kpi-metrics .cmp-kpi-actions {
  margin-left: auto;
}
.cmp-kpis-inline {
  margin: 0;
  flex: 1;
  justify-content: flex-end;
}
.cmp-kpis-inline .cmp-kpi {
  padding: 6px 10px;
  min-width: 72px;
}
.cmp-kpis-inline .cmp-kpi-val { font-size: 15px; }
.cmp-kpi {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  padding: 10px 14px;
  min-width: 96px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmp-kpi-hero {
  border-color: var(--niq-500, #0aa689);
  background: linear-gradient(180deg, #ecfdf8 0%, #fff 70%);
  min-width: 120px;
}
.cmp-kpi-hero .cmp-kpi-val { font-size: 22px; }
.cmp-kpi-val {
  font-weight: 700;
  font-size: 18px;
  color: var(--niq-700);
  font-variant-numeric: tabular-nums;
}
.cmp-kpi-lbl {
  font-size: 11px;
  color: var(--muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.cmp-kpi-legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
}
.cmp-kpi-legend.cmp-kpi-legend--inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
  flex: 1 1 auto;
  min-width: 0;
}
.cmp-kpi-legend-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted, #6b7280);
}
.cmp-kpi-legend-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gray-700, #374151);
  min-width: 1.2em;
}
.cmp-kpi-legend-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.cmp-kpi-counts .cmp-kpi-val {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cmp-kpi-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.cmp-store-overview { margin-bottom: 10px; }
.cmp-cam-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}
.cmp-cam-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: white;
  cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms, transform 80ms;
  color: inherit;
  min-height: 96px;
}
.cmp-cam-card:hover {
  border-color: var(--niq-500);
  box-shadow: 0 0 0 2px rgba(10, 166, 137, 0.12);
}
.cmp-cam-card.active {
  border-color: var(--niq-600);
  box-shadow: 0 0 0 2px rgba(10, 166, 137, 0.28);
  transform: translateY(-1px);
}
.cmp-cam-card.is-loading { opacity: 0.85; }
.cmp-cam-card:not(.has-truth) { opacity: 0.72; }
.cmp-cam-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cmp-cam-id {
  font-weight: 700;
  font-size: 13px;
}
.cmp-cam-card .badge-muted {
  background: var(--gray-100, #f3f4f6);
  color: var(--muted, #6b7280);
}
.cmp-cam-f1 {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--niq-700);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.cmp-cam-block-lbl {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}
.cmp-cam-divider {
  border: 0;
  border-top: 1px solid var(--border, #e5e7eb);
  margin: 10px 0 8px;
}
.cmp-cam-block-price .cmp-cam-f1.cmp-cam-price-val {
  font-size: 16px;
  color: var(--niq-700);
}
.cmp-cam-legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
}
.cmp-cam-legend-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted, #6b7280);
}
.cmp-cam-legend-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gray-700, #374151);
  min-width: 1.2em;
}
.cmp-cam-legend-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.cmp-cam-mini-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted, #6b7280);
  align-items: center;
}
.cmp-cam-mini-counts span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cmp-detail {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cmp-detail-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.cmp-detail-head-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.cmp-authorized-cats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}
.cmp-authorized-cats-label {
  color: var(--muted, #6b7280);
  font-size: 11px;
  font-weight: 600;
}
.cmp-category-audit {
  white-space: nowrap;
}
.cmp-category-audit.is-ok {
  background: #dcfce7;
  color: #166534;
}
.cmp-category-audit.is-error {
  background: #fee2e2;
  color: #991b1b;
}
.cmp-kpi-metrics--detail {
  margin-left: auto;
  width: auto;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.cmp-kpi-metrics--detail .cmp-kpi {
  padding: 6px 10px;
  min-width: 72px;
}
.cmp-kpi-metrics--detail .cmp-kpi-val {
  font-size: 15px;
}
.cmp-selectable {
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
/* Vue Image = surface de dessin : tous les panneaux qui apparaissent à la
   sélection (barre EAN, Chroma, Identify) passent SOUS le canvas. Sinon leur
   apparition au pointerdown pousse l'image vers le bas en pleine prise du
   slot — et le delta de drag, calculé sur la géométrie décalée, déplace la
   bbox tout seul. `order` suffit : le DOM reste partagé avec la vue Grille. */
.cmp-pane-truth.is-image-view .cmp-image-view { order: 1; }
.cmp-pane-truth.is-image-view .cmp-edit-bar {
  order: 2;
  position: static;
  margin: 10px 0 0;
}
.cmp-pane-truth.is-image-view .cmp-chroma { order: 3; }
.cmp-pane-truth.is-image-view .cmp-identify-result { order: 4; }
.cmp-edit-bar.is-sticky {
  position: sticky;
  top: 0;
  z-index: 4;
  background: white;
  margin-top: 0;
  margin-bottom: 10px;
  padding: 8px 0;
  border-top: none;
  border-bottom: 1px solid var(--border);
}
.cmp-action-toast {
  flex: 1 1 180px;
  min-width: 140px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  border: 1px solid var(--border);
  background: #f8fafb;
  color: var(--muted, #6b7280);
}
.cmp-action-toast.is-ok {
  border-color: #b6e4da;
  background: #ecfdf8;
  color: var(--niq-700, #0f766e);
  font-weight: 600;
}
.cmp-action-toast.is-err {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--danger, #b91c1c);
  font-weight: 600;
}
.cmp-cell.is-flash {
  outline: 2px solid var(--niq-500, #0aa689);
  box-shadow: 0 0 0 3px rgba(10, 166, 137, 0.25);
  animation: cmp-flash-pulse 0.9s ease-out 1;
}
@keyframes cmp-flash-pulse {
  0% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
.cmp-side-apply {
  flex: 0 0 auto;
  align-self: center;
  padding: 3px 8px;
  font-size: 11px;
}
.cmp-split {
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(300px, 1.2fr) minmax(220px, 0.9fr);
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 1280px) {
  .cmp-split {
    grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.1fr);
  }
  .cmp-pane-side {
    grid-column: 1 / -1;
    max-height: 360px;
  }
}
@media (max-width: 900px) {
  .cmp-split { grid-template-columns: 1fr; }
}
.cmp-pane {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  min-height: 0;
}
.cmp-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  min-height: 40px;
}
.cmp-pane-truth .cmp-grid-wrap,
.cmp-pane-daily .cmp-daily-viewport,
.cmp-pane-side .cmp-side-tree {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: min(68vh, 680px);
}
.cmp-canvas {
  position: relative;
  background: var(--gray-100, #f3f4f6);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  min-height: 180px;
}
.cmp-canvas.is-drawing { cursor: crosshair; }
.cmp-canvas.is-editing-bbox { cursor: grabbing; }
.cmp-canvas.is-edit-move { cursor: grabbing; }
.cmp-canvas.is-edit-n,
.cmp-canvas.is-edit-s { cursor: ns-resize; }
.cmp-canvas.is-edit-e,
.cmp-canvas.is-edit-w { cursor: ew-resize; }
.cmp-canvas.is-edit-nw,
.cmp-canvas.is-edit-se { cursor: nwse-resize; }
.cmp-canvas.is-edit-ne,
.cmp-canvas.is-edit-sw { cursor: nesw-resize; }
.cmp-overlay .cmp-bbox.cmp-editable { cursor: move; }
.cmp-overlay .cmp-handle {
  fill: #1d4ed8;
  stroke: #ffffff;
  stroke-width: 1.5;
  pointer-events: all;
}
.cmp-overlay .cmp-handle-n,
.cmp-overlay .cmp-handle-s { cursor: ns-resize; }
.cmp-overlay .cmp-handle-e,
.cmp-overlay .cmp-handle-w { cursor: ew-resize; }
.cmp-overlay .cmp-handle-nw,
.cmp-overlay .cmp-handle-se { cursor: nwse-resize; }
.cmp-overlay .cmp-handle-ne,
.cmp-overlay .cmp-handle-sw { cursor: nesw-resize; }
.cmp-canvas-inner {
  position: relative;
  width: 100%;
  line-height: 0;
}
.cmp-canvas-inner img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.cmp-daily-viewport {
  position: relative;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  overflow: auto;
  background: var(--gray-100, #f3f4f6);
  border-radius: var(--radius-md, 8px);
}
/* Attente de la photo (changement de jour) : voile sur le cadre, jamais sur la
   barre d'outils ni sur la bande de jours, qui restent cliquables. */
.cmp-stage-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
}
.cmp-daily-viewport.can-pan { cursor: grab; }
.cmp-daily-viewport.is-panning { cursor: grabbing; }
.cmp-daily-viewport.is-panning * { pointer-events: none; }
.cmp-daily-stage {
  width: calc(100% * var(--cmp-zoom, 1));
  max-width: none;
  flex: 0 0 auto;
  overflow: visible;
  background: transparent;
  min-height: 0;
}
/* Navigation photo du panneau Daily (X derniers jours, photos seules). */
.cmp-daynav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.cmp-daynav-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.cmp-daynav-lbl {
  flex: 0 0 auto;
  font-size: 11.5px;
  line-height: 22px;   /* aligné sur la première ligne de chips */
  cursor: help;
}
/* Pas de scroll horizontal : la fenêtre fait quelques jours, les chips
   passent à la ligne. Une barre de défilement ici se superposait aux chips
   (overlay macOS) et rognait les libellés. */
.cmp-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}
.cmp-strip > * { flex: 0 0 auto; }
.cmp-daynav-loader { flex: 0 0 auto; margin-top: 3px; }
.cmp-strip-skel { display: flex; gap: 6px; }
.cmp-day-skel {
  width: 46px;
  height: 22px;
  border-radius: 999px;
}
.cmp-day-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11.5px;
  line-height: 14px;
  white-space: nowrap;
  cursor: pointer;
  color: var(--gray-700, #374151);
}
.cmp-day-chip:hover { border-color: var(--niq-400, #34d3b5); }
.cmp-day-chip.is-current { font-weight: 600; }
.cmp-day-chip.active {
  border-color: var(--niq-600, #089377);
  background: var(--niq-50, #ecfdf8);
  color: var(--niq-800, #06614f);
  font-weight: 600;
}
.cmp-daynav-hist {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  border-radius: var(--radius-sm, 6px);
  font-size: 12px;
  color: #92400e;
}
.cmp-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.62);
  backdrop-filter: blur(4px);
}
.cmp-zoom-btn {
  min-width: 28px;
  height: 26px;
  padding: 0 7px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #f9fafb;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.cmp-zoom-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.cmp-zoom-btn:disabled { opacity: 0.4; cursor: default; }
.cmp-zoom-level {
  min-width: 42px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.cmp-side-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}
.cmp-side-tab {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: white;
}
.cmp-side-tab.current {
  border-color: var(--niq-500);
  box-shadow: 0 0 0 1px var(--niq-500);
}
.cmp-side-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: none;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  color: inherit;
}
.cmp-side-tab-head:hover { background: var(--niq-50, #ecfdf8); }
.cmp-side-tab.current .cmp-side-tab-head { background: var(--niq-50, #ecfdf8); }
.cmp-side-tab-body {
  border-top: 1px solid var(--border);
  background: var(--gray-50, #f9fafb);
  max-height: 42vh;
  overflow-y: auto;
}
.cmp-side-slot {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.cmp-side-slot:last-child { border-bottom: none; }
.cmp-side-slot:hover,
.cmp-side-slot.is-hover { background: rgba(37, 99, 235, 0.08); }
.cmp-side-slot.is-hover:not(.active) {
  box-shadow: inset 3px 0 0 #2563eb;
}
.cmp-side-slot.active {
  background: rgba(37, 99, 235, 0.12);
  box-shadow: inset 4px 0 0 #2563eb, 0 0 0 2px rgba(37, 99, 235, 0.45);
  outline: 2px solid #2563eb;
  outline-offset: -2px;
  z-index: 1;
  position: relative;
}
.cmp-side-slot.cmp-cell-wrong_ean.active {
  box-shadow: inset 4px 0 0 #d97706, 0 0 0 2px rgba(217, 119, 6, 0.4);
  outline-color: #d97706;
}
.cmp-side-slot.cmp-cell-fp.active {
  box-shadow: inset 4px 0 0 #7c3aed, 0 0 0 2px rgba(124, 58, 237, 0.4);
  outline-color: #7c3aed;
}
.cmp-side-ord {
  flex: 0 0 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--gray-100, #f3f4f6);
  font-weight: 700;
  font-size: 11px;
  color: var(--gray-700, #374151);
}
.cmp-side-slot.active .cmp-side-ord {
  background: #2563eb;
  color: white;
}
.cmp-side-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  flex: 0 0 auto;
}
.cmp-side-body { flex: 1; min-width: 0; }
.cmp-side-title {
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cmp-side-ean {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #6b7280);
}
.cmp-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.cmp-overlay .cmp-bbox {
  stroke: #9ca3af;
  stroke-width: 1.5;
  stroke-dasharray: 3 2;
  fill: transparent;
}
.cmp-overlay .cmp-bbox.cmp-tp { stroke: #0aa689; stroke-dasharray: none; stroke-width: 2; }
.cmp-overlay .cmp-bbox.cmp-wrong_ean { stroke: #d97706; stroke-dasharray: none; stroke-width: 2; }
.cmp-overlay .cmp-bbox.cmp-fn { stroke: #dc2626; stroke-dasharray: none; stroke-width: 2; }
.cmp-overlay .cmp-bbox.cmp-fp { stroke: #7c3aed; stroke-dasharray: 4 2; stroke-width: 1.5; }
.cmp-overlay .cmp-bbox.cmp-drawing {
  stroke: #0aa689;
  stroke-dasharray: 4 2;
  fill: rgba(10, 166, 137, 0.15);
}
.cmp-overlay .cmp-target-band {
  fill: rgba(10, 166, 137, 0.12);
  stroke: #0aa689;
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
}
.cmp-overlay .cmp-bbox.cmp-dim { opacity: 0.18; }
.cmp-overlay .cmp-bbox.cmp-active { opacity: 1; }
.cmp-overlay .cmp-bbox.cmp-hov {
  stroke: #3b82f6 !important;
  stroke-width: 3.5 !important;
  stroke-dasharray: none !important;
  fill: rgba(59, 130, 246, 0.18) !important;
}
.cmp-overlay .cmp-bbox.cmp-selected {
  stroke: #1d4ed8 !important;
  stroke-width: 4.5 !important;
  stroke-dasharray: none !important;
  fill: rgba(37, 99, 235, 0.28) !important;
  filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.85));
}
.cmp-overlay .cmp-bbox-label {
  fill: #ffffff;
  paint-order: stroke;
  stroke: rgba(17, 24, 39, 0.85);
  stroke-width: 0.004;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
}
.cmp-overlay .cmp-bbox-label-active {
  fill: #1d4ed8;
  stroke: #ffffff;
  stroke-width: 0.006;
  font-weight: 800;
}
.cmp-edit-bar {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cmp-winner-debug {
  margin-top: 9px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--gray-50, #f9fafb);
  font-size: 11px;
}
.cmp-winner-loading,
.cmp-winner-api,
.cmp-winner-why,
.cmp-winner-merge {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.cmp-winner-section + .cmp-winner-section { margin-top: 10px; }
.cmp-winner-title {
  margin-bottom: 5px;
  color: var(--text, #111827);
  font-size: 12px;
  font-weight: 700;
}
.cmp-winner-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(70px, auto));
  gap: 3px 7px;
}
.cmp-winner-grid > span { color: var(--muted, #6b7280); }
.cmp-winner-grid > code { overflow-wrap: anywhere; }
.cmp-winner-ean {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: inherit;
}
.cmp-winner-ean.is-gt code {
  font-weight: 800;
  color: #166534;
}
.cmp-winner-gt {
  display: inline-flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.cmp-winner-why { margin-top: 6px; }
.cmp-winner-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}
.cmp-winner-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.cmp-winner-table th,
.cmp-winner-table td {
  padding: 3px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.cmp-winner-table th {
  color: var(--muted, #6b7280);
  font-weight: 600;
}
.cmp-winner-table tr.is-gt {
  background: rgba(22, 163, 74, 0.12);
}
.cmp-winner-merge { margin-top: 9px; }
.cmp-winner-raw { margin-top: 9px; }
.cmp-winner-raw summary { cursor: pointer; color: var(--muted, #6b7280); }
.cmp-winner-raw pre {
  max-height: 260px;
  margin: 6px 0 0;
  padding: 8px;
  overflow: auto;
  border-radius: 4px;
  background: #111827;
  color: #e5e7eb;
  font-size: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cmp-side-ean.cmp-selectable {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted, #6b7280);
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.cmp-identify-result {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  line-height: 1.4;
}
.chroma-tab { margin-top: 12px; }
.chroma-tab-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.chroma-audit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 10px 0 0;
  border-top: 1px solid var(--border);
}
.chroma-audit-store {
  flex: 1;
  min-width: 240px;
}
.chroma-audit-nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  outline: none;
}
.chroma-audit-pos {
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.chroma-audit-current {
  margin: 0 0 10px;
  font-size: 13px;
}
.cmp-chroma {
  margin-top: 8px;
  padding: 10px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
}
.cmp-chroma-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cmp-chroma-head code {
  font-size: 12px;
  background: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.cmp-chroma-error {
  color: var(--danger, #e5484d);
  font-size: 12px;
  margin-bottom: 8px;
}
.cmp-chroma-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}
.cmp-chroma-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
}
.cmp-chroma-pill.warn,
.cmp-chroma-badge.warn {
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
}
/* Vecteur indexé sans fichier dans ITALY_448 : information, pas erreur —
   l'EAN reste servi par la collection (vignettes encodées ailleurs). */
.cmp-chroma-pill.orphan,
.cmp-chroma-badge.orphan {
  background: rgba(37, 99, 235, 0.12);
  color: #1e40af;
}
.cmp-chroma-pill.ok,
.cmp-chroma-badge.ok {
  background: rgba(22, 163, 74, 0.13);
  color: #166534;
}
.cmp-chroma-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 3px solid rgba(37, 99, 235, 0.55);
  background: rgba(37, 99, 235, 0.06);
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  color: var(--text, #111827);
}
.cmp-chroma-backends {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--gray-50, #f9fafb);
  font-size: 12px;
}
.cmp-chroma-backends-lead {
  margin: 0 0 4px;
  font-weight: 600;
}
.cmp-chroma-backends-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
.cmp-chroma-backends-table th,
.cmp-chroma-backends-table td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.cmp-chroma-backends-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #6b7280);
}
.cmp-chroma-backends-table tr.is-audited {
  background: rgba(22, 163, 74, 0.07);
}
.cmp-chroma-backends-note {
  margin: 8px 0 0;
  color: var(--muted, #6b7280);
  font-size: 11px;
}
.cmp-chroma-badge.muted {
  background: var(--gray-100, #f3f4f6);
  color: var(--muted, #6b7280);
}
.cmp-chroma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.cmp-chroma-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}
.cmp-chroma-card.is-orphan { border-color: rgba(220, 38, 38, 0.45); }
.cmp-chroma-card.is-warn { border-color: rgba(245, 158, 11, 0.55); }
.cmp-chroma-card.is-ok { border-color: rgba(22, 163, 74, 0.35); }
.cmp-chroma-card.is-removing { opacity: 0.55; pointer-events: none; }
.cmp-chroma-card.is-rotating { opacity: 0.65; }
.cmp-chroma-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
}
.cmp-chroma-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  display: block;
}
.cmp-chroma-rotate {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}
.cmp-chroma-rotate button {
  width: 28px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.82);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}
.cmp-chroma-rotate button:hover { background: rgba(22, 101, 52, 0.94); }
.cmp-chroma-rotate button:disabled { opacity: 0.45; cursor: not-allowed; }
.cmp-chroma-x {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
  z-index: 2;
}
.cmp-chroma-card:hover .cmp-chroma-x,
.cmp-chroma-card:focus-within .cmp-chroma-x,
.cmp-chroma-x:focus-visible {
  opacity: 1;
  transform: scale(1);
}
.cmp-chroma-x:hover { background: #b91c1c; }
.cmp-chroma-x:disabled { opacity: 0.4; cursor: not-allowed; }
.cmp-chroma-confirm {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 7px 7px;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  z-index: 3;
  animation: cmp-chroma-confirm-in 0.16s ease;
}
@keyframes cmp-chroma-confirm-in {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.cmp-chroma-confirm-msg {
  width: 100%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmp-chroma-confirm-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.cmp-chroma-confirm-ok,
.cmp-chroma-confirm-cancel {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cmp-chroma-confirm-ok {
  background: #16a34a;
  color: #fff;
}
.cmp-chroma-confirm-ok:hover { background: #15803d; }
.cmp-chroma-confirm-cancel {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.cmp-chroma-confirm-cancel:hover { background: rgba(255, 255, 255, 0.28); }
.cmp-chroma-confirm-ok:disabled,
.cmp-chroma-confirm-cancel:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cmp-chroma-card-meta {
  padding: 4px 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmp-chroma-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 5px;
  border-radius: 4px;
}
.cmp-chroma-file {
  font-size: 10px;
  color: var(--muted, #6b7280);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmp-identify-thumb {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
}
.cmp-identify-result code {
  font-size: 12px;
  background: white;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.cmp-identify-result details {
  margin-top: 8px;
}
.cmp-identify-result pre {
  max-height: 320px;
  margin: 6px 0 0;
  padding: 8px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 11px;
}
.cmp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted, #6b7280);
}
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9ca3af;
}
.cmp-dot.cmp-tp { background: #0aa689; }
.cmp-dot.cmp-wrong_ean { background: #d97706; }
.cmp-dot.cmp-fn { background: #dc2626; }
.cmp-dot.cmp-fp { background: #7c3aed; }
.cmp-dot.cmp-oos { background: #64748b; }
.cmp-dot.cmp-pl0 { background: #0aa689; }
.cmp-dot.cmp-pl1 { background: #eab308; }
.cmp-dot.cmp-pl2 { background: #d97706; }
.cmp-dot.cmp-pl3 { background: #ea580c; }
.cmp-dot.cmp-pl4 { background: #dc2626; }
.cmp-dot.cmp-plna { background: #94a3b8; }

.cmp-oos-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.cmp-kpi-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 140px;
}

.cmp-overlay .cmp-bbox.cmp-oos { stroke: #64748b; stroke-dasharray: 4 3; stroke-width: 2; }
.cmp-cell.cmp-cell-oos:not(.is-selected):not(.is-hover) { border-color: #64748b; }
.cmp-side-slot.cmp-cell-oos.active { outline-color: #64748b; }

/* Truth grid (tablette / ordre) */
.cmp-filters .combo { min-width: 180px; }
.cmp-filters .combo input.input { width: 100%; min-width: 0; }
.stale-warn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 4px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  white-space: nowrap;
}
.stale-warn--icon {
  padding: 0;
  border: none;
  background: transparent;
  gap: 0;
}
.stale-warn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.cmp-load-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md, 8px);
  font-size: 13px;
  border: 1px solid var(--border);
  background: #f8fafb;
  color: var(--muted, #6b7280);
}
.cmp-load-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmp-load-status.is-busy {
  border-color: #b6e4da;
  background: #ecfdf8;
  color: var(--niq-700, #0aa689);
}
.cmp-load-status.is-done {
  border-color: var(--border);
  background: #f8fafb;
  color: var(--muted, #6b7280);
}
.cmp-load-status.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--danger, #b91c1c);
}
.cmp-load-status .loader {
  width: 14px;
  height: 14px;
  border-width: 2px;
  flex-shrink: 0;
}
.cmp-load-bar {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(10, 166, 137, 0.15);
  overflow: hidden;
}
.cmp-load-status.is-error .cmp-load-bar {
  display: none;
}
.cmp-load-bar-indeterminate {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: var(--niq-500, #12b89a);
  animation: cmp-load-slide 1.15s ease-in-out infinite;
  will-change: transform;
}
@keyframes cmp-load-slide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.cmp-view-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--gray-100, #f3f4f6);
  padding: 2px;
  border-radius: var(--radius-sm, 6px);
}
.cmp-grid-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 2px;
}
.cmp-level {
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: var(--gray-50, #f9fafb);
  padding: 8px;
}
.cmp-level.current {
  border-color: var(--niq-500, #0aa689);
  box-shadow: 0 0 0 1px rgba(10, 166, 137, 0.25);
  background: #fff;
}
.cmp-level-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.cmp-level-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--niq-700);
}
.cmp-level-cells {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.cmp-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 0 0 118px;
  width: 118px;
  padding: 7px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md, 8px);
  background: white;
  cursor: pointer;
  text-align: center;
  transition: border-color 120ms, box-shadow 120ms, transform 80ms;
  scroll-snap-align: start;
}
.cmp-cell:hover,
.cmp-cell.is-hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
  background: rgba(239, 246, 255, 0.9);
}
.cmp-cell.is-selected {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.55);
  background: #eff6ff;
  transform: translateY(-1px);
  z-index: 2;
}
.cmp-cell.cmp-cell-tp:not(.is-selected):not(.is-hover) { border-color: #0aa689; }
.cmp-cell.cmp-cell-wrong_ean:not(.is-selected):not(.is-hover) { border-color: #d97706; }
.cmp-cell.cmp-cell-fn:not(.is-selected):not(.is-hover) { border-color: #dc2626; }
.cmp-cell-pos {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  letter-spacing: 0.01em;
}
.cmp-cell-thumb {
  width: 68px;
  height: 68px;
  object-fit: contain;
  background: var(--gray-50, #f9fafb);
  border-radius: 4px;
}
.cmp-cell-title {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--gray-800, #1f2937);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
  min-height: 2.5em;
}
.cmp-cell-ean {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: var(--gray-700, #374151);
  line-height: 1.2;
}
.cmp-cell-sigma {
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.cmp-cell-sigma.is-shared {
  color: #047857;
  font-weight: 600;
}
.cmp-cell-price,
.cmp-side-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted, #6b7280);
  line-height: 1.2;
}
.cmp-cell-soucat,
.cmp-side-soucat {
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted, #6b7280);
  font-weight: 500;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmp-side-soucat {
  display: block;
  margin-top: 1px;
}
.cmp-side-price {
  display: flex;
  flex-wrap: wrap;
  margin-top: 2px;
}
.cmp-cell-price.is-price-ok,
.cmp-side-price.is-price-ok { color: #0aa689; }
.cmp-cell-price.is-price-near,
.cmp-side-price.is-price-near { color: #d97706; }
.cmp-cell-price.is-price-wrong,
.cmp-side-price.is-price-wrong { color: #dc2626; }
.cmp-cell-price.is-price-missing,
.cmp-side-price.is-price-missing { color: #94a3b8; font-weight: 500; }
.cmp-kpi-price-lvls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  font-size: 10px;
  line-height: 1.3;
  margin-top: 4px;
  color: var(--muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.cmp-price-lvl-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cmp-euro-err {
  display: inline-block;
  margin-left: 6px;
  color: #dc2626;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.cmp-side-tab-title {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.cmp-price-prefix {
  font-weight: 500;
  color: var(--muted, #6b7280);
  margin-right: 4px;
}
.cmp-price-sep {
  margin: 0 2px;
  opacity: 0.55;
  font-weight: 500;
}
.cmp-side-price.is-price-ok .cmp-price-prefix,
.cmp-side-price.is-price-near .cmp-price-prefix,
.cmp-side-price.is-price-wrong .cmp-price-prefix,
.cmp-side-price.is-price-missing .cmp-price-prefix {
  color: inherit;
  opacity: 0.85;
}

/* ═══════════════════════ Admin › HITL (revue humaine du réalogramme) ═══════════════════════
   Palette d'états, reprise de l'éditeur EAN Conad pour que le code couleur soit
   le même d'un outil à l'autre :
     rouge  = mauvais produit (≠ TBL_COMPLIANCE)     gris   = position hors vérité terrain
     ambre  = EAN sentinelle 9999… (trou à combler)  vert   = conforme
     jaune  = correction réservée (rien en base)     bleu   = correction appliquée
     ardoise = fausse alerte écartée
   Les classes .hitl-* sont autonomes : elles ne dépendent pas des styles .cmp-*
   du sous-onglet Compliance, qui peuvent bouger indépendamment. */

.hitl-toolbar {
  display: grid;
  gap: 10px;
}
.hitl-toolbar-fields {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(280px, 2fr) 88px;
  gap: 10px;
  align-items: end;
  min-width: 0;
}
.hitl-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.hitl-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.hitl-field .input { width: 100%; min-width: 0; }
.hitl-field .cb { display: block; width: 100%; }
.hitl-field .cb-input { min-width: 0; }
.hitl-field-wide,
.hitl-field-narrow { min-width: 0; }
.hitl-toolbar-actions .btn { margin-left: auto; }
@media (max-width: 1050px) {
  .hitl-toolbar-fields {
    grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) 88px;
  }
  .hitl-field-wide { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 650px) {
  .hitl-toolbar-fields { grid-template-columns: 1fr 88px; }
  .hitl-toolbar-fields .hitl-field:first-child,
  .hitl-field-wide { grid-column: 1 / -1; }
  .hitl-toolbar-actions .btn { margin-left: 0; width: 100%; }
}
.hitl-field-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gray-500);
}
.hitl-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
}
.hitl-check input { cursor: pointer; }

.hitl-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.hitl-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.hitl-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--gray-100);
  color: var(--gray-700);
}
.hitl-chip-pending,
.hitl-chip-mismatch     { background: #fde2e2; color: #b91c1c; }
.hitl-chip-absent       { background: var(--gray-200); color: var(--gray-700); }
.hitl-chip-placeholder  { background: #fdebd0; color: #9a4a06; }
.hitl-chip-ok           { background: #d7f5e6; color: #047857; }
.hitl-chip-no_truth     { background: var(--gray-100); color: var(--gray-500); }
.hitl-chip-planned      { background: #fef3c7; color: #92600c; }
.hitl-chip-applied      { background: #dbeafe; color: #1d4ed8; }
.hitl-chip-dismissed    { background: var(--gray-100); color: var(--gray-500); }

.hitl-warn {
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
}
.hitl-msg { font-size: 12px; font-weight: 600; }
.hitl-msg.is-ok  { color: #047857; }
.hitl-msg.is-err { color: #b91c1c; }

.hitl-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gray-200);
  border-top-color: var(--info);
  border-radius: 50%;
  animation: hitl-spin 0.8s linear infinite;
  vertical-align: -2px;
}
@keyframes hitl-spin { to { transform: rotate(360deg); } }

/* Bandeau d'application : volontairement voyant, c'est le seul geste de la page
   qui écrit dans les tables du pipeline CV. */
.hitl-apply-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-md);
  background: #fffbeb;
  font-size: 12.5px;
  font-weight: 600;
  color: #92600c;
}

.hitl-split {
  display: grid;
  grid-template-columns: minmax(340px, 1.35fr) minmax(320px, 0.95fr);
  gap: 14px;
  align-items: start;
  margin-top: 14px;
}
@media (max-width: 1100px) {
  .hitl-split { grid-template-columns: 1fr; }
}
.hitl-pane {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  min-height: 0;
}
/* Colonne de décision : longue (slot, catalogue, historique, vérité terrain),
   elle défile pour ne pas repousser la photo hors de l'écran. */
.hitl-pane-side {
  max-height: min(84vh, 900px);
  overflow: auto;
  overscroll-behavior: contain;
}
.hitl-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* « safe center » : l'image reste centrée tant qu'elle tient, puis s'aligne au
   bord dès qu'elle déborde — sinon le haut et la gauche sortent de la zone
   défilable et deviennent inatteignables au zoom. */
.hitl-viewport {
  position: relative;
  display: flex;
  align-items: safe center;
  justify-content: safe center;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  max-height: min(72vh, 760px);
}
/* Pastille de chargement des slots, posée au-dessus de la photo sans la
   masquer : on voit que ça travaille tout en gardant l'image lisible. */
.hitl-viewport-loader {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.hitl-stage {
  width: calc(100% * var(--hitl-zoom, 1));
  max-width: none;
  flex: 0 0 auto;
}
.hitl-canvas-inner {
  position: relative;
  width: 100%;
  line-height: 0;
}
.hitl-canvas-inner img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.hitl-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.hitl-overlay .hitl-bbox {
  fill: transparent;
  stroke: #94a3b8;
  stroke-width: 1.5;
}
.hitl-overlay .hitl-mismatch          { stroke: #ef4444; stroke-width: 2.5; fill: rgba(239, 68, 68, 0.18); }
.hitl-overlay .hitl-absent_compliance { stroke: #94a3b8; stroke-width: 2; fill: rgba(148, 163, 184, 0.14); }
.hitl-overlay .hitl-placeholder       { stroke: #f59e0b; stroke-width: 2.5; fill: rgba(245, 158, 11, 0.20); }
.hitl-overlay .hitl-ok                { stroke: #10b981; fill: rgba(16, 185, 129, 0.06); }
.hitl-overlay .hitl-no_truth          { stroke: #cbd5e1; fill: transparent; }
.hitl-overlay .hitl-planned           { stroke: #eab308; stroke-width: 2.5; fill: rgba(234, 179, 8, 0.26); }
.hitl-overlay .hitl-applied           { stroke: #3b82f6; stroke-width: 2.5; fill: rgba(59, 130, 246, 0.18); }
.hitl-overlay .hitl-dismissed         { stroke: #64748b; stroke-dasharray: 0.01 0.008; fill: rgba(100, 116, 139, 0.10); }
.hitl-overlay .hitl-hover    { stroke-width: 3; }
.hitl-overlay .hitl-selected { stroke: #0f172a; stroke-width: 4; fill: rgba(15, 23, 42, 0.10); }
.hitl-overlay .hitl-bbox-label {
  fill: #0f172a;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 0.004;
}
.hitl-overlay .hitl-thumb { opacity: 0.95; }

.hitl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--gray-600);
}
.hitl-legend > span { display: inline-flex; align-items: center; gap: 4px; }
.hitl-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  border: 1.5px solid transparent;
}
.hitl-dot-mismatch    { background: rgba(239, 68, 68, 0.25);   border-color: #ef4444; }
.hitl-dot-absent      { background: rgba(148, 163, 184, 0.25); border-color: #94a3b8; }
.hitl-dot-placeholder { background: rgba(245, 158, 11, 0.25);  border-color: #f59e0b; }
.hitl-dot-ok          { background: rgba(16, 185, 129, 0.20);  border-color: #10b981; }
.hitl-dot-planned     { background: rgba(234, 179, 8, 0.30);   border-color: #eab308; }
.hitl-dot-applied     { background: rgba(59, 130, 246, 0.25);  border-color: #3b82f6; }
.hitl-dot-dismissed   { background: rgba(100, 116, 139, 0.18); border-color: #64748b; }

.hitl-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 10px;
  background: var(--bg-card);
}
.hitl-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.hitl-card-head h4 { margin: 0; font-size: 14px; font-weight: 750; }
.hitl-sub-title {
  display: block;
  font-size: 12px;
  font-weight: 750;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Onglets du panneau de décision : historique / catalogue / vérité terrain.
   Empilés, ces trois blocs faisaient plusieurs écrans de haut. */
.hitl-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: -2px 0 10px;
  overflow-x: auto;
}
.hitl-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: none;
  background: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.hitl-tab:hover { color: var(--niq-700); }
.hitl-tab.is-active {
  color: var(--niq-700);
  border-bottom-color: var(--niq-500);
}
.hitl-tab-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
}
.hitl-tab.is-active .hitl-tab-count {
  background: var(--niq-100, #e0e7ff);
  color: var(--niq-700);
}

.hitl-product {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 9px;
  align-items: center;
  margin-top: 6px;
}
.hitl-product-thumb,
.hitl-candidate > img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.hitl-product-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  min-width: 0;
}
.hitl-expected,
.hitl-decision {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

.hitl-candidate {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 6px;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
}
.hitl-candidate:hover { border-color: var(--info); background: var(--bg-hover); }
.hitl-candidate-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  min-width: 0;
}
.hitl-candidate-body > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hitl-catalog-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}
/* 4 produits visibles (2 × 2), le reste au scroll : la grille ne doit pas
   repousser le bouton « charger plus » et la vérité terrain hors de l'écran.
   La hauteur de carte est figée — donc calculable — parce que les trois lignes
   de texte sont tronquées à une ligne chacune (`white-space: nowrap`). */
.hitl-products {
  /* 6 padding ×2 + 3 gaps ×3 + image 76 + 16 + 14 + 14 + bordures 2 = 144 */
  --hitl-prod-card-h: 144px;
  --hitl-prod-gap: 7px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--hitl-prod-gap);
  margin-top: 8px;
  max-height: calc(2 * var(--hitl-prod-card-h) + var(--hitl-prod-gap));
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Évite que la dernière rangée soit coupée pile au bord : on sent qu'il y a
     une suite. */
  padding-right: 2px;
}
.hitl-product-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  height: var(--hitl-prod-card-h, auto);
  overflow: hidden;
}
.hitl-product-card:hover { border-color: var(--info); background: var(--bg-hover); }
.hitl-product-card img {
  width: 100%;
  height: 76px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
}
.hitl-product-name {
  font-size: 11.5px;
  line-height: 16px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hitl-product-meta {
  font-size: 10.5px;
  line-height: 14px;
  color: var(--gray-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin › OOS continu */
.oos-monitor {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.oos-monitor-toolbar,
.oos-monitor-section-title,
.oos-monitor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.oos-monitor-toolbar h2,
.oos-monitor-section-title h3 { margin: 0; }
.oos-monitor-toolbar p { margin: 4px 0 0; }
.oos-monitor-actions { flex-wrap: wrap; justify-content: flex-end; }
.oos-monitor-source { margin: 0; }
.oos-monitor-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.oos-monitor-kpis .card {
  display: grid;
  gap: 5px;
  min-height: 88px;
  align-content: center;
}
/* Cartes côte à côte : l'espacement vient du `gap`, le margin-top des siblings
   `.card + .card` décalerait toutes les cartes sauf la première. */
.oos-monitor-kpis .card + .card { margin-top: 0; }
.oos-monitor-kpis span {
  color: var(--gray-600);
  font-size: 12px;
}
.oos-monitor-kpis strong {
  font-size: 25px;
  line-height: 1;
}
.oos-monitor-kpis small { font-size: 11px; }
.oos-monitor-lag-card.is-late {
  border-color: #fdba74;
  background: #fff7ed;
}
.oos-monitor-lag-card.is-late strong { color: #c2410c; }
.oos-monitor-trend { margin-bottom: 16px; }
.oos-monitor-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--gray-600);
  font-size: 12px;
}
.oos-monitor-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.oos-monitor-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.oos-monitor-legend .is-processed,
.oos-monitor-bar.is-processed { background: #22c55e; }
.oos-monitor-legend .is-discovered,
.oos-monitor-bar.is-discovered { background: #bfdbfe; }
.oos-monitor-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(70px, 1fr));
  gap: 12px;
  height: 220px;
  padding-top: 22px;
  border-bottom: 1px solid var(--border);
}
.oos-monitor-day {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 4px;
  min-width: 0;
  text-align: center;
}
.oos-monitor-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  min-height: 0;
}
.oos-monitor-bar {
  position: relative;
  width: min(28px, 38%);
  min-height: 0;
  border-radius: 5px 5px 0 0;
  transition: height .2s ease;
}
.oos-monitor-bar > span {
  position: absolute;
  bottom: 100%;
  left: 50%;
  padding-bottom: 2px;
  color: var(--gray-700);
  font-size: 10px;
  transform: translateX(-50%);
}
.oos-monitor-day > strong { font-size: 11px; }
.oos-monitor-day > small { color: var(--gray-500); font-size: 10px; }
.oos-monitor-filters {
  display: grid;
  grid-template-columns: minmax(150px, .7fr) repeat(2, minmax(190px, 1fr)) minmax(170px, .8fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}
.oos-monitor-filters label {
  display: grid;
  gap: 5px;
  color: var(--gray-600);
  font-size: 12px;
}
.oos-monitor-filters input,
.oos-monitor-filters select {
  width: 100%;
  min-height: 36px;
}
.oos-monitor-section-title { margin-bottom: 12px; }
.oos-monitor-scroll {
  max-height: min(55vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
}
.oos-monitor-scroll thead th { z-index: 2; }
.oos-monitor-table { table-layout: fixed; }
.oos-monitor-table td { vertical-align: top; }
.oos-monitor-table .col-status { width: 108px; }
.oos-monitor-table .col-store { width: 18%; }
.oos-monitor-table .col-camera { width: 22%; }
.oos-monitor-table .col-time { width: 190px; }
.oos-monitor-table .col-num { width: 90px; }
.oos-monitor-table .col-error { width: auto; }
.oos-monitor-table .col-action { width: 132px; }
.oos-monitor-table .col-store,
.oos-monitor-table .col-camera { overflow-wrap: anywhere; }
.oos-monitor-history-time {
  white-space: nowrap;
  user-select: all;
}
.oos-monitor-error-modal {
  display: grid;
  width: min(760px, 92vw);
  max-height: 80vh;
  grid-template-rows: auto minmax(0, 1fr);
}
.oos-monitor-error-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.oos-monitor-error-head small { display: block; margin-top: 4px; }
.oos-monitor-error-body {
  margin: 0;
  padding: 16px 20px;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
.oos-monitor-id {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Message tronqué sur une ligne : la version complète s'ouvre dans la modale. */
.oos-monitor-error {
  display: block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--niq-700);
  font: inherit;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.oos-monitor-error:hover { text-decoration: underline; }
.oos-monitor-status {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  color: var(--gray-700);
  background: var(--gray-100);
}
.oos-monitor-status.is-done { color: #166534; background: #dcfce7; }
.oos-monitor-status.is-processing { color: #1d4ed8; background: #dbeafe; }
.oos-monitor-status.is-failed { color: #b91c1c; background: #fee2e2; }
.oos-monitor-status.is-pending { color: #92400e; background: #fef3c7; }
.text-danger { color: #b91c1c !important; }

/* ── Out-of-Shelf : correction HITL depuis la cellule rouge du mini-plan ── */
.current-oos-hitl-modal {
  width: min(760px, calc(100vw - 32px));
  overflow: hidden;
  background: #fff;
}
.current-oos-hitl-shell {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}
/* `.modal img { max-width: 100% }` se calcule sur la modale si le cadre
   n'établit pas de bloc. On recadre ici, hauteur en px, overflow hidden. */
.current-oos-hitl-modal img {
  display: block;
  max-width: 100%;
}
.current-oos-hitl-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.current-oos-hitl-head-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--primary, #2f6df6);
  background: #eef4ff;
}
.current-oos-hitl-head-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.current-oos-hitl-head-text { flex: 1; min-width: 0; }
.current-oos-hitl-head-text h3 { margin: 0; font-size: 18px; }
.current-oos-hitl-head-text p {
  margin: 3px 0 0;
  color: var(--gray-500);
  font-size: 13px;
}
.current-oos-hitl-body {
  padding: 16px 20px 18px;
  overflow: auto;
}
.current-oos-hitl-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}
.current-oos-hitl-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card, #fff);
}
/* La cible vide doit se lire comme une zone à remplir, pas comme une carte
   cassée : bordure pointillée et fond neutre tant que rien n'est choisi. */
.current-oos-hitl-side.is-empty {
  border-style: dashed;
  background: var(--gray-50, #f8fafc);
}
.current-oos-hitl-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
}
.current-oos-hitl-target {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.current-oos-hitl-figure {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 104px;
  width: 100%;
  height: 104px;
  min-height: 104px;
  max-height: 104px;
  padding: 6px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border);
}
.current-oos-hitl-figure img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 92px;
  object-fit: contain;
}
.current-oos-hitl-name {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 650;
  color: var(--gray-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.current-oos-hitl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--gray-500);
}
.current-oos-hitl-meta > span:last-child { font-weight: 700; color: var(--gray-700); }
.current-oos-hitl-clear {
  align-self: flex-start;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--niq-600, #2d6df6);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.current-oos-hitl-clear:hover { text-decoration: underline; }
.current-oos-hitl-placeholder {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 6px;
  color: var(--gray-500);
  font-size: 12.5px;
  text-align: center;
}
.current-oos-hitl-placeholder svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0.6;
}
.current-oos-hitl-arrow {
  display: grid;
  place-items: center;
  align-self: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: var(--gray-500);
  background: var(--gray-100, #f1f5f9);
}
.current-oos-hitl-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.current-oos-hitl-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.current-oos-hitl-search-field {
  position: relative;
  display: block;
  flex: 1;
  min-width: 0;
}
.current-oos-hitl-search-field svg {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--gray-400, #9ca3af);
  stroke-width: 1.8;
  stroke-linecap: round;
  pointer-events: none;
}
.current-oos-hitl-search-field input {
  width: 100%;
  padding-left: 32px;
}
.current-oos-hitl-search-field input::-webkit-search-cancel-button { cursor: pointer; }
.current-oos-hitl-count {
  flex: 0 0 auto;
  color: var(--gray-500);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.current-oos-hitl-results {
  max-height: 268px;
  margin-top: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.current-oos-hitl-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  color: var(--gray-500);
  font-size: 12.5px;
}
.current-oos-hitl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-right: 2px;
}
.current-oos-hitl-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms, box-shadow 120ms, background 120ms;
}
.current-oos-hitl-card:hover { border-color: var(--gray-300); background: var(--bg-hover); }
.current-oos-hitl-card.is-selected {
  border-color: var(--niq-500, #2d6df6);
  background: var(--niq-50, #eef4ff);
  box-shadow: 0 0 0 1px var(--niq-500, #2d6df6);
}
.current-oos-hitl-card img {
  width: 100%;
  height: 72px;
  max-height: 72px;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-sm);
}
.current-oos-hitl-card-name {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
  color: var(--gray-900);
  /* Deux lignes max : les cartes gardent la même hauteur, la grille ne saute
     pas d'une recherche à l'autre. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 31px;
}
.current-oos-hitl-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: 11px;
  color: var(--gray-500);
}
.current-oos-hitl-card-meta > span:last-child { font-weight: 700; color: var(--gray-700); }
.current-oos-hitl-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 650;
}
.current-oos-hitl-note.is-error { color: var(--danger, #d92d20); }
.current-oos-hitl-note.is-warning { color: #b45309; }
.current-oos-hitl-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
/* Sans cible choisie, le bouton doit se voir comme inactif : sinon on clique et
   rien ne se passe. */
.current-oos-hitl-foot .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (max-width: 760px) {
  .current-oos-hitl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .current-oos-hitl-compare { grid-template-columns: 1fr; }
  .current-oos-hitl-arrow { transform: rotate(90deg); }
  .current-oos-hitl-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .oos-monitor-kpis { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .oos-monitor-filters { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
}
@media (max-width: 700px) {
  .oos-monitor-toolbar { align-items: flex-start; flex-direction: column; }
  .oos-monitor-actions { justify-content: flex-start; }
  .oos-monitor-kpis { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
  .oos-monitor-filters { grid-template-columns: 1fr; }
  .oos-monitor-chart {
    grid-template-columns: repeat(7, minmax(64px, 1fr));
    overflow-x: auto;
  }
}

.mobile-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
}
.mobile-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.mobile-toolbar-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.mobile-toolbar-store {
  flex: 0 1 300px;
  width: 300px;
  max-width: 100%;
}
.mobile-toolbar-search {
  flex: 0 1 240px;
  width: 240px;
  max-width: 100%;
}
.mobile-toolbar-field .cb { display: block; width: 100%; }
.mobile-toolbar-field .cb-input { min-width: 0; }
.mobile-toolbar-tools {
  display: flex;
  align-items: end;
  gap: 12px;
  margin-left: auto;
}
.mobile-hitl-progress {
  display: flex;
  min-width: 168px;
  flex-direction: column;
  gap: 3px;
}
.mobile-hitl-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #166534;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.mobile-hitl-progress-head strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.mobile-hitl-progress-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(22, 163, 74, 0.16);
}
.mobile-hitl-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #16a34a;
}
.mobile-hitl-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: #3f6212;
  font-size: 11px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}
.mobile-toolbar-export { align-self: end; }
.mobile-type-filter {
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.mobile-type-btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.mobile-type-btn:hover { border-color: var(--niq-300, #9dbcfb); }
/* Le type actif s'inverse : la couleur du badge ne suffit pas à le distinguer. */
.mobile-type-btn.is-active {
  border-color: var(--niq-500, #2d6df6);
  background: var(--niq-50, #eef4ff);
  color: var(--niq-700, #1a4cb8);
}
.mobile-type-count {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-variant-numeric: tabular-nums;
}
.mobile-type-btn.is-active .mobile-type-count {
  background: rgba(45, 109, 246, 0.16);
  color: var(--niq-700, #1a4cb8);
}
.mobile-result-line { margin-bottom: 10px; }

.pill-shelf-frigo {
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.4);
}
.pill-shelf-bac {
  background: rgba(168, 85, 247, 0.14);
  color: #7e22ce;
  border-color: rgba(168, 85, 247, 0.4);
}
.pill-shelf-other {
  background: rgba(100, 116, 139, 0.14);
  color: #334155;
  border-color: rgba(100, 116, 139, 0.35);
}
.pill-shelf-levels {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--border);
  text-transform: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
}
/* `.card + .card` pose un margin-top de 16px qui raccourcirait et décalerait
   toutes les cartes sauf la première de chaque ligne. */
.card-grid .card + .card { margin-top: 0; }
.mobile-shelf-card {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: left;
}
.mobile-shelf-card-open {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mobile-shelf-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  margin: 0 12px 12px;
  min-width: 0;
}
.mobile-shelf-card-actions .btn {
  height: 30px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-shelf-card-actions .btn:first-child {
  flex: 0 1 auto;
}
.mobile-shelf-card-actions .mobile-delete-confirm {
  flex: 0 0 auto;
}
.mobile-shelf-card-image {
  position: relative;
  display: block;
  width: 100%;
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--gray-100);
}
.mobile-shelf-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}
.mobile-shelf-card:hover .mobile-shelf-card-image img {
  transform: scale(1.025);
}
.mobile-shelf-card-body {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px 14px;
}
.mobile-shelf-card-body strong,
.mobile-shelf-card-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-shelf-card-type {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(3px);
}
.pill-hitl {
  background: rgba(22, 163, 74, 0.16);
  color: #166534;
  border-color: rgba(22, 163, 74, 0.45);
}
.mobile-hitl-badge { cursor: pointer; }
.mobile-hitl-badge:disabled { cursor: default; opacity: 0.65; }
.mobile-shelf-card-hitl {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(22, 163, 74, 0.92);
  color: white;
  border-color: transparent;
}
.mobile-shelf-card-counts {
  margin-top: auto;
  padding-top: 3px;
  color: var(--gray-700);
  font-size: 12px;
}
.main:has(.mobile-page.is-detail) {
  padding-bottom: 16px;
}
.mobile-page.is-detail {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--sticky-chrome-h) - 44px);
  min-height: 480px;
}
.mobile-detail {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.mobile-page.is-detail .mobile-detail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.mobile-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.mobile-detail-head h2 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
}
.mobile-cam-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mobile-cam-btn {
  min-width: 32px;
  padding-inline: 8px;
  font-size: 18px;
  line-height: 1;
}
.mobile-cam-pos {
  min-width: 4.6em;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.mobile-overlay-toggles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}
.mobile-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.mobile-pill-toggle:hover { border-color: var(--niq-300, #9dbcfb); }
.mobile-pill-toggle.is-on {
  border-color: var(--niq-500, #2d6df6);
  background: var(--niq-50, #eef4ff);
  color: var(--niq-700, #1a4cb8);
}
.mobile-pill-knob {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: var(--gray-300, #d1d5db);
  transition: background 0.15s ease;
}
.mobile-pill-knob::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease;
}
.mobile-pill-toggle.is-on .mobile-pill-knob { background: var(--niq-500, #2d6df6); }
.mobile-pill-toggle.is-on .mobile-pill-knob::after { transform: translateX(12px); }
.mobile-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}
.mobile-detail-layout.has-side {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
/* La carte d'édition reste dans le DOM quand elle est masquée. Sans ça,
   `.card + .card` décale le panneau produits sous la photo. */
.mobile-detail-layout > .card + .card { margin-top: 0; }
.mobile-page.is-detail .shelf-canvas {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.mobile-shelf-viewport {
  container-type: size;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  align-items: safe center;
  justify-content: safe center;
  min-width: 0;
  min-height: 240px;
  max-height: none;
  overflow: auto;
}
.mobile-shelf-viewport .shelf-canvas-inner {
  flex: 0 0 auto;
  width: min(
    calc(100cqi * var(--shelf-zoom, 1)),
    calc(100cqh * var(--mobile-ar, 0.75) * var(--shelf-zoom, 1))
  );
  max-width: none;
  aspect-ratio: 3 / 4;
}
.mobile-shelf-viewport .shelf-canvas-inner img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}
@media (max-width: 1100px) {
  .mobile-page.is-detail {
    height: auto;
    min-height: 0;
  }
  .mobile-detail-layout,
  .mobile-detail-layout.has-side { grid-template-columns: minmax(0, 1fr); }
  .mobile-page.is-detail .shelf-canvas { height: auto; }
  .mobile-shelf-viewport {
    height: min(72vh, 820px);
    flex: none;
  }
}
.mobile-shelf-marks {
  position: absolute;
  inset: 0;
}
.mobile-shelf-marks.can-open-product .mobile-shelf-box {
  pointer-events: auto;
  cursor: pointer;
}
.mobile-shelf-box {
  position: absolute;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #2f9e44;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
  pointer-events: none;
}
.mobile-shelf-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.mobile-facing-size {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100%;
  padding: 2px 4px;
  overflow: hidden;
  border-radius: 0 0 3px 0;
  background: rgba(17, 24, 39, 0.88);
  color: #fff;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.mobile-facing-erased {
  position: absolute;
  right: 0;
  bottom: 0;
  max-width: 100%;
  padding: 2px 4px;
  background: rgba(201, 42, 42, 0.92);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}
.mobile-facing-foot {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  max-width: 100%;
  pointer-events: none;
}
.mobile-mark {
  flex: 0 0 auto;
  min-width: 14px;
  margin-right: 2px;
  padding: 1px 3px;
  border-radius: 999px;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}
.mobile-mark.is-high,
.mobile-mark.is-ok { background: #2f9e44; }
.mobile-mark.is-mid,
.mobile-mark.is-partial { background: #f59f00; }
.mobile-mark.is-low,
.mobile-mark.is-bad { background: #e03131; }
.mobile-mark.is-missing { background: #868e96; }
.mobile-facing-ean {
  position: static;
  max-width: 100%;
  padding: 2px 4px;
  overflow: hidden;
  border-radius: 3px 0 0 0;
  background: rgba(47, 158, 68, 0.94);
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.mobile-facing-oos {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  max-width: 100%;
  padding: 4px;
  color: #c92a2a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}
.mobile-facing-oos span {
  font-weight: 600;
}
.mobile-facing-oos .mono {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 10px;
}
.mobile-shelf-box.is-oos {
  border-color: #e03131;
  border-style: dashed;
  background: rgba(255, 241, 241, 0.42);
}
.mobile-shelf-marks.is-adding { cursor: crosshair; }
.mobile-shelf-box.is-draft {
  z-index: 4;
  border-color: #e67700;
  border-style: dashed;
  background: rgba(255, 243, 191, 0.35);
  pointer-events: none;
}
.mobile-shelf-marks.is-detection-editing .mobile-shelf-box:not(.is-slot) {
  overflow: visible;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.mobile-shelf-marks.is-detection-editing .mobile-slot-handle {
  position: absolute;
  display: block;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid #2f9e44;
  border-radius: 2px;
}
.mobile-scale {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.85));
}
.mobile-scale-bar {
  display: flex;
  width: 100%;
  height: 100%;
  border: 1px solid #111;
}
.mobile-scale-bar span {
  flex: 1 1 0;
  box-shadow: inset -1px 0 0 #111;
}
.mobile-scale-bar span:last-child { box-shadow: none; }
.mobile-scale-bar .is-dark { background: #111; }
.mobile-scale-bar .is-light { background: #fff; }
.mobile-scale-caption {
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.mobile-shelf-box.is-invalid {
  border-color: #c92a2a;
  border-style: dashed;
  background: rgba(255, 201, 201, 0.62);
}
.mobile-shelf-box.is-replaced {
  border-color: #7048e8;
  background: rgba(229, 219, 255, 0.58);
}
.mobile-shelf-box.is-selected {
  z-index: 6;
  box-shadow: 0 0 0 4px rgba(230, 119, 0, 0.55);
}
.mobile-shelf-box.is-hovered {
  z-index: 5;
  border-color: #e67700;
  background: rgba(255, 243, 191, 0.72);
  box-shadow: 0 0 0 3px rgba(230, 119, 0, 0.45);
}
.mobile-shelf-box.is-slot {
  z-index: 2;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: visible;
  border-color: #087f8c;
  border-radius: 2px;
  background: rgba(8, 127, 140, 0.08);
}
.mobile-shelf-box.is-slot.has-no-ean {
  border-style: dashed;
}
.mobile-slot-ean {
  max-width: 100%;
  padding: 2px 4px;
  overflow: hidden;
  border-radius: 0 0 3px 0;
  background: rgba(8, 80, 88, 0.92);
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
.mobile-shelf-marks.is-editing .mobile-shelf-box.is-slot {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}
.mobile-shelf-box.is-slot.is-selected {
  z-index: 4;
  border-color: #e67700;
  background: rgba(230, 119, 0, 0.16);
}
.mobile-slot-handle { display: none; }
.mobile-shelf-marks.is-editing .mobile-slot-handle {
  position: absolute;
  display: block;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid #087f8c;
  border-radius: 2px;
}
.mobile-shelf-marks.is-editing .mobile-shelf-box:not(.is-slot) .mobile-slot-handle {
  display: none;
}
.mobile-slot-handle.nw { left: -6px; top: -6px; cursor: nwse-resize; }
.mobile-slot-handle.ne { right: -6px; top: -6px; cursor: nesw-resize; }
.mobile-slot-handle.sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.mobile-slot-handle.se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.mobile-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.mobile-edit-actions .btn[aria-pressed="true"] {
  border-color: #e67700;
  background: #fff3bf;
}
.mobile-page .btn {
  cursor: pointer;
  transition: background 120ms, border-color 120ms, transform 80ms, box-shadow 120ms;
}
.mobile-page .btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.mobile-page .btn:focus-visible,
.mobile-pill-toggle:focus-visible {
  outline: 2px solid var(--niq-500, #2d6df6);
  outline-offset: 2px;
}
.mobile-page .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.mobile-page .btn.is-busy:disabled {
  opacity: 0.85;
  cursor: progress;
}
.loader-btn {
  width: 13px;
  height: 13px;
  border-width: 2px;
  flex-shrink: 0;
}
.mobile-pill-toggle {
  transition: background 120ms, border-color 120ms, color 120ms, transform 80ms;
}
.mobile-pill-toggle:active { transform: scale(0.97); }
.mobile-product-card.is-clickable { cursor: pointer; }
.mobile-product-card.is-clickable:active { transform: scale(0.995); }
.mobile-catalog-item:active { transform: scale(0.99); }
.mobile-shelf-viewport.is-loading img { opacity: 0.45; transition: opacity 0.15s ease; }
.mobile-shelf-box.is-flash {
  z-index: 8;
  animation: mobile-box-flash 1.5s ease-out;
}
.mobile-shelf-box.is-pending {
  outline: 2px solid #f08c00;
  outline-offset: 2px;
}
.mobile-thumb-btn {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.mobile-thumb-btn img,
.mobile-thumb-open {
  cursor: zoom-in;
}
.mobile-catalog-price {
  color: #0b7285;
  font-size: 12px;
  font-weight: 600;
}
@keyframes mobile-box-flash {
  0%, 30% { box-shadow: 0 0 0 5px rgba(47, 158, 68, 0.75); }
  100% { box-shadow: 0 0 0 0 rgba(47, 158, 68, 0); }
}
.mobile-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
}
.mobile-toast-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2f9e44;
  font-size: 12px;
  font-weight: 800;
}
.mobile-toast.is-info .mobile-toast-icon { background: var(--niq-500, #2d6df6); }
.mobile-toast.is-error { background: #7f1d1d; }
.mobile-toast.is-error .mobile-toast-icon { background: #e03131; }
.mobile-apply-same {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.35;
}
.mobile-edit-fields,
.mobile-catalog-search {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.mobile-note-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-note-row .input {
  flex: 1;
  min-width: 0;
}
.mobile-note-row .mobile-why-copy {
  width: 28px;
  height: 28px;
}
.mobile-note-row .mobile-why-copy svg {
  width: 16px;
  height: 16px;
}
.mobile-catalog-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.mobile-catalog-filters label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}
.mobile-catalog-combo {
  position: relative;
}
.mobile-catalog-list {
  position: absolute;
  z-index: 8;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  margin: 0;
  padding: 4px;
  overflow: auto;
  background: var(--bg-card, #fff);
  border: 1px solid var(--line, #d7dee8);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}
.mobile-catalog-list.is-panel,
.mobile-neighbour-list {
  position: static;
  z-index: auto;
  max-height: 280px;
  margin-top: 8px;
  box-shadow: none;
}
.mobile-neighbour-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}
.mobile-neighbour-list > .muted {
  grid-column: 1 / -1;
}
.mobile-neighbour-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.mobile-neighbour-card img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--gray-50, #f8fafc);
}
.mobile-neighbour-card > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}
.mobile-neighbour-card strong,
.mobile-neighbour-card .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-neighbour-card strong { font-size: 11px; }
.mobile-neighbour-card .muted { font-size: 11px; }
.mobile-neighbour-card.is-selected {
  border-color: #16a34a;
  background: #f0fdf4;
}
.mobile-correction-tabs {
  display: flex;
  gap: 8px;
}
.mobile-swap-label {
  color: var(--gray-500, #667085);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mobile-swap-next {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid #86efac;
  border-radius: 10px;
  background: #f0fdf4;
}
.mobile-swap-next .mobile-swap-label {
  grid-column: 1 / -1;
}
.mobile-swap-next img,
.mobile-detection-current img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.mobile-edit-actions .btn-primary.is-ready {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}
.mobile-catalog-empty {
  margin: 6px 8px;
}
.mobile-catalog-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.mobile-catalog-item img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.mobile-catalog-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.mobile-catalog-copy strong,
.mobile-catalog-copy .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-catalog-item strong {
  font-size: 13px;
}
.mobile-catalog-item.is-selected {
  border-color: #7048e8;
  background: #f3f0ff;
}
.mobile-detection-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.mobile-correction-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--gray-50, #f8fafc);
}
.mobile-correction-section h4 {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--gray-800, #1f2937);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.mobile-identify {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.mobile-identify-result {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.mobile-identify-result p {
  margin: 0;
}
.mobile-detection-current {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 10px;
  background: white;
}
.mobile-detection-current img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.mobile-detection-current div,
.mobile-detection-target,
.mobile-detection-target div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.mobile-detection-target {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.mobile-detection-target img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.mobile-products {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 14px;
  max-height: calc(100vh - 220px);
}
.mobile-page.is-detail .mobile-products {
  max-height: none;
  height: 100%;
  min-height: 0;
}
.mobile-page.is-detail .mobile-products:not(:has(.mobile-product-list)) {
  overflow: auto;
}
.mobile-products-heading {
  margin-bottom: 10px;
  gap: 8px;
}
.mobile-products-heading h3 {
  margin: 0;
  font-size: 14px;
}
.mobile-product-list {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.mobile-product-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}
.mobile-product-card.is-oos {
  border-color: #f1aeb5;
  background: #fff7f7;
}
.mobile-product-card.is-hovered {
  border-color: #e67700;
  background: #fff8eb;
}
.mobile-product-card.has-invalid {
  border-color: #c92a2a;
}
/* Le détail DEBUG_CV est un enfant de la carte (vignette | texte). Il prend
   toute la largeur, sinon la grille le pose dans la colonne de 56 px. */
.mobile-why {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}
.mobile-why-block + .mobile-why-block { margin-top: 12px; }
.mobile-why-run {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.mobile-why-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
}
.mobile-why-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.mobile-why-facts > span {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}
.mobile-why-facts em {
  color: var(--gray-500);
  font-style: normal;
  font-size: 11px;
}
.mobile-why-facts code { overflow-wrap: anywhere; }
.mobile-why-ean {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.mobile-why-copy {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
}
.mobile-why-copy:hover { color: var(--niq-700, #1c4ed8); }
.mobile-why-copy svg { width: 13px; height: 13px; display: block; }
.mobile-why-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.mobile-why-reasons > span {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--niq-50, #eef4ff);
  color: var(--niq-700, #1a4cb8);
  font-size: 11px;
  font-weight: 700;
}
.mobile-why-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.mobile-why-head > div { min-width: 0; }
.mobile-why-thumb {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}
.mobile-why-thumb img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}
.mobile-why-split {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.mobile-why-split > section { min-width: 0; }
.mobile-why .cmp-winner-table-wrap { overflow-x: visible; }
.mobile-why .cmp-winner-table {
  font-size: 11px;
  white-space: normal;
}
.mobile-why .cmp-winner-table th,
.mobile-why .cmp-winner-table td {
  padding: 3px 4px;
  vertical-align: middle;
}
.mobile-why .cmp-winner-table code { font-size: 10px; }
.mobile-why .empty { margin: 0; font-size: 12px; }
.mobile-product-warning { color: #c92a2a; font-weight: 600; }
.mobile-product-corrected { color: #7048e8; font-weight: 600; }
.mobile-product-card > img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}
.mobile-product-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.mobile-product-size,
.mobile-product-area {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mobile-product-area {
  color: var(--gray-700);
}
.mobile-product-copy strong,
.mobile-product-cat {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-product-cat { color: var(--gray-600); }

.inventory-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.inventory-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 24px;
}
.inventory-kpis {
  display: flex;
  flex: none;
  gap: 12px;
}
.inventory-kpi {
  min-width: 148px;
  margin: 0;
  padding: 14px 20px 16px 22px;
}
.inventory-kpi.open::before { background: var(--vusion-500); }
.inventory-kpi.done::before { background: var(--niq-500); }
.inventory-kpi.resolved::before { background: var(--success); }
.inventory-kpi .kpi-label { margin-bottom: 8px; }
.inventory-kpi .kpi-value {
  font-size: 32px;
  letter-spacing: -0.03em;
}
.current-oos-filter-card .inventory-switch { margin-bottom: 14px; }
.inventory-search-row { grid-template-columns: minmax(240px, 1fr) auto auto; }
@media (max-width: 700px) {
  .inventory-search-row { grid-template-columns: 1fr 1fr; }
}
.inventory-switch {
  display: inline-flex;
  gap: 8px;
}
.inventory-switch button {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 500;
}
.inventory-switch button.active {
  border-color: var(--gray-400);
  background: var(--gray-100);
  color: var(--gray-900);
  font-weight: 600;
}
.inventory-search {
  min-width: 220px;
  flex: 1 1 220px;
  max-width: 320px;
}
.inventory-list {
  display: grid;
  gap: 24px;
}
.inventory-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  box-shadow: var(--shadow-sm);
}
.inventory-media {
  display: flex;
  align-items: center;
  gap: 10px;
}
.inventory-crop {
  display: block;
  flex: none;
  width: 168px;
  height: 96px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f4f1ea;
  cursor: zoom-in;
}
.inventory-crop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.inventory-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
}
.inventory-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}
.inventory-title-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}
.inventory-badges {
  display: inline-flex;
  flex: none;
  gap: 6px;
}
.inventory-title-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--gray-900);
}
.inventory-ean,
.inventory-meta,
.inventory-when {
  color: var(--gray-500);
  font-size: 13px;
  line-height: 1.35;
}
.inventory-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.inventory-pill,
.inventory-badge {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
}
.current-oos-alert-badges .inventory-resolved {
  gap: 7px;
  padding: 6px 11px;
  border-radius: var(--radius-md);
  background: var(--success);
  color: white;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  white-space: nowrap;
}
.inventory-pill strong {
  font-weight: 700;
  color: var(--gray-900);
}
.inventory-when { margin-top: 2px; }
.inventory-stock { margin: 0; }
.inventory-stock-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
  padding: 18px 16px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: white;
}
.inventory-stock-panel .inventory-stock {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
}
.inventory-list .current-oos-history { grid-template-columns: minmax(0, 1fr); }
.inventory-list .current-oos-product {
  flex: 0 1 auto;
  width: max-content;
  max-width: min(520px, 100%);
}
.inventory-list .current-oos-product-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: max-content;
  max-width: 100%;
}
.inventory-list .current-oos-product-copy {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 340px;
}
.inventory-list .current-oos-product-thumb { flex: 0 0 104px; }
.inventory-list .current-oos-place {
  grid-template-rows: auto auto auto;
  align-self: start;
  justify-self: end;
  width: 168px;
  margin-left: auto;
}
.inventory-list .current-oos-locator { grid-template-rows: auto; }
.inventory-list .current-oos-camera { padding-top: 0; border-top: 0; }
.inventory-list .current-oos-location strong {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .inventory-list .current-oos-place {
    width: 100%;
    justify-content: flex-end;
  }
}
@media (min-width: 1101px) {
  .inventory-list .current-oos-card-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
  }
  .inventory-list .current-oos-history {
    flex: 0 0 200px;
    width: 200px;
  }
  .inventory-list .inventory-stock-panel {
    flex: 1 1 220px;
    min-width: 180px;
    max-width: 280px;
  }
  .inventory-list .current-oos-place { flex: 0 0 168px; }
}
.inventory-stock-chart {
  display: block;
  width: 100%;
  height: auto;
}
.inventory-stock-chart .grid { stroke: #e6ebf2; stroke-width: 1; }
.inventory-stock-chart .zero { stroke: #b7c2d0; stroke-width: 1.25; stroke-dasharray: 4 3; }
.inventory-stock-chart .alert { stroke: var(--vusion-500); stroke-width: 1.5; }
.inventory-stock-chart .area { fill: var(--niq-500); opacity: .14; }
.inventory-stock-chart .line {
  fill: none;
  stroke: var(--niq-500);
  stroke-width: 2.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.inventory-stock-chart .dot { fill: white; stroke: var(--niq-500); stroke-width: 2; }
.inventory-stock-chart text {
  fill: #64748b;
  font-size: 13px;
  font-weight: 650;
}
.inventory-stock-chart .qty { fill: var(--niq-700, #1d4ed8); font-size: 14px; }
.inventory-stock-chart .alert-label { fill: #9a6700; font-size: 13px; font-weight: 750; }
.inventory-stock-caption {
  color: var(--gray-500);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}
.inventory-preview {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}
.inventory-preview img {
  max-width: min(1100px, 100%);
  max-height: 100%;
  object-fit: contain;
  background: white;
}
@media (max-width: 720px) {
  .inventory-head { flex-direction: column; }
  .inventory-kpis { width: 100%; }
  .inventory-kpi { flex: 1; }
  .inventory-search { max-width: none; }
  .inventory-crop { width: 120px; height: 80px; }
}

/* Vignettes manquantes Wrong Product France — file opérateur.
   L'onglet porte déjà le titre : la zone de travail occupe le reste
   de l'écran, le panneau de droite scrolle tout seul. */
.main:has(> .wpv) {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 113px);
  padding: 10px 24px 12px;
  overflow: hidden;
}
.wpv {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 8px;
}
.wpv-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.wpv-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.wpv-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) auto;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.wpv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 12px; }
.wpv-field .input, .wpv-field textarea { width: 100%; }
.wpv-bar {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
}
.wpv-error, .wpv-alert {
  color: var(--danger, #b42318);
  font-size: 13px;
  margin: 0;
}
.wpv-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: hitl-spin 0.8s linear infinite;
}
.wpv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.wpv-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
}
.wpv-card.is-locked { opacity: 0.72; }
.wpv-card.is-mine { outline: 2px solid var(--accent, #2563eb); }
.wpv-thumb {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: var(--gray-100, #f3f4f6);
  border-radius: 6px;
}
.wpv-badge, .wpv-ean, .wpv-name, .wpv-meta, .wpv-lock { font-size: 12px; }
.wpv-ean { font-weight: 650; }
.wpv-name, .wpv-meta, .wpv-lock { color: var(--muted, #667085); }
.wpv-detail {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
}
.wpv-dialog {
  display: flex;
  flex-direction: column;
  width: min(1280px, 100%);
  background: var(--bg-card, #fff);
  border-radius: var(--radius-lg, 12px);
  overflow: hidden;
}
.wpv-dialog-head, .wpv-dialog-nav, .wpv-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.wpv-dialog-head { justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.wpv-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
  flex: 1;
  min-height: 0;
}
.wpv-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 0 0 auto;
  padding-bottom: 2px;
}
.wpv-chip {
  flex: 0 0 76px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  text-align: left;
}
.wpv-chip.active { outline: 2px solid var(--niq-500, #ca8a04); }
.wpv-chip.is-locked { opacity: 0.55; }
.wpv-chip img {
  width: 70px;
  height: 46px;
  object-fit: contain;
  display: block;
  background: var(--gray-100, #f3f4f6);
}
.wpv-chip span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wpv-work {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  background: var(--bg-card, #fff);
  overflow: hidden;
}
.wpv-stage, .wpv-side { min-width: 0; min-height: 0; padding: 10px 14px; }
.wpv-stage { display: flex; flex-direction: column; }
.wpv-side { overflow: auto; border-left: 1px solid var(--border); }
.wpv-viewport {
  container-type: size;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--gray-100, #f3f4f6);
  border-radius: 8px;
}
.wpv-shot {
  position: relative;
  width: max-content;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
  cursor: crosshair;
}
.wpv-shot img {
  display: block;
  max-width: 100cqw;
  max-height: 100cqh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.wpv-lens {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #4c9aff;
  background: rgba(76, 154, 255, 0.28);
  pointer-events: none;
}
.wpv-loupe-pane {
  z-index: 30;
  background-color: #fff;
  background-repeat: no-repeat;
  pointer-events: none;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.16);
}
.wpv-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.wpv-cdn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--gray-700, #344054);
}
.wpv-cdn-open {
  display: block;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--gray-100, #f3f4f6);
  cursor: pointer;
}
.wpv-cdn-open:hover { border-color: #4c9aff; }
.wpv-cdn-open img {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: contain;
}
.wpv-cdn-frame { position: relative; }
.wpv-cdn-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 16px;
  line-height: 20px;
  cursor: pointer;
}
.wpv-cdn-remove:hover { background: #b42318; }
.wpv-cdn-remove:disabled { opacity: 0.55; cursor: default; }
.wpv-note {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 10px;
  margin-top: 10px;
}
.wpv-facts { display: grid; grid-template-columns: 140px 1fr; gap: 4px 8px; font-size: 13px; }
.wpv-facts dt { color: var(--muted, #667085); }
.wpv-facts dd { margin: 0; }
.wpv-ean {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wpv-ean-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--gray-500, #667085);
}
.wpv-ean-search:hover { color: var(--niq-700, #1d4ed8); background: var(--gray-100, #f3f4f6); }
.wpv-ean-search svg { width: 15px; height: 15px; }
.wpv-drop {
  position: relative;
  margin-top: 12px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}
.wpv-drop.is-off { opacity: 0.55; }
.wpv-drop.is-hot {
  border-color: var(--accent, #2563eb);
  background: rgba(37, 99, 235, 0.08);
}
.wpv-url { display: flex; gap: 8px; margin: 8px 0; }
.wpv-url .input { flex: 1; min-width: 0; }
.wpv-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.wpv-previews { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.wpv-previews figure { width: 92px; margin: 0; }
.wpv-previews img, .wpv-collected {
  width: 92px;
  height: 92px;
  object-fit: contain;
  background: var(--gray-100, #f3f4f6);
  border-radius: 6px;
}
.wpv-previews figcaption { display: flex; justify-content: space-between; gap: 4px; font-size: 11px; }
.wpv-history { list-style: none; padding: 0; margin: 0; font-size: 12px; }
.wpv-history li { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.wpv-keys { flex: 0 0 auto; margin: 6px 0 0; font-size: 12px; }
.wpv-lexicon { width: min(680px, 100%); }
.wpv-lexicon-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}
.wpv-lexicon-head h2 { margin: 0; font-size: 18px; }
.wpv-lexicon-body { padding: 4px 18px 18px; }
.wpv-lexicon-body h3 {
  margin: 16px 0 8px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #667085);
}
.wpv-lexicon-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wpv-lexicon-list li {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  font-size: 13px;
  line-height: 1.4;
}
.wpv-lexicon-list strong { font-size: 13px; }
.wpv-lexicon-list em { font-style: normal; color: var(--muted, #667085); }
.wpv-lexicon-body > .muted { margin: 14px 0 0; font-size: 13px; }
@media (max-width: 980px) {
  .main:has(> .wpv) { height: auto; overflow: visible; }
  .wpv { height: auto; }
  .wpv-toolbar { flex-direction: column; align-items: stretch; }
  .wpv-filters { grid-template-columns: 1fr 1fr; }
  .wpv-viewport { height: min(52vh, 480px); flex: none; }
  .wpv-dialog-body { grid-template-columns: 1fr; height: auto; max-height: none; overflow: visible; }
  .wpv-identity, .wpv-note, .wpv-lexicon-list li { grid-template-columns: 1fr; }
  .wpv-side { border-left: 0; border-top: 1px solid var(--border); }
  .wpv-detail { padding: 8px; }
}


/* ═══════════════════════ Admin › Pipelines (carte des traitements) ═══════════════════════ */
.admin-pipe { margin-top: 16px; }
.admin-pipe-body { display: grid; gap: 16px; }
.admin-pipe-body > .card { margin: 0; }
.admin-pipe-loader { margin: 24px auto; }
.admin-pipe-error { color: var(--danger); border-color: #fecaca; background: #fef2f2; }

.admin-pipe .srv-104 { --pipe-srv: var(--niq-500); --pipe-srv-soft: var(--niq-50); --pipe-srv-ink: var(--niq-700); }
.admin-pipe .srv-106 { --pipe-srv: #8b5cf6; --pipe-srv-soft: #f5f3ff; --pipe-srv-ink: #6d28d9; }
.admin-pipe .srv-107 { --pipe-srv: #0d9488; --pipe-srv-soft: #f0fdfa; --pipe-srv-ink: #0f766e; }
.admin-pipe .srv-108 { --pipe-srv: #db2777; --pipe-srv-soft: #fdf2f8; --pipe-srv-ink: #be185d; }
.admin-pipe .srv-aks { --pipe-srv: var(--vusion-600); --pipe-srv-soft: var(--vusion-50); --pipe-srv-ink: var(--vusion-700); }
.admin-pipe .srv-other { --pipe-srv: var(--gray-400); --pipe-srv-soft: var(--gray-100); --pipe-srv-ink: var(--gray-700); }

.admin-pipe-head { display: grid; gap: 10px; }
.admin-pipe-head h2 { margin: 0; font-size: 20px; color: var(--gray-900); }
.admin-pipe-head p { margin: 4px 0 0; max-width: 95ch; line-height: 1.55; }
.admin-pipe-head .admin-pipe-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  font-size: 12px;
  color: var(--gray-500);
}
.admin-pipe-checked { font-weight: 600; color: var(--gray-600); }
.admin-pipe-card-head { margin-bottom: 12px; }
.admin-pipe-card-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--gray-900); }
.admin-pipe-card-head p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; }

.admin-pipe-flow { overflow-x: auto; padding: 2px 0; }
.admin-pipe-flow svg { display: block; min-width: 900px; height: auto; font-family: var(--font-sans); }
.admin-pipe-rank {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  fill: var(--gray-400);
}
.admin-pipe-edge { fill: none; stroke: var(--gray-300); stroke-width: 1.2; }
.admin-pipe-edge.is-hot { stroke: var(--niq-500); stroke-width: 2; }
.admin-pipe-arrow-head { fill: var(--gray-300); }
.admin-pipe-arrow-head.is-hot { fill: var(--niq-500); }
.admin-pipe-node-box { fill: var(--gray-50); stroke: var(--gray-200); stroke-width: 1; transition: fill 0.15s, stroke 0.15s; }
.admin-pipe-node.is-process .admin-pipe-node-box { fill: #fff; stroke: var(--gray-300); }
.admin-pipe-node-bar { fill: var(--pipe-srv, var(--gray-400)); }
.admin-pipe-node-title { font-size: 12px; font-weight: 650; fill: var(--gray-900); }
.admin-pipe-node-sub { font-size: 10.5px; fill: var(--gray-500); }
.admin-pipe-node.is-clickable { cursor: pointer; }
.admin-pipe-node.is-clickable:hover .admin-pipe-node-box { fill: var(--niq-50); stroke: var(--niq-200); }
.admin-pipe-node.is-selected .admin-pipe-node-box { fill: var(--niq-50); stroke: var(--niq-500); stroke-width: 2; }
.admin-pipe-node:focus { outline: none; }
.admin-pipe-node:focus-visible .admin-pipe-node-box { stroke: var(--niq-600); stroke-width: 2.5; }

.admin-pipe-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  font-size: 12px;
}
.admin-pipe-maps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.admin-pipe-map {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--gray-700);
  cursor: pointer;
}
.admin-pipe-map:hover { border-color: var(--gray-400); }
.admin-pipe-map.active { background: var(--niq-50); border-color: var(--niq-500); color: var(--niq-700); font-weight: 600; }

.admin-pipe-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
}
.admin-pipe-srv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--pipe-srv-ink, var(--gray-700));
  background: var(--pipe-srv-soft, var(--gray-100));
}
.admin-pipe-srv::before,
.admin-pipe-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pipe-srv, var(--gray-400));
}
.admin-pipe-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: var(--gray-700);
}
.admin-pipe-chip:hover { border-color: var(--pipe-srv, var(--gray-400)); }
.admin-pipe-chip.active { background: var(--niq-50); border-color: var(--niq-500); color: var(--niq-700); font-weight: 600; }

.admin-pipe-detail { border-top: 3px solid var(--niq-500); }
.admin-pipe-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.admin-pipe-detail-head h3 { margin: 0; font-size: 17px; color: var(--gray-900); }
.admin-pipe-detail-head p { margin: 2px 0 0; font-size: 12.5px; }
.admin-pipe-detail-servers { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-pipe-summary { margin: 12px 0 0; max-width: 95ch; font-size: 13.5px; line-height: 1.55; color: var(--gray-800); }
.admin-pipe-section { margin-top: 18px; }
.admin-pipe-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
}
.admin-pipe-steps,
.admin-pipe-onboarding,
.admin-pipe-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.admin-pipe-steps li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--gray-50);
}
.admin-pipe-steps li > .admin-pipe-where { max-width: 340px; justify-self: end; }
.admin-pipe-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--niq-500);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}
.admin-pipe-step-body { display: grid; gap: 3px; justify-items: start; }
.admin-pipe-step-body strong { font-size: 13px; color: var(--gray-900); }
.admin-pipe-step-body p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.admin-pipe-where {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--gray-700);
  white-space: normal;
  overflow-wrap: anywhere;
}
.admin-pipe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.admin-pipe-list li {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.admin-pipe-list li strong { font-size: 13px; color: var(--gray-900); }
.admin-pipe-list li p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.admin-pipe-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 0; }
.admin-pipe-facts div { min-width: 0; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--gray-50); }
.admin-pipe-facts dt { font-size: 11.5px; font-weight: 600; color: var(--gray-500); }
.admin-pipe-facts dd {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--gray-800);
  overflow-wrap: anywhere;
}
.admin-pipe-note {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid var(--info);
  border-radius: var(--radius-md);
  background: #eff6ff;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-800);
}
.admin-pipe-note.tone-warning { border-left-color: var(--warning); background: #fffbeb; }

.admin-pipe-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.admin-pipe-table th { position: static; }
.admin-pipe-table td { vertical-align: top; font-size: 12.5px; }
.admin-pipe-table tr:hover td { background: transparent; cursor: default; }
.admin-pipe-table tbody tr:last-child td { border-bottom: 0; }
.admin-pipe-table code { font-family: var(--font-mono); font-size: 11.5px; overflow-wrap: anywhere; }
.admin-pipe-table .admin-pipe-cmd {
  display: block;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: var(--gray-900);
  color: var(--gray-100);
  white-space: pre-wrap;
}

.admin-pipe-onboarding li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.admin-pipe-onboarding-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-pipe-onboarding .admin-pipe-where { margin-top: 3px; }
.admin-pipe-scope {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--gray-100);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-600);
}
.admin-pipe-scope.scope-all { background: var(--niq-50); color: var(--niq-700); }
.admin-pipe-scope.scope-leclerc { background: #ecfdf5; color: #047857; }
.admin-pipe-scope.scope-blink,
.admin-pipe-scope.scope-non_blink { background: #f5f3ff; color: #6d28d9; }

.admin-pipe-timeline { overflow-x: auto; }
.admin-pipe-timeline svg { display: block; min-width: 860px; height: auto; font-family: var(--font-sans); }
.admin-pipe-tl-band { fill: var(--gray-50); }
.admin-pipe-tl-grid { stroke: var(--gray-200); stroke-width: 1; }
.admin-pipe-tl-hour { font-family: var(--font-mono); font-size: 10px; fill: var(--gray-500); }
.admin-pipe-tl-server { font-size: 10.5px; font-weight: 700; fill: var(--pipe-srv-ink, var(--gray-700)); }
.admin-pipe-tl-label { font-size: 11px; fill: var(--gray-700); }
.admin-pipe-tl-span { fill: var(--pipe-srv, var(--gray-400)); opacity: 0.85; }
.admin-pipe-tl-tick { stroke: var(--pipe-srv-ink, var(--gray-700)); stroke-width: 1.6; stroke-linecap: round; }
.admin-pipe-tl-skipped { fill: #fff; stroke: var(--pipe-srv, var(--gray-400)); stroke-width: 1.5; stroke-dasharray: 2 2; }
.admin-pipe-tl-now { stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 4 3; }
.admin-pipe-tl-now-label { font-size: 10.5px; font-weight: 700; fill: var(--danger); }
.admin-pipe-key { display: inline-flex; align-items: center; gap: 6px; color: var(--gray-600); }
.admin-pipe-key i { display: inline-block; }
.admin-pipe-key-span { width: 18px; height: 8px; border-radius: 3px; background: var(--niq-500); }
.admin-pipe-key-tick { width: 2px; height: 12px; border-radius: 1px; background: var(--niq-700); }
.admin-pipe-key-skipped { width: 10px; height: 10px; border: 1.5px dashed var(--niq-500); border-radius: 50%; }
.admin-pipe-key-now { width: 0; height: 12px; border-left: 1.5px dashed var(--danger); }

.admin-pipe-servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.admin-pipe-server {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 12px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--pipe-srv, var(--gray-400));
  border-radius: var(--radius-md);
}
.admin-pipe-server-head { display: grid; gap: 2px; }
.admin-pipe-server-head strong { font-size: 14px; color: var(--gray-900); }
.admin-pipe-server-head span { font-size: 11.5px; }
.admin-pipe-server ul { display: grid; gap: 3px; margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--gray-700); }

@media (max-width: 980px) {
  .admin-pipe-grid { grid-template-columns: 1fr; }
  .admin-pipe-steps li { grid-template-columns: 24px minmax(0, 1fr); }
  .admin-pipe-steps li > .admin-pipe-where { grid-column: 2; justify-self: start; max-width: none; }
}

/* ───────── Contrôle des livraisons (BNC) ───────── */
.bnc-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.bnc-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.bnc-head .page-title { margin: 0; }
.bnc-head .page-subtitle { margin: 4px 0 0; }
.bnc-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 14px;
  background: #ede9fe;
  color: #4c1d95;
}
.bnc-head-icon svg { width: 28px; height: 28px; }
.bnc-search-actions {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.bnc-message { margin: 0; }
.bnc-idle {
  padding: 20px 24px;
  color: var(--gray-600);
}
.bnc-board {
  padding: 20px 24px;
}
.bnc-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.bnc-kpi {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 220px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
}
.bnc-kpi strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  color: var(--gray-900);
}
.bnc-kpi span { color: var(--gray-700); font-size: 14px; }
.bnc-kpi-icon { display: inline-flex; }
.bnc-kpi-icon svg { width: 30px; height: 30px; }
.bnc-kpi.is-alert {
  border-color: #fecdd3;
  background: #fff1f2;
}
.bnc-kpi.is-alert .bnc-kpi-icon,
.bnc-kpi.is-alert strong { color: #b42318; }
.bnc-kpi.is-done .bnc-kpi-icon { color: #16a34a; }
.bnc-age-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--gray-700);
  font-size: 14px;
}
.bnc-age-pill svg { width: 20px; height: 20px; color: var(--gray-700); }
.bnc-age-pill strong { color: var(--gray-900); }
.bnc-tabs { margin-bottom: 4px; }
.bnc-table-wrap { overflow-x: auto; }
.bnc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.bnc-table th {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.bnc-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
  white-space: nowrap;
}
.bnc-table tbody tr:last-child td { border-bottom: 0; }
.bnc-product {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
}
.bnc-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: none;
  overflow: hidden;
  border-radius: 8px;
  background: var(--gray-100);
}
.bnc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.bnc-product-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  white-space: normal;
}
.bnc-product-text strong { color: var(--gray-900); }
.bnc-product-text span { color: var(--gray-600); font-size: 13px; }
.bnc-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fee4e2;
  color: #b42318;
  font-size: 13px;
  font-weight: 600;
}
.bnc-state svg { width: 15px; height: 15px; }
.bnc-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bnc-icon-btn,
.bnc-check-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--gray-800);
  cursor: pointer;
}
.bnc-icon-btn { width: 34px; padding: 0; }
.bnc-check-btn { padding: 0 12px; font-size: 13px; font-weight: 500; }
.bnc-icon-btn svg { width: 18px; height: 18px; }
.bnc-check-btn svg { width: 16px; height: 16px; }
.bnc-icon-btn:hover:not(:disabled),
.bnc-check-btn:hover:not(:disabled) { background: var(--gray-100); }
.bnc-icon-btn:disabled,
.bnc-check-btn:disabled { opacity: 0.45; cursor: default; }
.bnc-menu { position: relative; }
.bnc-menu-list {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
}
.bnc-menu-list button {
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--gray-800);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.bnc-menu-list button:hover:not(:disabled) { background: var(--gray-100); }
.bnc-menu-list button:disabled { opacity: 0.45; cursor: default; }
.bnc-preview-error {
  max-width: 420px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: white;
  color: var(--gray-700);
  font-size: 14px;
}
@media (max-width: 720px) {
  .bnc-age-pill { margin-left: 0; }
  .bnc-kpi { flex: 1; min-width: 0; }
}
