/* ==========================================================================
   components.css — every component of DESIGN-SPEC §2 with all its states.
   Values are copied from the inline style objects of the prototypes
   (docs/redesign/design-source/*.dc.html): btn(), cardStyle, sheetStyle,
   cartColStyle, navDrawerStyle, …
   ========================================================================== */

/* ==========================================================================
   1 · Buttons
   ========================================================================== */

.np-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--np-s2);
  border: 0;
  border-radius: var(--np-r-btn);
  padding: 11px 16px;
  min-height: var(--np-touch);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  color: var(--np-ink);
  background: transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

/* --- primary: Encaisser, Envoyer, Enregistrer, Connexion ------------------ */
.np-btn--primary { background: var(--np-ink); color: var(--np-cream); }
.np-btn--primary:hover:not(:disabled) { background: var(--np-ink-hover); }
.np-btn--primary:active:not(:disabled) { background: var(--np-ink-press); transform: translateY(1px); }
.np-btn--primary:disabled { background: var(--np-disabled-bg); color: var(--np-dim); }
.np-btn--primary.is-loading { color: var(--np-onink-2); }

/* --- secondary: Table, Client, Actions ----------------------------------- */
.np-btn--secondary {
  background: var(--np-surface);
  color: var(--np-ink);
  border: 1px solid var(--np-line-input);
}
.np-btn--secondary:hover:not(:disabled) { background: var(--np-surface-alt); border-color: var(--np-muted-line); }
.np-btn--secondary:active:not(:disabled) { background: var(--np-soft); border-color: var(--np-muted-line); }
.np-btn--secondary:disabled { color: var(--np-disabled-ink); border-color: var(--np-disabled-line); }
.np-btn--secondary.is-active { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }

/* --- accent: Suppléments, Analyser le fichier ----------------------------- */
.np-btn--accent { background: var(--np-lav-soft); color: var(--np-lav-ink); }
.np-btn--accent:hover:not(:disabled) { background: var(--np-lav-hover); }
.np-btn--accent.is-active { background: var(--np-lav-strong); color: #fff; }

/* --- destructive: Retirer, Annuler, Supprimer ----------------------------- */
.np-btn--danger {
  background: transparent;
  color: var(--np-red);
  border: 1px solid var(--np-red-line);
}
.np-btn--danger:hover:not(:disabled) { background: var(--np-red-soft); border-color: var(--np-red-line-hover); }
.np-btn--danger:disabled,
.np-btn--danger.is-locked { color: var(--np-disabled-ink); border-color: var(--np-locked-line); background: transparent; }

/* Solid red is reserved for the LAST confirmation step. */
.np-btn--danger-solid { background: var(--np-red); color: #fff; font-weight: 700; }
.np-btn--danger-solid:hover:not(:disabled) { background: #9C2E29; }

/* --- soft/icon-ish: Modifier, Extras (always with a text label) ----------- */
.np-btn--soft {
  background: var(--np-soft);
  color: var(--np-mid);
  padding: 9px 12px;
  font-size: var(--np-fs-secondary);
}
.np-btn--soft:hover:not(:disabled) { background: #EAE3D6; }

/* --- sizes ---------------------------------------------------------------- */
.np-btn--sm { padding: 11px 14px; }
.np-btn--lg { padding: 13px 18px; min-height: calc(var(--np-touch) + 6px); font-size: var(--np-fs-body); }
.np-btn--cta { padding: 16px 22px; border-radius: var(--np-r-line); font-size: 16px; font-weight: 700; }
.np-btn--block { display: flex; width: 100%; }
.np-btn--flex { flex: 1; }
.np-btn--square {
  width: calc(var(--np-touch) + 4px);
  height: calc(var(--np-touch) + 4px);
  min-height: 0;
  padding: 0;
  font-size: 18px;
}

.np-btn__spinner {
  width: 14px; height: 14px; flex: none;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: np-spin 0.7s linear infinite;
}
@keyframes np-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   2 · Chips, badges, pills
   ========================================================================== */

.np-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--np-s2);
  min-height: 48px;
  padding: 13px 17px;
  border-radius: var(--np-r-pill);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  color: var(--np-ink);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
}
.np-chip.is-on { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }

.np-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 10px;
  border-radius: var(--np-r-badge);
  background: var(--np-soft);
  color: var(--np-dim);
  white-space: nowrap;
}
.np-badge--sm { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; }
.np-badge--ok { background: var(--np-green-soft); color: var(--np-green); }
.np-badge--sent { background: var(--np-green-soft); color: var(--np-green); }
.np-badge--togo { background: var(--np-amber-soft); color: var(--np-amber-ink); }
.np-badge--discount { background: var(--np-lav-soft); color: var(--np-lav-ink); }
.np-badge--waiter { background: var(--np-waiter-soft); color: var(--np-waiter-ink); }
.np-badge--off { background: var(--np-soft); color: var(--np-dim); }

/* ==========================================================================
   3 · Cards, panels, tables
   ========================================================================== */

.np-card {
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-panel);
  background: var(--np-surface);
  overflow: hidden;
}
.np-card--pad { padding: var(--np-s4); }

.np-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--np-s3);
  padding: 0 2px var(--np-s2);
}

