/* =========================================================================
   Paper: A4 documents and reports (794 × 1123 px = 210 × 297 mm @ 96 dpi).
   Rendered on screen, captured to PDF, or printed — one stylesheet for all.
   Plain colours only inside sheets so every capture path renders identically.
   ========================================================================= */
.sheet {
  width: 794px; height: 1123px; position: relative; overflow: hidden; background: #fff; color: #10152A;
  font: 12.5px/1.6 'Geist', 'IBM Plex Sans Arabic', system-ui, sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  --p-accent: #4F46E5; --p-gold: #B8893B; --p-ink: #10152A; --p-ink-2: #3E4559; --p-ink-3: #6E7588; --p-line: #E3E6EC; --p-soft: #F4F5F8;
  --p-ok: #1F9D6B; --p-warn: #C88A00; --p-bad: #D64545;
}
.sheet[dir="rtl"] { font-family: 'IBM Plex Sans Arabic', 'Geist', system-ui, sans-serif; line-height: 1.75; }
.sheet * { box-sizing: border-box; }
.sheet h1, .sheet h2, .sheet h3, .sheet h4 { margin: 0; color: var(--p-ink); letter-spacing: -0.015em; line-height: 1.2; font-weight: 700; }
.sheet[dir="rtl"] :is(h1, h2, h3, h4) { letter-spacing: 0; line-height: 1.4; }
.sheet p { margin: 0 0 8px; }
.sheet .ltr { direction: ltr; unicode-bidi: isolate; }
.sheet-body { position: absolute; inset: 92px 56px 70px; }
.sheet.cover .sheet-body, .sheet.letter .sheet-body { inset: 0; }

