/**
 * Zyron CRM - Professional A4 Receipt/Print Styles
 */

/* ─── Receipt Container ─── */
.receipt {
  width: 794px; /* A4 at 96dpi */
  max-width: 100%;
  background-color: white;
  font-family: 'Poppins', 'Inter', -apple-system, sans-serif;
  font-size: 13px;
  color: #222;
  padding: 40px 36px;
  box-sizing: border-box;
  line-height: 1.5;
}

/* ─── Header ─── */
.receipt__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid #D7263D;
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.receipt__logo {
  font-size: 18px;
  font-weight: 600;
  color: #111;
  max-width: 55%;
}

.receipt__logo small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #888;
  margin-top: 6px;
  line-height: 1.7;
}

.receipt__logo-img {
  display: block;
  max-height: 60px;
  max-width: 200px;
  width: auto;
  height: auto;
  margin-bottom: 8px;
  object-fit: contain;
}

.receipt__logo-company {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
}

.receipt__doc {
  text-align: right;
  flex-shrink: 0;
}

.receipt__doc-title {
  font-size: 17px;
  font-weight: 600;
  color: #D7263D;
  letter-spacing: 1px;
}

.receipt__doc-no {
  font-size: 13px;
  color: #444;
  margin-top: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.receipt__doc-date {
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.receipt__status {
  display: inline-block;
  padding: 3px 12px;
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── Info Section (Two Column) ─── */
.receipt__info {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.receipt__info-box {
  flex: 1;
  min-width: 0;
}

.receipt__label {
  font-size: 10px;
  font-weight: 500;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.receipt__value {
  font-size: 13px;
  color: #333;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 5px;
  min-height: 22px;
  word-break: break-word;
}

/* ─── Table ─── */
.receipt__table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.receipt__table thead {
  background-color: #D7263D;
}

.receipt__table th {
  color: white;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.receipt__table td {
  padding: 10px 12px;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  color: #333;
  vertical-align: middle;
}

.receipt__table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.receipt__table tbody tr:last-child td {
  border-bottom: 2px solid #D7263D;
}

/* ─── Total ─── */
.receipt__total-text {
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: #D7263D;
  padding: 12px 0;
  border-bottom: 2px solid #D7263D;
  margin-bottom: 20px;
}

/* ─── Notes / Payment Box ─── */
.receipt__payment-box {
  padding: 14px 18px;
  background-color: #f9f9f9;
  border-left: 4px solid #D7263D;
  margin-bottom: 20px;
  border-radius: 0 4px 4px 0;
}

.receipt__payment-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ─── Footer ─── */
.receipt__footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid #ddd;
  font-size: 11px;
  color: #777;
}

.receipt__signature {
  border-top: 1px solid #999;
  width: 200px;
  text-align: center;
  padding-top: 8px;
  font-size: 11px;
  color: #999;
}

/* ─── IBAN Section ─── */
.receipt__iban-section {
  margin-top: 8px;
  padding: 10px 14px;
  background: #f9f9f9;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.8;
}

.receipt__iban-unvan {
  font-size: 11px;
  color: #333;
  margin-bottom: 4px;
}

.receipt__iban-row {
  font-size: 11px;
  color: #444;
}

.receipt__iban-bank {
  font-weight: 600;
  color: #333;
  margin-right: 4px;
}

.receipt__iban-no {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  color: #555;
}

/* ─── Legacy Compat ─── */
.receipt__company { font-size: 18px; font-weight: 600; color: #111; }
.receipt__meta { font-size: 11px; color: #888; margin-top: 2px; }
.receipt__title { font-size: 16px; font-weight: 600; color: #D7263D; text-align: center; margin: 16px 0 4px; }
.receipt__no { font-family: 'JetBrains Mono', monospace; text-align: center; font-size: 13px; color: #555; }
.receipt__divider { border-top: 1px solid #ddd; margin: 14px 0; }
.receipt__row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.receipt__total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; padding: 10px 0; }
.receipt__note { padding: 10px; background: #f9f9f9; border-left: 3px solid #D7263D; margin-top: 10px; font-size: 12px; }

/* ─── Print Overlay ─── */
.print-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0,0,0,0.85);
  display: none;
  flex-direction: column;
}

.print-overlay.is-open {
  display: flex;
}

.print-overlay__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background-color: #1a1a1a;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.print-overlay__title {
  font-weight: 600;
  color: #f5f5f5;
  font-size: 14px;
}

.print-overlay__subtitle {
  color: #888;
  font-size: 12px;
}

.print-overlay__frame {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 30px 20px;
}

/* ─── Print Area ─── */
#print-area {
  display: none;
}

/* ─── Print Media Query ─── */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 10mm;
  }

  body {
    background: white;
  }

  body > * {
    display: none !important;
  }

  #print-area {
    display: block !important;
  }

  .receipt {
    width: 100%;
    padding: 0;
    box-shadow: none;
  }
}