/* --- data table (PC / tablet landscape) ---------------------------------- */
.np-table { display: flex; flex-direction: column; }
.np-table__head {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  padding: 12px var(--np-s4);
  background: var(--np-surface-alt);
}
.np-table__head span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--np-dim);
  min-width: 0;
}
.np-table__row {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  padding: 12px var(--np-s4);
  border-top: 1px solid var(--np-divider);
  background: var(--np-surface);
}
.np-table__row:nth-child(even) { background: var(--np-surface-alt); }
.np-table__cell {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: var(--np-s2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-table__cell--badge { flex: 0 0 84px; }
/* For the one column that carries a name rather than a number: equal flex:1
   columns starve it while the numeric ones keep slack they never use. */
.np-table__cell--wide { flex: 2.4; }
.np-table__cell--swatch { flex: 0 0 60px; }
/* Reserve the same width in the header row as in the body rows, so the
   "Actions" column heading lines up with its buttons. */
.np-table__actions,
.np-table__head .np-table__actions-head { display: flex; gap: var(--np-s1); flex: none; min-width: 176px; }
.np-table__foot { padding: 12px var(--np-s4); border-top: 1px solid var(--np-divider); }

.np-swatch {
  width: 26px; height: 26px; flex: none;
  border-radius: var(--np-r-xs);
  border: 1px solid rgba(22, 19, 15, 0.12);
}

/* --- stacked list (tablet portrait / phone replacement for a table) ------- */
.np-stack {
  display: flex;
  flex-direction: column;
  gap: var(--np-s3);
  padding: 14px 15px;
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-card);
  background: var(--np-surface);
}
.np-stack__title { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; text-wrap: pretty; }
.np-stack__pairs { display: flex; flex-direction: column; gap: var(--np-s1); }
.np-stack__pair { display: flex; align-items: baseline; gap: var(--np-s3); font-size: 13px; }
.np-stack__label { flex: 0 0 96px; color: var(--np-dim); }
.np-stack__value { flex: 1; min-width: 0; font-weight: 600; text-wrap: pretty; }

/* --- KPI tile ------------------------------------------------------------- */
.np-kpi {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--np-s4) 18px;
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-panel);
  background: var(--np-surface);
}
.np-kpi__value {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.np-kpi__num {
  font-size: var(--np-fs-kpi);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.np-kpi__unit { font-size: 13px; font-weight: 600; color: var(--np-mid); }

/* ==========================================================================
   4 · Fields
   ========================================================================== */

.np-field { display: flex; flex-direction: column; gap: 6px; }
.np-field > span,
.np-field > label { font-size: var(--np-fs-secondary); color: var(--np-mid); }

.np-input,
.np-select,
.np-textarea {
  width: 100%;
  min-height: calc(var(--np-touch) + 6px);
  border: 1px solid var(--np-line-input);
  border-radius: var(--np-r-input);
  padding: 0 13px;
  background: var(--np-surface);
  color: var(--np-ink);
  font-size: 14.5px;
  outline: none;
}
.np-textarea { padding: 10px 13px; min-height: 84px; resize: vertical; line-height: 1.45; }
.np-select {
  appearance: none;
  padding-inline-end: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%236B6255' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}
[dir="rtl"] .np-select { background-position: left 13px center; }

.np-input::placeholder,
.np-textarea::placeholder { color: var(--np-dim); }
.np-input:focus-visible,
.np-select:focus-visible,
.np-textarea:focus-visible { border-color: var(--np-lav); box-shadow: var(--np-sh-focus); }

.np-input.is-error,
.np-select.is-error { border-color: var(--np-red); background: var(--np-red-soft); color: var(--np-red); }
.np-error { font-size: 13px; color: var(--np-red); }

/* colour input keeps its native swatch but our frame */
.np-input[type="color"] { padding: 4px; min-width: 64px; cursor: pointer; }

/* --- search --------------------------------------------------------------- */
.np-search {
  display: flex;
  align-items: center;
  gap: var(--np-s2);
  min-height: 44px;
  background: var(--np-surface);
  border: 1px solid var(--np-line-input);
  border-radius: var(--np-r-input);
  padding: 0 12px;
}
.np-search > .np-ico { color: var(--np-dim); }
.np-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  padding: 0;
}
.np-search__clear {
  flex: none;
  width: 26px; height: 26px;
  min-height: 0;
  padding: 0;
  border-radius: var(--np-r-badge);
  background: var(--np-soft);
  color: var(--np-mid);
  font-size: 13px;
}

/* --- toggle --------------------------------------------------------------- */
.np-toggle {
  width: 52px; height: 32px; flex: none;
  border-radius: var(--np-r-pill);
  border: 0;
  background: #D9D0C0;
  display: flex;
  align-items: center;
  padding: 3px;
  justify-content: flex-start;
  transition: background-color 0.15s ease;
  min-height: 0;
}
.np-toggle__knob {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--np-surface);
  display: block;
  transition: transform 0.15s ease;
}
.np-toggle[aria-checked="true"] { background: var(--np-ink); }
.np-toggle[aria-checked="true"] .np-toggle__knob { transform: translateX(20px); }
[dir="rtl"] .np-toggle[aria-checked="true"] .np-toggle__knob { transform: translateX(-20px); }

/* --- segmented control ---------------------------------------------------- */
.np-seg {
  display: flex;
  gap: 6px;
  background: var(--np-soft);
  padding: 5px;
  border-radius: var(--np-r-line);
}
.np-seg__tab {
  flex: 1;
  padding: 12px 10px;
  /* 44px was hard-coded, so a touch device got 44 where the design rule asks
     for 48 (--np-touch is 40 on a mouse PC, 48 on touch). max() keeps the
     roomier 44 on the PC and reaches 48 the moment the pointer is a finger. */
  min-height: max(44px, var(--np-touch));
  border-radius: var(--np-r-btn);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--np-mid);
  background: transparent;
}
.np-seg__tab.is-on { background: var(--np-surface); color: var(--np-ink); box-shadow: var(--np-sh-seg); }

/* Two-option ink/white variant (Pourcentage / Montant, Partage / Par article) */
.np-duo { display: flex; gap: 6px; }
.np-duo__opt {
  flex: 1;
  padding: 13px;
  min-height: 48px;
  border-radius: var(--np-r-btn);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  color: var(--np-ink);
  font-size: var(--np-fs-body);
  font-weight: 600;
}
.np-duo__opt.is-on { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }

/* --- preset chips (5 %, 500 DA, Compte juste) ---------------------------- */
.np-preset {
  padding: 12px 18px;
  min-height: calc(var(--np-touch) + 8px);
  border-radius: var(--np-r-btn);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  color: var(--np-ink);
  font-size: var(--np-fs-body);
  font-weight: 600;
}
.np-preset.is-on { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }

/* --- radio card (import mode) -------------------------------------------- */
.np-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--np-line-input);
  border-radius: var(--np-r-card);
  background: var(--np-surface);
  text-align: start;
}
.np-radio-card.is-on { border-color: var(--np-ink); }
.np-radio-card__dot {
  width: 18px; height: 18px; flex: none;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--np-muted-line);
  background: transparent;
}
.np-radio-card.is-on .np-radio-card__dot {
  border-color: var(--np-ink);
  background: var(--np-ink);
  box-shadow: inset 0 0 0 3px var(--np-surface);
}

/* --- drop zone ------------------------------------------------------------ */
.np-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--np-s2);
  padding: 26px 18px;
  border: 1px dashed var(--np-muted-line);
  border-radius: var(--np-r-panel);
  background: var(--np-surface);
  text-align: center;
  width: 100%;
}
.np-dropzone.is-over { border-color: var(--np-lav); background: var(--np-lav-soft); }

