/* ALMODEER 1.1.6 — economical printing of screens and reports (owner's request 2026-10-27 20:43).
   Goal: as little ink and paper as possible, a plain clear font, the rows of a long report packed
   tightly like a classic ledger listing: white page, black text, hair-lines, no colour fills,
   no cards or shadows, a small header (establishment · report · period · printed on) and the
   column titles repeated on every page. Invoices and vouchers keep their own layout (print.css). */
@media print {
  @page { size: A4; margin: 9mm 8mm 11mm; }
  @page wide { size: A4 landscape; margin: 8mm 8mm 10mm; }
  /* a listing with many columns turns the paper sideways by itself, and packs a little tighter */
  .content:has(table thead tr > :nth-child(10)) { page: wide; }
  .content:has(table thead tr > :nth-child(10)) table td,
  .content:has(table thead tr > :nth-child(10)) table th { font-size: 7.5pt !important; padding: 1px 3px !important; }

  html, body { background: #fff !important; }
  body {
    color: #000 !important;
    font-family: 'Cairo', Tahoma, 'Segoe UI', Arial, sans-serif;
    font-size: 8.5pt !important;
    line-height: 1.3;
    -webkit-print-color-adjust: economy; print-color-adjust: economy;
  }
  html[lang="en"] body { font-family: 'Inter', Tahoma, 'Segoe UI', Arial, sans-serif; }

  /* nothing that only helps on screen */
  .sidebar, .topbar, .app-footer, .no-print, .btn, .btn-group, .filter-bar, .nav-pills, .faheem-panel,
  .alert, .alert-stack, .alert-bell, .board-attention, .page-tabs, .services-nav, .people-nav, form .form-control,
  form .form-select, form label, .pagination, .dropdown, .modal, .level-bar, .tier-legend, .board-empty,
  .share-auto, #mustChangeBanner { display: none !important; }
  .main-column, [dir="ltr"] .main-column { margin: 0 !important; }
  .content, .container, .container-fluid { padding: 0 !important; max-width: none !important; }
  .row { --bs-gutter-x: 6px; --bs-gutter-y: 6px; }
  * { box-shadow: none !important; text-shadow: none !important; }
  a { color: #000 !important; text-decoration: none !important; }

  /* cards and panels become plain blocks */
  .card, .panel, .stat-card, .mini-stat { background: #fff !important; border: 0 !important; border-radius: 0 !important; }
  .card-body, .panel { padding: 0 !important; }
  .card-header, .panel-title { background: none !important; border: 0 !important; padding: 0 0 2px !important;
    font-size: 9.5pt !important; font-weight: 700; color: #000 !important; }
  h1, h2, h3, h4, h5, .h5, .h6 { color: #000 !important; font-size: 10pt !important; margin: 4px 0 !important; }
  i.fa-solid, i.fa-regular, i.fa-brands, .tier { display: none !important; }

  /* figures above a report: one thin framed line, no colour */
  .stat-card { border: .5pt solid #888 !important; padding: 2px 6px !important; }
  .stat-card .card-body { padding: 0 !important; }
  .stat-card .stat-label { font-size: 7.5pt !important; color: #333 !important; min-height: 0 !important; }
  .stat-card .stat-value, #boardKpis .stat-value { font-size: 10pt !important; color: #000 !important; margin: 0 !important; }
  .text-success, .text-danger, .text-warning, .text-muted, .text-primary, .text-secondary { color: #000 !important; }
  .badge, .badge-status, .att, .attn, .pill, .chip, [class*="bg-"] { background: none !important; color: #000 !important; border: 0 !important; padding: 0 !important;
    font-weight: 400 !important; font-size: inherit !important; }

  /* charts cost ink: a long listing prints without them (dashboards still print theirs) */
  .content:has(table tbody tr:nth-child(12)) .panel:has(canvas),
  .content:has(table tbody tr:nth-child(12)) .card:has(canvas) { display: none !important; }
  canvas { max-height: 60mm !important; }

  /* the listing itself */
  .table-responsive { overflow: visible !important; }
  table, .table { width: 100% !important; border-collapse: collapse !important; margin: 0 0 4px !important;
    font-size: 8pt !important; --bs-table-bg: #fff; --bs-table-striped-bg: #fff; --bs-table-hover-bg: #fff; }
  .table > :not(caption) > * > * { padding: 1px 4px !important; background: #fff !important; color: #000 !important;
    border-bottom: .3pt solid #bbb !important; box-shadow: none !important; }
  .table td, .table th, table td, table th { font-size: 8pt !important; line-height: 1.25 !important; }
  td.text-end, th.text-end, td.num, td.text-center, td.p-num { white-space: nowrap !important; }
  thead { display: table-header-group; }          /* column titles on every page */
  tfoot { display: table-row-group; }             /* the totals once, after the last row */
  thead th, .table thead th { background: #fff !important; color: #000 !important; font-weight: 700 !important;
    border-top: 1pt solid #000 !important; border-bottom: 1pt solid #000 !important; white-space: nowrap; font-size: 8pt !important; }
  tfoot td, tfoot th, tr.total-row td, tr.table-total td { font-weight: 700 !important; border-top: 1pt solid #000 !important;
    border-bottom: 1pt double #000 !important; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  td { vertical-align: top; }
  .num, td.text-end, td.text-start.num { font-variant-numeric: tabular-nums; }

  /* the small header (layout: .print-head) and the line repeated at the foot of each page */
  .report-head { display: none !important; }
  .print-head { display: block !important; margin: 0 0 6px; }
  .print-head .ph-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .print-head .ph-org { border: .75pt solid #000; padding: 2px 10px; font-size: 10.5pt; font-weight: 700; }
  .print-head .ph-title { border: .75pt solid #000; padding: 2px 14px; font-size: 10.5pt; font-weight: 700; text-align: center; }
  .print-head .ph-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 3px; font-size: 8pt; }
  .print-head .ph-meta span:empty { display: none; }
  .print-head + * { margin-top: 0 !important; }
  .level-section { break-inside: auto; }
}
.print-head { display: none; }
