/* [COC-110] Foglio di stampa unico del gestionale (A4 verticale, bianco e nero, leggibile).
   Si carica con media="print" in fondo a <head> di base.html: sullo schermo non cambia nulla.
   Vale per tutte le pagine che si stampano dal browser (fatture, preventivo, estratto conto, sollecito, scheda cliente...). */
@page{size:A4 portrait;margin:12mm 12mm 16mm 12mm;
  @bottom-right{content:"Pagina " counter(page) " di " counter(pages);font:8pt Atkinson,Arial,sans-serif;color:#444}}

/* colori: sempre inchiostro nero su carta bianca, anche con tema scuro o telefono in modalità notte */
:root,html[data-theme],html:not([data-theme="light"]){
  --ink:#000 !important;--sheet:#fff !important;--paper:#fff !important;--text:#000 !important;--muted:#333 !important;
  --line:#999 !important;--field:#fff !important;--acqua:#000 !important;--livella:#000 !important;
  --fault:#000 !important;--done:#000 !important;--warn:#000 !important;--sh1:none !important;--sh2:none !important;
  color-scheme:light !important}
*,*::before,*::after{animation:none !important;transition:none !important;text-shadow:none !important;
  backdrop-filter:none !important;-webkit-backdrop-filter:none !important}
html,body{background:#fff !important;color:#000 !important;height:auto !important;overflow:visible !important;
  font-size:10.5pt !important;line-height:1.35 !important;width:auto !important;min-width:0 !important}
html,body,input,select,textarea,button,table,th,td{font-family:Arial,"Liberation Sans",Helvetica,sans-serif !important}
body{display:block !important}
a,a:visited{color:#000 !important;text-decoration:none !important}
b,strong,th,h1,h2,h3{color:#000 !important}

/* via tutto ciò che è solo da schermo */
.sidebar,.topbar,.bottomnav,.noprint,.no-print,.savebar,.ti-push-box,#ti-push-box,.flash,.skip,.hamb,.bell,
.actions,.topsearch,.btn,button,form.filters,.mapbar,.mapsheet,#map,.minimap,iframe,.leaflet-container,
.fc-toolbar,.dlg-fondo,.chips,.tabs,nav,input[type=submit],input[type=file],input[type=hidden],
.navsep,.badge-n{display:none !important}
.print-head{display:flex !important}
.solo-stampa{display:block !important}

/* contenuto a tutta pagina */
.main,.content{margin:0 !important;padding:0 !important;max-width:none !important;width:auto !important;
  opacity:1 !important;transform:none !important;position:static !important}
.content>*{opacity:1 !important;transform:none !important}

/* testata dell'azienda in cima a ogni stampa */
.print-head{justify-content:space-between;align-items:flex-start;gap:14px;border-bottom:1.5pt solid #000;
  padding:0 0 6px;margin:0 0 10px;break-inside:avoid}
.print-head .ph-az{display:flex;gap:10px;align-items:center;min-width:0}
.print-head img{height:15mm;width:auto;max-width:34mm;object-fit:contain}
.print-head .ph-az b{font-size:12pt}
.print-head .ph-az small{display:block;font-size:8.5pt;line-height:1.3;color:#222}
.print-head .ph-doc{text-align:right;font-size:9pt;color:#222;flex:0 0 auto;max-width:60mm}
.print-head .ph-doc b{display:block;font-size:12pt;color:#000;line-height:1.2}

/* schede e griglie */
.card,.tile,.kpi,.dlg{background:#fff !important;border:.75pt solid #777 !important;border-radius:3px !important;
  box-shadow:none !important;padding:6px 9px !important;margin:0 0 8px !important}
.card:not(:has(table)){break-inside:avoid}
.card h2,h2,h3{font-size:11pt !important;margin:0 0 5px !important;break-after:avoid;color:#000 !important}
.grid{display:grid !important;gap:8px !important}
.g2,.g3{grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important}
.g-side{grid-template-columns:minmax(0,1fr) !important}
.grid>*,.card{min-width:0}
.fgrid,.fgrid.g4{display:grid !important;grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;gap:4px 12px !important}
.fgrid>*{grid-column:auto !important}
.fgrid>.full{grid-column:1 / -1 !important}
.kpis{display:grid !important;grid-template-columns:repeat(4,minmax(0,1fr)) !important;gap:6px !important}
.dl{display:grid !important;grid-template-columns:28mm minmax(0,1fr) !important;gap:2px 8px !important;font-size:10pt !important}
.dl dt{margin:0 !important;color:#333 !important}
.dl dd{max-width:none !important;overflow-wrap:anywhere}
.mt{margin-top:8px}
.muted,.small{color:#333 !important}
.small{font-size:9pt !important}
.cnt,.badge,.chip{background:#fff !important;color:#000 !important;border:.5pt solid #555 !important;
  border-radius:3px !important;padding:0 4px !important;font-size:8.5pt !important;min-height:0 !important}
.right{text-align:right !important}

/* tabelle: tornano tabelle vere (sul telefono diventano schede), righe intere, intestazione ripetuta */
.tblwrap{overflow:visible !important;border:0 !important;background:none !important;border-radius:0 !important;box-shadow:none !important}
.hide-m{display:revert !important}
table.tbl,table{display:table !important;width:100% !important;border-collapse:collapse !important;table-layout:auto !important}
table.tbl thead,table thead{display:table-header-group !important}
table.tbl tbody,table tbody{display:table-row-group !important}
table.tbl tfoot,table tfoot{display:table-footer-group !important}
table.tbl tr,table tr,table.tbl tr.tbl-head{display:table-row !important;background:none !important;border:0 !important;
  border-radius:0 !important;margin:0 !important;padding:0 !important;break-inside:avoid;page-break-inside:avoid}
table.tbl th,table.tbl td,table th,table td,table.tbl td.hide-m,table.tbl th.hide-m,table.tbl td.tbl-span{
  display:table-cell !important;padding:3px 6px !important;border:0 !important;border-bottom:.5pt solid #888 !important;
  font-size:9.5pt !important;vertical-align:top !important;text-align:left !important;
  word-break:normal !important;overflow-wrap:break-word !important;grid-template-columns:none !important;min-height:0 !important}
table.tbl td.right,table.tbl th.right,table td.right,table th.right{text-align:right !important;white-space:nowrap !important}
table.tbl th,table th{white-space:nowrap !important}
table.tbl td::before{content:none !important;display:none !important}
table.tbl th,table th{background:#e6e6e6 !important;font-weight:700 !important;font-size:9pt !important;
  text-transform:none !important;letter-spacing:0 !important;border-bottom:1pt solid #000 !important;
  -webkit-print-color-adjust:exact;print-color-adjust:exact}
table.tbl td .btn{display:none !important}

/* moduli: campi come righe scritte, non come riquadri da compilare */
label{font-size:9pt !important;color:#333 !important;font-weight:700 !important;display:block !important}
input,select,textarea{background:#fff !important;color:#000 !important;border:.5pt solid #999 !important;
  border-radius:2px !important;box-shadow:none !important;min-height:0 !important;height:auto !important;
  padding:2px 5px !important;font:inherit !important;font-size:10pt !important;width:100% !important;max-width:none !important;
  -webkit-appearance:none;appearance:none}
textarea{resize:none;white-space:pre-wrap;overflow:visible !important;field-sizing:content !important;min-height:2.4em !important}
input[type=checkbox],input[type=radio]{width:auto !important;-webkit-appearance:auto;appearance:auto}
.matrow{display:grid !important;grid-template-columns:3fr 1fr 1fr !important;gap:6px !important}
.matrow>:first-child{grid-column:auto !important}

img{max-width:100% !important;height:auto;break-inside:avoid}
.gallery,.ph{display:flex;flex-wrap:wrap;gap:6px}
.gallery img{width:42mm;height:32mm;object-fit:cover}
h1,h2,h3{break-after:avoid}
p,li{orphans:3;widows:3}
