@media print {
  html, body {
      width: 100%;
      margin: 0;
      padding: 0;
      overflow: hidden;
      font-size: 10pt;  /* Smaller font size to ensure more content fits */
  }
  .container, .invoice {
      width: 100%;
      max-width: 100%;  /* Override any max-width set */
      box-sizing: border-box;  /* Include padding and border in the element's width */
  }
  textarea, input[type="text"], .table {
      width: 100%;  /* Ensure form elements do not overflow */
      box-sizing: border-box;  /* Include padding and border in the width */
  }
  nav, .btn, header, footer, .non-printable {
      display: none;  /* Hide non-essential elements */
  }
  textarea {
    /* Adjust height based on content */
   /* Set a minimum height */
  overflow: visible;  /* Allow content to expand outside the box if necessary */
  white-space: pre-wrap;  /* Maintain whitespace formatting */
  word-wrap: break-word;  /* Prevent long text strings from overflowing */
}
}

@page {
    size: letter;
    margin: 0.1in 0.1in;  /* Minimal margins: top/bottom: 0.1in, left/right: 0.1in */
}

body {
    width: 8.5in;
    min-height: 11in;
    margin: 0 auto;
    padding: 0.1in 0.1in;
    box-sizing: border-box;
    background-color: #f5f5f5;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.9rem;  
}

  .img-fluid {
    border-radius: 20px;
  }
  
  .invoice {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #fff;
  }
  #print-button {
    background-color: #007bff;
  
  }

  #myTextarea {
    background-color: #fff;
  }
  table input[type="text"],
  table input[type="number"],
  table textarea {
    background-color: #fff;
}

  tr {
    background-color: #f5f5f5;
  }

  th {
    background-color: #f5f5f5;
  }
  
  td {
    background-color: white!important;
    min-height: fit-content!important;
    padding: 0.05in 0.1in;
  }


  #signature-pad {
    background-color: white;
  }
  
  
  input[type="text"],
input[type="number"],
textarea {
  background-color: #fff;
}

input[type="text"],
input[type="number"],
textarea {
  background-color: #fff;
}



  #print-button:hover,
#print-button:focus {
  background-color: #0069d9;
}

  
  

textarea {
    overflow: hidden;
    resize: none;
    border: none;
}


canvas { 
    
    border: .25px solid #000; 

}

.input {
    width:100%;
    height: 100%;
}

.input,
.textarea {
  font-family: inherit;
  font-size: inherit;
  padding: 1px 6px;
}

.input-wrap {
  position: relative;
  width: 100%;
}
.input-wrap .input {
  position: absolute;
  width: 100%;
  left: 0;
}
.width-machine {
  /*   Sort of a magic number to add extra space for number spinner */
  padding: 0 1rem;
}

.editable-input {
  border: 1px solid #ccc;
  padding: 5px;
  min-height: 20px;
  overflow: hidden;
  word-wrap: break-word;
}

.textarea {
  display: block;
  width: 100%;
  overflow: hidden;
  resize: both;
  min-height: 40px;
  line-height: 20px;
}

.textarea[contenteditable]:empty::before {
  content: "Placeholder still possible";
  color: gray;
}

.invoice {
    background: transparent;
    padding: 20px
    
}

span.input {
    min-width: 100%;
}
.pt-3-half {
    padding-top: 1.4rem;
  }

.invoice-company {
    font-size: 20px
}

.invoice-header {
    margin: 0 -20px;
    background: #f0f3f4;
    padding: 20px
}

address {
    line-height: normal;
}

.invoice-date,
.invoice-from,
.invoice-to {
    display: table-cell;
    width: 50%;
}

.invoice-to2 {
    display: table-cell;
    width: 100%
}

.invoice-from,
.invoice-to {
    padding-right: 20px;
}

.invoice-date .date,
.invoice-from strong,
.invoice-to strong {
    font-size: 16px;
    font-weight: 600
}

.invoice-date {
    text-align: right;
    padding-left: 20px
}

.invoice-price {
    background: #f0f3f4;
    display: table;
    width: 100%
}

.invoice-price .invoice-price-left,
.invoice-price .invoice-price-right {
    display: table-cell;
    padding: 20px;
    font-size: 20px;
    font-weight: 600;
    width: 75%;
    position: relative;
    vertical-align: middle
}

.invoice-price .invoice-price-left .sub-price {
    display: table-cell;
    vertical-align: middle;
    padding: 0 20px
}

.invoice-price small {
    font-size: 12px;
    font-weight: 400;
    display: block
}

.invoice-price .invoice-price-row {
    display: table;
    float: left
}

.invoice-price .invoice-price-right {
    width: 25%;
    background: #2d353c;
    color: #fff;
    font-size: 28px;
    text-align: right;
    vertical-align: bottom;
    font-weight: 300
}

.invoice-price .invoice-price-right small {
    display: block;
    opacity: .6;
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 12px
}

