/* طبقة إصلاحات العرض والتصدير — تُحمّل بعد styles.css لتتقدم عليه */

/* ===== إصلاح تصدير PDF: الجداول تلتف ولا تُقص مهما كان عرض الجهاز ===== */
@media print {
  table.tbl { display: table !important; white-space: normal !important; overflow: visible !important; width: 100% !important; table-layout: auto; }
  .tbl thead { display: table-header-group !important; }
  .tbl tbody { display: table-row-group !important; }
  .tbl tr { display: table-row !important; }
  .tbl th, .tbl td { display: table-cell !important; white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; }
  .report-doc, .report-doc > table.tbl, .report-doc h3 + table.tbl { overflow: visible !important; }
  .report-doc table.tbl { break-inside: auto !important; }
  .tbl tr { break-inside: avoid; }
  .report-doc table.tbl { font-size: .78rem; }
  .report-doc table.tbl td { padding: 8px 10px; vertical-align: top; }
}

/* ===== إصلاح صف الملفات على الجوال: لا تراكب — الأزرار تنزل سطرًا مستقلًا ===== */
@media (max-width: 760px) {
  .file-row { flex-wrap: wrap; row-gap: 8px; }
  .file-row .fmeta { flex: 1 1 0; }
  .file-row .fmeta b { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
  .file-row .fmeta span { display: block; line-height: 1.8; }
  .file-row .file-actions { flex-basis: 100%; flex-wrap: wrap; justify-content: flex-start; }
  .file-row .file-actions .btn { min-height: 36px; }
}
