/* ==========================================================================
   Printable US Letter Receipt Stylesheet
   Replicates BEST AUTO REPAIR & SERVICE, INC invoice layout identically
   on screen preview and @media print.
   ========================================================================== */

.receipt-paper {
  width: 8.5in;
  min-height: 10.55in;
  padding: 0.34in 0.38in;
  background: #ffffff;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9pt;
  line-height: 1.3;
  box-sizing: border-box;
  margin: 0 auto;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.receipt-paper * {
  box-sizing: border-box;
}

.receipt-paper .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Header Title */
.receipt-shop-banner {
  text-align: center;
  margin-bottom: 10px;
}

.receipt-shop-name {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 20.5pt;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin: 0;
  line-height: 1.1;
  color: #000000;
}

.receipt-shop-web {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 11.5pt;
  font-weight: 700;
  font-style: italic;
  margin-top: 2px;
  color: #000000;
}

/* 3-Column Customer / Shop / Vehicle Header */
.receipt-top-info {
  display: grid;
  grid-template-columns: 34% 31% 35%;
  align-items: start;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 8.8pt;
  line-height: 1.34;
}

.receipt-customer-block {
  word-break: break-word;
}

.receipt-shop-block {
  text-align: center;
  padding-top: 2px;
}

.receipt-vehicle-block {
  font-size: 8.3pt;
  line-height: 1.3;
}

.veh-row {
  display: grid;
  grid-template-columns: 68px 1fr;
  column-gap: 6px;
}

.veh-lbl {
  color: #111111;
}

.veh-val {
  color: #000000;
  word-break: break-word;
}

/* Shaded Invoice Metadata Strip */
.receipt-meta-bar {
  background: #d4d4d4;
  border-top: 1.5px solid #222222;
  border-bottom: 1.5px solid #222222;
  padding: 3px 6px;
  display: grid;
  grid-template-columns: 37% 27% 36%;
  align-items: center;
  font-size: 8.8pt;
  margin-bottom: 4px;
}

.meta-left {
  display: flex;
  gap: 14px;
  white-space: nowrap;
}

.meta-center {
  text-align: center;
  font-weight: 700;
  font-style: italic;
  font-size: 10.5pt;
  letter-spacing: 0.3px;
}

.meta-right {
  display: flex;
  justify-content: flex-end;
  gap: 32px;
  padding-right: 12px;
}

/* Main Split Table */
.receipt-items-box {
  display: flex;
  border: 1px solid #222222;
  width: 100%;
}

.items-side {
  display: flex;
  flex-direction: column;
}

.items-left {
  flex: 0 0 47.5%;
  width: 47.5%;
  border-right: 3px double #222222;
}

.items-right {
  flex: 0 0 52.5%;
  width: 52.5%;
}

.items-col-headers {
  background: #d4d4d4;
  border-bottom: 1px solid #222222;
  font-weight: 700;
  font-size: 8.2pt;
  padding: 3px 5px;
  align-items: center;
}

.labor-grid {
  display: grid;
  grid-template-columns: 1fr 40px 56px;
  column-gap: 4px;
}

.part-grid {
  display: grid;
  grid-template-columns: 1fr 44px 52px 60px;
  column-gap: 4px;
}

.items-col-body {
  position: relative;
  min-height: 4.15in;
  flex: 1;
}

.col-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.guide-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 1px solid #444444;
}

/* Exact guide positions centered in 4px gaps (padding-right: 5px) */
.guide-labor-1 {
  right: 107px;
}
.guide-labor-2 {
  right: 63px;
}

.guide-part-1 {
  right: 171px;
}
.guide-part-2 {
  right: 123px;
}
.guide-part-3 {
  right: 67px;
}

.items-rows-list {
  position: relative;
  z-index: 1;
  padding: 4px 0;
}

.receipt-item-row {
  padding: 2px 5px;
  font-size: 8.4pt;
  line-height: 1.32;
  align-items: start;
}

.labor-row {
  display: grid;
  grid-template-columns: 1fr 40px 56px;
  column-gap: 4px;
  margin-bottom: 6px;
}

.part-row {
  display: grid;
  grid-template-columns: 1fr 44px 52px 60px;
  column-gap: 4px;
  margin-bottom: 2px;
}

.receipt-item-row .col-desc {
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 4px;
}

/* Middle Summary & Totals Section */
.receipt-summary-grid {
  margin-top: 3px;
  display: grid;
  grid-template-columns: 42% 28% 30%;
  border: 1px solid #222222;
}

/* Left Approval Panel */
.summary-approval-col {
  border-right: 1px solid #222222;
  display: flex;
  flex-direction: column;
}

