/* Invoice Print & High-Fidelity Preview Stylesheet (German Rechnungen) */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,400;0,600;0,700;1,400&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #2b2b2b;
  background-color: #f1f3f5;
  line-height: 1.45;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

.print-toolbar {
  max-width: 800px;
  margin: 16px auto;
  padding: 12px 20px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-print {
  background: #4f46e5;
  color: #ffffff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.btn-print:hover {
  background: #4338ca;
}

.btn-close {
  background: #e2e8f0;
  color: #334155;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-close:hover {
  background: #cbd5e1;
}

/* Printable A4 Page Container */
.invoice-page {
  width: 210mm;
  min-height: 297mm;
  padding: 24mm 24mm 22mm 24mm;
  margin: 0 auto 30px auto;
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 1. Header */
.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}

.invoice-title {
  font-size: 26px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.seller-info p {
  margin: 2px 0;
  color: #333333;
  font-size: 13.5px;
}

.seller-name {
  font-weight: 600;
}

.seller-email {
  margin-top: 10px !important;
}

.invoice-meta {
  text-align: right;
}

.invoice-num {
  font-size: 22px;
  font-weight: 700;
  color: #2b2b2b;
  margin-bottom: 6px;
}

.invoice-date {
  font-size: 13.5px;
  color: #333333;
}

/* Divider line */
.header-divider {
  width: 100%;
  height: 1.5px;
  background-color: #222222;
  margin-bottom: 36px;
}

/* 2. Recipient Box with Pink/Magenta Accent */
.recipient-box {
  border-left: 4.5px solid #d81b60;
  padding-left: 14px;
  margin-bottom: 38px;
}

.recipient-label {
  font-weight: 700;
  font-size: 14px;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.recipient-name {
  font-size: 13.5px;
  color: #2b2b2b;
}

.recipient-address {
  font-size: 13.5px;
  color: #2b2b2b;
  line-height: 1.4;
}

/* 3. Salutation */
.salutation-text {
  font-size: 13.5px;
  color: #2b2b2b;
  margin-bottom: 26px;
  line-height: 1.5;
}

/* 4. Table */
.invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 26px;
}

.invoice-table thead tr {
  background-color: #f1f3f5;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.invoice-table th {
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #212529;
}

.invoice-table th.col-desc {
  text-align: left;
}

.invoice-table th.col-amount {
  text-align: right;
  width: 130px;
}

.invoice-table td {
  padding: 14px 14px;
  font-size: 13.5px;
  color: #2b2b2b;
  border-bottom: 1px solid #f1f3f5;
}

.invoice-table td.desc {
  text-align: left;
}

.invoice-table td.amount {
  text-align: right;
  white-space: nowrap;
}

/* 5. Total Sum */
.total-section {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-bottom: 45px;
  padding-right: 14px;
}

.total-label {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

.total-amount {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

/* 6. Footer (Legal & Bank Details) */
.invoice-footer {
  margin-top: auto;
  text-align: center;
  font-size: 10.5px;
  color: #6c757d;
  line-height: 1.6;
  padding-top: 25px;
}

.invoice-footer p {
  margin: 3px 0;
}

.footer-thanks {
  font-size: 11px;
}

.footer-terms {
  margin-bottom: 8px !important;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.footer-tax {
  margin-top: 6px !important;
}

.footer-bank {
  margin-top: 2px !important;
}

/* Print Setup for Physical Printers / PDF */
@media print {
  body {
    background: transparent;
    color: #000000;
  }

  .no-print, .print-toolbar {
    display: none !important;
  }

  .invoice-page {
    width: 100%;
    min-height: 100%;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }

  @page {
    size: A4;
    margin: 18mm 18mm 18mm 18mm;
  }

  .invoice-table thead tr {
    background-color: #f1f3f5 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .recipient-box {
    border-left: 4.5px solid #d81b60 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
