/* ═══════════════════════════════════════════════════════════════════════════
   VALIDURE ERP — print                                   owner: UI Designer
   Imported by app.css with a `print` media condition; the rules are also
   wrapped in @media print so the file is safe to link on its own.
   Document layouts (A4 .sheet, 80/58 mm thermal) live in layout.css and the
   print pages; this file removes app chrome and forces black-on-white.
   ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  @page {
    size: A4;
    margin: 12mm 12mm 14mm;
  }

  /* Paper is always light, whatever theme/mode the operator uses on screen. */
  :root,
  html[data-mode],
  html[data-theme] {
    color-scheme: light;
    --e-bg: #ffffff;
    --e-raised: #ffffff;
    --e-surface: #f2f2f2;
    --e-subtle: #f7f7f7;
    --e-border: #bdbdbd;
    --e-border-strong: #555555;
    --e-fg: #000000;
    --e-muted: #333333;
    --e-faint: #444444;
    --e-primary: #000000;
    --e-primary-dark: #000000;
    --e-primary-soft: #eeeeee;
    --e-on-primary: #ffffff;
    --e-focus: #000000;
    --e-ok: #000000;
    --e-warn: #000000;
    --e-err: #000000;
    --e-info: #000000;
    --e-ok-fg: #000000;
    --e-warn-fg: #000000;
    --e-err-fg: #000000;
    --e-info-fg: #000000;
    --e-ok-soft: #ffffff;
    --e-warn-soft: #ffffff;
    --e-err-soft: #ffffff;
    --e-info-soft: #ffffff;
    --shadow-1: none;
    --shadow-2: none;
    --shadow-pop: none;
  }

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

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* chrome off */
  [data-print="hide"],
  .sidebar,
  .topbar,
  .toolbar,
  .pagination,
  .toast,
  .toast-stack,
  .skip-link,
  .btn,
  .menu,
  .tabs,
  .crumbs,
  .page-head__actions,
  .readonly-note,
  dialog:not([open]),
  [popover]:not(:popover-open) {
    display: none !important;
  }

  [data-print="only"] {
    display: revert !important;
  }

  .app,
  .main,
  .page {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  /* links: plain text on paper */
  a,
  a:visited {
    color: inherit !important;
    text-decoration: none !important;
  }

  /* surfaces flatten to hairlines */
  .card,
  .kpi,
  .table-wrap,
  .alert {
    border-color: #bdbdbd !important;
    background: #fff !important;
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible !important;
    max-height: none !important;
    border-radius: 0 !important;
  }

  .table thead th {
    position: static;
    background: #f2f2f2 !important;
    color: #000 !important;
  }

  .table thead {
    display: table-header-group; /* repeat header on each page */
  }

  /* On paper the width is fixed: text cells may wrap, figures and codes may not. */
  .table {
    font-size: 9pt;
  }

  .table th,
  .table td {
    padding: 4pt 5pt;
    white-space: normal;
  }

  .table .num,
  .table td.code,
  .table th.code {
    white-space: nowrap;
  }

  .table .check,
  .table .actions {
    display: none;
  }

  .table tfoot {
    display: table-footer-group;
  }

  .table tr,
  .table td,
  .table th {
    break-inside: avoid;
  }

  .table tbody tr:hover,
  .table--zebra tbody tr:nth-child(even) {
    background: transparent !important;
  }

  /* badges keep their words, lose their fills */
  .badge {
    border: 1px solid #555 !important;
    background: #fff !important;
    color: #000 !important;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
  }

  p,
  li,
  dd {
    orphans: 3;
    widows: 3;
  }

  img,
  svg,
  figure {
    break-inside: avoid;
  }

  /* a report printed as a working paper opens with its .print-head (legal
     name, PAN, GSTINs, statement + period, basis, printed by + date) */
  .print-head {
    display: block;
    margin-bottom: var(--sp-3);
    padding-bottom: var(--sp-2);
    border-bottom: 1px solid var(--e-border-strong);
    font-size: var(--fs-xs);
  }

  .print-head strong {
    font-size: var(--fs-sm);
  }

  /* page-break helpers for document authors */
  .page-break,
  [data-print="break-before"] {
    break-before: page;
  }

  [data-print="avoid-break"] {
    break-inside: avoid;
  }
}
