

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(90deg, #ff7e5f, #feb47b, #86a8e7, #91eae4);
  margin: 0;
  padding: 0;
}

.header-logo img {
  height: 60px;
  margin-left: -24px;
}

.invoice-box {
 
  background: rgb(255, 255, 255);
  margin: 0 auto;
  padding: 0;
  border-radius: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  background-color: #100f0d;
  padding: 25px;
}

header h1 {
  font-size: 40px;
  color: #ff1212;
}

.company-info h2 {
  margin: 0;
  color: #fefeff;
  font-size: 22px;
}

.company-info {
  align-items: flex-start;
  color: #ffffff;
  text-align: end;
  line-height: 15px;
  font-family: 'Poppins', sans-serif;
}

.receipt-layout {
  display: flex;
  justify-content: space-between;
  gap: 80px;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding: 30px;
}

.left-fields,
.right-fields {
  flex: 1;
  min-width: 250px;
}

.inline-field {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.inline-field label {
  flex: 0 0 100px;
  font-weight: 600;
  color: #333;
  margin-right: 10px;
}

.input-text,
.input-date {
  flex: 1;
  padding: 6px 8px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
}

.half-paid-wrapper {
  position: relative;
  max-width: 150px;
}

.half-paid-wrapper .input-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #020202;
  font-weight: bold;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  pointer-events: none;
  user-select: none;
  z-index: 2;
}

.half-paid-wrapper .half-paid-input {
  padding-left: 50px;
  background-color: #ffdd00;
  color: rgb(2, 2, 2);
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
  text-align: center;
  box-sizing: border-box;
}

.receipt-no {
  font-weight: bold;
  font-size: 16px;
  color: #333;
  padding-left: 10px;
}

.items {
  padding: 30px;
}

.items table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}

.items th,
.items td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}

.items th {
  background-color: #f0f0f0;
}

.items thead tr th:nth-child(2),
.items tbody tr td:nth-child(2) {
  display: none;
}

.items textarea,
.items input[type="number"] {
  font-family: inherit;
  font-size: 14px;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
}

.price-input-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
}

.total {
  text-align: right;
  padding: 30px;
}

.total p {
  font-size: 18px;
  margin: 5px 0;
}

.total .amount {
  font-size: 22px;
  font-weight: bold;
  color: #e40b0b;
}

footer {
  text-align: center;
  border-top: 1px solid #ddd;
  margin-top: 10px;
  padding-top: 10px;
  color: #777;
}

/* Transaction Table */
.section-heading {
  font-size: 22px;
  color: #333;
  margin: 0;
  padding: 30px 30px 10px;
  font-weight: 600;
  
}

.transaction-table {
  padding:  30px;
  margin-top: -33px;

}

.transaction-table table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.transaction-table th,
.transaction-table td {
  padding: 10px;
  border: 1px solid #ccc;
  text-align: left;
  vertical-align: middle;
}

.transaction-table th {
  background-color: #f9f9f9;
  font-weight: 600;
}

.transaction-table input {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Payment Proof */
.proof-container {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 0;
  padding: 30px;
}

.proof-box {
  flex: 1;
  min-width: 250px;
}

.proof-box label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.proof-box input[type="file"] {
  margin-bottom: 15px;
}

.screenshot-preview {
  border: 1px dashed #ccc;
  padding: 10px;
  border-radius: 6px;
  background-color: #fefefe;
  text-align: center;
  max-height: auto;
  overflow: hidden;
}

.screenshot-preview img {
  max-width: 140px;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 0 6px rgba(0,0,0,0.08);
}

/* Footer Area */
.footer-logo {
  text-align: center;
  margin-bottom: 15px;
}

.footer-logo img {
  max-width: 250px;
  height: auto;
  object-fit: contain;
}

.invoice-footer {
  background-color: #100f0d;
  padding: 20px 30px;
  text-align: center;
  font-family: 'Poppins', sans-serif;
  border-top: 1px solid #faf6f6;
  margin-top: 10px;
  font-size: 14px;
  color: #d0c8c8;
}

.invoice-footer .footer-content p {
  margin: 6px 0;
}

.invoice-footer .thank-you {
  font-size: 16px;
  font-weight: 600;
  color: #1e88e5;
}

.invoice-footer a {
  color: #1e88e5;
  text-decoration: none;
  font-weight: 500;
}

.invoice-footer a:hover {
  text-decoration: underline;
}

.invoice-footer .rights {
  margin-top: 10px;
  color: #777;
  font-size: 13px;
}

/* PDF conversion optimization */
#invoice {
  width: 794px;
  margin: 0 auto;
  background: white;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
}