/* --- stepper (guests, quantities) ---------------------------------------- */
.np-stepper {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--np-soft);
  border-radius: var(--np-r-input);
  padding: 4px;
}
.np-stepper__btn {
  width: calc(var(--np-touch) + 4px);
  height: calc(var(--np-touch) + 4px);
  min-height: 0;
  border-radius: var(--np-r-sm);
  background: var(--np-surface);
  font-size: 19px;
  box-shadow: var(--np-sh-btn);
}
.np-stepper__value {
  min-width: 40px;
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   5 · Sheets, drawer, toast, confirm, overlay
   ========================================================================== */

.np-backdrop {
  position: absolute;
  inset: 0;
  background: var(--np-backdrop);
  z-index: 35;
}

.np-sheet {
  position: absolute;
  z-index: 36;
  display: flex;
  flex-direction: column;
  background: var(--np-cream);
  /* Side sheet from the start edge (POS: covers rail+grid, cart stays visible) */
  inset-block: 0;
  inset-inline-start: 0;
  inset-inline-end: var(--np-sheet-inset-end, 0px);
  border-inline-end: 1px solid var(--np-line);
  box-shadow: var(--np-sh-sheet-side);
}
[dir="rtl"] .np-sheet { box-shadow: var(--np-sh-sheet-side-end); }

/* Admin sheets come from the END edge and have a fixed width. */
.np-sheet--end {
  inset-inline-start: auto;
  inset-inline-end: 0;
  width: var(--np-sheet-w);
  border-inline-end: 0;
  border-inline-start: 1px solid var(--np-line);
  box-shadow: var(--np-sh-sheet-side-end);
}
[dir="rtl"] .np-sheet--end { box-shadow: var(--np-sh-sheet-side); }

.np-sheet__head {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  padding: 14px var(--np-s4) 10px;
}
.np-sheet__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.np-sheet__title { font-family: var(--np-font-title); font-size: var(--np-fs-sheet-title); }
.np-sheet__sub { font-size: var(--np-fs-secondary); color: var(--np-mid); }
.np-sheet__close {
  flex: none;
  width: calc(var(--np-touch) + 4px);
  height: calc(var(--np-touch) + 4px);
  min-height: 0;
  border: 1px solid var(--np-line-input);
  border-radius: var(--np-r-line);
  background: var(--np-surface);
  font-size: 16px;
  color: var(--np-mid);
}
.np-sheet__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--np-s4) var(--np-s4);
}
.np-sheet__foot {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--np-s2);
  padding: var(--np-s3) var(--np-s4) var(--np-s4);
}

/* Bottom sheet on tablet portrait + phone. */
@media (max-width: 899px) {
  .np-sheet,
  .np-sheet--end {
    inset-inline: 0;
    inset-block-start: var(--np-sheet-top, 70px);
    /* Stop at the on-screen keyboard, never under it (F001/F074/F185). */
    inset-block-end: var(--np-kb-h, 0px);
    width: auto;
    border: 0;
    border-start-start-radius: var(--np-r-sheet);
    border-start-end-radius: var(--np-r-sheet);
    box-shadow: var(--np-sh-sheet-bottom);
  }
  .np-sheet--end { --np-sheet-top: 12%; }
}

/* --- nav drawer ----------------------------------------------------------- */
.np-drawer {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--np-drawer-w);
  background: var(--np-surface);
  z-index: 46;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: var(--np-sh-drawer);
}
/* In Arabic the drawer comes in from the right; its shadow has to follow it,
   exactly as the side sheets' already does (F010). */
[dir="rtl"] .np-drawer { box-shadow: var(--np-sh-drawer-end); }
.np-drawer__backdrop { position: absolute; inset: 0; background: var(--np-backdrop-drawer); z-index: 45; }
.np-drawer__item {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  min-height: 52px;
  padding: 13px 12px;
  border-radius: var(--np-r-input);
  background: transparent;
  color: var(--np-mid);
  font-size: 15px;
  font-weight: 600;
  text-align: start;
  width: 100%;
}
.np-drawer__item.is-active { background: var(--np-soft); color: var(--np-ink); }
.np-drawer__item .np-ico { opacity: 0.75; }
.np-drawer__item.is-active .np-ico { opacity: 1; }
.np-drawer__item--danger { color: var(--np-red); }

/* --- toast ---------------------------------------------------------------- */
.np-toasts {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 14px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: var(--np-s2);
  pointer-events: none;
}
.np-toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 340px;
  padding: 11px 14px;
  border-radius: var(--np-r-input);
  background: var(--np-ink);
  color: var(--np-cream);
  font-size: 13.5px;
  box-shadow: var(--np-sh-toast);
  pointer-events: auto;
  animation: np-toast-in 0.18s ease-out;
}
.np-toast__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--np-net-ok-dot); flex: none; }
.np-toast--error .np-toast__dot { background: #E48A84; }
.np-toast--warn .np-toast__dot { background: var(--np-net-off-dot); }
.np-toast__text { flex: 1; min-width: 0; }
.np-toast__hint { font-size: 11px; color: var(--np-onink-2); flex: none; }
@keyframes np-toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* --- confirm (a sheet variant) ------------------------------------------- */
.np-confirm__body { font-size: 15px; color: #3A342B; line-height: 1.5; }

/* --- loading overlay ------------------------------------------------------ */
.np-loading {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 241, 232, 0.55);
  backdrop-filter: blur(1px);
}
.np-loading__spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--np-muted-line-2);
  border-top-color: var(--np-ink);
  border-radius: 50%;
  animation: np-spin 0.8s linear infinite;
}

/* ==========================================================================
   6 · Empty states
   ========================================================================== */

.np-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--np-s2);
  padding: 40px 20px;
  text-align: center;
  flex: 1;
}
.np-empty__mark {
  width: 44px; height: 44px;
  border-radius: var(--np-r-panel);
  border: 2px dashed var(--np-muted-line-2);
}
.np-empty__title { font-family: var(--np-font-title); font-size: var(--np-fs-sheet-title); }
.np-empty__body { font-size: 13.5px; color: var(--np-mid); max-width: 300px; }
.np-empty--boxed {
  padding: 36px var(--np-s4);
  color: var(--np-dim);
  font-size: 13.5px;
  text-align: center;
  border: 1px dashed #D9D0C0;
  border-radius: var(--np-r-line);
}
/* Inside a card the dashed box needs breathing room of its own. */
.np-card > .np-empty--boxed,
.np-card .np-empty--boxed { margin: var(--np-s3); }

/* ==========================================================================
   7 · POS — product card, cart line, table tile, extras chip, customer row
   ========================================================================== */

.np-product {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 118px;
  padding: 12px 13px 15px;
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-card);
  background: var(--np-surface);
  text-align: start;
  overflow: hidden;
  box-shadow: var(--np-sh-card);
  width: 100%;
}
.np-product:hover { border-color: var(--np-muted-line); }
.np-product:active { transform: translateY(1px); }
/* The base `:focus-visible` ring is a box-shadow, and so is the card's resting
   elevation — same specificity (0,1,0), and components.css is loaded after
   base.css, so the card's shadow WON the cascade and a keyboard user tabbing
   the product grid got no cue at all. Not the 1.6:1 F038 measured: nothing.
   Restated here so the ring survives, with the elevation kept behind it. */
