@media print {
  /* Hide app chrome and banners */
  .no-print, header, nav, .environment-banner, .db-indicator, .top-nav, .mobile-nav, footer, .footer { 
    display: none !important; 
  }

  @page { 
    size: Letter; 
    margin: 0.5in; 
  }

  /* Keep invoice together and at top of page */
  .invoice-container, .invoice-print-container { 
    break-before: avoid; 
    page-break-before: auto; 
  }
  
  .invoice-container, .invoice-container *, 
  .invoice-print-container, .invoice-print-container * { 
    break-inside: avoid; 
  }

  /* Tighten spacing for 1-page fit */
  h1,h2,h3 { 
    margin: 0 0 .25rem 0; 
  }
  
  .section { 
    margin: .25rem 0; 
  }
  
  footer { 
    margin-top: .25rem; 
  }

  /* Compress invoice sections */
  .invoice-header {
    margin-bottom: 1rem !important;
  }

  .invoice-details-section {
    margin-bottom: 0.5rem !important;
  }

  .invoice-table {
    margin-bottom: 0.5rem !important;
  }

  .invoice-table th,
  .invoice-table td {
    padding: 0.25rem !important;
    font-size: 0.9rem !important;
  }

  .invoice-footer {
    margin-top: 0.5rem !important;
  }
}

