/* ── printable documents (A4) — the statement ── */
.pr-root { min-height: 100vh; background: #e9ecef; padding: 72px 16px 32px; color: #1f2933; }
.pr-toolbar { position: fixed; inset: 0 0 auto 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 20px; background: #fff; border-bottom: 1px solid #dde2e6; font-size: 13px; color: #5f6b76; }
.pr-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid #cfd6dc; background: #fff; color: #1f2933; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.pr-btn.primary { background: var(--accent, #0F766E); border-color: var(--accent, #0F766E); color: #fff; }

.pr-page { width: 210mm; min-height: 297mm; margin: 0 auto; background: #fff; padding: 14mm 12mm 12mm; box-shadow: 0 4px 24px rgba(15, 23, 42, .12); display: flex; flex-direction: column; gap: 14px; font-size: 11.5px; line-height: 1.55; }
.pr-page .num { font-variant-numeric: tabular-nums; }

.pr-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 3px solid var(--accent, #0F766E); }
.pr-brand { display: flex; align-items: center; gap: 10px; }
.pr-logo { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--accent, #0F766E); color: #fff; font-size: 22px; font-weight: 700; }
.pr-brand b { display: block; font-size: 15px; }
.pr-brand small { color: #5f6b76; }
.pr-title { text-align: center; }
.pr-title h1 { margin: 0; font-size: 22px; letter-spacing: .2px; color: var(--accent, #0F766E); }
.pr-title small { color: #8a96a0; letter-spacing: 2px; text-transform: uppercase; font-size: 10px; }
.pr-meta { justify-self: end; border-collapse: collapse; font-size: 11px; }
.pr-meta th { text-align: start; color: #8a96a0; font-weight: 500; padding: 1px 0; padding-inline-end: 10px; }
.pr-meta td { font-weight: 600; }

.pr-parties { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.pr-box { border: 1px solid #dde2e6; border-radius: 8px; padding: 8px 10px; display: grid; gap: 1px; }
.pr-box > span { font-size: 10px; color: #8a96a0; }
.pr-box b { font-size: 14px; }
.pr-box small { color: #5f6b76; }
.pr-box.wide { border-inline-start: 4px solid var(--accent, #0F766E); }

.pr-sum { display: grid; grid-template-columns: repeat(4, 1fr) 1.3fr; gap: 8px; }
.pr-sum > div { border: 1px solid #dde2e6; border-radius: 8px; padding: 8px 10px; display: grid; gap: 1px; background: #f7f9fa; }
.pr-sum span { font-size: 10px; color: #8a96a0; }
.pr-sum b { font-size: 14px; }
.pr-sum .late b { color: #b42318; }
.pr-sum .main { background: var(--accent, #0F766E); border-color: var(--accent, #0F766E); color: #fff; }
.pr-sum .main span, .pr-sum .main small { color: rgba(255, 255, 255, .85); }
.pr-sum .main b { font-size: 17px; }

.pr-h2 { margin: 6px 0 -6px; font-size: 13px; color: var(--accent, #0F766E); display: flex; align-items: center; gap: 8px; }
.pr-h2::after { content: ""; flex: 1; height: 1px; background: #dde2e6; }
.pr-table { width: 100%; border-collapse: collapse; }
.pr-table th { background: #eef3f2; color: #33414c; font-weight: 600; font-size: 10.5px; text-align: start; padding: 6px 6px; border-bottom: 1px solid #cfd6dc; }
.pr-table td { padding: 5px 6px; border-bottom: 1px solid #edf0f2; vertical-align: top; }
.pr-table .end { text-align: end; white-space: nowrap; }
.pr-table tbody tr:nth-child(even) td { background: #fafbfc; }
.pr-table tr { break-inside: avoid; }
.pr-table tfoot td { font-weight: 700; background: #eef3f2; border-top: 2px solid #cfd6dc; border-bottom: 0; }
.pr-table td.late { color: #b42318; font-weight: 600; }
.pr-kind { font-size: 10px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
tr.debt .pr-kind { background: #fff4e5; color: #b54708; }
tr.pay .pr-kind { background: #e7f6ec; color: #1a7f45; }
.pr-ref { display: inline-block; min-width: 30px; text-align: center; font-weight: 700; font-size: 10.5px; padding: 0 6px; border-radius: 4px; border: 1px solid #cfd6dc; background: #fff; margin-inline-end: 5px; font-variant-numeric: tabular-nums; direction: ltr; }
.pr-settle { display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.pr-settle b { margin-inline-start: auto; padding-inline-start: 8px; }
.pr-settle.credit { color: #5f6b76; font-style: italic; }
.pr-sub { display: block; color: #8a96a0; font-size: 10px; }
.pr-note { margin: -6px 0 0; color: #8a96a0; font-size: 10px; }
.pr-empty { color: #5f6b76; text-align: center; padding: 24px 0; }

.pr-sign { display: flex; gap: 24px; margin-top: auto; padding-top: 28px; }
.pr-sign > div { flex: 1; display: grid; gap: 4px; text-align: center; }
.pr-sign span { font-size: 10.5px; color: #5f6b76; }
.pr-sign i { height: 34px; border-bottom: 1px dashed #9aa5ae; }
.pr-sign small { color: #33414c; font-weight: 600; }
.pr-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px solid #dde2e6; color: #8a96a0; font-size: 9.5px; }

@page { size: A4; margin: 10mm 9mm 12mm; @bottom-center { content: "صفحة " counter(page) " من " counter(pages); font-family: "IBM Plex Sans Arabic", sans-serif; font-size: 9px; color: #8a96a0; } }
@media print {
    html, body { background: #fff !important; }
    .pr-root { padding: 0; background: #fff; min-height: 0; }
    .pr-toolbar { display: none; }
    .pr-page { width: auto; min-height: 0; padding: 0; box-shadow: none; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media screen and (max-width: 860px) { .pr-page { width: 100%; padding: 16px; } .pr-parties, .pr-sum { grid-template-columns: 1fr 1fr; } }
