/* MATEC HUB - step 1 reversibile: campi e label. */
html[data-theme]{--mh-form-height:3.25rem;--mh-form-radius:.9rem;--mh-form-border:#b8cbe5;--mh-form-focus:#2563eb;--mh-form-label:var(--mh-text,#17233c);--mh-form-placeholder:#748198;--mh-form-font:var(--ds-font-family,var(--mh-font),Arial,sans-serif)}
html[data-theme="dark"]{--mh-form-border:#52657f;--mh-form-focus:#60a5fa;--mh-form-label:#e8eef8;--mh-form-placeholder:#94a3b8}

/* Il carattere e sempre lo stesso, anche nei controlli a geometria speciale. */
html[data-theme] body :is(input,select,textarea,.ds-input,.ds-select){font-family:var(--mh-form-font)!important}

/* Controlli ordinari: sono esclusi slide, file, scanner, PIN e chat. */
html[data-theme] body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not(.scanner-input),select,textarea,.ds-input,.ds-select):not(.composer textarea):not(.tablet-activation input){box-sizing:border-box!important;min-width:0;min-height:var(--mh-form-height)!important;padding:0 1rem!important;border:1px solid var(--mh-form-border)!important;border-radius:var(--mh-form-radius)!important;background:var(--mh-surface,#fff)!important;color:var(--mh-text,#17233c)!important;font-size:1rem!important;font-weight:500!important;line-height:1.25!important;letter-spacing:normal!important;text-transform:none!important;box-shadow:none!important}
html[data-theme] body :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not([type="file"]){width:100%}
html[data-theme] body select:not([multiple]){padding-right:2.75rem!important}
html[data-theme] body textarea:not(.composer textarea){min-height:6.5rem!important;padding:.85rem 1rem!important;line-height:1.45!important;resize:vertical}
html[data-theme] body :where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not(.scanner-input),select,textarea,.ds-input,.ds-select):not(.composer textarea):not(.tablet-activation input):focus{outline:none!important;border-color:var(--mh-form-focus)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--mh-form-focus) 18%,transparent)!important}
html[data-theme] body :is(input,select,textarea)::placeholder{color:var(--mh-form-placeholder)!important;font-family:var(--mh-form-font)!important;font-weight:400!important;opacity:1!important}
html[data-theme] body :is(input,select,textarea):disabled,html[data-theme] body :is(input,select,textarea)[readonly]{border-color:var(--mh-border,#c9d5e5)!important;background:var(--mh-surface-soft,#f3f6fa)!important;color:var(--mh-muted,#718096)!important;opacity:1!important;cursor:not-allowed}

/* Label avvolgenti e label separate usate nei vari form. */
html[data-theme] body label:not(:has(input[type="checkbox"],input[type="radio"],input[type="file"])):not(.switch):not(.toggle):not(.toggle-field):not(.filter-toggle):not(.media-attachment-control),html[data-theme] body :is(.field,.oj-field,.field-group,.setting-field,.form-field,.gps-radius-field,.oj-radius-field)>label{color:var(--mh-form-label)!important;font-family:var(--mh-form-font)!important;font-size:.82rem!important;font-weight:900!important;line-height:1.15!important;letter-spacing:.01em!important;text-transform:none!important}
html[data-theme] body :is(.setting-field__label,.field-label,.form-label),html[data-theme] body label:has(>input,>select,>textarea,>.input-with-unit)>span:first-child{font-family:var(--mh-form-font)!important;letter-spacing:.01em!important;text-transform:none!important}
html[data-theme] body label:has(>:is(input,select,textarea)),html[data-theme] body label:has(>span>:is(input,select,textarea)),html[data-theme] body :is(.field,.oj-field,.field-group,.setting-field,.form-field,.gps-radius-field,.oj-radius-field){gap:.45rem!important}
html[data-theme] body label :is(input,select,textarea,.ds-input,.ds-select),html[data-theme] body label>small,html[data-theme] body :is(.field,.oj-field,.field-group,.setting-field,.form-field,.gps-radius-field,.oj-radius-field)>small{letter-spacing:normal!important;text-transform:none!important}
html[data-theme] body label>small,html[data-theme] body :is(.field,.oj-field,.field-group,.setting-field,.form-field,.gps-radius-field,.oj-radius-field)>small{color:var(--mh-muted,#64748b)!important;font-family:var(--mh-form-font)!important;font-size:.76rem!important;font-weight:500!important;line-height:1.35!important}

/* Ricerca: bordo unico sul contenitore e 48 px riservati alla lente. */
html[data-theme] body :is(.ds-search-field,.oj-search-wrap,.employee-search,.employee-filter-wrap){position:relative!important;box-sizing:border-box!important;min-height:var(--mh-form-height)!important;overflow:hidden!important;border:1px solid var(--mh-form-border)!important;border-radius:var(--mh-form-radius)!important;background:var(--mh-surface,#fff)!important;box-shadow:none!important}
html[data-theme] body main :is(.ds-search-field,.oj-search-wrap,.employee-search,.employee-filter-wrap)>input,html[data-theme] body main :is(.ds-search-field,.oj-search-wrap,.employee-search,.employee-filter-wrap) input:is(.ds-standard-search,.search,.employee-filter,.oj-search){width:100%!important;max-width:none!important;min-height:calc(var(--mh-form-height) - 2px)!important;padding:0 1rem 0 3.5rem!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
/* Alcune pagine avevano gia una lente testuale: resta una sola icona, quella uniforme del design system. */
html[data-theme] body main :is(.ds-search-field,.oj-search-wrap,.employee-search,.employee-filter-wrap)>span[aria-hidden="true"]{display:none!important}
html[data-theme] body :is(.ds-search-field,.oj-search-wrap,.employee-search,.employee-filter-wrap):focus-within{border-color:var(--mh-form-focus)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--mh-form-focus) 18%,transparent)!important}

/* Unita: il bordo esterno appartiene solo al contenitore. */
html[data-theme] body :is(.input-with-unit,.field-with-unit,.input-unit){box-sizing:border-box!important;display:flex!important;align-items:stretch!important;width:100%!important;min-height:var(--mh-form-height)!important;overflow:hidden!important;border:1px solid var(--mh-form-border)!important;border-radius:var(--mh-form-radius)!important;background:var(--mh-surface,#fff)!important;box-shadow:none!important}
html[data-theme] body :is(.input-with-unit,.field-with-unit,.input-unit):focus-within{border-color:var(--mh-form-focus)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--mh-form-focus) 18%,transparent)!important}
html[data-theme] body .ds-app__main :is(.input-with-unit,.field-with-unit,.input-unit)>input{flex:1 1 auto!important;width:auto!important;min-width:0!important;min-height:calc(var(--mh-form-height) - 2px)!important;padding-right:.75rem!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
html[data-theme] body .ds-app__main :is(.input-with-unit,.field-with-unit,.input-unit)>:is(b,span):last-child{display:grid!important;place-items:center!important;flex:0 0 auto!important;min-height:calc(var(--mh-form-height) - 2px)!important;padding:0 .85rem!important;border:0!important;border-left:1px solid var(--mh-form-border)!important;border-radius:0!important;background:var(--mh-surface-soft,#f3f6fa)!important;color:var(--mh-text,#17233c)!important;font-family:var(--mh-form-font)!important;font-size:.88rem!important;font-weight:850!important;line-height:1!important;letter-spacing:normal!important;text-transform:none!important;white-space:nowrap}
/* Specificita deliberatamente alta: neutralizza i vecchi raggi locali senza toccare il bordo esterno. */
html[data-theme] body .ds-app__main .input-with-unit.input-with-unit.input-with-unit>input[type="number"]{width:auto!important;border-width:0!important;border-style:none!important;border-color:transparent!important;border-radius:0!important;outline:0!important;background:transparent!important;background-clip:border-box!important;box-shadow:none!important}
html[data-theme] body .ds-app__main .input-with-unit.input-with-unit.input-with-unit>span:last-child{border:0!important;border-left:1px solid var(--mh-form-border)!important;border-radius:0!important}

@media(max-width:760px){html[data-theme]{--mh-form-height:3rem}html[data-theme] body :is(input,select,textarea){font-size:16px!important}}