.np-product:focus-visible { box-shadow: var(--np-sh-focus), var(--np-sh-card); }
.np-product__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--np-s2);
  width: 100%;
}
.np-product__prefix {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--np-dim);
  font-weight: 700;
}
.np-product__sig {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--np-red);
}
.np-product__name {
  font-size: var(--np-fs-product);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: pretty;
}
.np-product__price-row { display: flex; align-items: baseline; gap: var(--np-s1); margin-top: auto; }
.np-product__price {
  font-size: var(--np-fs-price);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.np-product__cur { font-size: 11px; font-weight: 600; color: var(--np-mid); }
.np-product__edge {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 4px;
  background: var(--np-cat, var(--np-line));
}
@media (max-width: 599px) { .np-product { min-height: 104px; } }

/* --- cart line ------------------------------------------------------------ */
.np-line {
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-line);
  background: var(--np-surface);
}
.np-line.is-selected { border-color: var(--np-lav); box-shadow: var(--np-sh-ring); }
.np-line__row {
  display: flex;
  align-items: flex-start;
  gap: var(--np-s3);
  width: 100%;
  min-height: calc(var(--np-touch) + 8px);
  padding: 12px 12px 10px;
  background: transparent;
  text-align: start;
}
.np-line__qty {
  flex: none;
  min-width: 26px; height: 26px;
  border-radius: var(--np-r-xs);
  background: var(--np-soft);
  color: var(--np-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.np-line.is-selected .np-line__qty { background: var(--np-lav-soft); color: var(--np-lav-ink); }
.np-line__mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.np-line__name { font-size: var(--np-fs-line); font-weight: 600; line-height: 1.3; text-wrap: pretty; }
.np-line__badges { display: flex; flex-wrap: wrap; gap: 5px; }
.np-line__total { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.np-line__extras {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px 8px;
  padding-inline-start: 46px;
}
/* Each extra owns a full touch row, so the ✕ that deletes it can reach
   --np-touch in both axes WITHOUT spilling into its neighbour's row — the
   buttons used to be 22 px squares stacked 2 px apart (F051). */
.np-line__extra {
  display: flex;
  align-items: center;
  gap: var(--np-s2);
  min-height: var(--np-touch);
  font-size: var(--np-fs-secondary);
  color: var(--np-mid);
}
/* The visible chip stays small; the target is a transparent overlay centred on
   it, exactly one --np-touch square and never taller than its own row —
   measured 41x40 on PC and 49x48 on touch, against 24x23 before. The glyph
   moves off #8A7F6E (3.31:1 on --np-soft) onto --np-mid, 5.05:1 (F008). */
.np-line__extra-x {
  position: relative;
  width: 26px; height: 26px; min-height: 0;
  flex: none;
  border-radius: 6px;
  background: var(--np-soft);
  color: var(--np-mid);
  font-size: 12px;
  padding: 0;
}
.np-line__extra-x::after {
  content: "";
  position: absolute;
  inset-block: calc((var(--np-touch) - 26px) / -2);
  inset-inline: calc((var(--np-touch) - 26px) / -2);
}
.np-line__extra-x:hover { background: var(--np-line); color: var(--np-ink); }
.np-line__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 10px;
  align-items: center;
}
.np-line__step {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--np-cream);
  border-radius: var(--np-r-btn);
  padding: 3px;
}
.np-line__step button {
  width: var(--np-touch); height: var(--np-touch);
  min-height: 0;
  border-radius: var(--np-r-xs);
  background: var(--np-surface);
  font-size: 18px;
  box-shadow: var(--np-sh-btn);
  padding: 0;
}
.np-line__step button:disabled { opacity: 0.35; }
.np-line__step-val {
  min-width: 26px;
  text-align: center;
  font-size: var(--np-fs-line);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.np-line__togo { background: var(--np-soft); color: var(--np-mid); }
.np-line__togo.is-on { background: var(--np-amber-soft); color: var(--np-amber-ink); }
@media (max-width: 899px) {
  .np-line__step-val { min-width: 28px; font-size: 15px; }
}

/* --- table tile ----------------------------------------------------------- */
.np-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 66px;
  padding: 11px 12px;
  border-radius: var(--np-r-line);
  border: 1px solid var(--np-line-input);
  border-inline-start: 4px solid var(--np-zone, var(--np-line));
  background: var(--np-surface);
  color: var(--np-ink);
  text-align: start;
  width: 100%;
}
.np-tile__name { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.np-tile__meta { font-size: 11.5px; color: var(--np-dim); }
.np-tile.is-busy { background: var(--np-amber-soft); border-color: var(--np-amber-line); }
.np-tile.is-busy .np-tile__meta { color: var(--np-amber-ink); font-weight: 700; }
.np-tile.is-current { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }
.np-tile.is-current .np-tile__meta { color: var(--np-onink-2); }
.np-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: var(--np-s2);
}
@media (max-width: 599px) { .np-tiles { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); } }

.np-zone-head { display: flex; align-items: center; gap: var(--np-s2); padding-bottom: var(--np-s2); }
.np-zone-head__dot { width: 10px; height: 10px; border-radius: 3px; background: var(--np-zone, var(--np-line)); flex: none; }
.np-zone-head__name { font-size: var(--np-fs-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--np-mid); font-weight: 700; }
.np-zone-head__free { font-size: 11.5px; color: var(--np-dim); }

