/* Food cost gratis — stampa (Ctrl+P) delle pagine riservate: programma, plancia, account, messaggi.
 * Tutto deve stare dentro un foglio A4 verticale: niente barre di scorrimento, tabelle che vanno a capo,
 * menu e pulsanti nascosti. Per una scheda ricetta curata c'è comunque il pulsante «Scheda PDF». */
@media print {
  @page { size: A4 portrait; margin: 12mm 11mm 14mm; }
  html, body { background: #fff !important; color: #111 !important; font-size: 10.5pt; }
  * { box-shadow: none !important; text-shadow: none !important; }
  *, *::before, *::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* quello che sulla carta non serve */
  header.top, nav, .nav, #tabs, .tabs2, .no-print, .lab-ann, .lab-fab, .lab-ov, #toast, .toast, dialog, .pdf-dlg,
  .btn, button:not(.chosen), input[type=search], .search, .crumb, [data-lab-user], .aiuto-pop, .aiuto-btn, .guida, .consulta-cta,
  .edit-only, .warnbox.esempio .btn, label.chk:has(#tutti) { display: none !important; }
  input[type=checkbox][data-sel] { display: none !important; }

  /* la pagina usa tutta la larghezza del foglio */
  main { padding: 0 !important; }
  .wrap, #main, main > .wrap { max-width: none !important; width: auto !important; padding: 0 !important; margin: 0 !important; }
  .head { margin: 0 0 6pt !important; display: block !important; }
  .head h1, h1 { font-size: 17pt !important; margin: 0 0 2pt !important; }
  .head .sub, .sub { font-size: 9.5pt !important; }
  h2, .sec { font-size: 12pt !important; margin: 10pt 0 4pt !important; }
  h1, h2, h3, .sec { break-after: avoid; page-break-after: avoid; }

  /* tabelle: niente scorrimento orizzontale, il testo va a capo */
  .tbl-wrap, .tabella { overflow: visible !important; border: 1px solid #c8c8c8 !important; border-radius: 0 !important; margin: 0 0 6pt !important; }
  table, table.t, table.mini { width: 100% !important; max-width: 100% !important; table-layout: auto; border-collapse: collapse; font-size: 9pt !important; }
  table.t th, table.t td, table.mini td { white-space: normal !important; overflow-wrap: break-word; word-break: normal; hyphens: auto;
    padding: 3pt 4pt !important; position: static !important; min-width: 0 !important; background: none !important; }
  table.t th { font-size: 8pt !important; color: #444 !important; border-bottom: 1px solid #999 !important; }
  table.t td.name, table.t td.wrap { min-width: 0 !important; }
  table.t td.n { white-space: nowrap !important; }                /* importi e numeri su una riga sola */
  thead { display: table-header-group; } tfoot { display: table-footer-group; }
  tr, td, th { break-inside: avoid; page-break-inside: avoid; }

  /* riquadri e numeri */
  .kpis { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 4pt !important; margin: 0 0 6pt !important; }
  .kpi { padding: 4pt 6pt !important; border: 1px solid #c8c8c8 !important; border-radius: 4pt !important; min-height: 0 !important; }
  .kpi b { font-size: 12pt !important; } .kpi span, .kpi small { font-size: 8pt !important; }
  .cols { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 6pt !important; }
  .box, .panel, .summary { padding: 6pt 8pt !important; margin: 6pt 0 !important; border: 1px solid #c8c8c8 !important; border-radius: 4pt !important; }
  .box, .panel, .kpi, .bub, .note, img { break-inside: avoid; page-break-inside: avoid; }
  .editor { display: block !important; }
  img { max-width: 100% !important; max-height: 70mm !important; }
  button.chosen { border: 0 !important; background: none !important; padding: 0 !important; font: inherit !important; color: inherit !important; text-align: left; }
  .line .comp, .line .comp * { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; max-width: none !important; }
  select { -webkit-appearance: none; appearance: none; background-image: none !important; }
  input, select, textarea { border: 0 !important; background: none !important; padding: 0 !important; font: inherit !important; color: inherit !important; }
  textarea { min-height: 0 !important; height: auto !important; resize: none; }
  a { color: inherit !important; text-decoration: none !important; }
  .pill { border: 1px solid #999 !important; background: none !important; color: #333 !important; }
  .chat .bub { max-width: 100% !important; border: 1px solid #c8c8c8 !important; }
}
