/* Print stylesheet : sortie A4 propre pour les pages admin (dashboard, anomalies, audit). */

@media print {
  /* Cache tout ce qui n'est pas le contenu principal */
  .topbar,
  .topbar-actions,
  .filters-card,
  .nav-dropdown,
  .nav-dropdown-menu,
  #toast-container,
  .cmdk-overlay,
  .shortcuts-overlay,
  button:not(.print-keep),
  .empty-state-rich__actions,
  #tv-mode-btn,
  .data-days,
  form { display: none !important; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  .wrap {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .kpi-card,
  .table-container,
  .chart-container,
  .anomaly-tile,
  .card {
    box-shadow: none !important;
    border: 1px solid #999 !important;
    page-break-inside: avoid;
    background: #fff !important;
    color: #000 !important;
  }

  .kpi-grid,
  .anomaly-summary {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
  }

  .table-scroll {
    max-height: none !important;
    overflow: visible !important;
  }

  table { page-break-inside: auto; }
  tr    { page-break-inside: avoid; page-break-after: auto; }
  thead { display: table-header-group; }

  /* En-tête imprimé */
  .wrap::before {
    content: 'GHOL Tags · ' attr(data-print-title) ' · ' attr(data-print-date);
    display: block;
    border-bottom: 1px solid #000;
    margin-bottom: 12px;
    font-size: 9pt;
    color: #555;
  }

  a { color: #000 !important; text-decoration: none !important; }
}
