/* CafeTurf — standalone receipt (screen preview + print). Always light theme. */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #fff !important;
  color: #111 !important;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.receipt-print-sheet {
  width: 100%;
  max-width: 80mm;
  background: #fff !important;
  color: #111 !important;
  padding: 10px 12px 14px;
  font-size: 11px;
  line-height: 1.35;
}

/* ── Header ── */
.rcpt-header {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 2px solid #111;
  margin-bottom: 10px;
}

.rcpt-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin: 0 auto 6px;
  display: block;
}

.rcpt-brand {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #111 !important;
}

.rcpt-brand .rcpt-turf { color: #047857 !important; }

.rcpt-tagline {
  margin: 4px 0 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #444 !important;
}

.rcpt-address {
  margin: 3px 0 0;
  font-size: 10px;
  color: #555 !important;
}

.rcpt-gstin {
  margin: 6px 0 0;
  font-size: 9px;
  color: #666 !important;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

/* ── Sections ── */
.rcpt-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #333 !important;
  margin: 0 0 6px;
  text-align: center;
}

.rcpt-divider {
  border: none;
  border-top: 1px dashed #999;
  margin: 10px 0;
}

.rcpt-divider--solid {
  border-top: 2px solid #111;
  border-style: solid;
}

.rcpt-type-badge {
  display: block;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #111 !important;
  background: #f0f0f0;
  padding: 5px 8px;
  margin-bottom: 10px;
}

/* ── Meta rows ── */
.rcpt-meta-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rcpt-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dotted #ccc;
  font-size: 10px;
}

.rcpt-meta-list li:last-child { border-bottom: none; }

.rcpt-meta-list .label {
  color: #555 !important;
  text-transform: uppercase;
  font-size: 8px;
  letter-spacing: 0.06em;
  font-weight: 600;
  flex-shrink: 0;
}

.rcpt-meta-list .value {
  color: #111 !important;
  font-weight: 600;
  text-align: right;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
}

/* ── Items table ── */
.rcpt-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 10px;
}

.rcpt-table col.col-item { width: auto; }
.rcpt-table col.col-qty { width: 28px; }
.rcpt-table col.col-amt { width: 52px; }

.rcpt-table thead th {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #444 !important;
  padding: 5px 2px;
  border-bottom: 2px solid #111;
  text-align: left;
}

.rcpt-table thead th.rcpt-amt { text-align: right; }

.rcpt-table tbody td {
  padding: 6px 2px;
  vertical-align: top;
  color: #111 !important;
  border-bottom: 1px dotted #bbb;
}

.rcpt-table tbody td.rcpt-amt {
  text-align: right;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  white-space: nowrap;
}

.rcpt-table tbody td.rcpt-qty {
  text-align: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.rcpt-table tbody td.rcpt-item-name {
  font-weight: 500;
  padding-right: 4px;
}

.rcpt-slot-detail td {
  font-size: 9px;
  color: #555 !important;
  padding-top: 2px;
  border-bottom: none !important;
}

/* ── Totals ── */
.rcpt-totals {
  margin-top: 6px;
}

.rcpt-total-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 10px;
  color: #333 !important;
}

.rcpt-total-row span:last-child {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  color: #111 !important;
}

.rcpt-total-row.rcpt-discount span:last-child {
  color: #047857 !important;
}

.rcpt-total-row.rcpt-grand {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 2px solid #111;
  font-size: 13px;
  font-weight: 800;
  color: #111 !important;
}

.rcpt-total-row.rcpt-grand span:last-child {
  font-size: 14px;
}

/* ── Payment ── */
.rcpt-payment {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
  padding: 8px;
  border: 1px solid #111;
  font-size: 10px;
}

.rcpt-payment .label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #444 !important;
}

.rcpt-payment strong {
  color: #111 !important;
  font-weight: 700;
}

/* ── Barcode ── */
.rcpt-barcode {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 40px;
  margin: 10px 0 6px;
}

.rcpt-barcode span {
  display: block;
  width: 2px;
  min-height: 10px;
  background: #111 !important;
}

.rcpt-barcode-id {
  text-align: center;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #333 !important;
  margin-bottom: 8px;
}

/* ── Footer ── */
.rcpt-footer {
  text-align: center;
  padding-top: 8px;
  border-top: 1px dashed #999;
}

.rcpt-footer p {
  margin: 0 0 4px;
  color: #111 !important;
  font-size: 11px;
  font-weight: 700;
}

.rcpt-footer-sub {
  font-size: 9px !important;
  font-weight: 500 !important;
  color: #555 !important;
}

.rcpt-footer-legal {
  font-size: 8px !important;
  color: #777 !important;
  margin-top: 8px !important;
  line-height: 1.4;
}

.rcpt-footer-credit {
  margin: 10px 0 0 !important;
  font-size: 8px !important;
  font-weight: 600 !important;
  color: #333 !important;
  letter-spacing: 0.02em;
  line-height: 1.35;
}

.rcpt-zigzag { display: none; }

