/* ===== هوية اللوحة: أخضر عسكري، ورق رمادي بارد، أحمر الختم، خاكي الشعار ===== */
:root {
  --olive: #2E3B2C;
  --olive-2: #3F4F3B;
  --paper: #F1F2EC;
  --sheet: #FFFFFF;
  --ink: #1B2019;
  --muted: #5E6559;
  --line: #D3D6C9;
  --khaki: #D9C870;
  --red: #A81E19;
  --green: #2F6B3A;
  --amber: #8A5A00;
  --kufi: 'Reem Kufi', 'Noto Kufi Arabic', Tahoma, sans-serif;
  --body: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --r: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.65 var(--body); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--khaki); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
mark { background: #F3E59A; color: inherit; padding: 0 1px; border-radius: 2px; }

/* صلاحيات العرض */
body:not([data-role="admin"]) .admin-only { display: none !important; }
body[data-role="viewer"] .edit-only { display: none !important; }
body:not([data-role="viewer"]) .viewer-only { display: none !important; }

/* ===== الترويسة الرسمية ===== */
.letterhead {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px 12px; background: var(--sheet); border-bottom: 1px solid var(--line);
}
.lh-units { font-family: var(--kufi); line-height: 1.5; }
.lh-line { font-size: 15px; font-weight: 500; color: var(--ink); }
.lh-0 { font-size: 18px; font-weight: 700; }
.lh-3 { color: var(--red); font-weight: 700; margin-top: 2px; padding-top: 2px; border-top: 2px solid var(--khaki); display: inline-block; }
.lh-emblems { display: flex; align-items: center; gap: 18px; }
.lh-logo { width: 84px; height: auto; display: block; }
.flag { display: block; width: 78px; height: 52px; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }

.title-band {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--red); color: #fff; padding: 10px 28px;
}
.title-band h1 { margin: 0; font: 700 21px/1.4 var(--kufi); letter-spacing: 0; }
.session { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.session .link-btn { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

.tabs { display: flex; gap: 2px; background: var(--olive); padding: 0 20px; overflow-x: auto; }
.tab {
  background: none; border: 0; color: #DDE2D4; padding: 12px 16px; cursor: pointer; white-space: nowrap;
  font-weight: 500; border-bottom: 3px solid transparent;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--khaki); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 20px 60px; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 7px 16px; border: 1px solid #B9BEAF; border-radius: var(--r);
  background: var(--sheet); cursor: pointer; font-weight: 500;
}
.btn:hover { border-color: var(--olive); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--olive); border-color: var(--olive); color: #fff; }
.btn-primary:hover { background: var(--olive-2); }
.btn-danger { color: var(--red); border-color: #E2B4B1; }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-sm { min-height: 32px; padding: 4px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 2px 0; color: var(--olive); cursor: pointer; font-weight: 500; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: var(--sheet); border-radius: 4px; cursor: pointer; font-size: 11px; }
.icon-btn:disabled { opacity: .3; }

/* ===== البحث ===== */
.search-box { position: relative; margin-bottom: 14px; }
#q {
  width: 100%; height: 62px; padding: 0 22px; font-size: 20px; border: 2px solid var(--olive);
  border-radius: var(--r); background: var(--sheet);
}
#q::placeholder { color: #8C9286; font-size: 17px; }
.search-meta { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.seg { display: inline-flex; border: 1px solid #B9BEAF; border-radius: var(--r); overflow: hidden; }
.seg-btn { border: 0; background: var(--sheet); padding: 8px 14px; cursor: pointer; }
.seg-btn.active { background: var(--olive); color: #fff; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.card {
  display: flex; gap: 12px; text-align: right; padding: 12px; cursor: pointer;
  background: var(--sheet); border: 1px solid var(--line); border-right: 5px solid var(--st, var(--red)); border-radius: 4px;
}
.card:hover { border-color: var(--olive); border-right-color: var(--st, var(--red)); }
.card-photo { flex: 0 0 64px; height: 80px; background: #E5E7DE; border-radius: 2px; overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-photo { display: block; width: 100%; height: 100%;
  background: radial-gradient(circle at 50% 36%, #C3C7B9 0 15px, transparent 16px), radial-gradient(ellipse at 50% 100%, #C3C7B9 0 28px, transparent 29px); }
.card-body { display: flex; flex-direction: column; min-width: 0; }
.card-name { font: 700 17px/1.45 var(--kufi); margin-bottom: 4px; }
.card-line { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-line .k { color: var(--muted); }
.card-line .k::after { content: ':'; }

.empty { text-align: center; padding: 50px 20px; background: var(--sheet); border: 1px dashed #B9BEAF; border-radius: var(--r); }
.empty h3 { font: 700 19px var(--kufi); margin: 0 0 6px; }
.empty p { color: var(--muted); margin: 0 0 16px; }

/* ===== الحالات ===== */
.status-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 3px 12px;
  border: 1px solid #B9BEAF; border-radius: 20px; background: var(--sheet); cursor: pointer; font-size: 14px;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--st, var(--olive)); }
.chip b { font-weight: 700; color: var(--muted); }
.chip.active { background: var(--st, var(--olive)); border-color: var(--st, var(--olive)); color: #fff; }
.chip.active b { color: #fff; }
.chip.active i { background: #fff; }
.st-pill {
  display: inline-block; align-self: flex-start; padding: 0 9px; border-radius: 3px; font-size: 12.5px; font-weight: 700;
  color: #fff; background: var(--st, var(--muted)); line-height: 1.7; white-space: nowrap;
}
.card .st-pill { margin-bottom: 3px; }
.status-pick { border: 0; padding: 0; margin: 0 0 16px; }
.status-pick legend { font-weight: 700; margin-bottom: 6px; }
.status-options { display: flex; flex-wrap: wrap; gap: 6px; }
.st-opt input { position: absolute; opacity: 0; pointer-events: none; }
.st-opt span {
  display: inline-block; padding: 6px 16px; border: 2px solid var(--st); color: var(--st); border-radius: var(--r);
  cursor: pointer; font-weight: 700; background: #fff;
}
.st-opt input:checked + span { background: var(--st); color: #fff; }
.st-opt input:focus-visible + span { outline: 3px solid var(--khaki); outline-offset: 2px; }
input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid #B9BEAF; border-radius: 4px; background: #fff; cursor: pointer; flex: none; }
.col-list .st-color { width: 34px; height: 30px; }

/* ===== الجداول ===== */
.tbl-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { background: #E7E9E0; text-align: right; font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid #E8EAE2; vertical-align: top; }
.tbl.clickable tbody tr { cursor: pointer; }
.tbl.clickable tbody tr:hover { background: #F5F6EF; }
.tbl .more { text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; color: var(--muted); }

/* ===== لوحات ===== */
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 18px; }
.panel h2 { font: 700 19px var(--kufi); margin: 0 0 4px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.hint { color: var(--muted); margin: 0 0 14px; font-size: 14px; max-width: 75ch; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 20px; font-size: 13px; background: #E7E9E0; white-space: nowrap; }
.pill.ok { background: #DDEBDD; color: var(--green); }
.pill.bad { background: #F4DEDC; color: var(--red); }
.pill.warn { background: #F3E8CF; color: var(--amber); }
.pill.info { background: #DCE5EC; color: #2B4A63; }
.ok-msg { color: var(--green); font-weight: 700; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 34px; border: 2px dashed #A9AF9D; border-radius: var(--r); cursor: pointer; text-align: center; background: #FAFBF7;
}
.drop.over, .drop:hover { border-color: var(--olive); background: #F0F3EA; }
.drop input { display: none; }
.drop strong { font-size: 17px; }
.drop small { color: var(--muted); }
#imp-preview { margin-top: 18px; }
.imp-row { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin-bottom: 12px; }
.imp-row label, .filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.imp-row input, .imp-row select { width: 160px; }
.imp-opts { border: 1px solid var(--line); border-radius: 4px; margin: 14px 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.imp-opts legend { padding: 0 6px; font-weight: 700; }
.progress { height: 8px; background: #E7E9E0; border-radius: 4px; overflow: hidden; margin-top: 12px; }
.progress div { height: 100%; width: 0; background: var(--olive); transition: width .2s; }

input:not([type=checkbox]):not([type=radio]), select, textarea {
  min-height: 40px; padding: 7px 11px; border: 1px solid #B9BEAF; border-radius: 4px; background: #fff; width: 100%;
}
textarea { resize: vertical; }

.inline-form { display: flex; gap: 8px; margin-bottom: 16px; max-width: 560px; }
.col-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: c; }
.col-list li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); counter-increment: c; }
.col-list li::before { content: counter(c); width: 26px; color: var(--muted); font-size: 13px; text-align: center; }
.col-list .col-name { flex: 1; font-weight: 500; }
.col-actions { display: flex; align-items: center; gap: 10px; }
.empty-li::before { display: none; }

.roles-key { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 14px; }
.filters select, .filters input { min-width: 140px; }
.diff { margin: 0; padding: 0 16px 0 0; font-size: 13px; }
.diff del { color: var(--red); }
.diff ins { color: var(--green); text-decoration: none; }

/* ===== النوافذ ===== */
.dlg { border: 0; border-radius: var(--r); padding: 22px; width: min(480px, 94vw); max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dlg-wide { width: min(860px, 96vw); }
.dlg::backdrop { background: rgba(20, 26, 18, .55); }
.dlg h2 { font: 700 20px var(--kufi); margin: 0 0 14px; }
.dlg form > label, .dlg label.check { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; font-weight: 500; }
.dlg label.check { flex-direction: row; align-items: center; gap: 8px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-error { color: var(--red); font-weight: 500; margin: 8px 0 0; }

.form-grid { display: grid; grid-template-columns: 170px 1fr; gap: 20px; }
.photo-field { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.photo-frame { width: 150px; height: 190px; border: 2px dashed #A9AF9D; background: #ECEEE6; display: grid; place-items: center; color: var(--muted); font-size: 13px; overflow: hidden; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }
.fields label.full { grid-column: 1 / -1; }

/* ===== ملف المطلوب ===== */
.d-head { display: flex; gap: 20px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); margin-bottom: 14px; }
.d-photo { flex: 0 0 150px; height: 190px; border: 1px solid var(--ink); background: #ECEEE6; display: grid; place-items: center; color: var(--muted); font-size: 13px; overflow: hidden; }
.d-photo img { width: 100%; height: 100%; object-fit: cover; }
.d-title { position: relative; flex: 1; padding-top: 6px; }
.d-title h2 { font: 700 28px/1.35 var(--kufi); margin: 0 0 8px; }
.d-meta { color: var(--muted); font-size: 13px; margin: 0; }
.stamp {
  display: inline-block; font: 700 18px var(--kufi); color: var(--st, var(--red)); border: 3px double var(--st, var(--red));
  padding: 0 14px; transform: rotate(-4deg); margin-bottom: 8px; letter-spacing: 2px;
}
.d-fields { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; }
.d-row { display: grid; grid-template-columns: 38% 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px dotted #B9BEAF; break-inside: avoid; }
.d-row dt { color: var(--muted); font-size: 14px; }
.d-row dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 140%); background: var(--olive); color: #fff;
  padding: 10px 20px; border-radius: var(--r); transition: transform .25s, visibility .25s; z-index: 1000; max-width: 92vw; visibility: hidden;
}
#toast.show { transform: translate(-50%, 0); visibility: visible; }
#toast.bad { background: var(--red); }

/* ===== صفحة الدخول ===== */
.login-page { min-height: 100vh; display: grid; place-items: center; background: var(--olive); padding: 24px 14px; }
.login-wrap { width: min(430px, 100%); background: var(--sheet); border-radius: var(--r); padding: 28px 28px 20px; text-align: center; border-top: 6px solid var(--red); }
.login-crest img { width: 120px; height: auto; }
.login-head { font: 500 15px/1.6 var(--kufi); margin: 8px 0 4px; }
.login-head div:first-child { font-weight: 700; font-size: 17px; }
.login-head div:last-child { color: var(--red); font-weight: 700; }
.login-title { font: 700 19px/1.5 var(--kufi); margin: 10px 0 18px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.login-form { text-align: right; display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 500; }
.login-flag { display: flex; justify-content: center; margin-top: 20px; }
.login-flag .flag { width: 66px; height: 44px; }
.classified { color: var(--red); font-size: 12.5px; font-weight: 700; margin: 10px 0 0; }

/* ===== إضافات ===== */
.sub-h { font: 700 15px var(--kufi); margin: 14px 0 6px; }
.imp-map { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; }
.imp-map li { padding: 6px 10px; border-radius: 4px; font-size: 14px; }
.imp-map li.ok { background: #E6EFE3; }
.imp-map li.miss { background: #F6EEDC; color: var(--amber); }
.tbl th.core { background: #DCE6D4; }
.core-li .col-name::after { content: ''; }
.danger-zone { border-color: #E2B4B1; }
.danger-zone h2, .danger-h { color: var(--red); }
.fab { display: none; }
html { scroll-padding-top: 70px; }
body { padding-bottom: env(safe-area-inset-bottom); }

/* ===== الهاتف (آيفون وأندرويد) ===== */
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  /* منع تكبير الآيفون عند الكتابة */
  input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea, #q { font-size: 16px !important; }

  .letterhead { padding: max(8px, env(safe-area-inset-top)) 12px 8px; gap: 8px; }
  .lh-units { line-height: 1.35; }
  .lh-line { font-size: 11.5px; } .lh-0 { font-size: 13px; } .lh-3 { font-size: 12px; }
  .lh-logo { width: 52px; } .lh-flag { width: 44px; height: 30px; }
  .lh-emblems { gap: 8px; }
  .title-band { padding: 8px 12px; gap: 4px; }
  .title-band h1 { font-size: 15px; line-height: 1.5; }
  .session { font-size: 12.5px; gap: 12px; width: 100%; }
  .session #who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .tabs { position: sticky; top: 0; z-index: 20; padding: 0 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 12px 13px; scroll-snap-align: start; font-size: 14.5px; }

  .wrap { padding: 12px 10px calc(90px + env(safe-area-inset-bottom)); }
  .search-box { position: sticky; top: 46px; z-index: 15; background: var(--paper); padding: 6px 0 2px; margin: -6px 0 8px; }
  #q { height: 52px; padding: 0 14px; }
  #q::placeholder { font-size: 14px; }
  .search-meta { position: static; transform: none; margin-top: 4px; font-size: 13px; }
  .toolbar { gap: 6px; }
  .toolbar .btn { flex: 1 1 auto; min-height: 44px; }
  .toolbar .grow { display: none; }
  #view-search .toolbar > .btn-primary { display: none; } /* زر الإضافة صار عائم */
  .seg { flex: 1 1 100%; } .seg-btn { flex: 1; min-height: 42px; }
  .status-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -10px 12px; padding: 2px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .status-chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; min-height: 38px; }

  .cards { grid-template-columns: 1fr; gap: 8px; }
  .card { padding: 10px; }
  .card-photo { flex-basis: 58px; height: 72px; }

  .fab {
    display: grid; place-items: center; position: fixed; z-index: 30;
    left: 16px; bottom: calc(18px + env(safe-area-inset-bottom));
    width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--olive); color: #fff; font-size: 32px; line-height: 1;
    box-shadow: 0 6px 18px rgba(0,0,0,.3);
  }
  body[data-role="viewer"] .fab { display: none; }

  .panel { padding: 14px 12px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input:not([type=color]) { flex: 1 1 200px; }
  .imp-row label { flex: 1 1 45%; } .imp-row input, .imp-row select { width: 100%; }
  .filters label { flex: 1 1 45%; } .filters select, .filters input { min-width: 0; }
  .filters .btn { flex: 1 1 100%; }
  .col-list li { flex-wrap: wrap; }
  .col-actions { gap: 14px; }
  .icon-btn { width: 38px; height: 38px; }
  .link-btn { padding: 6px 0; }

  /* النوافذ تصير شاشة كاملة */
  .dlg, .dlg-wide {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border-radius: 0;
    padding: calc(14px + env(safe-area-inset-top)) 14px 0;
  }
  .dlg > form, .dlg { display: flex; flex-direction: column; }
  .dlg:not([open]) { display: none; }
  .dlg-actions {
    position: sticky; bottom: 0; margin: auto -14px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); z-index: 2;
  }
  .dlg-actions .btn { flex: 1 1 auto; min-height: 46px; }
  .dlg-actions .grow { display: none; }

  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .photo-field { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px 14px; }
  .photo-frame { width: 120px; height: 150px; }
  .fields, .d-fields { grid-template-columns: 1fr; }
  .st-opt span { padding: 8px 14px; }

  .d-head { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .d-photo { flex: none; width: 150px; height: 190px; }
  .d-title h2 { font-size: 23px; }
  .d-row { grid-template-columns: 40% 1fr; }

  .tbl { font-size: 13.5px; }
  .roles-key { flex-direction: column; }
  .panel-head { flex-wrap: wrap; gap: 8px; }
  #toast { bottom: calc(90px + env(safe-area-inset-bottom)); }

  .login-page { padding: calc(20px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom)); }
  .login-wrap { padding: 22px 18px 16px; }
}
@media (hover: none) {
  .card:active { background: #F5F6EF; }
  .btn:active { transform: scale(.98); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== الطباعة ===== */
#print-area { display: none; }
@page { size: A4 portrait; margin: 12mm; }
@media print {
  body { background: #fff; font-size: 12pt; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  .p-letterhead { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
  .p-letterhead .lh-units { font-family: var(--kufi); font-weight: 700; font-size: 12.5pt; line-height: 1.55; }
  .p-emblems { display: flex; align-items: center; gap: 12px; }
  .p-emblems img { width: 72px; }
  .p-emblems .flag { width: 60px; height: 40px; }
  .p-title { text-align: center; font: 700 16pt var(--kufi); margin: 6px 0 4px; }
  .p-sub { text-align: center; margin: 0 0 8px; }
  .p-tbl { font-size: 9.5pt; }
  .p-tbl th, .p-tbl td { border: 1px solid #555; padding: 4px 5px; }
  .p-tbl th { background: #e6e6e6 !important; position: static; }
  .p-tbl tr { break-inside: avoid; }
  .p-tbl thead { display: table-header-group; }
  .dossier .d-fields { grid-template-columns: 1fr 1fr; }
  .st-pill, .stamp { -webkit-print-color-adjust: exact; }
  .p-foot { margin-top: 14px; font-size: 9pt; color: #444; border-top: 1px solid #999; padding-top: 4px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
