/* TEMA COMUNE DEL GESTIONALE - modificare qui per aggiornare le pagine collegate.
   Le sezioni successive contengono soltanto le disposizioni specifiche. */
html:has(meta[name="patron-tema"]){
 --tema-primario:#245944;
 --tema-testo:#142b20;
 --tema-secondario:#43594a;
 --tema-sfondo:#f3f6f2;
 --tema-superficie:#ffffff;
 --tema-bordo:#becdc2;
 --tema-riga-alterna:#f0f3ef;
 --tema-azione-chiara:#edf5ed;
 --tema-pericolo:#aa4540;
 --tema-font:'Segoe UI',Arial,sans-serif;
 --tema-raggio-campi:6px;
 --tema-raggio-riquadri:12px;
}
/* CRUD: regole condivise */
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]){--ddt-ink:var(--tema-testo);--ddt-green:var(--tema-primario);--ddt-muted:var(--tema-secondario);--ddt-line:var(--tema-bordo)}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) *{box-sizing:border-box}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) body{margin:0;padding:20px 16px;background:var(--tema-sfondo);color:var(--ddt-ink);font:14px/1.5 var(--tema-font)}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-heading,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-nav,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-card,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filters{max-width:1440px;margin:0 auto 14px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-heading h1{margin:0;font-size:30px;font-weight:650;letter-spacing:-.7px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-heading p{margin:5px 0 0;color:var(--ddt-muted)}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-nav{display:flex;gap:10px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-nav a,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-nav a:visited{padding:8px 13px;border:1px solid var(--ddt-line);border-radius:var(--tema-raggio-campi);background:var(--tema-superficie);color:var(--ddt-green);font-weight:600;text-decoration:none;font-size:13px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-card,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter{border:1px solid var(--ddt-line);border-radius:var(--tema-raggio-riquadri);background:var(--tema-superficie);padding:14px;box-shadow:0 4px 16px #193c3104}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-card h2,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter h2{font-size:16px;margin:0 0 17px;font-weight:650}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-editor form{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px 14px;text-align:left;margin:0}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-field{display:flex;flex-direction:column;gap:6px;min-width:0}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-field span,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter label{font-size:12px;font-weight:600;color:var(--ddt-muted)}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) input,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) select,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) button{font:14px var(--tema-font)}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-card input:not([type=submit]):not([type=hidden]),
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-card select,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter input:not([type=submit]){width:100%;height:32px;min-width:0;padding:5px 8px;border:1px solid #bacabd;border-radius:var(--tema-raggio-campi);background:var(--tema-superficie);color:var(--ddt-ink)}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-card input:disabled{background:#f0f3ee!important;color:#7a867e!important}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) input:focus-visible,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) select:focus-visible,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) button:focus-visible,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) a:focus-visible{outline:2px solid #79a58b;outline-offset:2px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-editor hr{display:none}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-editor input[type=hidden]{display:none}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-editor input[type=submit]{grid-column:1/-1;justify-self:start;min-width:165px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-card input[type=submit],
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter input[type=submit]{height:30px;border-radius:var(--tema-raggio-campi);border:1px solid var(--ddt-green);padding:5px 12px;background:var(--ddt-green);color:var(--tema-superficie);font-weight:600;cursor:pointer}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filters{display:grid;grid-template-columns:1fr 1.5fr;gap:12px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter h2{margin-bottom:12px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter form{margin:0;display:flex;align-items:end;gap:9px;flex-wrap:wrap}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter label{display:flex;flex-direction:column;gap:5px;flex:1;min-width:130px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-filter input[type=submit]{flex-shrink:0}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-list{padding:0;overflow:hidden}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-list h2{padding:11px 14px;margin:0;border-bottom:1px solid var(--ddt-line)}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1{height:auto;max-height:640px;overflow:auto;border:0;text-align:left;margin:0;padding:0 12px 12px;scrollbar-color:#a6baac #eef3ee}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1>table{width:100%;min-width:1060px;border:0;border-collapse:separate;border-spacing:0;padding:0;font:13px/1.45 var(--tema-font)}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1>table>tbody>tr>th{position:sticky;top:0;z-index:1;background:#f4f7f3;border:0;border-bottom:1px solid var(--ddt-line);padding:8px 7px;color:var(--ddt-muted);font-size:11px;text-transform:uppercase;text-align:left;white-space:nowrap}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1>table>tbody>tr>td{padding:5px 7px;border:0;border-bottom:1px solid #d4ddd5;text-align:left;background:var(--tema-superficie);font-variant-numeric:tabular-nums;white-space:nowrap}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1>table>tbody>tr:hover>td{background:#f7faf6}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1>table>tbody>tr>td:nth-child(2){white-space:normal;min-width:210px;max-width:330px;font-weight:600}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1 table table,
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1 table table td{border:0;padding:0;background:transparent;border-collapse:separate}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1 table table td+td{padding-left:7px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1 form{white-space:nowrap;margin:0;display:flex;gap:7px}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1 input[type=submit]{width:auto!important;height:28px;padding:4px 8px;font-size:11px;background:var(--tema-azione-chiara);color:var(--ddt-green);border:1px solid #b6cebd}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) #tabella1 input[name=delete]{background:#fff5f3;color:var(--tema-pericolo);border-color:#efcfca}
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .error{max-width:1440px;width:auto;border-radius:var(--tema-raggio-campi);font-family:inherit}
@media(max-width:1100px){
html:has(meta[name="patron-tema"][content="ddt-merci"],meta[name="patron-tema"][content="ddt-out"]) .ddt-editor form{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* DDT merci: disposizione specifica */
html:has(meta[name="patron-tema"][content="ddt-merci"]) .ddt-field:has(select[name=id_fornitore]){grid-column:span 2}
html:has(meta[name="patron-tema"][content="ddt-merci"]) #tabella1>table>tbody>tr>td:nth-child(3),
html:has(meta[name="patron-tema"][content="ddt-merci"]) #tabella1>table>tbody>tr>td:nth-child(7),
html:has(meta[name="patron-tema"][content="ddt-merci"]) #tabella1>table>tbody>tr>td:nth-child(8),
html:has(meta[name="patron-tema"][content="ddt-merci"]) #tabella1>table>tbody>tr>td:nth-child(9){text-align:right}
html:has(meta[name="patron-tema"][content="ddt-merci"]) #tabella1 form[action^=carico] input{background:var(--ddt-green);color:var(--tema-superficie);border-color:var(--ddt-green)}
@media(max-width:650px){
html:has(meta[name="patron-tema"][content="ddt-merci"]) body{padding:20px 12px}
html:has(meta[name="patron-tema"][content="ddt-merci"]) .ddt-heading h1{font-size:26px}
html:has(meta[name="patron-tema"][content="ddt-merci"]) .ddt-editor form{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
html:has(meta[name="patron-tema"][content="ddt-merci"]) .ddt-card,
html:has(meta[name="patron-tema"][content="ddt-merci"]) .ddt-filter{padding:16px}
html:has(meta[name="patron-tema"][content="ddt-merci"]) .ddt-list{padding:0}
html:has(meta[name="patron-tema"][content="ddt-merci"]) .ddt-filters{grid-template-columns:1fr}
html:has(meta[name="patron-tema"][content="ddt-merci"]) .ddt-field:has(select[name=id_fornitore]){grid-column:1/-1}
}

/* DDT uscita e corpo: disposizione specifica */
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-field:has(select[name=id_cliente]){grid-column:span 2}
html:has(meta[name="patron-tema"][content="ddt-out"]) #tabella1>table>tbody>tr:nth-child(odd)>td{background:var(--tema-riga-alterna)}
html:has(meta[name="patron-tema"][content="ddt-out"]) #tabella1 form[action^=scarico_ddt] input{background:var(--ddt-green);color:var(--tema-superficie);border-color:var(--ddt-green)}
@media(max-width:650px){
html:has(meta[name="patron-tema"][content="ddt-out"]) body{padding:20px 12px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-heading h1{font-size:26px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-editor form{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-card,
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-filter{padding:16px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-list{padding:0}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-filters{grid-template-columns:1fr}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-field:has(select[name=id_cliente]){grid-column:1/-1}
}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-print-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-print-actions>form,
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-print-actions>p{margin:0!important}
html:has(meta[name="patron-tema"][content="ddt-out"]) body>.note{width:auto;max-width:1440px;margin:0 auto 14px;padding:12px 16px;background:var(--tema-superficie);border:1px solid var(--ddt-line);border-left:4px solid var(--ddt-green);border-radius:var(--tema-raggio-riquadri);font-family:inherit;text-align:left;line-height:1.55}
html:has(meta[name="patron-tema"][content="ddt-out"]) body>.note i{font-style:normal;color:var(--ddt-muted)}
html:has(meta[name="patron-tema"][content="ddt-out"]) body>.note form{display:inline-block;margin:10px 8px 0 0}
html:has(meta[name="patron-tema"][content="ddt-out"]) body>.note input[type=submit]{border:1px solid #c4d3c7;border-radius:var(--tema-raggio-campi);padding:10px 16px;background:var(--tema-azione-chiara);color:var(--ddt-green);font:600 13px var(--tema-font);cursor:pointer}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-scroll{overflow-x:auto;padding:0 12px 12px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe{width:100%;min-width:1100px;border:0;padding:0;border-collapse:separate;border-spacing:0;font:13px/1.4 var(--tema-font)}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe th{border:0;border-bottom:1px solid var(--ddt-line);background:#f4f7f3;padding:8px 6px;color:var(--ddt-muted);font-size:11px;text-transform:uppercase;text-align:right;white-space:nowrap}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe th:first-child{text-align:left}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe td{border:0;border-bottom:1px solid #cbd8ce;padding:4px 5px;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe tr.ddt-data:nth-child(even)>td{background:var(--tema-superficie)}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe tr.ddt-data:nth-child(odd)>td{background:var(--tema-riga-alterna)}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe tr.ddt-data:focus-within>td{box-shadow:inset 0 2px #7d9d86,inset 0 -2px #7d9d86}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe input[type=text],
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe select{height:28px;border:1px solid #afc0b2;border-radius:var(--tema-raggio-campi);background:transparent!important;font:13px var(--tema-font);padding:4px 6px;width:91px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe input[name=colli]{width:58px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe input[name=UM]{width:44px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe input[name=tara_u]{width:75px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe select[name=id_carico]{width:max-content;max-width:none;text-align:left}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe input[type=submit]{height:34px;padding:6px 12px;border:1px solid #aec6b6;border-radius:var(--tema-raggio-campi);background:var(--tema-azione-chiara);color:var(--ddt-green);font:600 11px var(--tema-font);cursor:pointer}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe input[name=cancella]{color:var(--tema-pericolo);border-color:#dfbfb9;background:#fff5f3}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe tr.ddt-inserimento>td{background:#edf5eb;border-top:3px solid #9bb8a4;padding-top:8px;padding-bottom:8px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe tr.ddt-inserimento input[name=aggiungi]{background:var(--ddt-green);color:var(--tema-superficie);border-color:var(--ddt-green);min-width:160px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe tr.ddt-ricerca>td{background:#f6f8f4;border:0;padding-top:8px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe input[name=cerca]{width:310px;background:var(--tema-superficie)!important}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary{max-width:900px;margin:22px auto}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary h2{font-size:16px;margin:0 0 10px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary table{width:100%;border:1px solid var(--ddt-line);border-radius:var(--tema-raggio-riquadri);border-spacing:0;border-collapse:separate;background:var(--tema-superficie);padding:0;overflow:hidden}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary th{border:0;text-align:left;background:var(--tema-superficie);padding:12px 18px 2px;color:var(--ddt-muted);font-size:11px;text-transform:uppercase}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary td{border:0;text-align:left;padding:0 18px 14px;font-size:23px;font-weight:650;font-variant-numeric:tabular-nums}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary td+td,
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary th+th{border-left:1px solid #edf1ec}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-back{max-width:1440px;margin:0 auto 12px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-back:empty{display:none}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-back input{padding:9px;border:1px solid var(--ddt-line);border-radius:var(--tema-raggio-campi);background:var(--tema-superficie);color:var(--ddt-green);cursor:pointer}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-card.ddt-list .ddt-scroll{padding-top:0}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-righe caption{display:none}
@media(max-width:650px){
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary th{padding:10px 10px 2px}
html:has(meta[name="patron-tema"][content="ddt-out"]) .ddt-summary td{padding:0 10px 12px;font-size:20px}
}

/* Carico: disposizione specifica */
html:has(meta[name="patron-tema"][content="carico"]){--carico-ink:var(--tema-testo);--carico-green:var(--tema-primario);--carico-muted:var(--tema-secondario);--carico-line:var(--tema-bordo)}
html:has(meta[name="patron-tema"][content="carico"]) *{box-sizing:border-box}
html:has(meta[name="patron-tema"][content="carico"]) body{margin:0;padding:20px 16px 24px;background:var(--tema-sfondo);color:var(--carico-ink);font:14px/1.45 var(--tema-font)}
html:has(meta[name="patron-tema"][content="carico"]) body>h1{max-width:1440px;margin:0 auto 14px;text-align:left;font-size:30px;font-weight:600;letter-spacing:-.7px;color:var(--carico-ink)}
html:has(meta[name="patron-tema"][content="carico"]) body>h1 b{font-weight:400;color:var(--carico-muted);font-size:20px;margin-left:12px;letter-spacing:0}
html:has(meta[name="patron-tema"][content="carico"]) body>.note{width:auto;max-width:1440px;min-height:0;height:auto;margin:0 auto 12px;padding:12px 16px;text-align:left;background:var(--tema-superficie);border:1px solid var(--carico-line);border-left:4px solid var(--carico-green);border-radius:var(--tema-raggio-riquadri);line-height:1.55;color:var(--carico-ink);font-family:inherit}
html:has(meta[name="patron-tema"][content="carico"]) body>.note i{font-style:normal;color:var(--carico-muted)}
html:has(meta[name="patron-tema"][content="carico"]) .carico-nav{max-width:1440px;margin:0 auto 14px;display:flex;gap:10px;flex-wrap:wrap;align-items:center}
html:has(meta[name="patron-tema"][content="carico"]) .carico-nav a,
html:has(meta[name="patron-tema"][content="carico"]) .carico-nav a:visited{padding:9px 14px;background:var(--tema-superficie);border:1px solid var(--carico-line);border-radius:var(--tema-raggio-campi);text-decoration:none;color:var(--carico-green);font-weight:600;font-size:13px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-nav a:hover{background:#e8f0e9;border-color:#b5c9bb}
html:has(meta[name="patron-tema"][content="carico"]) .carico-panel{max-width:1440px;margin:0 auto 14px;background:var(--tema-superficie);border:1px solid var(--carico-line);border-radius:var(--tema-raggio-riquadri);box-shadow:0 4px 16px #193c3105;overflow:hidden}
html:has(meta[name="patron-tema"][content="carico"]) .carico-panel-title{padding:11px 14px;border-bottom:1px solid var(--carico-line);display:flex;justify-content:space-between;align-items:center;gap:16px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-panel-title h2{margin:0;font-size:17px;font-weight:650}
html:has(meta[name="patron-tema"][content="carico"]) .carico-panel-title span{font-size:12px;color:var(--carico-muted)}
html:has(meta[name="patron-tema"][content="carico"]) .carico-scroll{overflow-x:auto;padding:0 12px 14px;scrollbar-color:#a6baac #eef3ee}
html:has(meta[name="patron-tema"][content="carico"]) .carico-scroll>div{width:100%}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe{border-collapse:separate;border-spacing:0;width:100%;min-width:1280px;margin:0;background:var(--tema-superficie)!important;border:0;font:13px/1.4 var(--tema-font)}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe caption{display:none}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe th{padding:4px 4px;background:#f4f7f3;border:0;border-bottom:1px solid var(--carico-line);color:#43594a;font-size:11px;white-space:nowrap;text-transform:uppercase;letter-spacing:.35px;font-weight:700;text-align:right}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe th:first-child,
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe th:nth-child(3),
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe th:nth-child(4),
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe th:nth-child(5){text-align:left}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe td{height:36px;padding:4px 4px;border:0;border-bottom:1px solid #d4ddd5;white-space:nowrap;text-align:right;background:var(--tema-superficie);font-variant-numeric:tabular-nums}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe td:first-child,
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe td:nth-child(3),
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe td:nth-child(4),
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe td:nth-child(5){text-align:left}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe tr:hover>td{background:#f7faf6}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input,
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe select{max-width:100%;height:28px;margin:0;border:1px solid #bacabd;border-radius:var(--tema-raggio-campi);background:var(--tema-superficie)!important;padding:4px 6px;font:13px var(--tema-font);box-shadow:none}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[type=text]{width:70px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe select[name=id_prodotto]{width:max-content;max-width:none}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe select[name=id_cesteria]{width:max-content;max-width:none}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=pezzi_collo]{width:44px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=note]{width:88px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=lotto]{width:70px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=colli],
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=distrutto]{width:50px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=tara_u],
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=prezzo_consigliato]{width:58px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=modifica]{width:57px;color:var(--carico-green);border-color:#b6cebd;background:var(--tema-azione-chiara)!important;font-weight:600}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=elimina]{width:57px;color:var(--tema-pericolo);background:#fff5f3!important;border-color:#efcfca;font-weight:600}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[type=submit]{cursor:pointer}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[type=submit]:hover{filter:brightness(.96)}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input:focus,
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe select:focus{outline:2px solid #79a58b;outline-offset:1px;border-color:#79a58b}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe tr:has(input[name=aggiungi])>td{background:#edf5eb;border-top:2px solid #b9cebd;padding-top:8px;padding-bottom:8px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=aggiungi]{background:var(--carico-green)!important;color:var(--tema-superficie);border-color:var(--carico-green);min-width:136px;font-weight:600}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe tr:has(form[name=cerca]) td{background:#f7f9f6;white-space:normal;text-align:left;color:var(--carico-muted);font-size:12px;padding-top:8px;padding-bottom:8px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=prodotto]{width:145px;margin-top:5px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=cesteria]{width:130px;margin-top:5px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input[name=cerca]{min-width:100px;color:var(--carico-green);font-weight:600;background:var(--tema-superficie)!important}
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali{max-width:1000px;width:100%;margin:0 auto 24px;border-collapse:separate;border-spacing:0;background:var(--tema-superficie);border:1px solid var(--carico-line);border-radius:var(--tema-raggio-riquadri);overflow:hidden;font-family:inherit}
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali caption{text-align:left;padding:0 0 12px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali caption h3{margin:0;font-size:16px;font-weight:600;color:var(--carico-ink)}
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali th{padding:12px 18px 3px;text-align:left;background:var(--tema-superficie);border:0;color:var(--carico-muted);font-size:11px;text-transform:uppercase;letter-spacing:.5px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali td{padding:0 18px 15px;text-align:left;background:var(--tema-superficie);border:0;color:var(--carico-ink);font-size:23px;font-weight:650;font-variant-numeric:tabular-nums}
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali th+th,
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali td+td{border-left:1px solid #edf1ec}
html:has(meta[name="patron-tema"][content="carico"]) .carico-scroll-help{max-width:1440px;margin:-8px auto 24px;color:var(--carico-muted);font-size:12px}
html:has(meta[name="patron-tema"][content="carico"]) body>.error{max-width:1440px;margin:16px auto}
@media(max-width:760px){
html:has(meta[name="patron-tema"][content="carico"]) body{padding:20px 12px}
html:has(meta[name="patron-tema"][content="carico"]) body>h1{font-size:25px}
html:has(meta[name="patron-tema"][content="carico"]) body>h1 b{display:block;margin:4px 0 0;font-size:16px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-panel-title{padding:14px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-panel-title span{display:none}
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali th{font-size:10px;padding:10px 8px 3px}
html:has(meta[name="patron-tema"][content="carico"]) .carico-totali td{font-size:18px;padding:0 8px 12px}
}
@media print{
html:has(meta[name="patron-tema"][content="carico"]) body{background:var(--tema-superficie);padding:0}
html:has(meta[name="patron-tema"][content="carico"]) .carico-nav,
html:has(meta[name="patron-tema"][content="carico"]) .carico-scroll-help{display:none}
html:has(meta[name="patron-tema"][content="carico"]) .carico-scroll{overflow:visible}
html:has(meta[name="patron-tema"][content="carico"]) .carico-panel{border:0;box-shadow:none}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe{min-width:0}
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe input,
html:has(meta[name="patron-tema"][content="carico"]) .carico-righe select{border:0}
}

/* Home: disposizione specifica */
html:has(meta[name="patron-tema"][content="home"]){--ink:var(--tema-testo);--green:var(--tema-primario);--paper:var(--tema-sfondo);--muted:var(--tema-secondario);--line:var(--tema-bordo)}
html:has(meta[name="patron-tema"][content="home"]) *{box-sizing:border-box}
html:has(meta[name="patron-tema"][content="home"]) body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--tema-font);line-height:1.5}
html:has(meta[name="patron-tema"][content="home"]) a{color:inherit}
html:has(meta[name="patron-tema"][content="home"]) button,
html:has(meta[name="patron-tema"][content="home"]) input{font:inherit}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio{width:100%;height:auto;margin:0;background:var(--tema-testo);display:flex;align-items:center;justify-content:space-between;padding:16px max(24px,calc((100vw - 1180px)/2));gap:20px;font-family:inherit;font-size:14px}
html:has(meta[name="patron-tema"][content="home"]) #logo{float:none;padding:0;display:flex;align-items:center;gap:12px;color:var(--tema-superficie);font-size:18px;font-weight:700;letter-spacing:1px}
html:has(meta[name="patron-tema"][content="home"]) #logo img{max-width:160px;border-radius:4px}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio ul{margin:0;padding:0;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio li{margin:0;list-style:none}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio a:link,
html:has(meta[name="patron-tema"][content="home"]) #menuservizio a:visited{font-variant:normal;color:#e6eee7}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio a:hover{text-decoration:underline}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio form{background:transparent}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio input[type=submit]{border:1px solid #658073;border-radius:var(--tema-raggio-campi);background:transparent;color:var(--tema-superficie);padding:8px 12px;cursor:pointer}
html:has(meta[name="patron-tema"][content="home"]) #contenitore{width:min(1180px,calc(100% - 48px));margin:0 auto;font-family:inherit;padding:0}
html:has(meta[name="patron-tema"][content="home"]) .welcome{padding:32px 0 22px}
html:has(meta[name="patron-tema"][content="home"]) .eyebrow{margin:0 0 10px;color:var(--green);text-transform:uppercase;font-size:12px;font-weight:700;letter-spacing:2px}
html:has(meta[name="patron-tema"][content="home"]) .welcome h1{font-size:clamp(30px,4vw,44px);line-height:1.15;letter-spacing:-1.5px;margin:0 0 12px;font-weight:650}
html:has(meta[name="patron-tema"][content="home"]) .welcome p:last-child{margin:0;color:var(--muted);font-size:16px}
html:has(meta[name="patron-tema"][content="home"]) .section-heading{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:20px 0 18px}
html:has(meta[name="patron-tema"][content="home"]) .section-heading h2{font-size:18px;margin:0}
html:has(meta[name="patron-tema"][content="home"]) .section-heading span{font-size:13px;color:var(--muted)}
html:has(meta[name="patron-tema"][content="home"]) .workspace-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding-bottom:28px}
html:has(meta[name="patron-tema"][content="home"]) .menu-card{background:var(--tema-superficie);border:1px solid var(--line);border-radius:var(--tema-raggio-riquadri);padding:16px;box-shadow:0 3px 8px #17362d03}
html:has(meta[name="patron-tema"][content="home"]) .card-heading{display:flex;align-items:center;gap:12px;margin-bottom:18px}
html:has(meta[name="patron-tema"][content="home"]) .card-mark{display:grid;place-items:center;width:38px;height:30px;border-radius:var(--tema-raggio-riquadri);background:#edf3ed;color:var(--green);font-size:13px;font-weight:700}
html:has(meta[name="patron-tema"][content="home"]) .menu-card h3{font-size:17px;margin:0;font-weight:650}
html:has(meta[name="patron-tema"][content="home"]) .card-link{display:flex;justify-content:space-between;align-items:center;gap:14px;text-decoration:none;padding:8px 0;border-top:1px solid #edf0eb;min-height:50px}
html:has(meta[name="patron-tema"][content="home"]) .card-link strong{display:block;font-size:14px;font-weight:600}
html:has(meta[name="patron-tema"][content="home"]) .card-link small{display:block;font-size:12px;color:var(--muted);margin-top:3px}
html:has(meta[name="patron-tema"][content="home"]) .card-link .arrow{font-size:21px;color:#779481}
html:has(meta[name="patron-tema"][content="home"]) .card-link:hover strong{color:#357252}
html:has(meta[name="patron-tema"][content="home"]) .card-link:hover .arrow{transform:translateX(3px)}
html:has(meta[name="patron-tema"][content="home"]) .card-link:focus-visible,
html:has(meta[name="patron-tema"][content="home"]) #menuservizio a:focus-visible,
html:has(meta[name="patron-tema"][content="home"]) #menuservizio input:focus-visible{outline:3px solid #c3a849;outline-offset:4px;border-radius:4px}
html:has(meta[name="patron-tema"][content="home"]) .menu-card.admin{background:#edf2ea;border-color:#d2dfce}
html:has(meta[name="patron-tema"][content="home"]) .menu-card.admin .card-mark{background:#dbe7d6}
html:has(meta[name="patron-tema"][content="home"]) .menu-card.tools{grid-column:span 2}
html:has(meta[name="patron-tema"][content="home"]) .menu-card.tools .tool-links{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}
html:has(meta[name="patron-tema"][content="home"]) #footer{width:100%;background:transparent;color:var(--muted);border-top:1px solid var(--line);margin:0 auto;padding:24px 0 32px;font:12px/1.9 var(--tema-font);text-align:left}
html:has(meta[name="patron-tema"][content="home"]) #footer address{font-style:normal}
html:has(meta[name="patron-tema"][content="home"]) #footer a:link,
html:has(meta[name="patron-tema"][content="home"]) #footer a:visited{color:var(--green);text-decoration:underline}
html:has(meta[name="patron-tema"][content="home"]) .session-label{font-size:12px;color:#c2d6c9}
@media(max-width:1000px){
html:has(meta[name="patron-tema"][content="home"]) #menuservizio{align-items:flex-start;flex-direction:column;padding:18px 24px}
html:has(meta[name="patron-tema"][content="home"]) .workspace-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
html:has(meta[name="patron-tema"][content="home"]) .menu-card.tools{grid-column:span 1}
html:has(meta[name="patron-tema"][content="home"]) .menu-card.tools .tool-links{grid-template-columns:1fr}
}
@media(max-width:600px){
html:has(meta[name="patron-tema"][content="home"]) #contenitore{width:calc(100% - 32px)}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio{padding:16px}
html:has(meta[name="patron-tema"][content="home"]) #menuservizio ul{justify-content:flex-start;gap:12px;font-size:12px}
html:has(meta[name="patron-tema"][content="home"]) .welcome{padding-top:30px}
html:has(meta[name="patron-tema"][content="home"]) .workspace-grid{grid-template-columns:1fr;gap:12px}
html:has(meta[name="patron-tema"][content="home"]) .menu-card{padding:18px}
html:has(meta[name="patron-tema"][content="home"]) .section-heading span{display:none}
html:has(meta[name="patron-tema"][content="home"]) .welcome h1{letter-spacing:-.8px}
}
@media(prefers-reduced-motion:no-preference){
html:has(meta[name="patron-tema"][content="home"]) .arrow{transition:transform .15s ease}
}
html:has(meta[name="patron-tema"]) .patron-pdf-button{background:var(--tema-primario)!important;border-color:var(--tema-primario)!important;border-radius:var(--tema-raggio-campi)!important;font-family:var(--tema-font)!important}

/* Tema compatto: titoli centrati e controlli delle righe piu raccolti. */
html:has(meta[name="patron-tema"][content]) .ddt-heading,html:has(meta[name="patron-tema"][content]) .ddt-card h2,html:has(meta[name="patron-tema"][content]) .ddt-filter h2,html:has(meta[name="patron-tema"][content]) .ddt-summary h2,html:has(meta[name="patron-tema"][content]) body>h1,html:has(meta[name="patron-tema"][content]) .carico-panel-title h2,html:has(meta[name="patron-tema"][content]) .carico-totali caption,html:has(meta[name="patron-tema"][content]) .welcome,html:has(meta[name="patron-tema"][content]) .menu-card h3{text-align:center}
html:has(meta[name="patron-tema"][content]) .carico-panel-title{justify-content:center;position:relative}
html:has(meta[name="patron-tema"][content]) .carico-panel-title span{position:absolute;right:14px}
html:has(meta[name="patron-tema"][content]) .ddt-card.ddt-list .ddt-righe input[type=text]{width:78px;height:28px;padding:4px 6px}
html:has(meta[name="patron-tema"][content]) .ddt-card.ddt-list .ddt-righe input[name=colli]{width:56px}
html:has(meta[name="patron-tema"][content]) .ddt-card.ddt-list .ddt-righe input[name=UM]{width:40px}
html:has(meta[name="patron-tema"][content]) .ddt-card.ddt-list .ddt-righe input[name=tara_u]{width:62px}
html:has(meta[name="patron-tema"][content]) .ddt-righe input[type=submit]{height:28px;padding:4px 8px}
html:has(meta[name="patron-tema"][content]) .ddt-card.ddt-list .ddt-righe select{height:28px}
html:has(meta[name="patron-tema"][content]) .ddt-righe tr.ddt-data>td{height:37px}
html:has(meta[name="patron-tema"][content]) .carico-righe input[name=prodotto],html:has(meta[name="patron-tema"][content]) .carico-righe input[name=cesteria]{height:28px}
html:has(meta[name="patron-tema"][content]) .ddt-card h2,html:has(meta[name="patron-tema"][content]) .ddt-filter h2{margin-bottom:11px}
html:has(meta[name="patron-tema"][content]) .ddt-list h2{margin:0}
html:has(meta[name="patron-tema"][content="home"]) .section-heading{justify-content:center;flex-direction:column;gap:4px}
html:has(meta[name="patron-tema"][content="home"]) .card-heading{justify-content:center}
@media(max-width:1000px){html:has(meta[name="patron-tema"][content]) .carico-panel-title span{display:none}}

html:has(meta[name="patron-tema"][content]) .ddt-card.ddt-list .ddt-righe input[name=cerca]{width:260px;max-width:100%}

/* I menu delle righe si dimensionano sulle opzioni, senza tagli del testo. */
html:has(meta[name="patron-tema"][content]) .carico-righe select,
html:has(meta[name="patron-tema"][content]) .ddt-card.ddt-list .ddt-righe select{
 width:max-content;max-width:none;min-width:max-content;white-space:nowrap;
}

/* RIEPILOGO: filtri, coda fornitori e confronto vendite / CV. */
html:has(meta[name="patron-tema"][content="riepilogo"]) body{margin:0;padding:20px 16px;background:var(--tema-sfondo);color:var(--tema-testo);font:13px/1.45 var(--tema-font)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-app{max-width:1500px;margin:0 auto}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo{text-align:center;margin:0 0 16px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo h1{margin:0;font-size:29px;letter-spacing:-.6px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo p{margin:4px 0 0;color:var(--tema-secondario)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-nav{display:flex;gap:9px;margin:12px 0;flex-wrap:wrap}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-nav a{padding:7px 12px;background:var(--tema-superficie);border:1px solid var(--tema-bordo);border-radius:var(--tema-raggio-campi);color:var(--tema-primario);font-weight:600;text-decoration:none}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-box{margin:0 0 14px;padding:14px;background:var(--tema-superficie);border:1px solid var(--tema-bordo);border-radius:var(--tema-raggio-riquadri)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-box h2{text-align:center;font-size:16px;margin:0 0 12px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:0}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri>label{display:flex;flex-direction:column;gap:5px;color:var(--tema-secondario);font-weight:600}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri select{width:max-content;min-width:240px;max-width:none}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri fieldset{display:flex;gap:12px;border:1px solid var(--tema-bordo);border-radius:var(--tema-raggio-campi);margin:0;padding:5px 10px 7px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri legend{font-size:11px;padding:0 4px;color:var(--tema-secondario)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri fieldset label{white-space:nowrap;cursor:pointer}
html:has(meta[name="patron-tema"][content="riepilogo"]) input,html:has(meta[name="patron-tema"][content="riepilogo"]) select{font:13px var(--tema-font)}
html:has(meta[name="patron-tema"][content="riepilogo"]) input[type=text],html:has(meta[name="patron-tema"][content="riepilogo"]) input[type=date],html:has(meta[name="patron-tema"][content="riepilogo"]) select{height:30px;border:1px solid var(--tema-bordo);border-radius:var(--tema-raggio-campi);padding:4px 6px;background:transparent}
html:has(meta[name="patron-tema"][content="riepilogo"]) input[type=radio]{accent-color:var(--tema-primario);vertical-align:middle}
html:has(meta[name="patron-tema"][content="riepilogo"]) input[type=submit]{height:30px;padding:5px 12px;border:1px solid #a8bfae;border-radius:var(--tema-raggio-campi);background:var(--tema-azione-chiara);color:var(--tema-primario);font-weight:600;cursor:pointer}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri>input[type=submit],html:has(meta[name="patron-tema"][content="riepilogo"]) input[name=registraCV],html:has(meta[name="patron-tema"][content="riepilogo"]) input[name=invio]{background:var(--tema-primario);border-color:var(--tema-primario);color:white}
html:has(meta[name="patron-tema"][content="riepilogo"]) input[name=riapri]{color:var(--tema-pericolo);background:#fff7f5;border-color:#dfbeb7}
html:has(meta[name="patron-tema"][content="riepilogo"]) input:focus-visible,html:has(meta[name="patron-tema"][content="riepilogo"]) select:focus-visible,html:has(meta[name="patron-tema"][content="riepilogo"]) a:focus-visible{outline:2px solid #709a80;outline-offset:2px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-scroll{overflow-x:auto;scrollbar-color:#a6baac #eef3ee}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri{overflow-x:auto;padding-bottom:2px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella,html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo{width:100%;border:0;border-collapse:separate;border-spacing:0;padding:0;font:13px/1.4 var(--tema-font)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella caption,html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo caption{text-align:center;font-weight:650;font-size:15px;padding:0 0 11px;color:var(--tema-testo)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella th,html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo th{border:0;border-bottom:1px solid var(--tema-bordo);background:#f0f4ef;color:var(--tema-secondario);font-size:11px;padding:7px 8px;white-space:nowrap;text-align:right}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella td,html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo td{border:0;border-bottom:1px solid #d4ddd5;padding:4px 7px;height:36px;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella th:first-child,html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella td:first-child,html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo th:first-child{text-align:left}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella>tbody>tr:nth-child(odd)>td{background:var(--tema-riga-alterna)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella form,html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo form{margin:0}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo{min-width:1250px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo font{font-size:inherit}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo tr.riep-pari>td{background:var(--tema-riga-alterna)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo tr.riep-dispari>td{background:var(--tema-superficie)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo tr.riep-vendite>td{font-size:12px;color:var(--tema-secondario);padding-top:10px;border-bottom:0}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo tr.riep-prezzi>td{padding-bottom:8px;border-bottom:2px solid var(--tema-bordo)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo tr.riep-prezzi>td:first-child{white-space:normal;min-width:260px;max-width:440px;font-weight:600}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo input[type=text]{height:28px;width:82px;text-align:right}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo input[name=distruttoCV]{width:48px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo input[name=prezzo]{width:70px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento{text-align:center}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento p{margin:0 0 10px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-aiuto{color:var(--tema-secondario);font-size:12px;text-align:center}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-totali .riep-tabella{min-width:940px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-totali font{font-size:inherit}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-totali td{font-weight:600}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-app .patron-cv-actions{margin:0 0 14px;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-app .patron-cv-actions input[type=submit],html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-app .patron-cv-actions a{height:32px;padding:0 12px;font:600 12px var(--tema-font);border-radius:var(--tema-raggio-campi)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-app .patron-cv-actions a{background:var(--tema-primario);color:white;border-color:var(--tema-primario)}
html:has(meta[name="patron-tema"][content="riepilogo"]) .error{width:auto;max-width:1500px;font-family:var(--tema-font);border-radius:var(--tema-raggio-campi)}
@media(max-width:650px){html:has(meta[name="patron-tema"][content="riepilogo"]) body{padding:16px 10px}html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo h1{font-size:25px}html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-box{padding:11px}html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri>label{flex:1;min-width:130px}html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-fornitore{flex-basis:100%!important}html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri fieldset{flex-basis:100%;justify-content:center}html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri select{min-width:220px}html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri>input[type=submit]{width:100%}}

html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-tabella td{background:var(--tema-superficie)}

/* Riepilogo: intestazione raccolta per dare priorita alle righe del CV. */
html:has(meta[name="patron-tema"][content="riepilogo"]) body{padding:10px 12px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-app{position:relative}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo{min-height:30px;margin:0 0 8px;padding:0 290px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo h1{font-size:22px;line-height:30px;letter-spacing:-.3px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo p{display:none}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo+.riep-nav{position:absolute;top:0;right:0;margin:0;gap:6px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo+.riep-nav a{padding:4px 9px;font-size:12px;line-height:20px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-box:has(>.riep-filtri){padding:7px 10px;margin-bottom:8px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-box:has(>.riep-filtri)>h2{display:none}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri{align-items:center;gap:8px;padding-bottom:0}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri>label{flex-direction:row;align-items:center;gap:6px;font-size:12px;white-space:nowrap}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri select{min-width:210px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri input[type=date]{height:28px;width:128px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri input[type=submit]{height:28px;padding:4px 10px;font-size:12px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri fieldset{position:relative;padding:3px 8px;gap:10px;align-items:center;min-height:28px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri legend{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px 16px;padding:7px 12px;margin-bottom:8px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento h2{font-size:14px;line-height:20px;margin:0}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento p{margin:0;font-size:12px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento form{margin:0}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento input[name=riapri]{height:28px;padding:4px 9px;font-size:12px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-scroll:has(.riep-corpo){padding-top:8px}
html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-corpo caption{font-size:13px;padding-bottom:6px}
@media(max-width:900px){
 html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo{padding:0}
 html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-titolo+.riep-nav{position:static;justify-content:center;margin:0 0 8px}
}
@media(max-width:650px){
 html:has(meta[name="patron-tema"][content="riepilogo"]) body{padding:8px}
 html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri>label{flex-direction:column;align-items:stretch;gap:3px}
 html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri input[type=date]{width:100%}
 html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-filtri fieldset{flex-basis:100%}
 html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento h2{flex-basis:100%;font-size:13px}
 html:has(meta[name="patron-tema"][content="riepilogo"]) .riep-documento{gap:5px;padding:7px}
}

/* Fatture emesse e corpo fattura */
html:has(meta[name="patron-tema"][content="fatture"]) body {
  margin: 0;
  padding: 10px 12px;
  background: var(--tema-sfondo);
  color: var(--tema-testo);
  font: 13px/1.45 var(--tema-font);
}
.fat-app, .fat-app * { box-sizing: border-box; }
.fat-app { max-width: 1500px; margin: 0 auto; }
.fat-header { position: relative; margin-bottom: 8px; padding: 0 300px; }
.fat-header h1 { margin: 0; min-height: 30px; font-size: 22px; text-align: center; }
.fat-header h1 small { font-size: 13px; font-weight: 400; }
.fat-header .fat-nav { position: absolute; right: 0; top: 0; }
.fat-nav, .fat-stampe, .fat-periodo, .fat-documento {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.fat-nav a, .fat-app input[type=submit], .fat-stampe a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  width: auto !important;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-campi);
  background: var(--tema-azione-chiara);
  color: var(--tema-primario);
  text-decoration: none;
  font: 600 12px var(--tema-font);
  cursor: pointer;
}
.fat-app input[name=ft], .fat-app input[name=aggiungi],
.fat-app input[name=submit], .fat-app input[name=includi] {
  background: var(--tema-primario);
  color: white;
}
.fat-app input[name=delete], .fat-app input[name=cancella], .fat-app input[name=annulla] {
  color: var(--tema-pericolo);
  background: #fff7f5;
}
.fat-panel {
  padding: 8px 10px;
  margin: 0 0 8px;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-riquadri);
  background: var(--tema-superficie);
}
.fat-panel h2, .fat-table caption {
  margin: 0;
  padding: 0 0 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 650;
  color: var(--tema-testo);
}
.fat-app form, .fat-stampe p { margin: 0; }
.fat-documento { justify-content: space-between; }
.fat-periodo { margin-bottom: 8px !important; }
.fat-editor form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.fat-editor .ddt-field { display: flex; flex-direction: column; gap: 3px; }
.fat-editor .fat-tipo { margin: 0; padding: 3px 8px; border: 1px solid var(--tema-bordo); border-radius: var(--tema-raggio-campi); }
.fat-editor input[type=text] { width: 110px !important; }
.fat-app input:not([type=submit]):not([type=radio]), .fat-app select {
  height: 28px;
  padding: 4px 6px;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-campi);
  background-color: transparent;
  font: 13px var(--tema-font);
}
.fat-scroll, .fat-editor { overflow-x: auto; }
.fat-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tema-superficie);
  font: 13px/1.4 var(--tema-font);
}
.fat-table th, .fat-table td {
  border: 0;
  border-bottom: 1px solid var(--tema-bordo);
  padding: 4px 6px;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fat-table th { color: var(--tema-secondario); background: var(--tema-riga-alterna); }
.fat-table tr:nth-child(odd) > td { background: var(--tema-riga-alterna); }
.fat-table input[type=number] { width: 74px; }
.fat-list { min-width: 950px; }
.fat-righe { min-width: 1050px; }
.fat-totali { min-width: 830px; }
.fat-righe input[type=text] { width: 74px; }
.fat-righe input[name=colli], .fat-righe input[name=UM] { width: 46px; }
.fat-righe input[name=prodotto] { width: 310px; }
.fat-righe input[name=cerca] { width: 220px; }
.fat-righe select, .fat-editor select { width: max-content; max-width: none; }
.fat-righe .fat-inserimento td { background: var(--tema-azione-chiara); }
.fat-app input:focus-visible, .fat-app select:focus-visible, .fat-app a:focus-visible {
  outline: 2px solid var(--tema-primario);
  outline-offset: 2px;
}
@media (max-width: 1050px) {
  .fat-header { padding: 0; }
  .fat-header .fat-nav { position: static; justify-content: center; margin-top: 5px; }
}

.fat-editor form > hr { display: none; }
.fat-app input:disabled { color: var(--tema-secondario); background: var(--tema-riga-alterna); }

/* Le tabelle di consultazione seguono la larghezza delle colonne. */
.fat-panel-misura {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.fat-table { border: 0; }
.fat-list, .fat-ddt, .fat-totali {
  width: max-content;
  min-width: 0;
  margin-inline: auto;
}
.fat-comandi {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fat-list th, .fat-list td { text-align: left; }
.fat-list th:nth-child(1), .fat-list td:nth-child(1),
.fat-list th:nth-child(5), .fat-list td:nth-child(5) {
  text-align: right;
}
.fat-list th:nth-child(8), .fat-list th:nth-child(9),
.fat-ddt th, .fat-ddt td { text-align: center; }
.fat-ddt th, .fat-ddt td, .fat-totali th, .fat-totali td {
  padding-inline: 9px;
}

/* Gli elenchi e i totali occupano lo spazio richiesto dalle colonne. */
html:has(meta[name="patron-tema"][content]) .ddt-list:has(> #tabella1),
html:has(meta[name="patron-tema"][content]) .riep-scroll:has(.riep-tabella),
html:has(meta[name="patron-tema"][content]) .ddt-summary {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}

html:has(meta[name="patron-tema"][content]) #tabella1 > table,
html:has(meta[name="patron-tema"][content]) .riep-tabella,
html:has(meta[name="patron-tema"][content]) .riep-totali .riep-tabella {
  width: max-content;
  min-width: 0;
  margin-inline: auto;
}

html:has(meta[name="patron-tema"][content]) .ddt-summary table,
html:has(meta[name="patron-tema"][content]) .carico-totali {
  width: auto;
  max-width: 100%;
  margin-inline: auto;
}



/* Controllo della sessione nella barra della schermata principale. */
#menuservizio .gestionale-uscita {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #e6eee7;
}

.gestionale-uscita button {
  border: 1px solid #bdcdc2;
  border-radius: 6px;
  padding: 5px 12px;
  background: #edf5ed;
  color: #245944;
  font-weight: 600;
  cursor: pointer;
}

.gestionale-uscita button:hover { background: #fff; }
.gestionale-uscita button:focus-visible {
  outline: 2px solid #e6eee7;
  outline-offset: 3px;
}

/* Accesso e amministrazione utenti */
:is(.auth-page, .utenti-page) {
  margin: 0;
  min-height: 100vh;
  background: var(--tema-sfondo);
  color: var(--tema-testo);
  font: 14px/1.5 var(--tema-font);
}
:is(.auth-page, .utenti-page) * { box-sizing: border-box; }
.auth-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding: 12px max(16px, calc((100vw - 1080px) / 2));
  background: #17362d;
  color: #fff;
}
.auth-nav ul { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 0; list-style: none; }
.auth-nav a { color: inherit; }
.auth-nav img { display: block; border-radius: 4px; }
.auth-main { width: min(100% - 32px, 390px); margin: clamp(24px, 8vw, 72px) auto 24px; }
.auth-card, .utenti-card {
  padding: 16px;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-riquadri);
  background: var(--tema-superficie);
}
.auth-card { padding: 22px; }
.auth-card h1, .utenti-page h1 { margin: 0 0 14px; text-align: center; font-size: 24px; }
.auth-form, .utenti-editor form { display: grid; gap: 10px; margin: 0; }
.auth-form label, .utenti-editor label { display: grid; gap: 3px; font-weight: 600; }
:is(.auth-form, .utenti-editor) :is(input[type=text], input[type=password]) {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-campi);
  color: var(--tema-testo);
  background: var(--tema-superficie);
  font: inherit;
}
.auth-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.auth-actions form { margin: 0; }
.auth-footer { max-width: 1000px; margin: 0 auto; padding: 12px 16px; text-align: center; color: var(--tema-secondario); font-size: 12px; }
.auth-footer address { font-style: normal; }
.auth-footer a { color: inherit; }
.auth-status { margin: 0 0 12px; padding: 8px 10px; border-radius: var(--tema-raggio-campi); background: var(--tema-azione-chiara); }
.utenti-page main { padding: 14px 16px; }
.utenti-header { text-align: center; margin: 0 auto 12px; }
.utenti-header h1 { margin-bottom: 6px; }
.utenti-editor { width: min(100%, 440px); margin: 0 auto 12px; }
.utenti-card h2 { margin: 0 0 10px; text-align: center; font-size: 16px; }
.utenti-editor br, .utenti-editor hr { display: none; }
.utenti-editor fieldset { min-width: 0; margin: 0; padding: 6px 8px; border: 1px solid var(--tema-bordo); border-radius: var(--tema-raggio-campi); }
.utenti-editor fieldset label { display: inline-flex; align-items: center; margin-right: 8px; font-weight: 400; }
.utenti-editor small { color: var(--tema-secondario); }
.utenti-lista { width: fit-content; max-width: 100%; margin: 0 auto; }
.utenti-scroll { overflow-x: auto; }
.utenti-scroll table { width: max-content; border: 0; border-collapse: collapse; }
.utenti-scroll :is(th, td) { padding: 4px 8px; border: 0; border-bottom: 1px solid var(--tema-bordo); text-align: left; }
.utenti-scroll th, .utenti-scroll > table > tbody > tr:nth-child(odd) { background: var(--tema-riga-alterna); }
.utenti-scroll td td { padding: 0; border: 0; }
.utenti-scroll td input { margin: 2px; }
.auth-button, .auth-form button, .auth-actions button, .utenti-page input[type=submit] {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-campi);
  background: var(--tema-azione-chiara);
  color: var(--tema-primario);
  font: 600 13px/1.5 var(--tema-font);
  text-decoration: none;
  cursor: pointer;
}
.auth-form button, .auth-button-primario, .utenti-editor input[type=submit] {
  background: var(--tema-primario);
  border-color: var(--tema-primario);
  color: #fff;
}
.utenti-page input[name=delete] { color: var(--tema-pericolo); background: #fff5f3; }
:is(.auth-page, .utenti-page) :focus-visible { outline: 2px solid #6c9c83; outline-offset: 2px; }


/* Crediti e fatture di acquisto */
.contabilita { margin: 0; background: var(--tema-sfondo); color: var(--tema-testo); font: 14px/1.45 var(--tema-font); }
.contabilita-main, .contabilita-main * { box-sizing: border-box; }
.contabilita-main { padding: 12px 16px; }
.contabilita-header { text-align: center; margin-bottom: 12px; }
.contabilita-header h1 { font-size: 24px; margin: 0 0 6px; }
.contabilita-header nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.contabilita-card {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 10px;
  padding: 8px 10px;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-riquadri);
  background: var(--tema-superficie);
  text-align: center;
}
.contabilita-card :is(h2, h3, caption) {
  margin: 0;
  padding: 3px 6px 6px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.contabilita-scroll, .contabilita-filtri { overflow-x: auto; max-width: 100%; }
.contabilita-scroll table { width: max-content; margin: 0 auto; border: 0; font-variant-numeric: tabular-nums; }
.contabilita-scroll :is(th, td) { border: 0; border-bottom: 1px solid var(--tema-bordo); padding: 4px 7px; }
.contabilita-scroll th { background: var(--tema-riga-alterna); color: var(--tema-secondario); }
.contabilita-scroll tr:nth-child(odd) td { background: var(--tema-riga-alterna); }
.contabilita-scroll td { max-width: 42ch; overflow-wrap: anywhere; }
.contabilita-filtri + .contabilita-scroll { margin-top: 6px; }
.contabilita-filtri form { margin: 0; line-height: 2.5; }
.contabilita-main select { width: max-content; max-width: none; }
.contabilita-main :is(input, select) { font: inherit; }
.contabilita-main :is(input[type=text], input[type=number], input[type=date], select) {
  min-height: 29px;
  padding: 3px 6px;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-campi);
  background: var(--tema-superficie);
  color: var(--tema-testo);
}
.contabilita-main input[name=competenzaA] { width: 70px; }
.contabilita-main input[type=submit], .contabilita-header a {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--tema-bordo);
  border-radius: var(--tema-raggio-campi);
  background: var(--tema-azione-chiara);
  color: var(--tema-primario);
  font: 600 12px/1.5 var(--tema-font);
  text-decoration: none;
  cursor: pointer;
}
.contabilita-main input:is([name=crea], [name=selezione], [name=carica], [name=intervallo]) {
  background: var(--tema-primario);
  color: #fff;
}
.contabilita-main input[name=elimina] { background: #fff5f3; color: var(--tema-pericolo); }
.contabilita-main :focus-visible { outline: 2px solid var(--tema-primario); outline-offset: 2px; }
.contabilita-azioni { display: flex; justify-content: center; gap: 5px; margin: 0; }

/* Corpi dei documenti a larghezza fluida. */
html:has(meta[name="patron-tema"][content]) :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) {
  width: 100% !important;
  min-width: 0 !important;
}

@media screen and (max-width: 760px) {
  html:has(meta[name="patron-tema"][content]) :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) {
    display: block;
    max-width: 100% !important;
  }

  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody { display: block; }
  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr:has(> th) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr:has(> td) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 8px;
    margin: 0 0 8px;
    padding: 8px;
    border: 1px solid var(--tema-bordo);
    border-radius: var(--tema-raggio-riquadri);
    background: var(--tema-superficie);
  }

  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr:nth-child(odd) { background: var(--tema-riga-alterna); }
  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > form { display: none; }

  html:has(meta[name="patron-tema"][content]) :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > td {
    display: block;
    min-width: 0 !important;
    max-width: none;
    height: auto !important;
    padding: 2px 0;
    border: 0;
    background: transparent !important;
    box-shadow: none;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > td:empty { display: none !important; }
  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > td::before {
    display: block;
    content: var(--etichetta-campo, none);
    color: var(--tema-secondario);
    font-size: 11px;
    font-weight: 650;
  }

  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > td[colspan],
  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > td:has(:is([name=id_prodotto], [name=prodotto], [name=id_carico], form[name=cerca])),
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:first-of-type,
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(2),
  :is(.carico-righe, .ddt-righe, .riep-corpo) > tbody > tr > td:first-of-type {
    grid-column: 1 / -1;
  }

  html:has(meta[name="patron-tema"][content]) :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > td :is(input:not([type=hidden]), select) {
    max-width: 100% !important;
    min-width: 0 !important;
  }
  html:has(meta[name="patron-tema"][content]) :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > td :is(input[type=text], input[type=number], select) {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 32px;
    font-size: 16px;
    box-sizing: border-box;
  }

  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr:has(> td[colspan]):has(form[name=cerca]) > td::before,
  :is(.carico-righe, .ddt-righe, .fat-righe, .riep-corpo) > tbody > tr > td:has(> input[type=submit])::before { content: none; }

  .carico-righe > tbody > tr > td:nth-of-type(1) { --etichetta-campo: "Prodotto"; }
  .carico-righe > tbody > tr > td:nth-of-type(2) { --etichetta-campo: "Pezzi per collo"; }
  .carico-righe > tbody > tr > td:nth-of-type(3) { --etichetta-campo: "Note"; }
  .carico-righe > tbody > tr > td:nth-of-type(4) { --etichetta-campo: "Cesteria"; }
  .carico-righe > tbody > tr > td:nth-of-type(5) { --etichetta-campo: "Lotto"; }
  .carico-righe > tbody > tr > td:nth-of-type(6) { --etichetta-campo: "Colli"; }
  .carico-righe > tbody > tr > td:nth-of-type(7) { --etichetta-campo: "Peso lordo"; }
  .carico-righe > tbody > tr > td:nth-of-type(8) { --etichetta-campo: "Tara unitaria"; }
  .carico-righe > tbody > tr > td:nth-of-type(9) { --etichetta-campo: "Tara"; }
  .carico-righe > tbody > tr > td:nth-of-type(10) { --etichetta-campo: "Peso netto"; }
  .carico-righe > tbody > tr > td:nth-of-type(11) { --etichetta-campo: "Prezzo consigliato"; }
  .carico-righe > tbody > tr > td:nth-of-type(12) { --etichetta-campo: "Distrutti"; }
  .carico-righe > tbody > tr > td:nth-of-type(13) { --etichetta-campo: "Media"; }

  .ddt-righe > tbody > tr > td:nth-of-type(1) { --etichetta-campo: "Prodotto"; }
  .ddt-righe > tbody > tr > td:nth-of-type(2) { --etichetta-campo: "Colli"; }
  .ddt-righe > tbody > tr > td:nth-of-type(3) { --etichetta-campo: "UM"; }
  .ddt-righe > tbody > tr > td:nth-of-type(4) { --etichetta-campo: "Peso lordo"; }
  .ddt-righe > tbody > tr > td:nth-of-type(5) { --etichetta-campo: "Tara unitaria"; }
  .ddt-righe > tbody > tr > td:nth-of-type(6) { --etichetta-campo: "Tara"; }
  .ddt-righe > tbody > tr > td:nth-of-type(7) { --etichetta-campo: "Peso netto"; }
  .ddt-righe > tbody > tr > td:nth-of-type(8) { --etichetta-campo: "Media"; }

  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(1) { --etichetta-campo: "Prodotto"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(2) { --etichetta-campo: "Colli"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(3) { --etichetta-campo: "UM"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(4) { --etichetta-campo: "Peso lordo"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(5) { --etichetta-campo: "Tara unitaria"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(6) { --etichetta-campo: "Tara"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(7) { --etichetta-campo: "Peso netto"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(8) { --etichetta-campo: "Prezzo reale"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(9) { --etichetta-campo: "Prezzo %"; }
  .fat-righe:not(:has(tr:first-child > th:nth-child(12))) > tbody > tr > td:nth-of-type(10) { --etichetta-campo: "Importo"; }

  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(1) { --etichetta-campo: "Riferimento"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(2) { --etichetta-campo: "Prodotto"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(3) { --etichetta-campo: "Colli"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(4) { --etichetta-campo: "UM"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(5) { --etichetta-campo: "Peso lordo"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(6) { --etichetta-campo: "Tara unitaria"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(7) { --etichetta-campo: "Tara"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(8) { --etichetta-campo: "Peso netto"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(9) { --etichetta-campo: "Prezzo reale"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(10) { --etichetta-campo: "Prezzo %"; }
  .fat-righe:has(tr:first-child > th:nth-child(12)) > tbody > tr > td:nth-of-type(11) { --etichetta-campo: "Importo"; }

  .riep-corpo > tbody > tr > td:nth-of-type(1) { --etichetta-campo: "Prodotto"; }
  .riep-corpo > tbody > tr > td:nth-of-type(2) { --etichetta-campo: "Colli caricati"; }
  .riep-corpo > tbody > tr > td:nth-of-type(3) { --etichetta-campo: "Colli venduti"; }
  .riep-corpo > tbody > tr > td:nth-of-type(4) { --etichetta-campo: "Distrutti"; }
  .riep-corpo > tbody > tr > td:nth-of-type(5) { --etichetta-campo: "Netto carico"; }
  .riep-corpo > tbody > tr > td:nth-of-type(6) { --etichetta-campo: "Netto vendita"; }
  .riep-corpo > tbody > tr > td:nth-of-type(7) { --etichetta-campo: "Differenza"; }
  .riep-corpo > tbody > tr > td:nth-of-type(8) { --etichetta-campo: "Prezzo lordo"; }
  .riep-corpo > tbody > tr > td:nth-of-type(9) { --etichetta-campo: "Prezzo netto"; }
  .riep-corpo > tbody > tr > td:nth-of-type(10) { --etichetta-campo: "Importo"; }
  .riep-corpo > tbody > tr > td:nth-of-type(11) { --etichetta-campo: "Utile"; }
}

