/* THE WHEATLESS WHISK - The branded invoice / receipt sheet
   Shared by the trade account (printed invoices), the control desk (Invoices tab) and the
   customer's invoice page (invoice.html). Fixed print-friendly colours on purpose: an invoice
   looks the same on paper, as a PDF and on screen, whatever theme the page has. */
.inv-sheet * { box-sizing: border-box; }
.inv-sheet { font-family: 'Inter', Arial, sans-serif; color: #2B2B2B; font-size: 10.5pt; line-height: 1.45; }
.inv-sheet strong { color: #2B2B2B; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 14px; border-bottom: 3px solid #D07275; margin-bottom: 18px; }
.inv-brand { display: flex; align-items: center; gap: 14px; }
.inv-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 12px; }
.inv-name { font-family: 'Fraunces', Georgia, serif; font-size: 20pt; font-weight: 700; color: #2B2B2B; line-height: 1.1; }
.inv-tag { color: #54724E; font-weight: 600; font-size: 9.5pt; letter-spacing: 0.04em; margin-top: 3px; }
.inv-contact { color: #6B6B6B; font-size: 9pt; margin-top: 2px; }
.inv-title { text-align: right; }
.inv-word { font-family: 'Fraunces', Georgia, serif; font-size: 26pt; font-weight: 700; color: #D07275; line-height: 1; text-transform: uppercase; letter-spacing: 0.06em; }
.inv-ref { font-family: monospace; font-size: 11pt; margin: 6px 0; color: #2B2B2B; }
.inv-status { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 9pt; font-weight: 700; }
.inv-status.is-paid { background: #E6F0E1; color: #2F5A2A; }
.inv-status.is-due { background: #FBF1DC; color: #6B4A12; }
.inv-status.is-overdue { background: #FDECEA; color: #A8322A; }
.inv-status.is-part { background: #EAF1FB; color: #2D5B8A; }
.inv-status.is-draft, .inv-status.is-cancelled { background: #F1ECE8; color: #6B6B6B; }
.inv-notes { background: #FBF6EE; border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; white-space: pre-wrap; }
.inv-cancelled { border: 2px solid #A8322A; color: #A8322A; border-radius: 8px; padding: 8px 12px; text-align: center; font-weight: 700; margin-bottom: 16px; }
.inv-legal { font-size: 8.5pt; }
.inv-meta { display: flex; gap: 16px; margin-bottom: 18px; }
.inv-box { flex: 1; background: #FDF1F1; border-radius: 10px; padding: 12px 14px; }
.inv-label { text-transform: uppercase; letter-spacing: 0.08em; font-size: 8pt; font-weight: 700; color: #BB5D60; margin-bottom: 4px; }
.inv-fact { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; }
.inv-fact span { color: #6B6B6B; }
.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.inv-table th { background: #D07275; color: #fff; text-align: left; font-size: 9pt; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 10px; border: 0; }
.inv-table th:first-child { border-radius: 8px 0 0 8px; }
.inv-table th:last-child { border-radius: 0 8px 8px 0; }
.inv-table td { padding: 8px 10px; border-bottom: 1px solid #F0DEDE; vertical-align: top; }
.inv-table tbody tr:nth-child(even) td { background: #FFF8F8; }
.inv-table th:not(:first-child), .inv-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.inv-pack { display: block; color: #6B6B6B; font-size: 9pt; }
.inv-totals { margin-left: auto; width: 46%; margin-bottom: 18px; }
.inv-totals div { display: flex; justify-content: space-between; padding: 5px 10px; }
.inv-totals .inv-grand { background: #2B2B2B; border-radius: 8px; margin-top: 4px; font-size: 12pt; }
.inv-totals .inv-grand span, .inv-totals .inv-grand strong { color: #fff; }
.inv-bank { background: #EEF3EC; border-left: 4px solid #54724E; border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; }
.inv-bank .inv-label { color: #54724E; }
.inv-foot { border-top: 1px solid #F0DEDE; padding-top: 10px; text-align: center; color: #6B6B6B; font-size: 9pt; }
.inv-foot p { margin: 2px 0; }
.inv-foot .inv-thanks { font-family: 'Fraunces', Georgia, serif; font-size: 12pt; color: #D07275; font-style: italic; }
/* Phones: stack the header and the boxes */
@media screen and (max-width: 600px) {
  .inv-head, .inv-meta { flex-direction: column; }
  .inv-title { text-align: left; }
  .inv-totals { width: 100%; }
  .inv-table th, .inv-table td { padding: 7px 6px; }
  .inv-table th:nth-child(3), .inv-table td:nth-child(3) { display: none; }
}
@media print {
  .inv-sheet, .inv-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .inv-table tr, .inv-totals, .inv-bank { break-inside: avoid; }
}

/* The customer's invoice page (invoice.html) */
.ip-page [hidden] { display: none !important; }
.ip-wrap { max-width: 860px; }
.ip-sheet { background: #fff; border: 1px solid #F0DEDE; border-radius: 16px; padding: 28px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06); }
.ip-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ip-notice { background: #FBF1DC; border: 1px solid #F1E2C2; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; color: #2B2B2B; }
.ip-notice.is-good { background: #E6F0E1; border-color: #CFE0C7; }
.ip-notice.is-error { background: #FDECEA; border-color: #F3C6C1; color: #A8322A; }
.ip-small { font-size: 0.85rem; color: var(--color-text-muted, #6B6B6B); margin: 0 0 12px; }
.ip-help { margin-top: 14px; text-align: center; }
@media screen and (max-width: 600px) {
  .ip-sheet { padding: 16px; border-radius: 12px; }
}
@media print {
  body.ip-page > *:not(main), .ip-actions, .ip-notice, .ip-small { display: none !important; }
  body.ip-page, body.ip-page main, body.ip-page .section-padding { background: #fff !important; background-image: none !important; padding: 0 !important; margin: 0 !important; }
  html:has(body.ip-page) { background: #fff !important; color-scheme: light !important; }
  body.ip-page .ip-sheet { border: 0; box-shadow: none; padding: 0; }
  body.ip-page .container { max-width: none; padding: 0; }
  @page { margin: 12mm; }
}
