/* ==========================================================================
   cash.css — the drawer (SPEC-V23 §2): the POS sheet, the top-bar chip and
   Recettes › Clôtures. Tokens only; logical properties only (RTL); every
   target at least --np-touch.
   ========================================================================== */

/* --- the top-bar chip ---------------------------------------------------- */
.np-cashchip {
  display: inline-flex;
  align-items: center;
  gap: var(--np-s2);
  min-height: 40px;
  margin-inline-start: var(--np-s2);
  padding: 6px 12px;
  border-radius: var(--np-r-pill);
  border: 1px solid var(--np-onbar-border);
  background: var(--np-onbar-fill-soft);
  color: var(--np-bar-ink);
  font-size: var(--np-fs-secondary);
  font-weight: 700;
  white-space: nowrap;
}
.np-cashchip .np-ico { width: 18px; height: 18px; }
.np-cashchip__dot {
  width: 9px; height: 9px; flex: none;
  border-radius: 50%;
  background: var(--np-red);
  box-shadow: 0 0 0 3px var(--np-onbar-fill-soft);
}
.np-cashchip.is-open .np-cashchip__dot { background: var(--np-green); }
.np-cashchip__label { font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; }
@media (max-width: 1279px) { .np-cashchip { min-height: 48px; } }
@media (max-width: 700px) { .np-cashchip__label { display: none; } }

/* --- the sheet ------------------------------------------------------------ */
.np-cash { display: flex; flex-direction: column; gap: var(--np-s4); }

.np-cash__state {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  padding: var(--np-s3) var(--np-s4);
  border-radius: var(--np-r-card);
  background: var(--np-soft);
}
.np-cash__state.is-open { background: var(--np-green-soft); }
.np-cash__state.is-closed { background: var(--np-red-soft); }
.np-cash__dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--np-red); }
.np-cash__state.is-open .np-cash__dot { background: var(--np-green); }

.np-cash__kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--np-s2); }
.np-cash__kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--np-s3);
  border-radius: var(--np-r-card);
  background: var(--np-surface);
  border: 1px solid var(--np-line);
}
.np-cash__kpi.is-strong { border-color: var(--np-ink); }
.np-cash__kpinum { font-size: 20px; font-weight: 700; }
.np-cash__kpi.is-over .np-cash__kpinum { color: var(--np-green); }
.np-cash__kpi.is-short .np-cash__kpinum { color: var(--np-red); }

.np-cash__pair { display: flex; justify-content: space-between; align-items: baseline; gap: var(--np-s3); }
.np-cash__pair.is-dim { color: var(--np-mid); }
.np-cash__pair.is-strong { font-weight: 700; font-size: 16px; }

.np-cash__actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--np-s2); }
.np-cash__actions .np-btn, .np-cash .np-btn--block { justify-content: center; gap: var(--np-s2); }

/* --- the count ------------------------------------------------------------ */
.np-cash__grid { display: flex; flex-direction: column; gap: 6px; }
.np-cash__denom {
  display: grid;
  grid-template-columns: minmax(58px, 1fr) auto minmax(64px, auto);
  align-items: center;
  gap: var(--np-s2);
  padding: 6px var(--np-s2);
  border-radius: var(--np-r-input);
  background: var(--np-surface);
  border: 1px solid var(--np-line);
}
.np-cash__face { display: flex; flex-direction: column; line-height: 1.15; }
.np-cash__facenum { font-size: 18px; font-weight: 700; }
.np-cash__facekind { font-size: 11px; color: var(--np-mid); text-transform: uppercase; letter-spacing: 0.06em; }
.np-cash__denom[data-kind="note"] .np-cash__face { padding-inline-start: 10px; border-inline-start: 4px solid var(--np-lav); }
.np-cash__denom[data-kind="coin"] .np-cash__face { padding-inline-start: 10px; border-inline-start: 4px solid var(--np-amber); }
.np-cash__denom .np-stepper__btn { width: var(--np-touch); height: var(--np-touch); }
.np-cash__n {
  width: 58px;
  min-height: calc(var(--np-touch) + 4px);
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.np-cash__sub { text-align: end; color: var(--np-mid); font-weight: 600; font-size: 13px; white-space: nowrap; }

.np-cash__totalbar {
  position: sticky;
  inset-block-end: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--np-s3);
  flex-wrap: wrap;
  padding: var(--np-s3) var(--np-s4);
  border-radius: var(--np-r-card);
  background: var(--np-ink);
  color: var(--np-cream);
}
.np-cash__totalbar .np-eyebrow, .np-cash__totalbar .np-secondary { color: var(--np-onink-2); }
.np-cash__total { font-size: 28px; font-weight: 800; }
.np-cash__cmp { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

.np-cash__var { font-weight: 800; font-variant-numeric: tabular-nums; }
.np-cash__var.is-zero { color: var(--np-green); }
.np-cash__var.is-near { color: var(--np-amber); }
.np-cash__var.is-over { color: var(--np-green); }
.np-cash__var.is-short { color: var(--np-red); }
.np-cash__totalbar .np-cash__var.is-zero,
.np-cash__totalbar .np-cash__var.is-over { color: var(--np-green-soft); }
.np-cash__totalbar .np-cash__var.is-short { color: var(--np-red-soft); }
.np-cash__totalbar .np-cash__var.is-near { color: var(--np-amber-soft); }

/* --- the verdict ---------------------------------------------------------- */
.np-cash__verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--np-s4);
  border-radius: var(--np-r-card);
  background: var(--np-soft);
  text-align: center;
}
.np-cash__verdict.is-zero, .np-cash__verdict.is-over { background: var(--np-green-soft); }
.np-cash__verdict.is-near { background: var(--np-amber-soft); }
.np-cash__verdict.is-short { background: var(--np-red-soft); }
.np-cash__verdictnum { font-size: 34px; font-weight: 800; }
.np-cash__verdict.is-short .np-cash__verdictnum { color: var(--np-red); }
.np-cash__verdict.is-zero .np-cash__verdictnum, .np-cash__verdict.is-over .np-cash__verdictnum { color: var(--np-green); }
.np-cash__verdictword { font-weight: 700; }