/* Pickup PIN + QR on printed receipt */
.pickup-verify {
  margin: 12px 0;
  padding: 12px;
  border: 2px dashed #111;
  border-radius: 8px;
  background: #f8fafc !important;
  color: #111 !important;
}
.pickup-verify-hdr strong,
.pickup-verify-hdr p {
  color: #111 !important;
}
.pickup-verify-body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pickup-qr-wrap {
  padding: 8px;
  background: #fff !important;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.pickup-qr-img {
  display: block;
  width: 120px;
  height: 120px;
}
.pickup-code-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: #555 !important;
}
.pickup-code-val {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #111 !important;
}
.pickup-code-sub {
  font-size: 10px;
  color: #666 !important;
}

@media print {
  @page { size: 80mm auto; margin: 4mm; }
  html, body { padding: 0; background: #fff !important; }
  .receipt-print-sheet {
    max-width: 100%;
    padding: 0;
  }
}

/* Modern invoice layout */
body { background: #eef2ef !important; padding: 28px; }

.receipt-print-sheet {
  max-width: 720px;
  padding: 32px;
  border: 1px solid #dfe7e2;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(16, 26, 24, .1);
  font-size: 12px;
}

.rcpt-header.rcpt-header--invoice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  padding: 0 0 22px;
  border: 0;
  text-align: left;
}

.rcpt-brand-lockup { display: flex; align-items: center; gap: 12px; }
.rcpt-brand-lockup .rcpt-logo { width: 46px; height: 46px; margin: 0; }
.rcpt-brand-lockup .rcpt-brand { font-size: 24px; }
.rcpt-brand-lockup .rcpt-tagline { margin-top: 3px; font-size: 8px; }

.rcpt-payment-status {
  border-radius: 999px;
  background: #dff7eb;
  color: #047857 !important;
  padding: 8px 12px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}
.rcpt-payment-status--due { background: #fff1d6; color: #9a5b00 !important; }

.rcpt-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid #dfe7e2;
  border-bottom: 1px solid #dfe7e2;
}
.rcpt-title-row .rcpt-section-title { margin: 0 0 5px; text-align: left; color: #68756e !important; }
.rcpt-title-row h2 { margin: 0; font-size: 24px; color: #101a18 !important; letter-spacing: 0; }
.rcpt-title-row .rcpt-type-badge {
  display: inline-flex;
  margin: 0;
  border-radius: 7px;
  background: #101a18;
  color: #fff !important;
  padding: 7px 10px;
  letter-spacing: .04em;
}

.rcpt-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px 0;
}
.rcpt-info-block span,
.rcpt-address-panel span {
  display: block;
  margin-bottom: 4px;
  color: #68756e !important;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.rcpt-info-block strong { color: #101a18 !important; font-size: 12px; }

.rcpt-address-panel {
  margin-bottom: 22px;
  border-left: 4px solid #10b981;
  border-radius: 0 9px 9px 0;
  background: #f1f7f3 !important;
  padding: 14px 16px;
}
.rcpt-address-panel strong { display: block; color: #101a18 !important; line-height: 1.5; }
.rcpt-address-panel small { display: block; margin-top: 5px; color: #68756e !important; }

.rcpt-table { margin: 0 0 18px; font-size: 11px; }
.rcpt-table thead th { padding: 10px 8px; border-bottom: 1px solid #bfcac3; background: #f5f7f5; }
.rcpt-table tbody td { padding: 12px 8px; border-bottom: 1px solid #e5ebe7; }

.rcpt-totals--invoice {
  width: min(100%, 320px);
  margin: 0 0 24px auto;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f5f7f5 !important;
}
.rcpt-totals--invoice .rcpt-total-row { padding: 5px 0; font-size: 11px; }
.rcpt-totals--invoice .rcpt-grand { margin-top: 8px; padding-top: 12px; border-top: 1px solid #bfcac3; font-size: 15px; }

.rcpt-payment--invoice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 22px;
  border-color: #dfe7e2;
  border-radius: 10px;
  padding: 14px 16px;
}
.rcpt-payment--invoice > div { min-width: 0; }
.rcpt-payment--invoice .label { display: block; margin-bottom: 5px; }
.rcpt-payment--invoice strong { display: block; overflow-wrap: anywhere; }

.pickup-verify {
  margin: 0 0 22px;
  border: 1px solid #a7e2c7;
  border-radius: 12px;
  background: #effaf4 !important;
  padding: 16px;
}
.pickup-verify-hdr { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 14px; }
.pickup-verify-hdr p { margin: 3px 0 0; color: #68756e !important; font-size: 10px; font-weight: 500; }
.pickup-verify-body { flex-wrap: nowrap; }
.pickup-code-block { display: flex; min-width: 0; flex-direction: column; }
.pickup-code-val { font-size: 28px; letter-spacing: .16em; }

.rcpt-footer { border-top: 1px solid #dfe7e2; padding-top: 18px; }

@media (max-width: 540px) {
  body { padding: 0; }
  .receipt-print-sheet { border: 0; border-radius: 0; padding: 22px 18px; box-shadow: none; }
  .rcpt-info-grid { gap: 12px; }
  .rcpt-payment--invoice { grid-template-columns: 1fr; gap: 12px; }
  .pickup-qr-img { width: 96px; height: 96px; }
  .pickup-code-val { font-size: 22px; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { display: block; padding: 0; background: #fff !important; }
  .receipt-print-sheet { max-width: 100%; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
}
