/* ARENA — A4 invoice (TEST COPY). Same layout as a classic invoice template, in ARENA's colours:
   night-blue edge blocks beside the title, the striped pole as the divider, a night-blue table head,
   a boxed total, a thank-you line and a night-blue footer with the horse head.
   The sheet is a real A4 page (794 × 1123 px = 210 × 297 mm); main.js shrinks it to fit small screens. */

.inv-wrap { padding: var(--sp-4); }
.inv-a4 {
  --inv-night: #06106A; --inv-blue: #0000A7; --inv-ink: #22264A; --inv-grey: #4A5070; --inv-line: #D9DCEC; --inv-tint: #E9EBFA;
  box-sizing: border-box; width: 794px; height: 1123px; margin: 0 auto; flex: none;
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: var(--inv-ink); font-family: var(--ui); font-size: 14px; line-height: 1.55;
  box-shadow: 0 6px 24px rgb(6 16 106 / .14);
}
.inv-a4 .num { font-variant-numeric: tabular-nums; }

/* ---------- top: edge blocks, the title, the club ---------- */
.inv-top { display: grid; grid-template-columns: 44px auto 1fr 44px; align-items: center; gap: 0; margin-top: 56px; }
.inv-edge { height: 70px; background: var(--inv-night); }
.inv-title { padding-inline: 24px; display: grid; line-height: 1; }
.inv-title h3 { margin: 0; font-size: 52px; font-weight: 800; color: var(--inv-night); line-height: 1.05; }
.inv-title .latin { font-family: var(--brand); font-size: 15px; letter-spacing: .32em; color: var(--inv-blue); margin-top: 6px; }
.inv-club { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 14px; padding-inline: 24px; text-align: end; }
.inv-club b { display: block; font-size: 17px; color: var(--inv-night); font-weight: 700; }
.inv-club small { display: block; font-size: 12px; color: var(--inv-grey); }
.inv-club img { width: 92px; height: auto; }

/* ---------- body ---------- */
.inv-body { flex: 1; display: flex; flex-direction: column; gap: 30px; padding: 34px 64px 0; }
.inv-body > .pole { width: 100%; height: 7px; }
.inv-lab { display: block; font-size: 12.5px; font-weight: 800; color: var(--inv-night); margin-bottom: 6px; }
.inv-parties { display: grid; grid-template-columns: 1fr auto; gap: 24px; }
.inv-parties p { margin: 0; font-size: 12.5px; color: var(--inv-grey); }
.inv-name { display: block; font-size: 24px; font-weight: 700; color: var(--inv-night); line-height: 1.3; margin-bottom: 6px; }
.inv-due { text-align: end; display: grid; justify-items: end; }
.inv-big { font-size: 28px; font-weight: 800; color: var(--inv-blue); line-height: 1.2; }
.inv-dash { display: block; width: 26px; height: 4px; border-radius: 2px; background: #C9CBDA; margin: 10px 0 12px; }
.inv-state { margin-top: 10px; display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 99px; background: var(--inv-tint); color: var(--inv-night); }
.inv-state.paid { background: #E5F2EA; color: #1B6E3F; }
.inv-state.partly { background: #FBF0DB; color: #8A5200; }
.inv-state.cancelled { background: #FBE8E6; color: #A8231B; }

/* ---------- the items table, with the totals box inside it (so its edges line up with the columns) ---------- */
.inv-table { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.inv-table th, .inv-table td { border: 0; background: none; }
.inv-table col, .inv-table th:nth-child(1) { width: auto; }
.inv-table thead th { background: var(--inv-night); color: #fff; font-weight: 700; font-size: 13.5px; padding: 11px 16px; text-align: center; }
.inv-table thead th:first-child { text-align: start; }
.inv-table thead th:nth-child(2) { width: 15%; }
.inv-table thead th:nth-child(3), .inv-table thead th:nth-child(4) { width: 19%; }
.inv-table tbody td { border: 1.5px solid var(--inv-night); padding: 14px 16px; text-align: center; font-weight: 700; color: var(--inv-night); }
.inv-table tbody td:first-child { text-align: start; }
.inv-table tbody td small { display: block; font-weight: 500; font-size: 12px; color: var(--inv-grey); }
.inv-table tbody .inv-disc td { color: var(--inv-grey); font-weight: 600; }

/* totals: label under «السعر», amount under «الإجمالي»; one outline, one strong line above «الباقي» */
.inv-table tfoot th, .inv-table tfoot td.inv-v { padding: 10px 16px; text-align: center; font-size: 13px; }
.inv-table tfoot th { font-weight: 500; color: var(--inv-grey); border-inline-start: 1.5px solid var(--inv-night); }
.inv-table tfoot td.inv-v { font-weight: 700; color: var(--inv-night); border-inline-end: 1.5px solid var(--inv-night); white-space: nowrap; }
.inv-table tfoot .inv-sum th, .inv-table tfoot .inv-sum td.inv-v { border-top: 1px solid var(--inv-line); }
.inv-table tfoot .inv-owed th, .inv-table tfoot .inv-owed td.inv-v { border-top: 1.5px solid var(--inv-night); font-size: 17px; font-weight: 800; color: var(--inv-night); padding-block: 13px; }
.inv-table tfoot .inv-owed td.inv-v { color: var(--inv-blue); }
.inv-table tfoot .inv-last th, .inv-table tfoot .inv-last td.inv-v { border-bottom: 1.5px solid var(--inv-night); }
.inv-table tfoot td.inv-pay { vertical-align: top; text-align: start; padding: 26px 0 0; padding-inline-end: 28px; }
.inv-pay h4 { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--inv-night); }
.inv-pay p { margin: 0; font-size: 12.5px; color: var(--inv-grey); font-weight: 400; }

.inv-thanks { margin: auto 0 0; padding-bottom: 92px;   /* sits above the hill, like the template */ font-size: 21px; font-weight: 800; color: var(--inv-night); }

/* ---------- footer: the hill with the horse head, and the contact line ---------- */
.inv-foot { position: relative; height: 54px; background: var(--inv-night); color: #fff; display: flex; align-items: center; padding-inline: 200px 64px; }
.inv-hill { position: absolute; inset-inline-start: 34px; bottom: 54px; width: 136px; height: 64px; background: var(--inv-night); border-radius: 70px 70px 0 0; display: grid; place-items: center; padding-top: 10px; box-sizing: border-box; }
.inv-hill img { width: 40px; height: 40px; }
.inv-foot p { margin: 0; margin-inline-start: auto; display: flex; gap: 22px; font-size: 12px; opacity: .92; }

/* ---------- print / PDF: exactly one A4 page, edge to edge ---------- */
@media print {
  .inv-wrap { padding: 0 !important; background: none !important; }
  .inv-a4 { zoom: 1 !important; width: 210mm !important; height: 296.5mm !important; box-shadow: none !important; margin: 0 !important; }
  .inv-a4, .inv-a4 * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