/* Livraison / à emporter row (cashier, vendor, admin only) */
.np-delivery {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  width: 100%;
  padding: 14px;
  border: 1px solid var(--np-line-input);
  border-radius: var(--np-r-card);
  background: var(--np-surface);
  text-align: start;
}
.np-delivery.is-current { border-color: var(--np-ink); box-shadow: 0 0 0 3px rgba(22, 19, 15, 0.07); }
.np-delivery__mark {
  width: 38px; height: 38px; flex: none;
  border-radius: var(--np-r-input);
  background: var(--np-amber-soft);
  color: var(--np-amber-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* --- extras chip (sheet) -------------------------------------------------- */
.np-extra {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  min-height: 48px;
  border-radius: var(--np-r-pill);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  color: var(--np-ink);
  font-size: var(--np-fs-body);
  font-weight: 600;
}
.np-extra.is-on { border-color: var(--np-lav); background: var(--np-lav-soft); }
.np-extra__qty {
  min-width: 22px; height: 22px;
  border-radius: var(--np-r-badge);
  background: var(--np-soft);
  color: var(--np-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.np-extra.is-on .np-extra__qty { background: var(--np-lav-strong); color: #fff; }
.np-extra__price { font-size: 12px; color: var(--np-mid); font-variant-numeric: tabular-nums; }

/* checklist variant (product ↔ extras link) */
.np-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: var(--np-touch);
  padding: 10px 14px;
  border-radius: var(--np-r-pill);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  font-size: 13.5px;
  font-weight: 600;
}
.np-check__box {
  width: 16px; height: 16px; flex: none;
  border-radius: 5px;
  border: 2px solid var(--np-muted-line);
  background: transparent;
}
.np-check.is-on { border-color: var(--np-lav); background: var(--np-lav-soft); }
.np-check.is-on .np-check__box { border-color: var(--np-lav); background: var(--np-lav); }

/* --- customer row (sheet) ------------------------------------------------- */
.np-customer {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  width: 100%;
  padding: 14px;
  border: 1px solid var(--np-line-input);
  border-radius: var(--np-r-card);
  background: var(--np-surface);
  text-align: start;
}
.np-customer.is-on { border-color: var(--np-ink); }
.np-customer__balance { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--np-green); }
.np-customer__balance.is-neg { color: var(--np-red); }

/* ==========================================================================
   8 · Calculator, receipt, paid screen
   ========================================================================== */

.np-calc__display {
  padding: var(--np-s4);
  border-radius: var(--np-r-card);
  background: var(--np-ink);
  color: var(--np-cream);
  text-align: end;
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-height: 62px;
  overflow: hidden;
}
.np-calc__keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.np-calc__key {
  height: 52px;
  min-height: 52px;
  border-radius: var(--np-r-btn);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  font-size: 18px;
  font-weight: 600;
}
.np-calc__key--op { background: var(--np-lav-soft); color: var(--np-lav-ink); border: 0; }
.np-calc__key--eq { background: var(--np-ink); color: var(--np-cream); border: 0; }

.np-receipt {
  width: 230px;
  background: var(--np-surface);
  border: 1px solid var(--np-line);
  border-radius: 6px;
  padding: var(--np-s4) 14px;
  font-family: var(--np-font-mono);
  font-size: 11.5px;
  color: #2A241C;
}
.np-receipt__name { text-align: center; font-family: var(--np-font-title); font-size: 15px; letter-spacing: 0.02em; }
.np-receipt__sub { text-align: center; font-size: 10px; color: var(--np-mid); padding-bottom: var(--np-s2); }
.np-receipt__sep { border-top: 1px dashed var(--np-muted-line); padding-top: var(--np-s2); }
.np-receipt__line { display: flex; justify-content: space-between; gap: var(--np-s2); }
.np-receipt__foot { text-align: center; padding-top: 10px; font-size: 10px; color: var(--np-mid); }
.np-receipt__cap { font-size: 11px; color: var(--np-dim); text-align: center; padding-top: var(--np-s2); }

.np-paid {
  position: absolute;
  inset: 0;
  background: var(--np-cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 30px;
  text-align: center;
  z-index: 40;
}
.np-paid__mark {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: var(--np-green-soft);
  color: var(--np-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.np-paid__title { font-family: var(--np-font-title); font-size: var(--np-fs-cart-total); }
.np-paid__meta { font-size: 15px; color: var(--np-mid); }

/* ==========================================================================
   9 · Avatars, login, PIN
   ========================================================================== */

.np-avatar {
  flex: none;
  width: 42px; height: 42px;
  border-radius: var(--np-r-card);
  background: var(--np-lav-soft);
  color: var(--np-lav-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  object-fit: cover;
}
.np-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.np-avatar--admin { background: var(--np-lav-soft); color: var(--np-lav-ink); }
.np-avatar--waiter { background: var(--np-waiter-soft); color: var(--np-waiter-ink); }
.np-avatar--vendor,
.np-avatar--user { background: var(--np-amber-soft); color: var(--np-amber-ink); }
.np-avatar--lg { width: 46px; height: 46px; border-radius: var(--np-r-panel); font-size: 15px; }
.np-avatar--card { width: 44px; height: 44px; }

.np-account {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  padding: 15px var(--np-s4);
  min-height: 72px;
  border: 1px solid var(--np-line-input);
  border-radius: var(--np-r-panel);
  background: var(--np-surface);
  text-align: start;
  box-shadow: var(--np-sh-card);
  width: 100%;
}
.np-account:hover { border-color: var(--np-muted-line); }
.np-account__name { font-size: var(--np-fs-product); font-weight: 600; }
.np-account__role { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--np-dim); font-weight: 700; }

.np-pin__dots { display: flex; gap: 9px; height: 20px; align-items: center; }
.np-pin__dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--np-muted-line-2);
}
.np-pin__dot.is-on { background: var(--np-ink); border-color: var(--np-ink); }
.np-pin__count { font-size: var(--np-fs-secondary); color: var(--np-mid); }
.np-pin__keys { display: grid; grid-template-columns: repeat(3, 84px); gap: 9px; }
.np-pin__key {
  height: 72px;
  min-height: 72px;
  border-radius: var(--np-r-btn);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  font-size: 24px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(22, 19, 15, 0.06);
}
.np-pin__key--alt { background: transparent; border-color: transparent; box-shadow: none; color: var(--np-mid); font-size: 13px; }
/* The field the "Code" key reveals, so a long code is visible while typed. */
.np-pin__typed {
  width: 267px;
  text-align: center;
  letter-spacing: 0.22em;
  font-size: 17px;
  font-weight: 600;
}
.np-pin__key.is-active { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }

.np-pin.is-error { animation: np-shake 0.4s; }
@keyframes np-shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* ==========================================================================
   10 · Settings, network, import preview, donut
   ========================================================================== */

.np-set-nav { display: flex; flex-direction: column; gap: var(--np-s1); }
.np-set-nav__item {
  display: flex;
  align-items: center;
  gap: var(--np-s2);
  width: 100%;
  min-height: var(--np-touch);
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--np-r-input);
  background: transparent;
  color: var(--np-ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: start;
}
.np-set-nav__item.is-on { background: var(--np-surface); border-color: var(--np-ink); }
.np-set-nav__hint { font-size: 11.5px; color: var(--np-dim); flex: none; }

.np-set-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px var(--np-s4);
  border-top: 1px solid var(--np-divider);
  min-height: calc(var(--np-touch) + 16px);
}
.np-set-row:first-child { border-top: 0; }
.np-set-row__labels { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.np-set-row__label { font-size: var(--np-fs-body); font-weight: 600; }
.np-set-row__hint { font-size: var(--np-fs-secondary); color: var(--np-mid); text-wrap: pretty; }
.np-set-row__control { flex: 0 1 auto; max-width: 52%; min-width: 0; display: flex; justify-content: flex-end; }
.np-set-row__control .np-input,
.np-set-row__control .np-select { min-width: 180px; }

/* On a phone a 52 %-wide control cannot hold an e-mail address: stack the
   label above a full-width control instead of squeezing both onto one line. */
@media (max-width: 599px) {
  .np-set-row { flex-direction: column; align-items: stretch; gap: var(--np-s2); }
  .np-set-row__control { max-width: none; justify-content: flex-start; }
  .np-set-row__control .np-input,
  .np-set-row__control .np-select,
  .np-set-row__control .np-textarea { min-width: 0; width: 100%; }
}

.np-savebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--np-s2);
  padding: 10px 14px;
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-line);
  background: var(--np-surface-alt);
}
.np-savebar__hint { flex: 1; min-width: 140px; font-size: var(--np-fs-secondary); color: var(--np-mid); }
.np-savebar.is-dirty .np-savebar__hint { color: var(--np-amber-ink); font-weight: 600; }
.np-savebar.is-saved .np-savebar__hint { color: var(--np-green); font-weight: 600; }

.np-net-banner {
  display: flex;
  flex-direction: column;
  gap: var(--np-s2);
  align-items: flex-start;
  padding: var(--np-s4);
  border-radius: var(--np-r-panel);
  background: var(--np-green-soft);
  color: var(--np-green);
}
.np-net-banner--warn { background: var(--np-amber-soft); color: var(--np-amber-ink); }
.np-net-banner--remote { background: var(--np-lav-soft); color: var(--np-lav-ink); }
.np-net-banner__title { font-size: var(--np-fs-body); font-weight: 700; }
.np-net-banner__body { font-size: 13px; text-wrap: pretty; }

.np-qr-card {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: var(--np-s2);
  padding: var(--np-s4);
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-panel);
  background: var(--np-surface);
}
.np-qr-card__addr { font-size: 15px; font-weight: 700; font-family: var(--np-font-mono); text-wrap: pretty; word-break: break-all; }
.np-qr-card__img { width: 62px; height: 62px; flex: none; border-radius: var(--np-r-xs); border: 1px solid var(--np-line-input); background: #fff; }
.np-qr-card__img--lg { width: 128px; height: 128px; border-radius: var(--np-r-btn); }

.np-preview__head,
.np-preview__row { display: flex; gap: var(--np-s3); padding: 12px var(--np-s4); border-top: 1px solid var(--np-divider); }
.np-preview__head { background: var(--np-surface-alt); padding: 10px var(--np-s4); }
.np-preview__cell { flex: 1; min-width: 0; font-size: 13.5px; }
.np-preview__cell--add { font-weight: 700; color: var(--np-green); }
.np-preview__cell--arch { font-weight: 700; color: var(--np-amber-ink); }
.np-preview__cell--zero { font-weight: 700; color: var(--np-mid); }

.np-donut {
  width: 150px; height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--np-soft);
}
.np-donut__hole {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--np-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.np-donut__num { font-size: var(--np-fs-sheet-title); font-weight: 700; font-variant-numeric: tabular-nums; }
.np-donut__cap { font-size: 10.5px; color: var(--np-dim); }
.np-legend__row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.np-legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: var(--np-zone, var(--np-line)); }

