/* Estilos de impressão compartilhados para relatórios frm_rel_* */

/* Reset de impressão */
@media print {
  html, body {
    background: #fff !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  body {
    font-family: Arial, sans-serif !important;
  }

  .container,
  .page,
  .report-wrapper,
  .container-fluid,
  .card,
  .card-body {
    width: auto !important;
    max-width: 210mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .header,
  .report-header,
  .page-header,
  .footer,
  .footer-bottom,
  .section-title {
    page-break-inside: avoid !important;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 10px !important;
    page-break-inside: auto !important;
  }

  table th,
  table td {
    border: 1px solid #333 !important;
    padding: 4px !important;
    text-align: left !important;
    vertical-align: top !important;
  }

  table th {
    background: #f2f2f2 !important;
    font-weight: bold !important;
  }

  .items-table th,
  .items-table td,
  .details td,
  .summary-table th,
  .summary-table td,
  .report-table th,
  .report-table td {
    border: 1px solid #333 !important;
  }

  .info-section,
  .details,
  .summary-section,
  .table-container,
  .tabela-cobranca,
  .carta,
  .report-content {
    width: 100% !important;
  }

  .page-break {
    page-break-after: always !important;
  }

  .page-break-inside-avoid {
    page-break-inside: avoid !important;
  }

  .text-right {
    text-align: right !important;
  }

  .text-center {
    text-align: center !important;
  }

  .small-print {
    font-size: 9px !important;
  }

  .separator {
    border-top: 1px solid #333 !important;
    margin: 4px 0 !important;
  }

  .no-margin {
    margin: 0 !important;
  }

  .no-padding {
    padding: 0 !important;
  }

  @page {
    size: auto;
    margin: 7mm;
  }
}

/* Ajustes responsivos para impressão estreita (80mm / 57mm) */
@media print and (max-width: 90mm) {
  html, body {
    font-size: 9px !important;
  }

  body {
    margin: 0 !important;
    padding: 0 !important;
  }

  .container,
  .page,
  .report-wrapper,
  .details,
  .items-table,
  .summary-table,
  .table-container,
  .report-content {
    width: 100% !important;
    min-width: auto !important;
  }

  .info-section,
  .header,
  .footer,
  .footer-bottom,
  .print-datetime,
  .filter-info,
  .summary-section,
  .report-header {
    display: block !important;
    width: 100% !important;
  }

  .info-section {
    display: block !important;
  }

  .info-item,
  .details td,
  .items-table td,
  .items-table th,
  .summary-table td,
  .summary-table th {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .items-table th,
  .items-table td,
  .summary-table th,
  .summary-table td {
    border: none !important;
    padding: 3px !important;
  }

  .items-table thead,
  .summary-table thead,
  .report-table thead {
    display: none !important;
  }

  .items-table tbody tr,
  .summary-table tbody tr,
  .report-table tbody tr {
    display: block !important;
    margin-bottom: 5px !important;
    border-bottom: 1px solid #ddd !important;
  }

  .items-table tbody tr td,
  .summary-table tbody tr td,
  .report-table tbody tr td {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding: 2px 0 !important;
  }

  .items-table td::before,
  .summary-table td::before,
  .report-table td::before {
    content: attr(data-label) ": ";
    font-weight: bold !important;
  }

  .col-cfop,
  .col-item,
  .col-unit,
  .col-disc,
  .col-acr,
  .col-total,
  .col-qty {
    display: none !important;
  }

  .page-break {
    page-break-after: always !important;
  }
}
