/* Label printing specific styles */
.label-preview-wrapper {
  background-color: #f8f9fa;
  border: 1px solid #e1e5ec;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.label-print-target {
  width: 100%;
  max-width: 794px;
  /* Default to A4 width but scale down if needed */
  height: auto;
  /* Auto height for screen viewing */
  min-height: 1123px;
  /* Minimal height to resemble A4 */
  margin: 0 auto 20px auto;
  background-color: #fff;
  border: 1px solid #ced4da;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  padding: 18px;
  position: relative;
  page-break-after: always;
  overflow: hidden;
  /* Prevent overflow */
}

@media print {
  .label-print-target {
    width: 794px !important;
    height: 1123px !important;
    max-width: none !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* Container for multiple A4 sheets */
#label-primary-preview-wrapper,
#label-secondary-preview-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.label-preview-grid {
  width: 100%;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
  justify-content: center;
  /* Center items when wrapping on small screens */
}

.label-ticket {
  width: 240px;
  height: 260px;
  border: 2px dashed #2e3b4a;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  text-align: left;
  background-color: #fff;
  padding: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.label-field-title {
  text-transform: uppercase;
  font-size: 14px;
  letter-spacing: 1px;
  color: #6c757d;
  margin-bottom: 6px;
}

.label-field-value {
  font-size: 24px;
  font-weight: 700;
  color: #2e3b4a;
  margin-bottom: 12px;
  word-break: break-word;
}

.label-ticket .label-field-value:last-child {
  margin-bottom: 0;
}

.label-barcode-wrapper {
  width: 100%;
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.label-barcode {
  width: 100%;
  max-width: 220px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: auto;
}

.label-barcode svg {
  max-width: 100%;
  height: auto;
  max-height: 40px;
}