/* Invoice proforma: form, document, print */
.invoice-section {
  padding: 58px 0 76px;
  background: linear-gradient(180deg, #eef4fb, #e8eff9);
  border-top: 1px solid #dde6f2;
}
.invoice-section .section-head { max-width: 760px; }

.invoice-workbench {
  margin-top: 26px;
  padding: 22px;
  border-radius: 18px;
  border: 1px solid #dbe5f2;
  background: #fff;
  box-shadow: 0 20px 50px -40px rgba(10, 34, 76, .5);
}
.invoice-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px 30px;
}
.invoice-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.invoice-form legend {
  padding: 0 0 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #5d7291;
}
.inv-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.inv-field { display: grid; gap: 5px; min-width: 0; }
.inv-field-wide { grid-column: 1 / -1; }
.inv-field > span { font-size: 10.5px; font-weight: 700; color: #475c79; }
.inv-field input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #dce5f1;
  border-radius: 9px;
  background: #fbfdff;
  color: #14243c;
  font-size: 12px;
}
.inv-field input:focus {
  outline: none;
  border-color: #7fa8ff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 109, 255, .12);
}
.inv-field input::placeholder { color: #9aabbf; }

.invoice-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed #e2e9f3;
}
.invoice-status { margin-left: auto; font-size: 11px; color: #64778f; }
.inv-hint { grid-column: 1 / -1; font-size: 10px; line-height: 1.5; color: #7a8ba3; }
.invoice-status strong { color: #12233d; }
.btn[disabled] { opacity: .48; cursor: not-allowed; transform: none !important; box-shadow: none; }

.invoice-doc {
  max-width: 960px;
  margin: 26px auto 0;
  padding: clamp(24px, 4vw, 50px);
  border-radius: 14px;
  border: 1px solid #dbe5f2;
  background: #fff;
  color: #101f36;
  box-shadow: 0 40px 80px -60px rgba(8, 28, 60, .7);
}
.inv-empty { display: grid; justify-items: center; gap: 8px; padding: 46px 16px; text-align: center; }
.inv-empty > .ico { width: 34px; height: 34px; color: #93a9c6; }
.inv-empty h3 { font-size: 16px; letter-spacing: -.02em; }
.inv-empty p { max-width: 46ch; font-size: 12px; line-height: 1.65; color: #63758e; }
.inv-empty .btn { margin-top: 6px; }

.inv-top {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 18px;
  border-bottom: 3px solid #0b2a6b;
}
.inv-brand { display: grid; gap: 8px; align-content: start; }
.inv-logo-img { height: 30px; width: auto; display: block; }
.inv-brand-meta { display: grid; gap: 1px; font-size: 10.5px; line-height: 1.5; color: #5b6d87; }
.inv-legal { font-size: 11px; font-weight: 800; color: #182b48; }
.inv-title { text-align: right; }
.inv-title h3 { font-size: 20px; letter-spacing: .05em; color: #0b2a6b; }
.inv-title > p { margin-top: 3px; font-size: 11px; color: #5b6d87; }
.inv-title > p strong { color: #14243c; }
.inv-title dl { display: grid; gap: 2px; margin-top: 10px; font-size: 10.5px; }
.inv-title dl div { display: flex; justify-content: flex-end; gap: 8px; }
.inv-title dt { color: #7a8ba3; }
.inv-title dd { margin: 0; font-weight: 700; color: #14243c; }

.inv-parties { display: grid; grid-template-columns: 1.05fr 1fr 1fr; gap: 20px; margin-top: 20px; }
.inv-block { display: grid; gap: 2px; align-content: start; font-size: 10.5px; line-height: 1.5; color: #556783; }
.inv-block h4 {
  margin-bottom: 4px;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8494aa;
}
.inv-block strong { font-size: 11px; color: #14243c; }
.inv-account { font-size: 12px; letter-spacing: .04em; }
.inv-placeholder { color: #9aa9bd; font-style: italic; }

.inv-table-wrap { margin-top: 24px; overflow-x: auto; }
.inv-table { width: 100%; min-width: 600px; border-collapse: collapse; }
.inv-table thead th {
  padding: 8px 10px;
  background: #0b2a6b;
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
}
.inv-table thead th:first-child { border-radius: 7px 0 0 0; }
.inv-table thead th:last-child { border-radius: 0 7px 0 0; }
.inv-table td { padding: 12px 10px; border-bottom: 1px solid #e7edf7; vertical-align: top; font-size: 10.5px; }
.inv-table tr.inv-group td {
  padding: 14px 10px 7px;
  border-bottom: 0;
  background: #f2f7fe;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #5d7291;
}
.inv-item { display: grid; gap: 2px; }
.inv-item strong { font-size: 11.5px; color: #14243c; }
.inv-item span { font-size: 10px; line-height: 1.5; color: #61738c; }
.inv-item-disc { color: #0c7a4d !important; font-weight: 700; }
.inv-num { text-align: right; white-space: nowrap; }
.inv-num small { display: block; font-size: 8.5px; color: #8b9ab0; }
.inv-strong { font-weight: 800; color: #14243c; }

.inv-totals { width: min(380px, 100%); margin: 18px 0 0 auto; font-size: 10.5px; }
.inv-row { display: flex; justify-content: space-between; gap: 14px; padding: 4px 2px; color: #4f6280; }
.inv-row span:last-child { font-weight: 700; color: #1a2d49; white-space: nowrap; }
.inv-row.is-credit { color: #0c7a4d; }
.inv-row.is-credit span:last-child { color: #0c7a4d; }
.inv-row.is-rule {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #e4ebf5;
  font-weight: 800;
  color: #14243c;
}
.inv-grand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
  padding: 11px 13px;
  border-radius: 8px;
  background: #0b2a6b;
  color: #fff;
}
.inv-grand span {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #b9cdf3;
}
.inv-grand strong { font-size: 15px; letter-spacing: -.02em; }

.inv-notes { margin-top: 26px; padding-top: 14px; border-top: 1px solid #e4ebf5; }
.inv-notes h4 { font-size: 8.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #8494aa; }
.inv-notes ul {
  display: grid;
  gap: 4px;
  margin-top: 7px;
  padding-left: 14px;
  list-style: disc;
  font-size: 10px;
  line-height: 1.55;
  color: #5b6d87;
}
.inv-sign { display: flex; justify-content: flex-end; margin-top: 30px; text-align: center; }
.inv-sign > div { display: grid; gap: 1px; min-width: 250px; }
.inv-sign span { font-size: 10px; color: #6c7e97; }
.inv-sign strong {
  margin-top: 38px;
  font-size: 12px;
  color: #14243c;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.inv-sign small { font-size: 9.5px; color: #6c7e97; }
.inv-warning {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid #ffe0a3;
  background: #fff8e6;
  color: #8a5a00;
  font-size: 10px;
  line-height: 1.5;
}
.inv-warning .ico { width: 14px; height: 14px; margin-top: 1px; flex: none; }
.inv-fine { margin-top: 18px; font-size: 8.5px; color: #93a1b4; }

@media (max-width: 960px) {
  .invoice-form { grid-template-columns: 1fr; gap: 18px; }
  .inv-parties { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .invoice-section { padding: 44px 0 56px; }
  .invoice-workbench { padding: 16px; }
  .inv-fields { grid-template-columns: 1fr; }
  .inv-field-wide { grid-column: auto; }
  .invoice-actions .btn { flex: 1 1 100%; }
  .invoice-status { margin-left: 0; flex: 1 1 100%; }
  .invoice-doc { padding: 20px 16px; border-radius: 12px; }
  .inv-top { flex-direction: column; gap: 16px; }
  .inv-title { text-align: left; }
  .inv-title dl div { justify-content: flex-start; }
  .inv-parties { grid-template-columns: 1fr; gap: 14px; }
  .inv-totals { width: 100%; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  .site-header,
  .site-footer,
  .floating-total,
  main > section:not(#invoice) { display: none !important; }
  #invoice { padding: 0 !important; background: #fff !important; border: 0 !important; }
  #invoice .container { width: 100% !important; max-width: none !important; margin: 0 !important; }
  #invoice .section-head,
  .invoice-workbench { display: none !important; }
  .invoice-doc {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 10pt;
  }
  .invoice-doc.is-empty,
  .invoice-doc.has-warning { display: none !important; }
  .inv-top { break-inside: avoid; }
  .inv-logo-img { height: 27px; }
  .invoice-actions { display: none !important; }
  .inv-table tr { break-inside: avoid; }
  .inv-sign { break-inside: avoid; }
  .inv-table thead th,
  .inv-grand {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .inv-table thead th,
  .inv-table td,
  .inv-table tr.inv-group td,
  .inv-totals,
  .inv-item span,
  .inv-notes ul { font-size: 9pt; }
  .inv-num small { font-size: 7.5pt; }
}
