/* ══════════════════════════════════════════════════════════════════════════
   THE ORDER RECEIPT — one order drawn as a receipt, opened from a sales row
   on the dashboard and from a ticket number in the drawer log.

   Lifted out of dashboard.css on 2026-09-15 so the two pages share one copy
   rather than the drawer growing a second. Pair it with receipt_modal.php,
   which carries the markup and the script.
   ══════════════════════════════════════════════════════════════════════════ */
.rcpt-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.rcpt-overlay[hidden] { display: none; }
.rcpt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 42, 82, 0.34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
body.rcpt-open { overflow: hidden; }

/* Narrow and tall on purpose — a receipt is a strip of paper, and the shape is
   most of what makes it read as one rather than as a dialog with a list in it. */
.rcpt-sheet {
  position: relative;
  width: min(420px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: #f4f5f7;
  box-shadow: 0 26px 70px rgba(13, 42, 82, 0.30);
}

.rcpt-topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid rgba(13, 42, 82, 0.08);
}
.rcpt-print {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  color: var(--brand-blue, #1a5fa8);
  background: rgba(26, 95, 168, 0.10);
}
.rcpt-print svg { width: 15px; height: 15px; }
.rcpt-x {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #64748b;
  background: rgba(13, 42, 82, 0.06);
}
.rcpt-x svg { width: 16px; height: 16px; }

.rcpt-paper {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 20px 26px;
  /* Deliberately NOT theme-coloured. A receipt is white paper in every theme —
     tinting it dark would make the one thing on screen meant to look printable
     look like another panel. */
  color: #1a1a1a;
}
.rcpt-loading { padding: 48px 0; text-align: center; color: #64748b; font-size: 13px; }

.rcpt-brand  { text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .14em;
               text-transform: uppercase; color: #64748b; }
.rcpt-thanks { margin: 6px 0 18px; text-align: center; font-size: 17px; font-weight: 700; color: #1a1a1a; }

.rcpt-card {
  padding: 20px 18px 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(13, 42, 82, 0.07);
}
.rcpt-title { margin-bottom: 12px; font-size: 15px; font-weight: 800; letter-spacing: .04em; }

.rcpt-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 13px;
  color: #64748b;
}
.rcpt-meta b { color: #1a1a1a; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.rcpt-cust {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-size: 15px;
}
.rcpt-cust svg { width: 16px; height: 16px; flex: 0 0 auto; color: #1a1a1a; }
.rcpt-cust-sub { margin-left: 23px; font-size: 13px; color: #64748b;
                 font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.rcpt-items { margin: 16px 0 14px; display: flex; flex-direction: column; gap: 9px; }
.rcpt-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border-radius: 12px;
  background: #f6f7f9;
}
.rcpt-item-img {
  width: 42px; height: 42px; flex: 0 0 auto;
  border-radius: 9px; object-fit: cover; background: #e6e8ec;
}
.rcpt-item-noimg { display: inline-block; }
.rcpt-item-name { flex: 1 1 auto; font-size: 13.5px; font-weight: 600; line-height: 1.32; }
/* The IMEI or barcode, when there is one. An identifier, so monospace-ish
   tabular figures rather than the body face. */
.rcpt-item-name span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  color: #8a93a0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}
.rcpt-item-price {
  flex: 0 0 auto; font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
}

.rcpt-line {
  display: flex; justify-content: space-between;
  padding: 5px 2px; font-size: 13.5px; color: #4a5261;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
}
.rcpt-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 10px; padding-top: 13px;
  border-top: 1px solid rgba(13, 42, 82, 0.12);
  font-size: 17px; font-weight: 800;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
}

/* One chip per method. A split order gets two, each carrying its own amount —
   which is the whole reason the amounts are stored per payment rather than as
   a single column on the sale. */
.rcpt-chip {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #f6f7f9;
}
.rcpt-chip img { width: 32px; height: 32px; object-fit: contain; flex: 0 0 auto; }
.rcpt-chip-dot { width: 32px; height: 32px; border-radius: 50%; background: #e6e8ec; flex: 0 0 auto; }
.rcpt-chip-text { flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.3; }
.rcpt-chip-text strong { font-size: 13.5px; }
.rcpt-chip-text span   { font-size: 11.5px; color: #8a93a0; }
.rcpt-chip-amt {
  flex: 0 0 auto; font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
}

.rcpt-notes {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed rgba(13, 42, 82, 0.14);
  font-size: 12.5px; line-height: 1.5; color: #64748b;
}

/* Print the receipt, not the dashboard behind it. */
@media print {
  body * { visibility: hidden !important; }
  #rcptOverlay, #rcptOverlay * { visibility: visible !important; }
  #rcptOverlay { position: absolute; inset: 0; padding: 0; display: block; }
  .rcpt-backdrop, .rcpt-topbar { display: none !important; }
  .rcpt-sheet { width: 100%; max-height: none; box-shadow: none; border-radius: 0; }
  .rcpt-paper { max-height: none; overflow: visible; }
}

@media (max-width: 520px) {
  .rcpt-overlay { padding: 10px; }
  .rcpt-sheet { max-height: 94vh; }
}

/* Only drawn when an order took more than one method, so it never labels a
   single obvious chip. */
.rcpt-paid-with {
  margin-top: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8a93a0;
}
.rcpt-paid-with + .rcpt-chip { margin-top: 7px; }
/* The discount under an item's name on the receipt (2026-09-26). */
.rcpt-item-name .rcpt-disc { display: block; font-size: 10.5px; color: #0b6b4f; margin-top: 2px; }

/* Edit (2026-10-07), beside Refund: the ticket back into the main checkout.
   Refund and Edit sit together in the middle of the bar — the auto margins
   share the free space either side of the pair; alone, either is centred by
   the bar's space-between. Plum, the sales accent. */
.rcpt-edit { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font: inherit; font-size: 12.5px; font-weight: 600;
  border: none; border-radius: 999px; cursor: pointer; color: #6b3744; background: rgba(107, 55, 68, .10); }
.rcpt-edit:hover { background: rgba(107, 55, 68, .17); }
.rcpt-edit[hidden] { display: none; }
.rcpt-edit svg { width: 15px; height: 15px; }
.rcpt-topbar .rcpt-refund:has(+ .rcpt-edit:not([hidden])) { margin-left: auto; }
.rcpt-topbar .rcpt-refund:not([hidden]) + .rcpt-edit { margin-left: 8px; margin-right: auto; }
@media print { .rcpt-edit { display: none !important; } }