.invoice-footer {
    border-top: 1px solid #ddd;
    padding-top: 10px;
    font-size: 10px
}
#print-button {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;


}

#print-button:hover {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color:none!important;

}


.invoice-note {
    color: #999;
    font-size: 85%;
    
}


.notes {
    width:100%;
}

.invoice>div:not(.invoice-footer) {
    margin-bottom: 20px
}

.btn.btn-white, .btn.btn-white.disabled, .btn.btn-white.disabled:focus, .btn.btn-white.disabled:hover, .btn.btn-white[disabled], .btn.btn-white[disabled]:focus, .btn.btn-white[disabled]:hover {
    color: #2d353c;
    background: #fff;
    border-color: #d9dfe3;
    
}

textarea {
  width: 100%;
  overflow: hidden; /* Hide overflow to make it look clean */
  resize: none; /* Prevent manual resizing by users */
  box-sizing: border-box;
  padding: 6px; /* Optional, adjust padding as needed */
  font-size: inherit; /* Ensure the font size matches other elements */
  line-height: 1.5; /* Maintain proper line height for readability */
}


input {
    background-color: transparent;
    border-color: transparent;
    width:100%;
    
}

/* Table column layout */
#invoiceTable {
    table-layout: fixed;
    width: 100%;
}

/* Description column */
#invoiceTable th:nth-child(1),
#invoiceTable td:nth-child(1) {
    width: 35% !important;
}

/* Quantity, Price, Type, Tax columns */
#invoiceTable th:nth-child(2),
#invoiceTable td:nth-child(2),
#invoiceTable th:nth-child(3),
#invoiceTable td:nth-child(3),
#invoiceTable th:nth-child(4),
#invoiceTable td:nth-child(4),
#invoiceTable th:nth-child(5),
#invoiceTable td:nth-child(5) {
    width: 12% !important;
}

/* Subtotal column */
#invoiceTable th:nth-child(6),
#invoiceTable td:nth-child(6) {
    width: 12% !important;
}

/* Remove button column */
#invoiceTable th:last-child,
#invoiceTable td:last-child {
    width: 5% !important;
}

/* Ensure inputs take full width of their cells */
#invoiceTable input,
#invoiceTable textarea,
#invoiceTable select {
    width: 100% !important;
    padding: 2px 5px !important;
    font-size: 0.9em !important;
}

/* Make description field more flexible */
#invoiceTable .description {
    resize: vertical;
    min-height: 38px;
    max-height: 150px;
}

.header-section {
    overflow: hidden;
    margin-bottom: 20px;
}

.service-number {
    float: left;
    margin-top: 20px;
}

.logo-section {
    float: right;
}

.logo-section img {
    max-height: 100px;
    width: auto;
}

/* Clear floats after the columns */
.header-section::after {
    content: "";
    display: table;
    clear: both;
}

.container {
    width: 100%; /* Use full width */
    margin: 0 auto;
    padding-top: 0;
    box-sizing: border-box;
}

.mt-5 {
    margin-top: 0 !important;
}

.invoice {
    padding-top: 0;
}

.header-section {
    margin-top: 0;
    padding-top: 0;
}

.logo-section {
    margin-top: 0;
    padding-top: 0;
}

table {
    margin-bottom: 0.2in;
    font-size: 0.9rem;
}

tr {
    page-break-inside: avoid;
}

@media print {
    /* Reduce gaps between pages */
    .page-break {
        margin: 0;
        break-after: page;
    }
    
    /* Tighter spacing in print */
    table {
        margin-bottom: 0.1in !important;
    }
    
    tr {
        page-break-inside: avoid !important;
    }
    
    body {
        font-size: 0.9rem;
        font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    }
    
    * {
        font-family: inherit !important;
    }
    
    /* Hide signature control buttons */
    #clear-button,
    #save-image-button,
    .bi-trash-fill,
    .bi-download {
        display: none !important;
    }
    
    /* Adjust signature heading to remove extra space */
    h2:contains("Customer Signature") {
        margin-right: 0 !important;
    }
}

textarea, input, select, table {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4 {
    font-weight: bold;
    margin-top: 0.1in;
    margin-bottom: 0.1in;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; }

/* Reduce service header spacing */
h1, h2, h3, h4 {
    margin-top: 0.1in;
    margin-bottom: 0.1in;
    font-size: 1.5rem;
    font-size: 1.3rem;
    font-size: 1.2rem;
    font-size: 1.1rem;
}

.service-header {
    margin-top: 0;
    margin-bottom: 0.1in;
}

/* Adjust heading sizes */
h1 { font-size: 1.5rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.1rem; }

/* Adjust table text */
td small {
    font-size: 0.9rem;
}

textarea {
    font-size: 0.9rem;
    line-height: 1.3;
}

.logo-text {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: bold;
    color: #0066cc;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}