.np-bar { width: 74px; height: 8px; border-radius: var(--np-r-pill); background: var(--np-soft); overflow: hidden; flex: none; }
.np-bar__fill { display: block; height: 100%; background: var(--np-ink); }

/* --- Réglages › Sauvegardes (backup.js, SPEC-BACKUP §5) ------------------- */

/* A state between "tout va bien" and "c'est cassé": the amber of --togo, for
   a backup that exists but has not been verified, or a folder we cannot use. */
.np-badge--warn { background: var(--np-amber-soft); color: var(--np-amber-ink); }
/* Two of these badges carry a whole sentence ("créée par une version plus
   récente…"): they are the only ones allowed to wrap. */
.np-badge--wrap { white-space: normal; text-align: start; line-height: 1.35; }

/* Status card: the facts on one side, the one action on the other. */
.np-bak-status {
  display: flex;
  align-items: flex-start;
  gap: var(--np-s4);
}
.np-bak-status__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--np-s2); }
.np-bak-status__cta { flex: none; }
.np-bak-status__when {
  font-family: var(--np-font-title);
  font-size: 22px;
  line-height: 1.15;
}
@media (max-width: 899px) {
  .np-bak-status { flex-direction: column; }
  .np-bak-status__cta { width: 100%; }
  .np-bak-status__cta .np-btn { display: flex; width: 100%; }
}

/* Where a bundle landed: one small chip per destination. */
.np-bak-locs { display: flex; flex-wrap: wrap; gap: 6px; }
.np-bak-loc { gap: 5px; }

/* Destination rows need more room than a 52 % control column gives. */
.np-set-row.np-bak-row .np-set-row__control { flex: 1 1 auto; max-width: 62%; }
.np-bak-destctl { width: 100%; min-width: 220px; }
@media (max-width: 599px) {
  .np-set-row.np-bak-row .np-set-row__control { max-width: none; }
}

.np-bak-usb {
  display: flex;
  flex-direction: column;
  gap: var(--np-s2);
  padding: 0 var(--np-s4) 14px;
}
.np-bak-drive {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  min-height: var(--np-touch);
  padding: 8px 12px;
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-line);
  background: var(--np-surface-alt);
  font-size: 13.5px;
}

/* Seven columns and four actions: the shared 176 px action slot is too small. */
.np-bak-table .np-table__actions,
.np-bak-table .np-bak-acts { min-width: 300px; flex-wrap: wrap; }
.np-bak-cell--state { flex: 0 0 132px; white-space: normal; }

/* Collapsible groups: hourly snapshots, old .sqlite copies, history. */
.np-bak-group > summary {
  display: flex;
  align-items: center;
  gap: var(--np-s2);
  min-height: var(--np-touch);
  cursor: pointer;
  font-size: var(--np-fs-body);
  font-weight: 700;
}
.np-bak-group > summary::marker { color: var(--np-dim); }
.np-bak-group__body { display: flex; flex-direction: column; gap: var(--np-s2); padding-block-start: var(--np-s3); }

/* Verification report: one line per check, with its mark. */
.np-bak-checks { display: flex; flex-direction: column; gap: 6px; }
.np-bak-check {
  display: flex;
  align-items: center;
  gap: var(--np-s2);
  padding: 9px 12px;
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-line);
  background: var(--np-surface);
  font-size: 13.5px;
}
.np-bak-check__mark {
  width: 20px; height: 20px; flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--np-r-badge);
  background: var(--np-soft);
  color: var(--np-dim);
  font-weight: 700;
}
.np-bak-check.is-ok .np-bak-check__mark { background: var(--np-green-soft); color: var(--np-green); }
.np-bak-check.is-ko .np-bak-check__mark { background: var(--np-red-soft); color: var(--np-red); }
.np-bak-check.is-ko { border-color: var(--np-red-line); }

/* "Sauvegarde du 04/09 14:00" against "maintenant", side by side. */
.np-bak-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--np-s3); }
.np-bak-cmp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--np-s3);
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-panel);
  background: var(--np-surface-alt);
  min-width: 0;
}
.np-bak-cmp__line { font-size: var(--np-fs-body); font-weight: 600; text-wrap: pretty; }
@media (max-width: 599px) {
  .np-bak-compare { grid-template-columns: minmax(0, 1fr); }
}

/* Journal rows. */
.np-bak-ev {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--np-s2);
  padding: 8px 10px;
  border-block-end: 1px solid var(--np-divider);
  font-size: 13px;
}
.np-bak-ev__at { flex: 0 0 96px; color: var(--np-dim); font-variant-numeric: tabular-nums; }
.np-bak-ev__kind { flex: 0 0 120px; font-weight: 600; }

/* The application-folder path is one long LTR string with no break
   opportunity. As an INLINE box its .np-truncate overflow was inert, so its
   min-content width — the whole "C:\…\data\backups" — became the min-content
   width of #np-set-body, which is shrink-to-fit (.np-settings is
   align-items:flex-start): a 390 px phone laid the section out 446 px wide and
   pushed "Sauvegarder maintenant", Enregistrer and the row actions off screen.
   Blockify it and take it out of intrinsic sizing so the truncation truncates:
   the section is then 358 px, and on PC the path still shows in full. */
