/* ═══════════════════════════════════════════════════════
   EQ Solves — Field  ·  print.css
   ═══════════════════════════════════════════════════════ */

@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  body { font-size: 11px; background: white; }

  .sidebar, #mobile-nav, #mobile-drawer,
  .topbar-actions, #eq-agent-fab, #eq-agent-panel,
  #offline-banner, #last-updated-bar,
  .filter-row, .section-actions,
  .modal-overlay, #loading-overlay,
  .toast, .edit-only, .btn,
  #roster-swipe-hint { display: none !important; }

  .shell   { display: block; height: auto; overflow: visible; }
  .content { overflow: visible; }
  .topbar  { display: none; }

  .page { display: block !important; overflow: visible; padding: 0; }
  .page:not(.print-active) { display: none !important; }

  .roster-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  .stats-row   { break-inside: avoid; }
  .stat-card   { border: 1px solid #ccc; }

  /* v3.5.33 (F-W3-print): tenant-aware print brand colour. print.css is a
     SHARED EQ/SKS stylesheet — hardcoding SKS navy here bled SKS colour into
     EQ-tenant prints. Default = EQ deep (--eq-deep #2986B4); SKS navy is
     scoped below under body.tenant-sks. We use the body tenant class (set once
     on load by applyTenantBranding in app-state.js, persists into @media print)
     rather than a runtime CSS var, which is not guaranteed to resolve in the
     print context. EQ brand: sky #3DA8D8 / deep #2986B4 / ink #1A1A2E. */
  thead tr { background: #2986B4 !important; color: white !important; }
  body.tenant-sks thead tr { background: #1F335C !important; color: white !important; }
  tr:nth-child(even) td { background: #f5f5f5 !important; }

  table { page-break-inside: auto; }
  tr    { page-break-inside: avoid; }

  .chip-blue   { background: #EFF4FF !important; color: #2563EB !important; }
  .chip-green  { background: #F0FDF4 !important; color: #16A34A !important; }
  .chip-amber  { background: #FFFBEB !important; color: #D97706 !important; }
  .chip-red    { background: #FEF2F2 !important; color: #DC2626 !important; }
  .chip-purple { background: #EEEDF8 !important; color: #7C77B9 !important; }
  .chip-grey   { background: #F8FAFC !important; color: #64748B !important; }

  /* v3.5.32 (F-W2-1): roster print/PDF header — branded title + week.
     Hidden on screen via inline style; revealed only in print.
     v3.5.33 (F-W3-print): underline + title colour now tenant-aware.
     Default = EQ deep (#2986B4); SKS navy scoped under body.tenant-sks
     (same class-based mechanism as the thead rule above). */
  #roster-print-header { display: block !important; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #2986B4; }
  #roster-print-title { color: #2986B4 !important; }
  body.tenant-sks #roster-print-header { border-bottom-color: #1F335C; }
  body.tenant-sks #roster-print-title { color: #1F335C !important; }
  .legend-bar { display: flex !important; }

  /* roster-v8: the screen grid has a LIGHT header with a grey date sub-line.
     In print the thead band is branded navy/deep (the thead tr rule above), so
     force the day labels + date sub-line white for contrast. The mobile person
     strips stay hidden (base.css .roster-mobile display:none persists in print);
     the desktop grid prints. */
  .roster-grid thead th,
  .roster-grid .roster-th-date { color: #fff !important; }

  /* v3.5.33 (F-W3-#14): Weekly Site Attendance report print container.
     Hidden on screen (inline display:none); printSiteAttendanceReport()
     marks it .print-active and reveals it here. Colours are tenant-aware:
     EQ deep default, SKS navy under body.tenant-sks — same mechanism as
     the roster header above. */
  #site-report-print.print-active { display: block !important; }

  #site-report-header { margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid #2986B4; }
  #site-report-title  { font-size: 20px; font-weight: 800; color: #2986B4; }
  #site-report-sub    { font-size: 12px; color: #334155; margin-top: 2px; }
  body.tenant-sks #site-report-header { border-bottom-color: #1F335C; }
  body.tenant-sks #site-report-title  { color: #1F335C; }

  .sr-site       { break-inside: avoid; margin-bottom: 14px; }
  .sr-site-head  { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
  .sr-site-name  { font-size: 14px; font-weight: 700; color: #2986B4; }
  body.tenant-sks .sr-site-name { color: #1F335C; }
  .sr-site-code  { font-size: 10px; font-family: monospace; color: #64748B; }
  .sr-site-count { font-size: 10px; color: #64748B; margin-left: auto; }

  .sr-table      { width: 100%; border-collapse: collapse; font-size: 10.5px; }
  .sr-table th, .sr-table td { border: 1px solid #ccc; padding: 4px 6px; }
  .sr-table thead th { background: #2986B4 !important; color: white !important; font-weight: 600; }
  body.tenant-sks .sr-table thead th { background: #1F335C !important; }
  .sr-name  { text-align: left; }
  .sr-jobs  { text-align: left; font-family: monospace; font-size: 9.5px; }
  .sr-day, .sr-date { text-align: center; }
  .sr-date  { font-weight: 400; font-size: 8.5px; color: #fff; }
  .sr-present { color: #16A34A; font-weight: 700; }
  .sr-absent  { color: #cbd5e1; }
  .sr-muted   { color: #cbd5e1; }
  .sr-foot    { font-weight: 700; }
  .sr-table tfoot td { background: #f1f5f9 !important; font-weight: 700; }
  #site-report-foot { margin-top: 12px; font-size: 9px; color: #94a3b8; }

  a { text-decoration: none; color: inherit; }
}
