/* On-screen sales documents: quote / invoice / credit note
   Slightly more vertical spacing; bottom padding reserved for multi-line notes */

.quote-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.quote-toolbar form {
  margin: 0;
}

.quote-more {
  position: relative;
}

.quote-more summary {
  cursor: pointer;
  border: 1px solid #444;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 20px;
  line-height: 18px;
}

.quote-more[open] a {
  display: block;
  background: #fff;
  border: 1px solid #ddd;
  padding: 9px 12px;
  text-decoration: none;
  color: #075984;
}

.quote-document,
.print-quote {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

.quote-document {
  padding: 58px 64px 72px;
  border: 1px solid #d8d8d8;
}

.print-quote {
  padding: 14mm 16mm 20mm;
}

.quote-document-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border: 0;
  padding: 0 0 12px;
  margin: 0 0 12px;
  gap: 12px;
}

.quote-document-head img {
  width: 399px;
  max-width: 48%;
  height: auto;
  max-height: 137px;
  object-fit: contain;
  object-position: left top;
  display: block;
  margin: 0;
  padding: 0;
}

.quote-document-head div {
  text-align: right;
  padding-top: 32px;
}

.quote-document-head span,
.quote-document-head .title-label,
.quote-document-head .title-date,
.quote-document-head .title-ref {
  display: block;
  font-size: 30px;
  font-weight: 300;
  line-height: 0.95;
  color: #000;
  letter-spacing: -2px;
}

.quote-document-head .title-spacer {
  display: block;
  height: 0.9em;
  line-height: 0.9em;
  font-size: 30px;
  margin: 0;
  padding: 0;
}

.quote-document-head strong {
  display: block;
  margin-top: 0;
  font-size: 30px;
  font-weight: 300;
  line-height: 0.95;
  color: #000;
  letter-spacing: -2px;
}

.quote-addresses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 0 0 22px;
  line-height: 1.5;
  font-size: 16px;
}

.quote-addresses > div:last-child {
  text-align: left;
  align-self: end;
}

.quote-addresses strong {
  font-size: 18px;
}

.quote-dates {
  text-align: right;
  font-size: 16px;
  color: #282828;
  margin: 0 0 18px;
}

.quote-document h2,
.print-quote h2 {
  font-weight: 400;
  font-size: 16px;
  margin: 0 0 24px;
  color: #222;
}

.quote-document table,
.print-quote table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 8px;
}

.quote-document th,
.print-quote th {
  background: #393a37;
  color: #fff;
  padding: 14px 14px;
  text-align: left;
  font-weight: 400;
  font-size: 15px;
}

.quote-document th:first-child:before,
.print-quote th:first-child:before {
  content: '#';
  display: inline-block;
  width: 52px;
}

.quote-document td,
.print-quote td {
  padding: 16px 14px;
  border-bottom: 0;
  vertical-align: top;
  font-size: 16px;
}

.quote-document tbody tr:last-child td,
.print-quote tbody tr:last-child td {
  border-bottom: 3px solid #aaa;
}

.quote-document td:first-child:before,
.print-quote td:first-child:before {
  counter-increment: item;
  content: counter(item);
  display: inline-block;
  width: 52px;
}

.quote-document tbody,
.print-quote tbody {
  counter-reset: item;
}

.quote-document th:not(:first-child),
.quote-document td:not(:first-child),
.print-quote th:not(:first-child),
.print-quote td:not(:first-child) {
  text-align: right;
}

.quote-summary {
  width: 50%;
  margin: 16px 0 48px auto;
  font-size: 17px;
}

.quote-subtotal,
.quote-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
}

.quote-subtotal {
  border: 0;
  background: #fff;
}

.quote-total {
  background: #f2f2f2;
  font-weight: 700;
  padding: 18px 14px;
}

/* On-screen total line used by invoice_view */
.quote-document .quote-total {
  margin-top: 16px;
  margin-bottom: 28px;
}

.quote-notes {
  margin: 0 0 36px;
  font-size: 15px;
}

.quote-notes h3,
.quote-terms {
  margin-top: 0;
  font-size: 15px;
}

.quote-notes h3,
.quote-terms h3 {
  font-size: 19px;
  font-weight: 400;
  margin: 0 0 12px;
}

.quote-notes p,
.quote-terms p {
  white-space: pre-line;
  margin: 0;
  line-height: 1.5;
}

.quote-terms {
  margin-top: 22px;
}

.quote-terms textarea {
  width: 100%;
  min-height: 150px;
  padding: 10px;
  font: inherit;
  border: 1px solid #8da0a9;
  border-radius: 6px;
}

/* Compact terms still need a little air (invoice view) */
.quote-document .quote-terms.compact-terms,
.quote-document .quote-job-notes.compact-terms {
  margin-top: 18px;
}

.quote-document .quote-terms.compact-terms h3,
.quote-document .quote-job-notes.compact-terms h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.quote-document .quote-terms.compact-terms p,
.quote-document .quote-job-notes.compact-terms p {
  white-space: pre-line;
  line-height: 1.35;
  font-size: 13px;
  margin: 0;
}

.print-page {
  background: #eef0f1;
  margin: 0;
  padding: 24px;
}

.print-button {
  position: fixed;
  top: 18px;
  right: 18px;
  background: #0a5f93;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: bold;
}

@media print {
  .print-button {
    display: none;
  }

  .print-page {
    background: white;
    padding: 0;
  }

  .print-quote {
    max-width: none;
    margin: 0;
    padding: 14mm 16mm 20mm;
  }

  .quote-document {
    border: 0;
    padding: 14mm 16mm 20mm;
  }
}

@media (max-width: 650px) {
  .quote-document {
    padding: 28px 22px 40px;
  }

  .quote-document-head img {
    width: 230px;
    height: 82px;
  }

  .quote-document-head span {
    font-size: 34px;
  }

  .quote-addresses {
    margin-top: 0;
    display: block;
    margin-bottom: 28px;
  }

  .quote-addresses > div:last-child {
    margin-top: 24px;
  }

  .quote-dates {
    text-align: right;
    font-size: 13px;
    color: #444;
    margin: 0 0 18px;
  }
}
