/* الطباعة: التقرير الأسبوعي ومحضر الاجتماع */
@media print {
  @page { size: A4; margin: 14mm; }
  :root {
    --bg: var(--pr-paper); --surface: var(--pr-paper); --surface-2: var(--pr-surface-2); --ink: var(--pr-ink); --ink-2: var(--pr-ink-2); --ink-3: var(--pr-ink-3);
    --line: var(--pr-line); --line-2: var(--pr-line-2); --accent: var(--pr-accent);
  }
  body { background: var(--pr-paper); font-size: 12px; color: var(--pr-ink); }
  .sidebar, .topbar, .bottombar, .scrim, .toasts, .no-print, #modal-root, .head-actions, .back, .filters { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; gap: 10px; }
  .card, .report .rsec, .strip { border: 1px solid var(--pr-line); break-inside: avoid; padding: 10px 12px; }
  .rsec { break-inside: auto; }
  .rlist li, .point { break-inside: avoid; }
  .strip { grid-template-columns: repeat(6, 1fr); }
  .kpi b { font-size: 20px; }
  .rhead { border: 1px solid var(--pr-line); }
  details > summary { list-style: none; }
  details:not([open]) > *:not(summary) { display: block; }
  a { color: inherit; text-decoration: none; }
  .badge { border: 1px solid var(--pr-badge); background: var(--pr-paper) !important; color: var(--pr-ink) !important; }
  .pchk { appearance: auto; }
  textarea.notes { border: 1px solid var(--pr-line); min-height: 0; height: auto; }
  h1 { font-size: 20px; }
  h2 { font-size: 14px; }

  /* قالب المحضر: يُطبع وحده */
  body.printing-doc > *:not(#print-doc) { display: none !important; }
  body.printing-doc #print-doc { display: block; }
  .mn-doc { color: var(--pr-ink); font-size: 12.5px; line-height: 1.7; }
  .mn-head { border-bottom: 3px double var(--pr-ink); padding-bottom: 10px; margin-bottom: 14px; }
  .mn-kicker { font-size: 13px; color: var(--pr-ink-2b); letter-spacing: .02em; }
  .mn-doc h1 { font-size: 24px; margin: 2px 0 8px; }
  .mn-doc h2 { font-size: 15px; margin: 18px 0 6px; padding-bottom: 3px; border-bottom: 1.5px solid var(--pr-ink); break-after: avoid; }
  .mn-meta { display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 12.5px; }
  .mn-names { margin: 4px 0; }
  .mn-none { color: var(--pr-muted); margin: 4px 0; }
  .mn-tbl { width: 100%; border-collapse: collapse; margin-top: 4px; }
  .mn-tbl th, .mn-tbl td { border: 1px solid var(--pr-grid); padding: 5px 8px; text-align: start; vertical-align: top; }
  .mn-tbl th { font-weight: 700; border-bottom: 2px solid var(--pr-ink); }
  .mn-tbl tr.mn-grp td { background: var(--pr-surface-2); border-top: 2px solid var(--pr-ink); }
  .mn-tbl tr { break-inside: avoid; }
  .mn-tbl thead { display: table-header-group; }
  .mn-tbl .c-n { width: 28px; text-align: center; }
  .mn-tbl .c-w { width: 18%; }
  .mn-tbl .c-d { width: 14%; }
  .mn-tbl .c-s { width: 11%; }
  .mn-sub { font-size: 11.5px; color: var(--pr-ink-2b); margin-top: 2px; }
  .mn-list { margin: 4px 0; padding-inline-start: 20px; list-style: disc; }
  .mn-sign { display: flex; gap: 40px; margin-top: 40px; break-inside: avoid; }
  .mn-sign div { flex: 1; }
  .mn-sign span { display: block; font-weight: 700; margin-bottom: 36px; }
  .mn-sign i { display: block; border-bottom: 1px solid var(--pr-ink); }
  .mn-foot { margin-top: 24px; padding-top: 6px; border-top: 1px solid var(--pr-rule); font-size: 11px; color: var(--pr-ink-3); }
}

/* العلامة المائية: لا تظهر على الشاشة، وتظهر في الطباعة فقط */
@media print {
  #wm-layer { display: block; position: fixed; inset: 0; z-index: 99999; pointer-events: none; overflow: hidden; }
  .wm-grid { position: absolute; inset: -20%; display: grid; grid-template-columns: repeat(3, 1fr); align-content: space-around; justify-items: center; transform: rotate(-30deg); }
  .wm-t { font-size: 22px; font-weight: 700; color: #000; opacity: var(--wm-op, .07); white-space: nowrap; padding: 36px 0; }
  .wm-foot { position: absolute; inset-inline: 0; bottom: 0; text-align: center; font-size: 10px; color: #000; opacity: calc(var(--wm-op, .07) * 4); }
  .wm-corner { display: none; }
}
