/* Demande de payout : imprimante en verre + facture de versement qui sort ligne par ligne.
   Le papier reste blanc dans les deux thèmes (c'est un ticket) ; le reste suit les jetons du dashboard. */
.np-rc {
  --paper-ink: #0b1222;
  --paper-ink-2: #3c4658;
  --paper-muted: #8a93a6;
  --paper-accent: #2f55ef;
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; overflow-y: auto; padding: 40px 16px;
}
.np-rc__scrim {
  position: fixed; inset: 0; background: rgba(8, 12, 22, 0.4);
  backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%);
  animation: rc-fade 260ms var(--ease) both;
}
:root[data-theme="dark"] .np-rc__scrim { background: rgba(0, 0, 0, 0.58); }
.np-rc__stage { position: relative; display: flex; flex-direction: column; align-items: center; width: min(400px, 100%); animation: rc-rise 420ms var(--ease) both; }
.np-rc__x { position: absolute; top: -46px; right: 0; background: var(--card); border-color: var(--line-strong); color: var(--ink-2); }

/* ---------- Imprimante ---------- */
.np-rc__printer {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; width: 100%; height: 60px; padding: 0 20px 18px;
  border-radius: 18px; background: linear-gradient(180deg, var(--card-hover), var(--card));
  border: 1px solid var(--line-strong); border-top-color: var(--edge-top, rgba(255, 255, 255, 0.9));
  box-shadow: var(--highlight), 0 22px 44px -20px rgba(8, 12, 22, 0.55);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.np-rc__led { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 12px var(--accent); }
.np-rc__status { color: var(--muted); font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.01em; }
.np-rc__slot {
  position: absolute; left: 24px; right: 24px; bottom: 13px; height: 7px; border-radius: 4px;
  background: linear-gradient(180deg, #05070c, #1a2030); box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.5);
}
.np-rc.is-printing .np-rc__led { animation: rc-blink 520ms ease-in-out infinite alternate; }
.np-rc.is-torn .np-rc__led { background: var(--live); box-shadow: 0 0 0 3px var(--ok-soft), 0 0 12px var(--live); }
.np-rc.is-torn .np-rc__status { color: var(--ok); }

/* ---------- Feuille ---------- */
.np-rc__sheet {
  position: relative; z-index: 1; width: calc(100% - 64px); margin-top: -20px; transform-origin: 50% 0;
  filter: drop-shadow(0 20px 28px rgba(8, 12, 22, 0.28)) drop-shadow(0 2px 4px rgba(8, 12, 22, 0.14));
}
.np-rc__paper {
  position: relative; padding: 14px 0 24px; background: #fff; color: var(--paper-ink-2); font-size: 13px; line-height: 1.45;
  /* Bords déchirés en zigzag, en haut et en bas. */
  -webkit-mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 12px 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 12px 51% repeat-x;
  mask:
    conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 12px 51% repeat-x,
    conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / 12px 51% repeat-x;
}
/* Avant l'impression, la feuille est encore dans l'imprimante. */
.np-rc:not(.is-printing):not(.is-torn) .np-rc__paper { clip-path: inset(0 0 100% 0); }
/* Ombre de la fente sur le haut du papier. */
.np-rc__paper::before { content: ""; position: absolute; inset: 0 0 auto; height: 16px; background: linear-gradient(180deg, rgba(8, 12, 22, 0.14), transparent); pointer-events: none; }

/* Bandeau graphite (comme la tuile de l'icône) : lockup Carbone figé, type de document dessous, aligné sur le nom. */
.np-rc__band {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; margin: 6px 14px 0;
  padding: 13px 14px 12px; border-radius: 10px; background: linear-gradient(135deg, #2a2e36 0%, #111318 100%); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.np-rc__band::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.1) 46%, transparent 56%, transparent 66%, rgba(255, 255, 255, 0.06) 72%, transparent 80%); }
/* Retrait = marque (0,98em) + écart (0,42em) du lockup sm de 17 px : le libellé part sous le C du nom. */
.np-rc__kind { padding-left: 24px; color: #c9ced8; font-size: var(--t-2xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

.np-rc__body { padding: 16px 22px 0; }
.np-rc__meta { display: grid; gap: 5px; margin: 0; }
.np-rc__meta div { display: flex; justify-content: space-between; gap: 12px; }
.np-rc__meta dt { color: var(--paper-muted); font-size: var(--t-2xs); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.np-rc__meta dd { margin: 0; color: var(--paper-ink); font-weight: 600; text-align: right; }
.np-rc__mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; letter-spacing: 0.02em; }
.np-rc__dots { height: 2px; margin: 14px 0; border: 0; background: radial-gradient(circle, #c5cad6 1px, transparent 1.4px) 0 50% / 7px 2px repeat-x; }
.np-rc__line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.np-rc__line strong { color: var(--paper-ink); font-weight: 600; }
.np-rc__line--fee strong { color: #c42d48; }
.np-rc__total { padding: 14px 12px; border-radius: 12px; background: #f1f5ff; text-align: center; }
.np-rc__total span { display: block; color: var(--paper-accent); font-size: var(--t-2xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.np-rc__total strong { display: block; margin-top: 2px; color: var(--paper-ink); font-size: 30px; font-weight: 750; line-height: 1.15; letter-spacing: -0.03em; }
.np-rc__eta { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 10px 0 0; color: var(--paper-ink-2); font-size: 12.5px; font-weight: 500; }
.np-rc__eta svg { width: 13px; height: 13px; color: var(--paper-accent); }
.np-rc__foot { margin: 0; color: var(--paper-muted); font-size: 11.5px; text-align: center; }
.np-rc__barcode {
  height: 34px; margin: 14px 8px 0; opacity: 0.85; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--paper-ink) 0 2px, transparent 2px 4px, var(--paper-ink) 4px 5px, transparent 5px 8px, var(--paper-ink) 8px 11px, transparent 11px 12px, var(--paper-ink) 12px 13px, transparent 13px 17px);
}

.np-rc__stamp {
  position: absolute; right: 16px; bottom: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 2.5px solid var(--paper-accent); border-radius: 10px; color: var(--paper-accent); background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9);
  font-size: 15px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  opacity: 0; transform: rotate(-12deg) scale(1.7); pointer-events: none;
}
.np-rc__stamp svg { width: 16px; height: 16px; stroke-width: 3; }

/* ---------- Détachement + tampon + confirmation ---------- */
.np-rc.is-torn .np-rc__sheet { animation: rc-tear 760ms var(--ease) forwards; }
.np-rc.is-torn .np-rc__stamp { animation: rc-stamp 460ms cubic-bezier(0.2, 1.5, 0.4, 1) 720ms forwards; }
.np-rc__done {
  width: 100%; margin-top: 34px; padding: 16px 18px 18px; border-radius: 16px; text-align: center;
  background: var(--card); border: 1px solid var(--line-strong); box-shadow: var(--highlight), var(--shadow-card);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity 360ms var(--ease) 1000ms, transform 360ms var(--ease) 1000ms, visibility 0s linear 1000ms;
}
.np-rc.is-torn .np-rc__done { opacity: 1; visibility: visible; transform: none; }
.np-rc__done h2 { margin: 0; color: var(--ink); font-size: var(--t-lg); font-weight: 650; letter-spacing: -0.01em; }
.np-rc__done p { margin: 4px 0 14px; color: var(--muted); font-size: var(--t-sm); }
.np-rc__done .btn { width: 100%; justify-content: center; }

.np-rc.is-leaving .np-rc__stage { opacity: 0; transform: scale(0.98); transition: opacity 200ms ease-in, transform 200ms ease-in; }
.np-rc.is-leaving .np-rc__scrim { opacity: 0; transition: opacity 200ms ease-in; }

@keyframes rc-fade { from { opacity: 0; } }
@keyframes rc-rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes rc-blink { to { opacity: 0.35; } }
@keyframes rc-tear {
  0% { transform: none; }
  22% { transform: translateY(-4px) rotate(0.8deg); }
  100% { transform: translateY(18px) rotate(-1.8deg); }
}
@keyframes rc-stamp { to { opacity: 1; transform: rotate(-12deg) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .np-rc *, .np-rc *::before, .np-rc *::after { animation: none !important; transition: none !important; }
  .np-rc.is-torn .np-rc__stamp { opacity: 1; transform: rotate(-12deg); }
}
@media (max-width: 480px) {
  .np-rc__x { width: 40px; height: 40px; top: -48px; }
  .np-rc { padding: 56px 12px 24px; place-items: start center; }
  .np-rc__sheet { width: calc(100% - 44px); }
  .np-rc__total strong { font-size: 26px; }
}
