/* invoice.css — the invoice document.
 *
 * Its own stylesheet because it is the one thing that leaves the building: it
 * has to survive a print dialog and a customer's email client, neither of which
 * know anything about the app's shell. Self-contained, print-safe, and it reads
 * the brand colour from three custom properties set on the article itself. */

.inv {
  --pad: 34px;
  background: #fff; color: #14170f;
  font: 400 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  max-width: 820px; margin: 0 auto; padding: var(--pad);
  border-top: 5px solid var(--inv-accent);
}
.inv * { box-sizing: border-box; }
.inv .num { text-align: right; font-variant-numeric: tabular-nums; }

.inv__head { display: flex; justify-content: space-between; gap: 28px; align-items: flex-start; margin-bottom: 30px; }
.inv__org { display: flex; gap: 15px; align-items: flex-start; min-width: 0; }
.inv__name { font-size: 19px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 5px; }
.inv__meta { font-size: 12.5px; color: #5f6657; line-height: 1.6; }
.inv__title { text-align: right; flex: none; }
.inv__word {
  font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--inv-accent);
}
.inv__no { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin-top: 3px; }
.inv__stamp {
  display: inline-block; margin-top: 9px; font-size: 11.5px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; padding: 4px 11px; border-radius: 4px;
}
.inv__stamp--paid { background: #eaf3ee; color: #2f7d5d; border: 1px solid #cbe2d6; }
.inv__stamp--late { background: #f9ece8; color: #96432a; border: 1px solid #f0d3cf; }

.inv__parties {
  display: flex; justify-content: space-between; gap: 30px;
  padding: 20px 0; border-top: 1px solid #e4e7e5; border-bottom: 1px solid #e4e7e5; margin-bottom: 26px;
}
.inv__label {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: #98a29d; margin-bottom: 6px;
}
.inv__strong { font-size: 15.5px; font-weight: 650; margin-bottom: 4px; }
.inv__dates { margin: 0; display: grid; gap: 7px; text-align: right; flex: none; }
.inv__dates > div { display: flex; gap: 18px; justify-content: flex-end; }
.inv__dates dt { font-size: 12.5px; color: #5f6657; }
.inv__dates dd { margin: 0; font-size: 13px; font-weight: 600; min-width: 130px; }

.inv__lines { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
.inv__lines th {
  text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: #fff; background: var(--inv-accent);
  padding: 10px 14px;
}
.inv__lines th.num { text-align: right; }
.inv__lines td { padding: 12px 14px; border-bottom: 1px solid #eef0ee; font-size: 13.5px; }
.inv__lines tbody tr:nth-child(even) td { background: #fafbf9; }

.inv__totals { margin-left: auto; width: 300px; }
.inv__totals > div { display: flex; justify-content: space-between; padding: 7px 14px; font-size: 13.5px; }
.inv__due {
  margin-top: 6px; padding: 13px 14px !important; border-radius: 6px;
  background: var(--inv-soft); border: 1px solid var(--inv-accent);
  font-size: 16px; font-weight: 700;
}

.inv__foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid #e4e7e5; }
.inv__terms { font-size: 12.5px; color: #5f6657; margin: 0 0 8px; line-height: 1.6; }
.inv__thanks { font-size: 13.5px; font-weight: 600; color: var(--inv-accent); margin: 10px 0 0; }

/* Shared brand mark, used here and by every other surface. */
.brandmark {
  display: inline-grid; place-items: center; flex: none; overflow: hidden;
  font-weight: 700; letter-spacing: .02em; line-height: 1;
}
.brandmark--img { background: #fff; }
.brandmark img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* The standalone print window. */
.inv-page { margin: 0; padding: 26px; background: #f4f5f4; }
@media print {
  .inv-page { padding: 0; background: #fff; }
  .inv { border-top-width: 4px; max-width: none; padding: 0; }
  @page { margin: 14mm; }
}

.inv__credit {
  display: flex; justify-content: space-between; gap: 24px;
  color: #4a6b1f; font-weight: 600;
}
.inv__prepaid {
  margin-top: 18px; padding: 12px 14px;
  background: #f2f6e8; border: 1px solid #d3ddb0; border-radius: 8px;
  font-size: 12.5px; line-height: 1.6; color: #3f4a2a;
}