.np-bak-destctl > .np-truncate {
  display: block;
  min-inline-size: 0;
  contain: inline-size;
}

/* The same slot carries a whole sentence for this section ("Aucune sauvegarde
   pour l'instant") and a count for the others. It was flex:none inside a
   240 px button, so it ate the section label. The label is what the operator
   navigates by: it keeps its width, the hint gives way and ellipsizes. */
.np-set-nav__item > .np-grow {
  flex: 1 1 auto;
  min-inline-size: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The 200 is a priority, not a ratio: the hint gives up every pixel of the
   deficit before the label gives up one. When even an empty hint is not
   enough (a translation nobody has written yet) the label ellipsizes rather
   than spilling out of the button. */
.np-set-nav__hint {
  flex: 0 200 auto;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Réglages › Mise à jour (settings.js, SPEC-UPDATES §7) ---------------- */

/* .np-bar is a 74 px inline gauge (`flex: none`) built for a table cell; the
   upload card needs the full width of the section (§7.6). analytics.css and
   inventory.css widen it the same way for their own screens — Réglages has no
   stylesheet of its own, so the modifier lives here. */
.np-upd-bar { inline-size: 100%; block-size: 10px; }

/* The updater's log is one long LTR block of French progress lines. It scrolls
   inside the sheet body and never grows the page (hard rule 8). */
.np-upd-log {
  max-block-size: 46vh;
  overflow: auto;
  font-size: 12.5px;
  line-height: 1.5;
}

/* Release notes are authored as several lines in manifest.json (§1.3). They
   are the vendor's own paragraph breaks, and the only place in the app where a
   text node must keep them; `pre-line` wraps normally and honours \n. Static,
   so it belongs in a class rather than in a style attribute (D-05). */
.np-upd-notes { white-space: pre-line; text-wrap: pretty; }

/* The 96 px label column of .np-stack__pair is sized for the narrow stack cards
   of the list sections. These two cards are the full width of the section and
   their labels are the longest in the app — « Base de données », « Lecture des
   fichiers ZIP », « قراءة ملفات ZIP » — so every one of them wrapped onto two
   lines while a third of the card stayed empty. Widened only where there is
   room: below 600 px the pairs are back to the shared column, which is what the
   phone screenshots want. `flex-basis` is writing-mode agnostic, so RTL needs
   nothing extra. */
@media (min-width: 600px) {
  .np-upd-pairs .np-stack__label { flex-basis: 168px; }
}

/* The restore is the one action worth a caption on the busy overlay. */
.np-bak-busytext {
  margin-block-start: var(--np-s3);
  padding: 8px 14px;
  border-radius: var(--np-r-pill);
  background: var(--np-ink);
  color: var(--np-cream);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  max-width: 320px;
}

/* ==========================================================================
   11 · Wizard
   ========================================================================== */

.np-steps { display: flex; align-items: center; gap: 6px; }
.np-steps__pill {
  flex: 1;
  min-height: var(--np-touch);
  border-radius: var(--np-r-btn);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  color: var(--np-dim);
  font-size: 13px;
  font-weight: 600;
}
.np-steps__pill.is-done { background: var(--np-lav-soft); color: var(--np-lav-ink); }
.np-steps__pill.is-on { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }

/* ==========================================================================
   12 · Virtual keyboard (setting `virtual_keyboard`)
   ========================================================================== */

.np-keyboard {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 80;
  background: var(--np-surface);
  border-top: 1px solid var(--np-line);
  box-shadow: 0 -12px 34px rgba(22, 19, 15, 0.18);
  padding: 10px 12px 14px;
  display: none;
}
.np-keyboard.is-open { display: block; }
.np-keyboard__head {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  padding-bottom: var(--np-s2);
}
.np-keyboard__title { flex: 1; min-width: 0; font-size: var(--np-fs-secondary); color: var(--np-mid); }
.np-keyboard__langs { display: flex; gap: var(--np-s1); }
.np-keyboard__lang {
  /* EN / AR / FR were 34 px — under the 40 px counter minimum, on a control
     that only ever exists on a touch screen (F007). */
  min-height: var(--np-touch);
  min-width: var(--np-touch);
  padding: 6px 12px;
  border-radius: var(--np-r-pill);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  font-size: 12.5px;
  font-weight: 600;
}
.np-keyboard__lang.is-on { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }
.np-keyboard__rows { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.np-keyboard__row { display: flex; gap: 6px; justify-content: center; }
.np-keyboard__key {
  min-height: 46px;
  min-width: 46px;
  flex: 0 1 auto;
  padding: 8px 10px;
  border-radius: var(--np-r-btn);
  border: 1px solid var(--np-line-input);
  background: var(--np-surface);
  color: var(--np-ink);
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--np-sh-card);
}
.np-keyboard__key:active,
.np-keyboard__key.is-down { background: var(--np-soft); transform: translateY(1px); }
.np-keyboard__key--wide { min-width: 84px; }
.np-keyboard__key--xwide { min-width: 120px; }
.np-keyboard__key--space { min-width: 220px; flex: 1 1 220px; max-width: 420px; }
.np-keyboard__key--fn { background: var(--np-soft); color: var(--np-mid); }
.np-keyboard__key--on { background: var(--np-ink); color: var(--np-cream); border-color: var(--np-ink); }
@media (max-width: 599px) {
  .np-keyboard__key { min-height: 40px; min-width: 30px; font-size: 13px; padding: 6px 4px; }
  .np-keyboard__key--space { min-width: 120px; flex: 1 1 120px; }
  .np-keyboard__key--wide { min-width: 52px; }
  .np-keyboard__key--xwide { min-width: 64px; }
}

.np-wizard__title { font-family: var(--np-font-title); font-size: var(--np-fs-cart-total); }
.np-wizard__field {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  min-height: calc(var(--np-touch) + 14px);
  padding: 13px 15px;
  border: 1px solid var(--np-line);
  border-radius: var(--np-r-line);
  background: var(--np-surface);
}
.np-wizard__field .np-input { max-width: 56%; text-align: end; border: 0; background: transparent; min-height: 0; padding: 0; font-weight: 600; }

/* --- fatal panel ---------------------------------------------------------
   Shown when the page loaded without its runtime (a skipped script tag). It
   must not depend on anything that may itself be missing: fixed position,
   own colours, one button. */
.np-fatal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(247, 241, 232, 0.94);
}
.np-fatal__card {
  max-inline-size: 380px;
  padding: 24px;
  text-align: center;
  background: var(--np-surface, #FFFDF9);
  border: 1px solid var(--np-muted-line-2, #E4DCCE);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(58, 52, 43, 0.14);
}
.np-fatal__msg {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--np-ink, #3A342B);
}

/* ==========================================================================
   Table service — covers, and moving an order between tables
   ========================================================================== */

/* the action row above the room: what can be done to the order already open */
.np-tableacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  margin-block-end: 4px;
  background: var(--np-surface-2);
  border: 1px solid var(--np-muted-line-2);
  border-radius: 12px;
}
.np-tableacts__cur { flex: 1 1 auto; min-inline-size: 0; font-size: 14px; color: var(--np-ink); }

/* the destination-picker banner: the grid means something different now */
.np-movebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  color: var(--np-lav-strong);
  background: rgba(110, 94, 198, 0.10);
  border: 1px solid rgba(110, 94, 198, 0.30);
  border-radius: 12px;
}
.np-movebar__txt { flex: 1 1 auto; font-size: 14px; }

/* a tile that cannot be chosen in the current mode: visible, but plainly out */
.np-tile.is-disabled {
  cursor: not-allowed;
  opacity: 0.38;
  filter: grayscale(0.6);
}
.np-tile.is-disabled:hover { transform: none; }

/* more people than seats — legitimate, and worth seeing */
.np-tile { position: relative; }
.np-tile.is-over { box-shadow: inset 0 0 0 2px var(--np-amber, #E08A24); }
.np-tile__over {
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 5px;
  padding: 0 5px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 16px;
  color: #FFFDF9;
  /* #FFFDF9 on --np-amber (#B5791A) measures 3.62:1 at 10.5 px bold — under
     the 4.5:1 the tokens adopt (F008). --np-amber-badge-text (#8A5A12) is the
     same hue picked in D-24 precisely for white text on it: 5.82:1. The tile's
     own `is-over` outline keeps --np-amber, which carries no text. */
  background: var(--np-amber-badge-text);
  border-radius: var(--np-r-pill);
}

/* The POS sheet variant is full-width; this question is not. Keep the whole
   thing in one readable column so the quick picks stay thumb-sized rather than
   stretching to 250px each. */
.np-covers-pane {
  inline-size: 100%;
  max-inline-size: 440px;
  margin-inline: auto;
  padding-block-start: 8px;
  text-align: center;
}

/* the covers stepper */
.np-covers {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}
.np-covers__step {
  inline-size: 56px;
  block-size: 56px;
  font-size: 26px;
  font-weight: 700;
  color: var(--np-ink);
  cursor: pointer;
  background: var(--np-surface-2);
  border: 1px solid var(--np-muted-line-2);
  border-radius: 16px;
}
.np-covers__step:hover { background: var(--np-surface); }
.np-covers__val {
  min-inline-size: 92px;
  font-size: 46px;
  font-weight: 700;
  color: var(--np-ink);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.np-covers__val.is-over { color: var(--np-amber-badge-text); }
.np-covers__quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.np-warnline { color: var(--np-amber-badge-text); font-weight: 600; }

@media (max-width: 560px) {
  .np-covers__step { inline-size: 48px; block-size: 48px; }
  .np-covers__val { font-size: 38px; min-inline-size: 74px; }
}

/* the chosen headcount, so a correct no-op does not look like a dead button */
.np-covers__quick .np-preset.is-active {
  color: var(--np-surface);
  background: var(--np-ink);
  border-color: var(--np-ink);
}

/* --- live tables ---------------------------------------------------------
   A busy tile carries four lines instead of two: the clock, the running
   total, who has it, and what the kitchen still owes. Everything here is
   additive to .np-tile above — a free tile is untouched. */
.np-tile.is-busy { min-height: 96px; gap: 4px; }
.np-tile__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--np-s2);
  width: 100%;
  min-width: 0;
}
/* Tabular figures so the seconds do not shove the layout every tick. */
.np-tile__time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--np-soft);
  color: var(--np-mid);
  flex: none;
}
.np-tile.is-warn  .np-tile__time { background: var(--np-amber-soft); color: var(--np-amber-ink); }
.np-tile.is-alert .np-tile__time { background: var(--np-red-soft);   color: var(--np-red); }
.np-tile.is-current .np-tile__time { background: rgba(255, 255, 255, .14); color: var(--np-cream); }
.np-tile__total { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.np-tile__state { display: flex; align-items: center; gap: var(--np-s2); flex-wrap: wrap; width: 100%; min-width: 0; }
/* A 116 px tile is narrower than "1 à envoyer" in some translations: the badge
   gives way with an ellipsis instead of spilling out of the tile.
   `display` is the load-bearing line — text-overflow is inert on a flex
   container, so the inherited .np-badge inline-flex hard-cut the Arabic
   "1 قيد الإرسال" mid-word with no ellipsis to say that it had. */
.np-tile__state .np-badge {
  display: block;
  max-inline-size: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.np-tile__last { font-size: 11px; color: var(--np-dim); margin-inline-start: auto; }
.np-tile.is-busy .np-tile__meta { font-weight: 600; }
.np-tile.is-current .np-tile__last { color: var(--np-onink-2); }

.np-livefilters { margin-block: -4px 0; }

/* "The feed is alive" is a one-word answer, so it is one dot. It stops
   pulsing and greys out the moment the last good answer is older than three
   poll intervals — the tiles then hold their last known state and the timers
   keep counting, which is the truth: the room did not stop, we did. */
.np-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--np-green);
  margin-inline-start: 6px;
  vertical-align: middle;
  animation: np-live-pulse 2s ease-in-out infinite;
}
.np-live-dot.is-stale { background: var(--np-dim); animation: none; }
@keyframes np-live-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
@media (prefers-reduced-motion: reduce) { .np-live-dot { animation: none; } }

