/*
 * Fichier  : assets/css/print-template.css
 * Auteur   : KREMER Régis
 * Version  : 2.6.24
 * Date     : 2026-07-08
 * Description : CSS — Base d'impression A4 premium commune MageStock.
 *
 * Changelog :
 *   v2.6.8  (2026-07-08) — Création du socle d'impression commun avec logo,
 *                       zones inutiles masquées et conservation des couleurs.
 *   v2.6.15 (2026-07-08) — Socle premium commun : masquage UI renforcé,
 *                       couleurs conservées, classes print produit et pages A4.
 *   v2.6.17 (2026-07-08) — Correctif : toolbar/impression robuste et fallback images/logo.
 *   v2.6.18 (2026-07-08) — Renforcement rendu impression et note de contenu vide.
 *   v2.6.23 (2026-07-08) — Classes print mouvements et densité BL/commande harmonisée.
 *   v2.6.24 (2026-07-08) — Cohérence finale : marges métier renforcées et images/logos stabilisés.
 *   v2.6.22 (2026-07-08) — Classes print inventaire/commande et marges de sécurité documents métier.
 */
@media print{
  html,body{
    background:#fff!important;
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }

  .sidebar,
  .top-header,
  .bottom-nav,
  .slide-menu,
  .slide-menu-backdrop,
  .main-footer,
  .toast-wrap,
  #scrollTopProgress,
  .no-print,
  .pwa-install-card,
  .pwa-install-backdrop,
  .modal-backdrop,
  .modal:not(.printable-modal),
  .btn:not(.print-keep),
  .toolbar:not(.print-keep),
  .page-actions:not(.print-keep),
  .filters-bar:not(.print-keep){
    display:none!important;
  }

  .app-shell,
  .main-area,
  .main-content,
  .page,
  .content,
  .view-shell{
    display:block!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
    box-shadow:none!important;
  }

  .card,
  .panel,
  .table-container,
  .tbl-wrap,
  .table-wrap,
  .report-tab,
  .inventory-detail-card{
    box-shadow:none!important;
    border-color:#dbe3ee!important;
    break-inside:avoid;
  }

  table{
    width:100%!important;
    border-collapse:collapse!important;
    break-inside:auto;
  }
  tr{break-inside:avoid;break-after:auto}
  thead{display:table-header-group}
  tfoot{display:table-footer-group}
  img{max-width:100%;height:auto;print-color-adjust:exact!important}
  a{color:inherit!important;text-decoration:none!important}
}

.ms-print-product{display:flex;align-items:center;gap:8px;min-width:0}
.ms-print-product img{width:34px;height:34px;object-fit:contain;border:1px solid #e2e8f0;border-radius:3px;background:#fff;flex:0 0 34px}
.ms-print-product-ph{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:3px;color:#64748b;flex:0 0 34px}
.ms-print-muted{color:#64748b;font-size:.92em}
.ms-print-avoid-break{break-inside:avoid;page-break-inside:avoid}


/* v2.6.22 — compléments print métier */
.ms-print-inventory-table th,.ms-print-inventory-table td{font-size:8.8px}
.ms-print-order-table th,.ms-print-order-table td{font-size:8.3px;padding:4px 5px}
.ms-print-order-table th:nth-child(1),.ms-print-order-table td:nth-child(1){width:26%}
.ms-print-order-table th:nth-child(4),.ms-print-order-table td:nth-child(4){width:13%}

/* v2.6.23 — impression mouvements */
.ms-print-movements-table th,.ms-print-movements-table td{font-size:8.4px;padding:4px 5px}
.ms-print-movements-table th:nth-child(1),.ms-print-movements-table td:nth-child(1){width:15%}
.ms-print-movements-table th:nth-child(3),.ms-print-movements-table td:nth-child(3){width:26%}
.ms-print-movements-table th:nth-child(5),.ms-print-movements-table td:nth-child(5){width:12%;white-space:nowrap}
.text-danger{color:#dc2626!important}.text-success{color:#16a34a!important}.text-info{color:#2563eb!important}


/* v2.6.24 — Cohérence finale impression : marge de sécurité et logos */
@page{margin:6mm}
@media print{
  .ms-print-page{
    margin:0 auto!important;
    padding:10mm 11mm!important;
    border:0!important;
  }
  .ms-print-header,
  .ms-print-title,
  .ms-print-meta-grid,
  .ms-print-summary,
  .ms-print-signatures,
  .ms-print-footer{
    break-inside:avoid!important;
    page-break-inside:avoid!important;
  }
}
.ms-print-primary-logo,.ms-print-secondary-logo{object-fit:contain!important;background:#fff!important}
.ms-print-brand-title,.ms-print-brand-sub{word-break:normal!important;overflow-wrap:break-word!important}