/* --- Recettes › Clôtures --------------------------------------------------- */
.np-cash-hist { display: flex; flex-direction: column; gap: var(--np-s4); }
.np-cash-hist__kpis > .np-cash__kpi { min-width: 150px; }
.np-cash-hist__table { overflow: auto; padding: 0; }
.np-cash-hist__row {
  display: grid;
  grid-template-columns: 48px 1.1fr 1.1fr 1fr 1fr 1fr 1fr 1fr;
  align-items: center;
  gap: var(--np-s2);
  width: 100%;
  min-width: 760px;
  min-height: var(--np-touch);
  padding: 8px var(--np-s4);
  border-top: 1px solid var(--np-line);
  background: transparent;
  text-align: start;
  color: var(--np-ink);
}
.np-cash-hist__row.is-head { border-top: 0; font-size: var(--np-fs-secondary); color: var(--np-mid); font-weight: 700; min-height: 0; }
button.np-cash-hist__row:hover { background: var(--np-soft-hover); }
.np-cash-hist__row .np-num { text-align: end; }

.np-cash-detail { display: flex; flex-direction: column; gap: var(--np-s4); }
.np-cash-detail__paper { align-items: center; }
.np-cash-cmp { display: flex; flex-direction: column; border: 1px solid var(--np-line); border-radius: var(--np-r-card); overflow: hidden; }
.np-cash-cmp__row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--np-s2); padding: 7px var(--np-s3); border-top: 1px solid var(--np-line); }
.np-cash-cmp__row:first-child { border-top: 0; }
.np-cash-cmp__row.is-head { background: var(--np-soft); font-weight: 700; font-size: var(--np-fs-secondary); }
.np-cash-cmp__row .np-num { text-align: end; }

@media print {
  .np-cashchip { display: none !important; }
}

/* --- the POS service gate (SPEC-V23 §2.7) --------------------------------- */
.np-service-gate {
  display: flex;
  align-items: center;
  gap: var(--np-s3);
  margin: 0 0 var(--np-s2);
  padding: 10px var(--np-s4);
  border-radius: var(--np-r-card);
  background: var(--np-amber-soft);
  border: 1px solid var(--np-amber-line);
  color: var(--np-amber-banner-ink);
}
.np-service-gate .np-ico { width: 22px; height: 22px; flex: none; }
.np-page--pos.is-service-closed .np-grid { opacity: 0.45; }

/* --- several drawers (v8) ------------------------------------------------- */
.np-cash__drawerbar { display: flex; align-items: center; gap: var(--np-s2); flex-wrap: wrap; }
.np-cash__others { display: flex; flex-wrap: wrap; gap: var(--np-s2) var(--np-s4); font-size: var(--np-fs-secondary); color: var(--np-mid); }
.np-cash__other { display: inline-flex; align-items: center; gap: 6px; }
.np-cash__other .np-cash__dot, .np-cash__pick .np-cash__dot { width: 9px; height: 9px; }
.np-cash__dot.is-open { background: var(--np-green); }
.np-cash__pick { justify-content: flex-start; gap: var(--np-s3); text-align: start; }
.np-cash__pick.is-on { border-color: var(--np-ink); }

/* --- tenders and the journal ---------------------------------------------- */
.np-cash-tender--cash { background: var(--np-green-soft); color: var(--np-green); }   /* = .np-badge--ok, audited */
.np-cash-tender--card { background: var(--np-lav-soft); color: var(--np-lav-ink); }
.np-cash-tender--account { background: var(--np-amber-soft); color: var(--np-amber-badge-text); }
.np-cash__ev--void { color: var(--np-red); font-weight: 600; }
.np-cash__ev--open, .np-cash__ev--close { font-weight: 700; }