.approval-hdr {
  background: #d4d4d4;
  border-bottom: 1px solid #222222;
  font-size: 7.4pt;
  font-weight: 700;
  padding: 2px 4px;
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1.15fr 1.2fr 1fr;
  gap: 2px;
  text-align: center;
}

.approval-body {
  flex: 1;
  min-height: 0.85in;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.approval-values-row {
  display: grid;
  grid-template-columns: 0.9fr 0.9fr 1.15fr 1.2fr 1fr;
  gap: 2px;
  font-size: 7.2pt;
  text-align: center;
}

.approval-sig-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.approval-ack {
  border-top: 1px solid #222222;
  padding: 3px 6px;
  font-size: 7.2pt;
  line-height: 1.22;
  text-align: center;
}

/* Middle Panel */
.summary-mid-col {
  border-right: 1px solid #222222;
  display: flex;
  flex-direction: column;
}

.mid-top-split {
  display: grid;
  grid-template-columns: 52% 48%;
  border-bottom: 1px solid #222222;
}

.parts-new-note {
  padding: 4px 4px;
  font-size: 7.6pt;
  line-height: 1.24;
  text-align: center;
  border-right: 1px solid #222222;
}

.labor-sublet-box {
  padding: 5px 6px;
  font-size: 8.6pt;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.ls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mid-reassembly-note {
  flex: 1;
  padding: 6px 8px;
  font-size: 7.6pt;
  line-height: 1.28;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Right Totals Panel */
.summary-totals-col {
  display: flex;
  flex-direction: column;
}

.parts-lub-row {
  border-bottom: 1px solid #222222;
  padding: 4px 7px;
  font-size: 8.6pt;
  line-height: 1.2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.totals-matrix {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 76px;
  font-size: 8.5pt;
  line-height: 1.32;
}

.tot-labels {
  padding: 3px 6px;
  background: #ffffff;
}

.tot-values {
  padding: 3px 7px;
  background: #d4d4d4;
}

.tot-row {
  min-height: 15.5px;
}

.tot-spacer {
  min-height: 10px;
}

.tot-bold {
  font-weight: 700;
  font-size: 8.9pt;
}

/* Footer Section */
.receipt-footer-grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 39% 61%;
  column-gap: 12px;
  align-items: end;
}

.footer-left-col {
  display: flex;
  flex-direction: column;
}

.payment-line {
  font-size: 8.5pt;
  min-height: 16px;
  margin-bottom: 6px;
  padding-left: 2px;
}

.footer-stamp-box {
  border: 1px solid #222222;
  height: 0.96in;
  padding: 5px 6px;
  font-size: 7.5pt;
  color: #222222;
  white-space: pre-wrap;
  overflow: hidden;
}

.footer-right-col {
  display: flex;
  flex-direction: column;
}

.acceptance-sig-block {
  padding: 2px 10px 6px 10px;
}

.sig-x-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.sig-x {
  font-size: 15pt;
  font-weight: 800;
  line-height: 1;
}

.sig-dots {
  flex: 1;
  border-bottom: 1.5px dotted #222222;
  min-height: 26px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sig-title {
  text-align: center;
  font-size: 8.2pt;
  font-weight: 600;
  letter-spacing: 3.5px;
  word-spacing: 8px;
  margin-top: 3px;
}

.sig-sub {
  text-align: center;
  font-size: 8pt;
  margin-top: 1px;
}

.legal-terms-box {
  border: 1px solid #222222;
  padding: 5px 7px;
  font-size: 6.9pt;
  line-height: 1.24;
  text-align: justify;
}

.sig-img {
  max-height: 44px;
  max-width: 180px;
  object-fit: contain;
}

.acceptance-sig-img {
  max-height: 30px;
  margin-bottom: 2px;
}

.typed-sig {
  font-family: "Brush Script MT", "Segoe Script", cursive, Georgia, serif;
  font-size: 16pt;
  color: #111111;
}

/* ==========================================================================
   Print Media Query - Only print the clean US Letter receipt
   ========================================================================== */
@page {
  size: letter portrait;
  margin: 0.25in 0.3in;
}

@media print {
  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    width: 100% !important;
    height: auto !important;
  }

  .app-shell,
  .no-print,
  .modal-backdrop,
  .toast-container {
    display: none !important;
  }

  .print-only-container {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .receipt-paper {
    width: 100% !important;
    max-width: 7.9in !important;
    min-height: 0 !important;
    padding: 0.08in 0.1in !important;
    margin: 0 auto !important;
    box-shadow: none !important;
  }
}
