/* ==========================================================================
   Print styles for MACE Accounting System
   Linked with media="print" from base.html, so it applies to every page.
   Replaces the partial @media print blocks that lived in six templates and
   were missing from the eight BIR form pages entirely.
   ========================================================================== */

@page {
  size: A4;
  margin: 15mm 12mm;
}

body {
  background: #fff !important;
  color: #000 !important;
  font-size: 10pt;
  line-height: 1.35;
}

/* Screen chrome never belongs on a filed return */
.navbar,
.skip-link,
.nav-toggle,
.page-actions,
.period-selector,
.filters,
.filter-header,
.filter-toggle,
.export-dropdown,
.dropdown-menu,
.tab-navigation,
.quick-actions,
.bir-quick-actions,
.bir-hero-section,
.sidebar,
.keyboard-shortcuts,
.autosave-indicator,
.validation-alert,
.action-buttons,
.activity-action,
.book-link,
.view-all,
.button,
.btn,
button {
  display: none !important;
}

/* Hidden tab panels must still print when they hold report content */
.tab-content {
  display: block !important;
}

.container,
.dashboard,
.report-container,
.table-wrapper,
.detail-container {
  max-width: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  border: none !important;
  overflow: visible !important;
}

/* Headings gradient-clipped to transparent on screen would print blank */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: #000 !important;
  background: none !important;
  -webkit-text-fill-color: #000 !important;
  break-after: avoid;
  page-break-after: avoid;
}

h1 { font-size: 16pt; }
h2 { font-size: 14pt; }
h3 { font-size: 12pt; }

a {
  color: #000 !important;
  text-decoration: none !important;
}

/* Tables: repeat headers across pages, keep rows intact */
table {
  width: 100% !important;
  border-collapse: collapse !important;
  break-inside: auto;
  page-break-inside: auto;
  font-size: 9pt;
}

thead {
  display: table-header-group;
}

tfoot {
  display: table-footer-group;
}

tr {
  break-inside: avoid;
  page-break-inside: avoid;
}

th,
td {
  border: 1px solid #999 !important;
  padding: 4pt 6pt !important;
  background: #fff !important;
  color: #000 !important;
}

thead th {
  background: #eee !important;
  font-weight: 700;
  border-bottom: 1.5pt solid #333 !important;
}

tfoot td,
.total-row td,
.subtotal-row td {
  background: #f2f2f2 !important;
  font-weight: 700;
  border-top: 1.5pt solid #333 !important;
}

.text-right,
.num,
.amount,
.amount-cell,
.debit-amount,
.credit-amount,
.balance-amount {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.text-center {
  text-align: center !important;
}

/* Cards and panels flatten to plain blocks on paper */
.card,
.dashboard-card,
.stat-card,
.stat-card-pro,
.summary-card,
.detail-card,
.report-section,
.account-type-section {
  box-shadow: none !important;
  border: 1px solid #ccc !important;
  border-radius: 0 !important;
  background: #fff !important;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* Stacked detail cards sit closer together on paper */
.detail-container {
  gap: 1rem;
}

/* Status pills read as text, not colour */
.status,
.badge,
.sequence-badge,
.party-badge,
.date-badge {
  background: none !important;
  color: #000 !important;
  border: 1px solid #999 !important;
  padding: 1pt 3pt !important;
}

.muted,
.text-muted,
.text-secondary {
  color: #333 !important;
}

/* Report footer notes stay with the table they explain */
.report-notes {
  background: #fff !important;
  border-top: 1pt solid #999 !important;
  font-size: 8.5pt;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* No animation on paper */
*,
*::before,
*::after {
  animation: none !important;
  transition: none !important;
}
