/* Impaginazione A4 per la stampa e il salvataggio in PDF dal browser. */

@page {
  size: A4 portrait;
  margin: 20mm 15mm 18mm;
  @top-right { content: "Business plan"; font: 8pt system-ui, sans-serif; color: #6b6a66; }
  @bottom-left { content: "Documento generato con BusinessPlan"; font: 8pt system-ui, sans-serif; color: #6b6a66; }
  @bottom-right { content: "Pagina " counter(page) " di " counter(pages); font: 8pt system-ui, sans-serif; color: #6b6a66; }
}
@page :first {
  @top-left { content: none; }
  @top-right { content: none; }
}

/* In stampa si usa sempre la palette chiara, indipendentemente dal tema scelto. */
:root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
  color-scheme: light;
  --surface: #ffffff;
  --bg: #ffffff;
  --panel: #ffffff;
  --border: #c9c7c0;
  --border-strong: #9a988f;
  --text: #000000;
  --text-2: #3f3e3b;
  --text-3: #5c5b57;
  --neg: #b42318;
  --grid: #e3e2de;
  --axis: #8a887f;
  --link: #000000;
  --info-bg: #f2f5f9;
  --warn-bg: #fff6e0;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #6250d6;
  --shadow: none;
}

html, body { background: #fff !important; }
body { font-size: 10pt; line-height: 1.4; display: block; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.app-header, .app-footer, .skip-link, .toasts, .no-print, .plan-header, .tabs-bar, .report-toolbar,
.btn, .chart-data, dialog { display: none !important; }
main { max-width: none; padding: 0; }

.report { border: 0; padding: 0; max-width: none; margin: 0; border-radius: 0; }
.report-cover { min-height: 230mm; display: flex; flex-direction: column; justify-content: center; border-bottom: 0; break-after: page; }
.report-cover h1 { font-size: 28pt; }
.report-toc { margin-top: 24mm; }
.report-toc a { color: #000; text-decoration: none; }
.report-toc ol { padding-left: 8mm; }
.report-section { margin: 0 0 8mm; }
.report-section.page-start { break-before: page; }
.report-section > h2 { font-size: 15pt; break-after: avoid; }
h3 { font-size: 11pt; break-after: avoid; }
p, li { orphans: 3; widows: 3; }

.table-wrap { overflow: visible; border: 0; border-radius: 0; margin-bottom: 8mm; break-inside: auto; }
.data-table { font-size: 8pt; width: 100%; }
.data-table caption { font-size: 9.5pt; padding: 0 0 2mm; }
.data-table thead { display: table-header-group; }
.data-table tr { break-inside: avoid; }
.data-table th, .data-table td { padding: 1.2mm 2mm; white-space: nowrap; }
.data-table th[scope="row"] { min-width: 0; white-space: normal; position: static; }
.data-table thead th { background: #f2f2f0; }
.monthly-table { font-size: 7.5pt; }
.data-table .row-sub th, .data-table .row-sub td { font-size: 0.92em; }
.text-table td { white-space: normal; }

.chart-grid { display: block; }
.chart-figure { border: 1px solid var(--border); break-inside: avoid; margin: 0 0 6mm; padding: 4mm; }
.chart-svg { width: 100%; height: auto; }
.chart-tip { display: none !important; }
.kv { grid-template-columns: repeat(3, 1fr); }
.swot-grid { grid-template-columns: 1fr 1fr; }
.swot-grid > div { break-inside: avoid; }
a[href]::after { content: none; }
