/* =====================================================================
   Printed report layout (all pages that include _report_header.html).
   Matches the reference "Sales Report" PDF: centred letterhead, rules,
   summary as a label / value list, plain ruled table, small footer.
   Loaded last so it wins over the on-screen card styles.
   ===================================================================== */
.report-summary-title{display:none}

@media print{
  /* named page so receipts / vouchers keep their own page setup */
  /* empty margin boxes replace the browser's own header/footer (date, page title, URL, page no.) */
  @page report{size:A4 landscape;margin:12mm 10mm;
    @top-left{content:''}@top-center{content:''}@top-right{content:''}
    @bottom-left{content:''}@bottom-center{content:''}
    @bottom-right{content:counter(page) ' / ' counter(pages);font:400 8pt Arial,Helvetica,sans-serif;color:#555}}
  .content:has(.report-print-header){page:report}

  .content:has(.report-print-header){font:9pt/1.35 Arial,Helvetica,sans-serif!important;color:#000!important;background:#fff!important}

  /* ---------- Letterhead ---------- */
  .content:has(.report-print-header) .report-print-header{display:block!important;margin:0 0 5mm;padding:0!important;text-align:center;color:#000}
  .content:has(.report-print-header) .report-identity{display:block;padding-bottom:4mm;border-bottom:1px solid #9a9a9a;text-align:center}
  .content:has(.report-print-header) .report-identity img{display:block;width:auto;max-width:24mm;max-height:24mm;margin:0 auto 3mm;object-fit:contain}
  .content:has(.report-print-header) .report-identity h1{margin:0 0 1.5mm;font-size:18pt;font-weight:700;line-height:1.2;color:#000}
  .content:has(.report-print-header) .report-identity p{margin:.6mm 0;font-size:9pt;color:#000}
  .content:has(.report-print-header) .report-title{margin:0!important;padding:4mm 0!important;border-top:0!important;border-bottom:1px solid #9a9a9a!important;text-align:center}
  .content:has(.report-print-header) .report-title h2{margin:0 0 1.5mm;font-size:15pt;font-weight:700;color:#000}
  .content:has(.report-print-header) .report-title p{margin:.6mm 0;font-size:9pt;color:#000}

  /* ---------- Summary: label / value list instead of boxes ---------- */
  .content:has(.report-print-header) .report-summary-title{display:block!important;margin:0 0 2mm;font-size:11pt;font-weight:700;color:#000}
  .content:has(.report-print-header) .metrics.report-summary{display:block!important;width:105mm;margin:0 0 6mm!important;padding:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;overflow:visible!important;break-inside:avoid}
  .content:has(.report-print-header) .metrics.report-summary>article{display:grid!important;grid-template-columns:1fr auto!important;flex-direction:row!important;align-items:baseline!important;justify-content:stretch!important;gap:6mm;width:100%!important;min-height:0!important;margin:0!important;padding:1mm 0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important}
  .content:has(.report-print-header) .metrics.report-summary>article::before,
  .content:has(.report-print-header) .metrics.report-summary>article::after{display:none!important;content:none!important}
  .content:has(.report-print-header) .metrics.report-summary>article span{display:block!important;margin:0!important;text-align:left!important;font-size:9.5pt!important;font-weight:400!important;color:#000!important}
  .content:has(.report-print-header) .metrics.report-summary>article strong{display:block!important;margin:0!important;font-size:9.5pt!important;font-weight:700!important;color:#000!important;text-align:right!important;white-space:nowrap}

  /* ---------- Tables: plain, ruled ---------- */
  .content:has(.report-print-header) .panel,
  .content:has(.report-print-header) .table-panel,
  .content:has(.report-print-header) .fin-table-scroll{margin:0 0 5mm!important;padding:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;overflow:visible!important}
  .content:has(.report-print-header) .table-panel>h2,
  .content:has(.report-print-header) .invoice-heading h2{margin:0 0 2mm;font-size:11pt;font-weight:700;color:#000}
  .content:has(.report-print-header) table{width:100%!important;min-width:0!important;table-layout:auto!important;border-collapse:collapse!important;border:0!important;background:none!important}
  .content:has(.report-print-header) thead{display:table-header-group}
  .content:has(.report-print-header) tr{break-inside:avoid}
  .content:has(.report-print-header) th,
  .content:has(.report-print-header) td{padding:1.8mm 2mm 1.8mm 1.2mm!important;border:0!important;border-bottom:1px solid #d4d4d4!important;background:none!important;box-shadow:none!important;color:#000!important;font-family:"Segoe UI",Arial,Helvetica,sans-serif!important;font-size:7.5pt!important;line-height:1.3!important;text-align:left!important;vertical-align:top;overflow-wrap:normal!important;word-break:normal!important;overflow:visible!important}
  .content:has(.report-print-header) th{position:static!important;border-bottom:1.5px solid #333!important;font-weight:700!important;letter-spacing:.03em;text-transform:uppercase;white-space:normal!important;vertical-align:bottom!important}
  .content:has(.report-print-header) td{font-weight:400!important}
  .content:has(.report-print-header) td *{color:#000!important;background:none!important}
  .content:has(.report-print-header) a{color:#000!important;text-decoration:none!important;font-weight:400!important}

  /* ---------- Hide screen-only bits ---------- */
  /* no-print must win over the narrow-screen rule that forces .analytics-filters to display:grid */
  .content:has(.report-print-header) .no-print,
  .content:has(.report-print-header) .pagination,
  .content:has(.report-print-header) .pagination-standard,
  .content:has(.report-print-header) .analytics-warning,
  .content:has(.report-print-header) .fin-table-head,
  .content:has(.report-print-header) .party-avatar{display:none!important}

  /* ---------- Footer ---------- */
  /* the shared app footer is the single "Powered by KAANIX" line; hide per-page duplicates */
  .content:has(.report-print-header) .analytics-kaanix-footer,
  .content:has(.report-print-header) .invoice-print-footer,
  .content:has(.report-print-header) .report-footer{display:none!important}
  .content:has(.report-print-header) .app-footer{display:block!important;margin:4mm 0 0!important;padding:0!important;text-align:center;color:#555!important;font:400 8.5pt Arial,Helvetica,sans-serif!important;letter-spacing:0}
}
