/* ============================================================
   360eDash — print stylesheet (TKT-000359)
   Linked with media="print" from index.html. Applies to the SPA
   shell and, together with css/report.css, to the report reader
   (TKT-000398). Forces the light tokens regardless of
   html[data-theme="dark"], because a printed page has no theme.
   ============================================================ */

@media print {
  /* ---- 1. Force the light palette even if data-theme=dark ---- */
  html, html[data-theme="dark"] {
    --page-bg: #ffffff;
    --ink: #111111;
    --muted: #444444;
    --surface: #ffffff;
    --surface-alt: #ffffff;
    --surface-raised: #ffffff;
    --border: #cccccc;
    --border-strong: #999999;
    background: #ffffff !important;
    color: #111111 !important;
  }

  body, .edash-content, .report-body {
    background: #ffffff !important;
    color: #111111 !important;
  }

  /* ---- 2. Hide navigation chrome, no exceptions ---- */
  .edash-sidebar,
  .edash-header,
  .sb-nav, .hd-profile-menu, .hd-notif-panel,
  .edash-fab, .fab, [class*="-fab"],
  button, .btn, .edash-toast, .toast,
  nav, .app-nav, .mobile-nav-toggle,
  .no-print {
    display: none !important;
  }

  .edash-layout, .edash-main, .edash-content {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* ---- 3. No glass, no shadow, no blur on the printed page ---- */
  * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* ---- 4. Sane page mechanics ---- */
  body {
    font-size: 11pt;
    line-height: 1.4;
    orphans: 3;
    widows: 3;
  }

  .card, table, figure, .chart-card, canvas {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  table {
    width: 100%;
    border-collapse: collapse;
  }
  table thead {
    display: table-header-group; /* repeat header row per printed page */
  }
  table, th, td {
    border: 1px solid #999999;
  }

  a[href]::after {
    content: "";
  }

  /* ---- 5. Traceability: canonical URL + print time on every page ---- */
  @page {
    margin: 18mm 14mm;
  }

  body::after {
    content: "edash.systems" attr(data-print-path) " — printed " attr(data-print-time);
    position: fixed;
    bottom: 6mm;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 8pt;
    color: #666666;
  }
}
