/*
 * Impresión de pantallas y reportes (§12.2). Las etiquetas tienen su propia hoja (labels.css).
 * Última capa: gana a todo. Los colores de tinta se toman de tokens y se fuerzan a gris/negro.
 */
@layer print {
  @media print {
    @page { size: A4 portrait; margin: 12mm 10mm 14mm; }
    @page wide { size: A4 landscape; }
    .p-print-wide { page: wide; }

    :root {
      --bg: var(--n-0);
      --surface-0: var(--n-0);
      --surface-1: var(--n-0);
      --surface-2: var(--n-50);
      --surface-3: var(--n-100);
      --text-primary: var(--n-1000);
      --text-secondary: var(--n-800);
      --text-tertiary: var(--n-700);
      --border: var(--n-400);
      --border-subtle: var(--n-200);
      --border-strong: var(--n-600);
      color-scheme: light;
    }

    html, body { background: var(--n-0) !important; }
    * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

    .l-app { display: block !important; padding: 0 !important; }
    .l-topbar, .l-sidebar, .l-bottombar, .l-backdrop, .c-fab, .l-toasts, .l-layer, .l-progress,
    .u-skip-link, .c-breadcrumbs, .l-page__actions,
    .c-table-toolbar, .c-table-bulk, .c-pagination, .c-filters, .c-filters__actions,
    .c-table__cell--check, .c-table__cell--actions, .c-scan-pill, .c-drawer, .u-no-print,
    /* El botón «Ver datos» de un gráfico no sirve en papel (QA visual, ola 8: salía en el reporte impreso) */
    .c-chart__tools {
      display: none !important;
    }
    .u-print-only { display: block !important; }

    .l-main { margin: 0 !important; padding: 0 !important; }
    .l-page { max-width: none !important; gap: var(--sp-4) !important; }

    .c-print-head { display: block !important; }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    tr, .c-kpi, figure, .c-card { break-inside: avoid; }
    h1, h2, h3 { break-after: avoid; }

    .c-table-scroll { overflow: visible !important; }
    .c-table thead th { position: static !important; }
    .c-row-card { display: none !important; }
    .c-table-wrap .u-hide-md-down { display: block !important; }

    a[href]::after { content: ""; }
    .c-link, a { color: var(--n-1000) !important; text-decoration: none !important; }
    .c-card, .c-table-wrap, .c-kpi { box-shadow: none !important; }
  }
}