/* running header / footer */
.p-head { position: absolute; top: 34px; inset-inline: 56px; display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--p-line); }
.p-mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(145deg, var(--p-accent), #2B2580); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; overflow: hidden; }
.p-mark img { width: 100%; height: 100%; object-fit: cover; }
.p-head .t { font-weight: 600; font-size: 12.5px; }
.p-head .s { color: var(--p-ink-3); font-size: 11.5px; margin-inline-start: auto; }
.p-foot { position: absolute; bottom: 28px; inset-inline: 56px; display: flex; gap: 12px; font-size: 10.5px; color: var(--p-ink-3); padding-top: 10px; border-top: 1px solid var(--p-line); }
.p-foot .pg { margin-inline-start: auto; font-weight: 600; color: var(--p-ink-2); }

/* cover */
  background: radial-gradient(520px 300px at 85% 18%, rgba(99, 91, 255, .55), transparent 70%), radial-gradient(420px 260px at 0% 100%, rgba(184, 137, 59, .45), transparent 70%), linear-gradient(160deg, #141B3A, #070A14 75%); }

/* report building blocks */
.blk { margin-bottom: 18px; }
.p-sec { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 12px; }
.p-sec::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--p-accent); align-self: center; }
.p-sec h2 { font-size: 17px; flex: 1; }
.p-sec span { color: var(--p-ink-3); font-size: 11.5px; }
.p-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.p-kpi { background: var(--p-soft); border-radius: 12px; padding: 12px 14px; }
.p-kpi span { display: block; font-size: 11px; color: var(--p-ink-3); }
.p-kpi b { display: block; font-size: 23px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; margin-top: 2px; }
.p-kpi em { font-style: normal; font-size: 10.5px; color: var(--p-ink-2); }
.p-kpi.hero { background: #10152A; color: #fff; } .p-kpi.hero span, .p-kpi.hero em { color: rgba(255,255,255,.7); }
.p-sum { font-size: 13.5px; line-height: 1.7; color: var(--p-ink-2); }
.p-insights { display: grid; gap: 8px; }
.p-ins { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--p-soft); border-inline-start: 3px solid var(--p-accent); font-size: 12.5px; }
.p-ins.warn { border-color: var(--p-warn); background: #FFF8E8; } .p-ins.bad { border-color: var(--p-bad); background: #FDF0F0; } .p-ins.ok { border-color: var(--p-ok); background: #EEF8F3; }
.p-ins b { display: block; font-size: 12.5px; }
.p-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.p-table th { text-align: start; font-weight: 600; color: var(--p-ink-3); font-size: 10.5px; padding: 7px 8px; background: var(--p-soft); }
.p-table th:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; } .p-table th:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; }
.p-table td { padding: 7px 8px; border-bottom: 1px solid var(--p-line); vertical-align: top; }
.p-table .num { text-align: end; } .p-table tr.total td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--p-ink); }
.p-chip { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: 10.5px; white-space: nowrap; }
.p-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.c-ok { color: var(--p-ok); } .c-warn { color: var(--p-warn); } .c-bad { color: var(--p-bad); } .c-mute { color: #8A90A0; }
.p-bars { display: grid; gap: 7px; }
.p-bar { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: 11.5px; }
.p-bar .tr { height: 10px; border-radius: 5px; background: var(--p-soft); overflow: hidden; display: flex; gap: 1px; }
.p-bar .tr i { display: block; height: 100%; }
.p-bar .v { text-align: end; font-weight: 600; }
.p-legend { display: flex; gap: 14px; font-size: 10.5px; color: var(--p-ink-3); margin-top: 6px; }
.p-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }
.p-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.p-ringrow { display: flex; gap: 20px; align-items: center; }
.p-ringrow .rings .ring-track { fill: none; opacity: .18; } .p-ringrow .rings .ring-arc { fill: none; stroke-linecap: round; }
.p-plan { border-radius: 14px; overflow: hidden; }
.p-plan.dark { background: linear-gradient(160deg, #141B3A, #080B16); padding: 8px; }
.p-plan .iso { width: 100%; height: auto; display: block; }
.p-plan .plan-svg { width: 100%; height: auto; display: block; }
.p-plan .plan-svg .hall { fill: #fff; stroke: #E3E6EC; stroke-width: .15; }
.p-plan .plan-svg .feature rect { fill: #E7EAF0; } .p-plan .plan-svg .feature text { fill: #6E7588; font: 600 1.15px 'Geist', 'IBM Plex Sans Arabic', sans-serif; }
.p-plan .plan-svg .booth rect.b { stroke: #fff; stroke-width: .28; }
.p-plan .plan-svg .booth.available rect.b { fill: #1F9D6B; } .p-plan .plan-svg .booth.reserved rect.b { fill: #D99A00; } .p-plan .plan-svg .booth.confirmed rect.b { fill: #D64545; }
.p-plan .plan-svg .booth text { fill: #fff; font: 700 1.05px 'Geist', sans-serif; }
.p-plan .plan-svg .booth .talk { fill: #fff; stroke: #7A8499; stroke-width: .18; }
.sheet .spark .spark-line { fill: none; stroke: var(--p-accent); stroke-width: 2; } .sheet .spark .spark-area { fill: rgba(79, 70, 229, .12); } .sheet .spark .spark-dot { fill: var(--p-accent); stroke: #fff; stroke-width: 2; }
.sheet .iso .iso-floor { fill: #1A2240; } .sheet .iso .iso-slab-l { fill: #0E1428; } .sheet .iso .iso-slab-r { fill: #131A33; }
.sheet .iso .iso-feature polygon { fill: rgba(255,255,255,.08); } .sheet .iso .iso-feature text { fill: rgba(255,255,255,.55); font: 600 1.15px 'Geist', 'IBM Plex Sans Arabic', sans-serif; }
.sheet .iso .iso-booth.available .f-t { fill: #2BB27F; } .sheet .iso .iso-booth.available .f-r { fill: #1E8A62; } .sheet .iso .iso-booth.available .f-l { fill: #176E4E; }
.sheet .iso .iso-booth.reserved .f-t { fill: #EDAE1A; } .sheet .iso .iso-booth.reserved .f-r { fill: #C38E0C; } .sheet .iso .iso-booth.reserved .f-l { fill: #9C7108; }
.sheet .iso .iso-booth.confirmed .f-t { fill: #EA5A5A; } .sheet .iso .iso-booth.confirmed .f-r { fill: #C24242; } .sheet .iso .iso-booth.confirmed .f-l { fill: #9D3333; }
.sheet .iso .iso-id { fill: rgba(255,255,255,.92); font: 700 1.3px 'Geist', sans-serif; } .sheet .iso .talk { fill: #fff; stroke: #7A8499; stroke-width: .18; }

/* ---------- letterhead (incoming government / company letters) ---------- */
.lh { position: absolute; inset: 0 0 auto 0; height: 150px; padding: 34px 56px 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 16px; }
.lh .side-a { text-align: start; } .lh .side-b { text-align: end; }
.lh .gov { font-size: 11px; color: var(--p-ink-3); }
.lh .ent { font-size: 15px; font-weight: 700; line-height: 1.35; }
.lh .ent-en { font-size: 12.5px; font-weight: 600; line-height: 1.35; direction: ltr; }
.lh .dept { font-size: 11px; color: var(--p-ink-2); margin-top: 2px; }
.seal { width: 74px; height: 74px; border-radius: 50%; border: 2px solid var(--p-gold); display: grid; place-items: center; position: relative; color: var(--p-gold); font-weight: 700; font-size: 17px; letter-spacing: .04em; }
.seal::before { content: ''; position: absolute; inset: 5px; border-radius: 50%; border: 1px dashed var(--p-gold); }
.lh-rule { position: absolute; top: 140px; inset-inline: 56px; height: 3px; background: linear-gradient(90deg, var(--p-gold), #E7D3A9 50%, var(--p-gold)); border-radius: 2px; }
.lh-meta { position: absolute; top: 158px; inset-inline: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: 11.5px; }
.lh-meta div { background: var(--p-soft); border-radius: 10px; padding: 8px 12px; }
.lh-meta span { display: block; color: var(--p-ink-3); font-size: 10.5px; }
.lh-meta b { font-weight: 600; }
.letter-body { position: absolute; top: 236px; inset-inline: 72px; bottom: 150px; font-size: 13.5px; line-height: 1.85; }
.sheet[dir="rtl"] .letter-body { font-size: 14.5px; line-height: 2; }
.letter-body .subj { font-weight: 700; font-size: 14.5px; margin-bottom: 14px; }
.letter-body .to { margin-bottom: 12px; font-weight: 600; }
.letter-body ol { margin: 6px 0 12px; padding-inline-start: 22px; }
.letter-body li { margin: 3px 0; }
.letter-sign { position: absolute; bottom: 92px; inset-inline-end: 72px; text-align: center; min-width: 210px; }
.letter-sign .stamp { width: 92px; height: 92px; border-radius: 50%; border: 2.5px solid rgba(79, 70, 229, .55); color: rgba(79, 70, 229, .7); display: grid; place-items: center; margin: 0 auto 8px; transform: rotate(-12deg); font-weight: 700; font-size: 11px; text-align: center; line-height: 1.3; padding: 10px; }
.letter-sign b { display: block; font-size: 12.5px; } .letter-sign span { font-size: 11px; color: var(--p-ink-3); }
.letter-foot { position: absolute; bottom: 34px; inset-inline: 56px; border-top: 1px solid var(--p-line); padding-top: 10px; display: flex; justify-content: space-between; font-size: 10px; color: var(--p-ink-3); }
.watermark { position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%) rotate(-28deg); font-size: 110px; font-weight: 800; color: rgba(214, 69, 69, .07); letter-spacing: .06em; white-space: nowrap; pointer-events: none; }
.watermark.amber { color: rgba(200, 138, 0, .09); }

/* ---------- contract ---------- */
.ct-title { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.ct-title h1 { font-size: 26px; letter-spacing: -0.025em; }
.ct-title .no { margin-inline-start: auto; text-align: end; font-size: 11.5px; color: var(--p-ink-3); }
.ct-title .no b { display: block; font-size: 15px; color: var(--p-ink); }
.ct-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 11px; padding: 4px 10px; border-radius: 99px; margin-top: 6px; }
.ct-status.signed { background: #EEF8F3; color: var(--p-ok); } .ct-status.reserved { background: #FFF6E2; color: var(--p-warn); } .ct-status.negotiation { background: #F0F1F4; color: #6E7588; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.party { border: 1px solid var(--p-line); border-radius: 12px; padding: 12px 14px; }
.party span { display: block; font-size: 10.5px; color: var(--p-ink-3); font-weight: 600; }
.party b { display: block; font-size: 14px; margin: 2px 0 4px; }
.party div { font-size: 11.5px; color: var(--p-ink-2); }
.ct-totals { margin-inline-start: auto; width: 290px; margin-top: 10px; font-size: 12.5px; }
.ct-totals div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--p-line); }
.ct-totals div.g { border: 0; border-top: 2px solid var(--p-ink); font-weight: 700; font-size: 15px; padding-top: 8px; }
.clauses { font-size: 11.8px; line-height: 1.7; }
.clauses h3 { font-size: 13px; margin: 12px 0 4px; }
.clauses ol { margin: 0; padding-inline-start: 18px; } .clauses li { margin-bottom: 4px; }
.sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 24px; }
.sig { border-top: 1.5px solid var(--p-ink); padding-top: 8px; font-size: 11.5px; position: relative; }
.sig b { display: block; font-size: 12.5px; }
.sig .e-sign { position: absolute; top: -46px; inset-inline-start: 0; font-size: 11px; color: var(--p-ok); font-weight: 700; border: 1.5px solid var(--p-ok); border-radius: 8px; padding: 4px 9px; background: #F3FBF7; transform: rotate(-3deg); }
.sig .pending { position: absolute; top: -40px; inset-inline-start: 0; font-size: 11px; color: var(--p-warn); font-weight: 600; }

/* ---------- certificate ---------- */
.cert { position: absolute; inset: 40px; border-radius: 6px; padding: 14px; background: repeating-linear-gradient(45deg, #F3EBDD 0 2px, #fff 2px 7px); }
.cert-in { position: absolute; inset: 14px; background: #fff; border: 1.5px solid var(--p-gold); border-radius: 4px; padding: 52px 56px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.cert-in .seal { margin-bottom: 14px; }
.cert-in .k { font-size: 12px; color: var(--p-ink-3); }
.cert-in h1 { font-size: 30px; margin: 8px 0 6px; }
.cert-in .issuer { font-size: 14px; font-weight: 600; color: var(--p-ink-2); }
.cert-grid { margin-top: 30px; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: start; }
.cert-grid div { background: var(--p-soft); border-radius: 10px; padding: 10px 14px; }
.cert-grid span { display: block; font-size: 10.5px; color: var(--p-ink-3); } .cert-grid b { font-size: 13px; }
.cert-valid { margin-top: 24px; font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 99px; }
.cert-valid.ok { background: #EEF8F3; color: var(--p-ok); } .cert-valid.warn { background: #FFF6E2; color: var(--p-warn); } .cert-valid.bad { background: #FDF0F0; color: var(--p-bad); }
.cert-body { margin-top: 24px; font-size: 13px; line-height: 1.8; color: var(--p-ink-2); max-width: 560px; }

/* ---------- minutes / memo ---------- */
.memo-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; margin-bottom: 18px; }
.memo-head h1 { font-size: 24px; }
.memo-head .k { color: var(--p-ink-3); font-size: 12px; margin-bottom: 4px; }
.memo-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.memo-meta div { background: var(--p-soft); border-radius: 10px; padding: 8px 12px; font-size: 11.5px; }
.memo-meta span { display: block; font-size: 10.5px; color: var(--p-ink-3); }
.memo-text { font-size: 13.5px; line-height: 1.85; }
.sheet[dir="rtl"] .memo-text { font-size: 14px; line-height: 2; }
.memo-text p { margin-bottom: 10px; }
.conf-band { display: inline-flex; gap: 6px; align-items: center; font-size: 10.5px; font-weight: 700; color: var(--p-bad); border: 1px solid #F3C9C9; background: #FDF3F3; padding: 3px 9px; border-radius: 99px; }

/* screen-only offscreen host and print */
#paper-host { position: fixed; left: -12000px; top: 0; width: 794px; }
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing { background: #fff !important; }
  body.printing #print-root { display: block; }
  #print-root .sheet { break-after: page; page-break-after: always; }
}

/* fixes (visual QA round 1): label selectors must not hit nested values */
.lh-meta span, .memo-meta span, .cert-grid span, .party span { display: inline; font-size: inherit; color: inherit; font-weight: inherit; }
.lh-meta > div > span:first-child, .memo-meta > div > span:first-child, .cert-grid > div > span:first-child, .party > span:first-child { display: block; font-size: 10.5px; color: var(--p-ink-3); font-weight: 600; }
.sigs { margin-top: 74px; }