@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    height: 100%;
  }

  body {
    zoom: 0.95;
    font-size: 12px;
  }

  #invoice {
    width: 794px;
    height: 1123px;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px;
  }

  header,
  .receipt-layout,
  .items,
  .transaction-table,
  .proof-container,
  .total,
  .invoice-footer {
    padding: 20px 30px !important;
    margin: 0 !important;
    page-break-inside: avoid;
  }
  

  input,
  textarea {
    font-size: 11px !important;
    padding: 4px 6px !important;
  }

  .screenshot-preview img {
    max-width: 180px !important;
    height: auto !important;
  }

  .pagebreak {
    display: none;
  }
}





.price-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.price-input-wrapper span {
  min-width: 50px;
  font-weight: 600;
}

.price-input-wrapper input {
  height: 28px;
  padding: 4px 8px;
  font-size: 14px;
  box-sizing: border-box;
  flex-grow: 1;
}

@media print {
  .price-input-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }
}


#invoice {
  max-width: 100%; /* A4 page width approx 8.27in minus margins */
  margin-top: -20px;
  padding: 0;
}


/* mobile respornive code  */
/* =======================
   MOBILE & TABLET FIXES
======================= */
@media (max-width: 768px) {

  /* -------------------
     Invoice Box Adjust
  ------------------- */
  #invoice {
    width: 95%;
    margin: 10px auto;
    padding: 0;
  }

  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px 10px;
    gap: 15px;
  }

  header h1 {
    font-size: 28px;
  }





  .company-info {
    text-align: center;
    font-size: 13px;
    line-height: 1.3;
  }

  .receipt-layout {
    flex-direction: column;
    gap: 20px;
    padding: 15px 10px;
  }

  .inline-field {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 8px;
  }

  .inline-field label {
    margin-bottom: 4px;
    flex: none;
  }

  .input-text,
  .input-date {
    width: 100%;
    max-width: 100%;
    font-size: 13px;
    padding: 5px 6px;
  }

  .half-paid-wrapper {
    max-width: 100%;
  }

  .half-paid-wrapper .half-paid-input {
    padding-left: 40px;
    font-size: 14px;
  }

  /* =====================
     Items Table
  ===================== */
  .items {
    padding: 15px 10px;
    margin: 15px auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 95%;
    overflow: hidden;
  }

  .items table,
  .items thead,
  .items tbody,
  .items th,
  .items td,
  .items tr {
    display: block;
    width: 100%;
  }

  .items thead {
    display: none;
  }

  .items tr {
    margin-bottom: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px 10px;
    background-color: #fefefe;
  }

  .items td {
    display: flex;
    justify-content: space-between;
    padding: 6px 4px;
    font-size: 13px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
  }

  .items td:last-child {
    border-bottom: none;
  }

  .items td:nth-child(1)::before { content: "Description"; font-weight: 600; flex: 0 0 90px; margin-right: 8px; }
  .items td:nth-child(2)::before { content: "Qty"; font-weight: 600; flex: 0 0 40px; margin-right: 8px; }
  .items td:nth-child(3)::before { content: "Price"; font-weight: 600; flex: 0 0 45px; margin-right: 8px; }
  .items td:nth-child(4)::before { content: "Total"; font-weight: 600; flex: 0 0 45px; margin-right: 8px; }

  .items textarea,
  .items input[type="number"] {
    width: auto;
    flex: 1;
    font-size: 12px;
    padding: 4px 5px;
  }

  .price-input-wrapper {
    flex-wrap: wrap;
    gap: 3px;
  }

  .price-input-wrapper span {
    min-width: 30px;
    font-size: 12px;
  }

  .price-input-wrapper input {
    font-size: 12px;
    padding: 3px 5px;
  }

  /* =====================
     Transaction Table
  ===================== */
  .transaction-table {
    padding: 15px 10px;
    margin-top: 10px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    max-width: 95%;
    overflow-x: auto;
  }

  .transaction-table table {
    width: 100%;
    min-width: 600px; /* ensure inputs have space */
    border-collapse: collapse;
  }

  .transaction-table th,
  .transaction-table td {
    padding: 6px 5px;
    font-size: 13px;
    text-align: left;
  }

  .transaction-table input {
    font-size: 12px;
    padding: 4px 5px;
  }

  .transaction-table th {
    background-color: #f9f9f9;
  }

  /* =====================
     Payment Proof
  ===================== */
  .proof-container {
    flex-direction: column;
    gap: 15px;
    padding: 15px 10px;
  }

  .proof-box {
    width: 100%;
  }

  .screenshot-preview img {
    max-width: 120px;
    height: auto;
  }

  /* =====================
     Total Section
  ===================== */
  .total {
    padding: 15px 10px;
    text-align: right;
  }

  .total p {
    font-size: 16px;
  }

  .total .amount {
    font-size: 20px;
  }

  /* =====================
     Footer
  ===================== */
  .invoice-footer {
    font-size: 13px;
    padding: 15px 10px;
  }

  .invoice-footer .thank-you {
    font-size: 15px;
  }
}
