/**
 * CA Assist - Proprietary Software
 * Copyright (c) 2026 Sana Shahzad. All rights reserved.
 * Print Stylesheet for Notice Replies & Client Reports
 * Completely strips web app shell, navigation, and advertising.
 */

@media print {
  /* Hide all app chrome */
  .app-header,
  .app-sidebar,
  .bottom-nav,
  .app-footer,
  #update-banner,
  #offline-banner,
  .page-actions,
  .tabs-nav,
  .btn,
  .toast-container,
  .modal-overlay,
  .no-print {
    display: none !important;
  }

  /* Reset layout margins for standard letter/A4 printing */
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
    line-height: 1.5;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

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

  .letter-sheet {
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .letter-sheet [contenteditable="true"] {
    outline: none !important;
    border: none !important;
  }

  .letter-blank {
    background-color: transparent !important;
    color: #000000 !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
  }

  .print-page-break {
    page-break-after: always;
  }

  /* Table printing */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  th, td {
    border: 1px solid #333333 !important;
    padding: 6px 8px !important;
  }

  /* SVG charts crisp in print */
  svg {
    max-width: 100% !important;
  }
}


/* ---- Letters and reports: only the document itself is printed ---- */
@page {
  size: A4;
  margin: 18mm 16mm;
}

@media print {
  .page-header,
  .alert-banner,
  .card.no-print,
  .tabs {
    display: none !important;
  }

  /* the notice drafter: no form column, the letter uses the full page */
  .notice-layout {
    display: block !important;
  }

  .letter-sheet {
    font-size: 11pt !important;
    line-height: 1.45 !important;
    color: #000000 !important;
    background: #ffffff !important;
  }

  .letter-sheet p,
  .letter-sheet li,
  .letter-sheet h1,
  .letter-sheet h2,
  .letter-sheet h3 {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .app-shell,
  .app-body,
  main,
  #view-container {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
  }

  /* reports: keep cards and charts whole and in a tidy grid */
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
  }
}
