/* Modern invoice skin.
 * Oddsprig spruce band, cream paper, structured totals card.
 * Lime is reserved for the website, not used as a large invoice fill.
 */

.invoice-sheet[data-template="modern"],
html[data-template="modern"] .invoice-sheet {
  --inv-paper: #fbfcf8;
  --inv-ink: #152227;
  --inv-muted: #4e6365;
  --inv-rule: #d4dbd0;
  --inv-rule-strong: #152227;
  --inv-accent: #152227;
  --inv-soft: #eef3e8;
  --inv-head-bg: #152227;
  --inv-head-ink: #edf2e9;
}

.invoice-sheet[data-template="modern"] {
  padding-top: 0;
}

.invoice-sheet[data-template="modern"]::before {
  content: "";
  display: block;
  height: 7mm;
  margin: 0 calc(var(--page-margin) * -1) 7mm;
  background: var(--inv-head-bg);
}

.invoice-sheet[data-template="modern"].is-pdf-export::before,
html[data-template="modern"] .invoice-sheet.is-pdf-export::before {
  margin-left: 0;
  margin-right: 0;
}

.invoice-sheet[data-template="modern"] .inv-title {
  font-family: var(--inv-sans);
  font-weight: 700;
  font-size: 22pt;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

.invoice-sheet[data-template="modern"] .inv-from-name {
  font-family: var(--inv-sans);
  font-weight: 700;
  font-size: 13pt;
  letter-spacing: -0.02em;
}

.invoice-sheet[data-template="modern"] .inv-status {
  display: inline-block;
  margin-bottom: 3mm;
  padding: 1mm 2.4mm;
  border: 0.6pt solid var(--inv-accent);
  border-radius: 2px;
  font-size: 7.5pt;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--inv-ink);
  background: transparent;
}

.invoice-sheet[data-template="modern"][data-status="paid"] .inv-status,
html[data-template="modern"] .invoice-sheet[data-status="paid"] .inv-status {
  background: #152227;
  color: #edf2e9;
  border-color: #152227;
}

.invoice-sheet[data-template="modern"] .inv-lines th {
  background: var(--inv-head-bg);
  color: var(--inv-head-ink);
  border-bottom: 0;
  padding: 2.2mm 2.4mm;
}

.invoice-sheet[data-template="modern"] .inv-lines td {
  padding: 2.6mm 2.4mm;
}

.invoice-sheet[data-template="modern"] .inv-lines tbody tr:nth-child(even) td {
  background: var(--inv-soft);
}

.invoice-sheet[data-template="modern"] .inv-lines tbody tr:last-child td {
  border-bottom: 0;
}

.invoice-sheet[data-template="modern"] .inv-totals {
  background: #ffffff;
  border: 0.6pt solid #c8d0c4;
  border-radius: 3px;
  padding: 3mm 4mm 2mm;
  overflow: hidden;
}

.invoice-sheet[data-template="modern"] .inv-totals .inv-total th,
.invoice-sheet[data-template="modern"] .inv-totals .inv-total td {
  border-top: 0.6pt solid #c8d0c4;
}

.invoice-sheet[data-template="modern"] .inv-totals .inv-balance th,
.invoice-sheet[data-template="modern"] .inv-totals .inv-balance td {
  border-top: 0;
  background: var(--inv-head-bg);
  color: var(--inv-head-ink);
  padding-left: 4mm;
  padding-right: 4mm;
  margin: 0;
}

/* Bleed the balance row to the card edges. */
.invoice-sheet[data-template="modern"] .inv-totals table {
  border-collapse: separate;
  border-spacing: 0;
}

.invoice-sheet[data-template="modern"] .inv-totals .inv-balance th {
  padding-left: 4mm;
  border-bottom-left-radius: 2px;
}

.invoice-sheet[data-template="modern"] .inv-totals .inv-balance td {
  padding-right: 4mm;
  border-bottom-right-radius: 2px;
}

.invoice-sheet[data-template="modern"] .inv-totals .inv-balance th,
.invoice-sheet[data-template="modern"] .inv-totals .inv-balance td {
  box-shadow: 4mm 0 0 var(--inv-head-bg), -4mm 0 0 var(--inv-head-bg);
}

@media print {
  /* Padding is removed in print; @page supplies the margin, so the bar
     should stay within the content box rather than underlap the page edge. */
  .invoice-sheet[data-template="modern"]::before {
    margin-left: 0;
    margin-right: 0;
  }
}
