/* ============================================================
   Print Styles - PV (Payment Voucher) Document Export
   ============================================================ */

@media print {
  /* Reset page layout */
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  @page {
    size: A4;
    margin: 15mm 12mm;
  }

  /* Hide app chrome */
  .sidebar,
  .navbar,
  .sidebar-overlay,
  .mobile-bottom-nav,
  .toast-container,
  .modal-backdrop,
  .no-print,
  .btn,
  .page-header-actions,
  .table-toolbar,
  .table-pagination {
    display: none !important;
  }

  /* Reset layout for print */
  body {
    background: white !important;
    color: #000 !important;
    font-size: 10pt;
    line-height: 1.4;
    font-family: 'Inter', Arial, sans-serif;
  }

  .app-layout {
    display: block;
  }

  .main-wrapper {
    margin-left: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .main-content {
    padding: 0 !important;
    max-width: none;
  }

  /* Card styling for print */
  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    break-inside: avoid;
    margin-bottom: 8mm;
  }

  .card-header {
    background: #f5f5f5 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Table printing */
  .table-container {
    overflow: visible !important;
    border: none !important;
  }

  .table {
    font-size: 8pt;
    border-collapse: collapse;
  }

  .table th {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 7pt;
    padding: 4px 6px !important;
    border: 1px solid #999 !important;
  }

  .table td {
    padding: 3px 6px !important;
    border: 1px solid #ccc !important;
    font-size: 8pt;
  }

  .table tfoot td {
    background: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: bold;
    border-top: 2px solid #666 !important;
  }

  .table thead {
    display: table-header-group;
  }

  .table tbody {
    display: table-row-group;
  }

  .table tr {
    page-break-inside: avoid;
  }

  /* PV Document Header */
  .pv-header {
    text-align: center;
    margin-bottom: 8mm;
    padding-bottom: 4mm;
    border-bottom: 2px solid #000;
  }

  .pv-company-name {
    font-size: 16pt;
    font-weight: bold;
    margin-bottom: 2mm;
    text-transform: uppercase;
  }

  .pv-company-reg {
    font-size: 8pt;
    color: #555;
    margin-bottom: 1mm;
  }

  .pv-company-address {
    font-size: 8pt;
    color: #555;
  }

  .pv-title {
    font-size: 14pt;
    font-weight: bold;
    margin-top: 4mm;
    text-transform: uppercase;
    letter-spacing: 0.5mm;
  }

  /* PV metadata row */
  .pv-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6mm;
    font-size: 9pt;
  }

  .pv-meta-item {
    display: flex;
    gap: 2mm;
  }

  .pv-meta-label {
    font-weight: bold;
    min-width: 25mm;
  }

  .pv-meta-value {
    border-bottom: 1px dotted #999;
    min-width: 40mm;
    padding-bottom: 1px;
  }

  /* PV payee info */
  .pv-payee {
    margin-bottom: 6mm;
    padding: 3mm;
    border: 1px solid #ccc;
    font-size: 9pt;
  }

  .pv-payee-row {
    display: flex;
    margin-bottom: 2mm;
  }

  .pv-payee-label {
    font-weight: bold;
    min-width: 35mm;
  }

  /* PV summary */
  .pv-summary {
    margin-top: 6mm;
    font-size: 9pt;
  }

  .pv-summary-row {
    display: flex;
    justify-content: flex-end;
    gap: 4mm;
    padding: 2mm 0;
  }

  .pv-summary-label {
    font-weight: bold;
    text-align: right;
    min-width: 40mm;
  }

  .pv-summary-value {
    text-align: right;
    min-width: 30mm;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
  }

  .pv-summary-total {
    border-top: 2px solid #000;
    border-bottom: 2px double #000;
    font-size: 10pt;
    padding-top: 2mm;
    margin-top: 2mm;
  }

  /* PV signatures */
  .pv-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 15mm;
    padding-top: 4mm;
  }

  .pv-signature-block {
    text-align: center;
    width: 35%;
  }

  .pv-signature-line {
    border-top: 1px solid #000;
    padding-top: 2mm;
    margin-top: 20mm;
    font-size: 8pt;
  }

  .pv-signature-name {
    font-weight: bold;
    font-size: 9pt;
  }

  .pv-signature-title {
    font-size: 7pt;
    color: #555;
  }

  /* PV footer / notes */
  .pv-footer {
    margin-top: 8mm;
    padding-top: 4mm;
    border-top: 1px solid #ccc;
    font-size: 7pt;
    color: #777;
  }

  /* Currency alignment in print */
  .col-currency {
    text-align: right !important;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    white-space: nowrap;
  }

  /* Badges for print */
  .badge {
    border: 1px solid #ccc !important;
    background: transparent !important;
    color: #333 !important;
    padding: 1px 4px;
    font-size: 7pt;
  }

  /* Links in print */
  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  /* Page break helpers */
  .page-break-before {
    page-break-before: always;
  }

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

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

  /* Print header/footer on each page */
  .print-header {
    position: running(header);
  }

  .print-footer {
    position: running(footer);
    font-size: 7pt;
    color: #999;
    text-align: center;
  }

  /* Show elements only in print */
  .print-only {
    display: block !important;
  }
}

/* Hide print-only elements on screen */
.print-only {
  display: none;
}
