/* Print styles — keep this minimal. Most pages aren't designed to print,
   but the audit log gets printed/exported for compliance reviews. */

@media print {
  /* Hide chrome and interactive shell */
  .sidebar,
  .topbar,
  .modal-host,
  .toast-host,
  .btn,
  .filter-bar,
  .pagination,
  .icon-btn {
    display: none !important;
  }

  /* Reclaim full page width */
  .app {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr !important;
    grid-template-areas:
      "main"
      "main" !important;
  }
  .content {
    padding: 0 !important;
    overflow: visible !important;
  }

  /* Drop the dark theme — paper is white */
  html, body, .app, .content {
    background: white !important;
    color: black !important;
  }

  /* Borders + tables: keep structure but make ink-friendly */
  .card,
  .table-wrap,
  .audit-table,
  table {
    background: white !important;
    color: black !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
  }
  th, td {
    color: black !important;
    border-color: #ccc !important;
  }
  th {
    background: #f0f0f0 !important;
    font-weight: 600 !important;
  }

  /* Badges drop their colour wash; rely on text */
  .badge,
  .pill,
  .tag {
    background: transparent !important;
    color: black !important;
    border: 1px solid #888 !important;
  }

  /* Page headers stay strong */
  h1, h2, h3, .page-title {
    color: black !important;
  }

  /* Force tables to not break across pages mid-row */
  tr, td, th {
    page-break-inside: avoid;
  }
  thead {
    display: table-header-group;
  }

  /* Auto-add URL after links so paper readers can verify sources */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }
  /* But not for in-app hash links — those are noise on paper */
  a[href^="#"]::after {
    content: "";
  }

  /* Print header band — one-liner with org + page title + timestamp */
  .print-header {
    display: block !important;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #000;
    font-size: 11pt;
  }
  .print-header strong {
    font-weight: 700;
  }

  /* Hide anything explicitly marked */
  .no-print {
    display: none !important;
  }
}

/* Hidden by default in screen mode */
.print-header {
  display: none;
}
