/* A6 Waybill Receipt Styles - Unified for Customer & Driver */
.waybill-receipt,
.receipt-wrapper {
  width: 105mm; /* A6 width */
  min-height: 148mm; /* A6 height */
  background: white;
  padding: 10mm;
  margin: 0 auto;
  font-family: "Arial", sans-serif;
  font-size: 9pt;
  color: #000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.receipt-header {
  text-align: center;
  border-bottom: 2px solid #1e40af;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.receipt-header img,
.receipt-logo {
  height: 40px;
  margin-bottom: 5px;
}

.receipt-header h1,
.receipt-header h2 {
  margin: 5px 0;
  font-size: 14pt;
  color: #1e40af;
  font-weight: bold;
}

.receipt-type,
.receipt-subtitle {
  font-size: 8pt;
  color: #666;
  margin: 0;
}

.tracking-box,
.tracking-number {
  text-align: center;
  background: #f0f4ff;
  border: 2px dashed #1e40af;
  padding: 8px;
  margin: 10px 0;
  border-radius: 4px;
}

.tracking-label,
.tracking-number strong {
  display: block;
  font-size: 7pt;
  color: #666;
  margin-bottom: 3px;
  text-transform: uppercase;
  font-weight: 600;
}

.tracking-number .tracking-number,
.tracking-code {
  font-size: 14pt;
  font-weight: bold;
  color: #1e40af;
  letter-spacing: 1px;
  font-family: "Courier New", monospace;
}

.receipt-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 10px;
  font-size: 8pt;
}

.receipt-section {
  margin-bottom: 10px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 4px;
}

.receipt-section h3,
.section-title {
  font-size: 9pt;
  margin: 0 0 6px 0;
  color: #1e40af;
  border-bottom: 1px solid #ddd;
  padding-bottom: 3px;
  font-weight: bold;
  text-transform: uppercase;
}

.receipt-section p,
.section-content p {
  margin: 3px 0;
  font-size: 8pt;
  line-height: 1.3;
}

.info-row {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
  font-size: 8pt;
}

.info-row .label,
.info-label {
  font-weight: 600;
  color: #555;
}

.info-row .value,
.info-value {
  text-align: right;
  color: #000;
}

.detail-grid {
  display: grid;
  gap: 4px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 8pt;
  border-bottom: 1px solid #eee;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-weight: 600;
  color: #555;
}

.detail-value {
  text-align: right;
  color: #000;
  font-weight: 500;
}

.pricing-grid {
  display: grid;
  gap: 4px;
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 8pt;
}

.pricing-label {
  font-weight: 500;
  color: #555;
}

.pricing-value {
  text-align: right;
  color: #000;
  font-weight: 600;
}

.pricing-details {
  background: #fff;
  border: 1px solid #ddd;
}

.total-row {
  border-top: 2px solid #1e40af;
  margin-top: 6px;
  padding-top: 6px;
  font-size: 9pt;
}

.total-row .label,
.total-row .value,
.total-row .pricing-label,
.total-row .pricing-value {
  color: #1e40af;
  font-weight: bold;
}

/* Proof of Delivery Section - Matching A6 style */
.delivery-proof-section {
  margin-bottom: 10px;
  padding: 8px;
  background: #f0fdf4;
  border-radius: 4px;
  border: 1px solid #22c55e;
}

.delivery-proof-section .section-title {
  color: #15803d;
  border-bottom-color: #86efac;
}

.delivery-proof-section p {
  margin: 3px 0;
  font-size: 8pt;
  line-height: 1.3;
  color: #15803d;
}

.proof-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 2px solid #22c55e;
  margin-top: 6px;
  display: block;
}

.receipt-footer {
  text-align: center;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed #ccc;
}

.receipt-footer p {
  margin: 3px 0;
  font-size: 8pt;
}

.receipt-footer strong {
  font-size: 9pt;
  color: #1e40af;
}

.footer-note {
  font-style: italic;
  color: #666;
  font-size: 7pt;
}

.receipt-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.receipt-actions .btn {
  padding: 10px 20px;
  font-size: 14px;
}

/* Print Styles */
@media print {
  body * {
    visibility: hidden;
  }

  .waybill-receipt,
  .waybill-receipt *,
  .receipt-wrapper,
  .receipt-wrapper * {
    visibility: visible;
  }

  .waybill-receipt,
  .receipt-wrapper {
    position: absolute;
    left: 0;
    top: 0;
    width: 105mm;
    min-height: 148mm;
    box-shadow: none;
    margin: 0;
    padding: 10mm;
  }

  .receipt-actions,
  .modal-close,
  .modal-header,
  header,
  footer,
  .header,
  .footer,
  button {
    display: none !important;
  }

  .receipt-header {
    border-bottom: 2px solid #000;
  }

  .tracking-box,
  .tracking-number {
    border: 2px dashed #000;
    background: #f5f5f5;
  }

  .receipt-section {
    page-break-inside: avoid;
  }

  .delivery-proof-section {
    page-break-inside: avoid;
    border: 1px solid #000;
  }

  .total-row {
    border-top: 2px solid #000;
  }

  @page {
    size: A6;
    margin: 0;
  }
}

/* Modal adjustments for receipt */
#receiptModal .modal-content {
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

/* Remove extra padding/margins in modal */
#receiptModal .waybill-receipt,
#receiptModal .receipt-wrapper {
  box-shadow: none;
  margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .waybill-receipt,
  .receipt-wrapper {
    width: 100%;
    max-width: 105mm;
    min-height: auto;
    padding: 8mm;
    font-size: 8pt;
  }

  .receipt-header h1,
  .receipt-header h2 {
    font-size: 12pt;
  }

  .tracking-code {
    font-size: 12pt;
  }

  .receipt-section h3,
  .section-title {
    font-size: 8pt;
  }

  #receiptModal .modal-content {
    max-width: 95%;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .waybill-receipt,
  .receipt-wrapper {
    width: 100%;
    padding: 5mm;
    font-size: 7pt;
  }

  .receipt-header img,
  .receipt-logo {
    height: 30px;
  }

  .receipt-header h1,
  .receipt-header h2 {
    font-size: 10pt;
  }

  .tracking-code {
    font-size: 10pt;
  }

  .receipt-info {
    grid-template-columns: 1fr;
  }

  .info-row,
  .detail-row,
  .pricing-row {
    flex-direction: column;
    gap: 2px;
  }

  .info-value,
  .detail-value,
  .pricing-value {
    text-align: left;
  }
}