.np-tablechip__badge {
  position: absolute;
  inset-block-start: -4px;
  inset-inline-end: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  /* --np-amber under white is 3.67:1 at 11px/700 — under the 4.5:1 this
     project holds itself to (D-24 made the same correction for the vendor and
     to-go badges). The next shade down in the same family, --np-amber-ink,
     reads 5.91:1 and the hue does not change. */
  background: var(--np-amber-ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
/* layout.css positions the chip but clips it; the attribute raises the
   specificity above that later rule without touching a file this feature does
   not own. The label keeps its own ellipsis, so nothing spills. */
.np-tablechip[data-np-open-tables] { position: relative; overflow: visible; }
.np-tablechip[data-np-open-tables] .np-tablechip__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 599px) {
  .np-tile__last { display: none; }
  .np-tile.is-busy { min-height: 88px; }
}

/* ---------------------------------------------------------------------------
   Focus rings that were losing the cascade (AUDIT F038 / W22).

   base.css declares `:focus-visible { box-shadow: var(--np-sh-focus) }` at
   specificity (0,1,0). Every component below sets its own `box-shadow` in a
   LATER file at the SAME specificity, so the ring lost on source order and a
   keyboard user got no cue at all on the login accounts, the quantity steppers
   and the selected segment of a segmented control. Composing the ring WITH the
   component's own shadow keeps both — and never needs !important.
   --------------------------------------------------------------------------- */
.np-account:focus-visible      { box-shadow: var(--np-sh-focus), var(--np-sh-card); }
.np-stepper__btn:focus-visible { box-shadow: var(--np-sh-focus), var(--np-sh-btn); }
.np-seg__tab.is-on:focus-visible { box-shadow: var(--np-sh-focus), var(--np-sh-seg); }
