/* ==========================================================================
   TERMAL VE A4 YAZICI ÇIKTI STİLLERİ (58mm / 80mm / A4)
   %100 KOYU SİYAH, NET VE OTOMATİK KAĞIT KESME UYUMLU
   ========================================================================== */

/* Ekran içi önizleme stilleri */
.receipt-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Courier New', monospace, sans-serif;
  color: #000000 !important;
  line-height: 1.35;
  background: #ffffff !important;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
  color-adjust: exact !important;
}

.receipt-header {
  text-align: center;
  margin-bottom: 6px;
}

.receipt-logo {
  max-height: 48px;
  max-width: 140px;
  object-fit: contain;
  display: block;
  margin: 0 auto 6px auto;
  filter: contrast(150%) grayscale(100%);
}

.receipt-title {
  font-size: 16px;
  font-weight: 900;
  color: #000000 !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.receipt-sub {
  font-size: 11px;
  font-weight: 700;
  color: #000000 !important;
  margin-bottom: 2px;
}

.receipt-divider {
  border-top: 1.5px dashed #000000 !important;
  margin: 6px 0;
}

.receipt-double-divider {
  border-top: 2.5px solid #000000 !important;
  margin: 8px 0;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #000000 !important;
  margin-bottom: 3px;
}

.receipt-row.bold {
  font-weight: 900;
  font-size: 13px;
}

.receipt-label {
  font-weight: 800;
  color: #000000 !important;
}

.receipt-val {
  text-align: right;
  font-weight: 800;
  color: #000000 !important;
}

.receipt-section-title {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  margin: 5px 0 3px 0;
  text-align: center;
  background: #ffffff !important;
  border-top: 1px solid #000000 !important;
  border-bottom: 1px solid #000000 !important;
  color: #000000 !important;
  padding: 2px 0;
}

.receipt-text-block {
  font-size: 11.5px;
  font-weight: 700;
  color: #000000 !important;
  margin-bottom: 4px;
  word-break: break-word;
}

.receipt-barcode-box {
  text-align: center;
  margin: 6px 0;
}

.receipt-barcode-box svg,
.receipt-barcode-box img {
  margin: 0 auto;
  display: block;
}

.receipt-barcode-num {
  font-size: 13px;
  font-weight: 900;
  color: #000000 !important;
  letter-spacing: 2px;
  margin-top: 2px;
}

.receipt-qr-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 6px 0;
}

.receipt-footer-terms {
  font-size: 9.5px;
  font-weight: 700;
  color: #000000 !important;
  text-align: justify;
  margin-top: 6px;
  line-height: 1.25;
}

.receipt-sign-box {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 11px;
  font-weight: 800;
  color: #000000 !important;
  text-align: center;
}

.receipt-sign-col {
  width: 45%;
  border-top: 1.5px solid #000000 !important;
  padding-top: 4px;
}

/* ==========================================================================
   A4 SERVİS FORMU STİLLERİ
   ========================================================================== */

.a4-form-wrapper {
  font-family: system-ui, -apple-system, sans-serif;
  color: #0f172a;
  line-height: 1.4;
  background: #fff;
}

.a4-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.a4-company-name {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.a4-company-details {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.a4-doc-info {
  text-align: right;
}

.a4-doc-title {
  font-size: 18px;
  font-weight: 800;
  color: #2563eb;
  text-transform: uppercase;
}

.a4-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.a4-box {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 12px;
}

.a4-box-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.a4-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.a4-table th {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 8px;
  font-size: 11px;
  text-align: left;
}

.a4-table td {
  border: 1px solid #cbd5e1;
  padding: 8px;
  font-size: 11px;
}

.a4-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
}

.a4-sign-line {
  width: 200px;
  text-align: center;
  border-top: 1px solid #333;
  padding-top: 6px;
  font-size: 11px;
  font-weight: 600;
}

/* ==========================================================================
   PRINT MEDIA QUERY (YAZDIRMA ANINDA ÇALIŞAN KISIM)
   ========================================================================== */

@media print {
  /* Ekran öğelerini tamamen gizle */
  body > *:not(#print-render-area) {
    display: none !important;
  }

  .modal-overlay,
  .sidebar,
  .top-header,
  #app-container,
  #login-screen,
  .modal-backdrop,
  #toast-container {
    display: none !important;
  }

  /* Sadece yazdırma alanını görünür ve akışta tut */
  #print-render-area,
  #print-render-area * {
    visibility: visible !important;
  }

  #print-render-area {
    display: block !important;
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: max-content !important;
  }

  /* Termal Yazıcılar İçin Genel Ayarlar */
  body.print-thermal-80,
  body.print-thermal-58 {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    height: auto !important;
    min-height: 0 !important;
  }

  body.print-thermal-80 .receipt-wrapper {
    width: 74mm !important;
    max-width: 74mm !important;
    margin: 0 auto !important;
    padding: 2mm 0 !important;
    font-size: 12.5px !important;
    height: auto !important;
  }

  body.print-thermal-58 .receipt-wrapper {
    width: 50mm !important;
    max-width: 50mm !important;
    margin: 0 auto !important;
    padding: 2mm 0 !important;
    font-size: 10.5px !important;
    height: auto !important;
  }

  /* A4 Standart Form */
  body.print-a4 .a4-form-wrapper {
    width: 100% !important;
    font-size: 12px !important;
  }
}
