/* تقارير A4 عمودية — نفس الهوية: كحلي · أخضر حوكمة · ذهبي */
:root { --navy: #123A5A; --teal: #2E7D6E; --gold: #D4A017; --bg: #F5F7FA; --ink: #333; --mut: #5B6576; --line: #E3E8EF; }
* { box-sizing: border-box; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body { margin: 0; background: #DDE3EA; font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; color: var(--ink); }
.bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; padding: 10px 16px; background: var(--navy); }
.bar .sp { flex: 1; }
.b { min-height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; font: inherit; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; cursor: pointer; }
.b.on { background: #fff; color: var(--navy); } .b.pri { background: var(--teal); border-color: var(--teal); }
.loading { text-align: center; padding: 60px; color: var(--mut); }
#pages { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 24px 0 48px; }

.page { width: 210mm; height: 297mm; background: #fff; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 6px 24px rgba(18,58,90,.18); }
.ph { background: var(--navy); color: #fff; padding: 26px 40px 22px; display: flex; justify-content: space-between; align-items: flex-end; border-right: 8px solid var(--gold); }
.ph small { font-size: 12px; font-weight: 700; color: #F2D27A; } .ph h1 { margin: 2px 0; font-size: 24px; } .ph p { margin: 0; font-size: 13px; color: #C9D6E3; }
.ph .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; color: #C9D6E3; }
.ph .meta b { padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: #fff; }
.pb { flex: 1; padding: 20px 40px 0; display: flex; flex-direction: column; gap: 13px; min-height: 0; }
.pf { height: 46px; margin: 0 40px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--mut); }
.pf .n, .ltr { direction: ltr; unicode-bidi: isolate; }
.pf .n { padding: 3px 14px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 700; }
.pf .cls { border-left: 3px solid var(--gold); padding-left: 8px; }

.h2 { white-space: nowrap; display: flex; align-items: baseline; gap: 8px; border-right: 4px solid var(--gold); padding-right: 10px; }
.h2 b { font-size: 16px; color: var(--navy); } .h2 span { font-size: 12px; color: var(--mut); }
.row { display: flex; gap: 12px; } .grow { flex: 1; min-width: 0; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 13px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kpi { flex: 1; min-width: 0; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 1px; }
.kpi span { font-size: 12px; font-weight: 600; color: #4A5565; } .kpi b { font-size: 24px; color: var(--navy); line-height: 1.25; } .kpi small { font-size: 12px; color: var(--mut); }
.donut { position: relative; flex: none; } .donut div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut b { font-size: 24px; color: var(--navy); } .donut small { font-size: 12px; color: var(--mut); }
.leg { display: flex; flex-direction: column; gap: 6px; flex: 1; font-size: 13px; }
.leg div { display: flex; align-items: center; gap: 8px; } .leg i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); flex: none; }
.leg span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .leg b { color: var(--navy); } .leg em { font-style: normal; color: var(--mut); width: 46px; text-align: left; }
.prog { display: flex; flex-direction: column; gap: 3px; font-size: 12px; } .prog > div:first-child { display: flex; justify-content: space-between; } .prog > div:first-child span { color: var(--mut); }
.track { height: 10px; background: #EEF1F5; border-radius: 999px; display: flex; overflow: hidden; } .track i { background: var(--teal); } .track i + i { background: #C0392B; }
.hbar { display: flex; align-items: center; gap: 10px; font-size: 12px; } .hbar > span:first-child { width: 118px; flex: none; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .t { flex: 1; height: 14px; background: #EEF1F5; border-radius: 4px; display: flex; overflow: hidden; } .hbar .t i { background: var(--c, var(--teal)); }
.hbar > span:last-child { min-width: 56px; white-space: nowrap; text-align: left; color: var(--navy); font-weight: 600; }
.cols { border: 1px solid var(--line); border-radius: 12px; padding: 13px; display: flex; gap: 10px; align-items: flex-end; height: 150px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 12px; }
.col b { color: var(--navy); } .col i { width: 60%; background: var(--teal); border-radius: 6px 6px 0 0; } .col span { color: var(--mut); }
.col.side { flex: 1.6; align-self: stretch; justify-content: center; align-items: flex-start; border-right: 1px solid var(--line); padding-right: 14px; }
.col.side b { font-size: 20px; }
.tbl { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 12px; }
.tbl > div { display: grid; grid-template-columns: var(--g); align-items: center; border-bottom: 1px solid var(--line); }
.tbl > div:first-child { background: var(--navy); color: #fff; font-weight: 600; } .tbl > div:last-child { border-bottom: 0; }
.tbl span { padding: 6px 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; } .tbl .num { text-align: left; font-weight: 600; color: var(--navy); }
.tbl > div:first-child .num { color: #fff; }
.mini { display: flex; align-items: center; gap: 6px; } .mini .track { flex: 1; height: 8px; } .mini b { width: 34px; }
.pill { display: inline-flex; padding: 2px 8px; border-radius: 999px; background: var(--bg-c); color: var(--fg-c); font-weight: 600; white-space: nowrap; }
.call { border-right: 4px solid var(--c); background: var(--bg-c); border-radius: 8px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.call b { color: var(--c); font-size: 13px; } .call span { font-size: 12px; line-height: 1.6; }
.cmp { flex: 1; border-radius: 10px; background: var(--bg-c); padding: 9px 12px; display: flex; flex-direction: column; gap: 1px; }
.cmp span { font-size: 13px; font-weight: 700; color: var(--fg-c); } .cmp b { font-size: 22px; color: var(--navy); } .cmp small { font-size: 12px; color: var(--mut); }
.stack { height: 18px; display: flex; border-radius: 999px; overflow: hidden; background: #EEF1F5; } .stack i { background: var(--c); }
.mx { display: grid; grid-template-columns: 150px repeat(6, 1fr); gap: 4px; font-size: 12px; }
.mx > span { padding: 4px; text-align: center; font-weight: 600; color: #4A5565; }
.mx .g { display: flex; align-items: center; gap: 6px; font-weight: 600; } .mx .g i { font-style: normal; min-width: 24px; height: 24px; border-radius: 6px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; }
.mx .c { height: 32px; border-radius: 6px; background: var(--bg-c, #FAFBFC); color: var(--fg-c, #A0A8B5); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.mx .c.t { background: #F0F3F7; color: var(--navy); }
.imp { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; }
.imp > span { font-size: 12px; font-weight: 600; color: #4A5565; } .imp s { color: var(--mut); font-size: 14px; } .imp b { font-size: 22px; color: var(--navy); } .imp small { font-size: 12px; color: var(--teal); font-weight: 600; }
.sign { display: flex; gap: 10px; margin-top: auto; margin-bottom: 14px; }
.sign div { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 14px; font-size: 12px; }
.sign b { color: var(--navy); } .sign b em { color: var(--mut); font-weight: 500; font-style: normal; }
.note { font-size: 12px; color: var(--mut); } .empty { padding: 14px; text-align: center; color: var(--mut); font-size: 12px; }

@page { size: A4 portrait; margin: 0; }
@media print {
  body { background: #fff; } .no-print { display: none !important; }
  #pages { padding: 0; gap: 0; } .page { box-shadow: none; break-after: page; }
}
