@media print {
  @page {
    size: A4 landscape;
    margin: 8mm 10mm;
  }

  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  :root, [data-theme="dark"] {
    --bg: #ffffff !important;
    --surface: #ffffff !important;
    --surface-2: #f8f8f8 !important;
    --surface-3: #f0f0f0 !important;
    --border: #dddddd !important;
    --border-strong: #000000 !important;
    --text: #000000 !important;
    --text-dim: #555555 !important;
    --grid: #e5e5e5 !important;
  }

  .topbar {
    position: static !important;
    border-bottom: 2px solid #000000 !important;
    padding: 8px 0 !important;
  }

  .container {
    padding: 8px 0 !important;
    max-width: 100% !important;
  }

  /* Ocultar botões de controlo e filtros interativos */
  .nav-btn,
  .theme-toggle,
  .company-tabs,
  .month-selector,
  .backoffice-view,
  .toast-msg {
    display: none !important;
  }

  /* Carimbo de período impresso */
  .month-section::after {
    content: 'Período Selecionado: ' attr(data-selected-month);
    display: inline-block;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 12px;
    border: 1.5px solid #000000;
    background: var(--brand-color) !important;
    color: #ffffff !important;
    margin-top: 4px;
  }

  .page-title {
    margin: 16px 0 12px !important;
  }

  .page-title h1 {
    font-size: 26px !important;
  }

  .card {
    break-inside: avoid;
    page-break-inside: avoid;
    min-height: auto !important;
    padding: 12px 14px !important;
    border: 1px solid #000000 !important;
  }

  .grid {
    gap: 12px !important;
    margin-bottom: 12px !important;
  }

  .kpi-row {
    margin-bottom: 14px !important;
  }

  .kpi-card {
    padding: 12px 14px !important;
  }

  .kpi-value {
    font-size: 20px !important;
  }

  .chart-container {
    height: 190px !important;
  }
  .chart-container.tall {
    height: 240px !important;
  }

  table {
    font-size: 9.5px !important;
  }
  table th, table td {
    padding: 4px 6px !important;
  }

  .scroll-table {
    max-height: none !important;
    overflow: visible !important;
    border: 1px solid #000000 !important;
  }

  .footer {
    margin-top: 24px !important;
    padding-top: 12px !important;
    page-break-inside: avoid;
  }
}
