/* Five Tour Staff APS Responsive 4.1.1. Private workspace only. */
body.ftaps-app { --ft411-sidebar-width:264px; }
html:has(>body.ftaps-app),body.ftaps-app:not(.ftaps-menu-lock) { overflow-x:visible; }
body.ftaps-app .ftaps-app-shell { width:100%; min-width:0; }
/* Legacy main{width:100%} plus the sidebar margin used to exceed the viewport. */
body.ftaps-app main.ftaps-main { width:calc(100% - var(--ft411-sidebar-width)); max-width:calc(100% - var(--ft411-sidebar-width)); min-width:0; margin-left:var(--ft411-sidebar-width); box-sizing:border-box; }
body.ftaps-app :is(.ftaps-content,.ftaps-auth-content,.ftaps-modal),
body.ftaps-app :is(.ftaps-content,.ftaps-auth-content,.ftaps-modal) :where(div,section,article,form,fieldset,details) { min-width:0; box-sizing:border-box; }
body.ftaps-app :is(.ftaps-content,.ftaps-auth-content) { width:100%; }
body.ftaps-app .ftaps-content>.section>.container { max-width:100%!important; width:100%!important; }
body.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) :where(fieldset,form,img,video,iframe) { max-width:100%; }
body.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) :where(h1,h2,h3,h4,p,label,a,small,strong,legend) { overflow-wrap:anywhere!important; }
body.ftaps-app .ftaps-topbar { min-width:0; width:100%; gap:14px; }
body.ftaps-app .ftaps-search { min-width:0; }
body.ftaps-app .ftaps-search input { min-width:0; flex:1 1 0; }
body.ftaps-app .ftaps-profile { flex:0 1 auto; min-width:0; }
body.ftaps-app .ftaps-profile span { min-width:0; max-width:180px; overflow-wrap:anywhere; }
body.ftaps-app :is(.ftaps-avatar,.ftaps-menu-button,.ftaps-icon-button,.ftaps-profile>div,.ftaps-topbar svg) { flex-shrink:0; }
body.ftaps-app .ftaps-topbar>.ftaps-icon-button { display:grid; }
body.ftaps-app .ftaps-nav-button { min-height:43px; height:auto!important; padding-top:10px!important; padding-bottom:10px!important; }
body.ftaps-app .ftaps-nav-button span { min-width:0; }
body.ftaps-app .ftaps-nav-button svg { flex:none; }
body.ftaps-app .ftaps-page-head { flex-wrap:wrap; }
body.ftaps-app .ftaps-page-head>div:first-child { flex:1 1 260px; min-width:0; }
body.ftaps-app .ftaps-head-actions { flex:0 1 auto; max-width:100%; }
body.ftaps-app .ftaps-stats { grid-template-columns:repeat(4,minmax(0,1fr)); }
body.ftaps-app .ftaps-dash-grid { grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr); }
body.ftaps-app :is(.ftaps-feature-grid,.ftaps-card-grid,.ftaps-register-grid) { grid-template-columns:repeat(3,minmax(0,1fr)); }
body.ftaps-app :is(.ftaps-quick-grid,.ftaps-detail-grid,.ftaps-form-grid) { grid-template-columns:repeat(2,minmax(0,1fr)); }
body.ftaps-app .ftaps-two-columns { grid-template-columns:minmax(0,1.55fr) minmax(0,.85fr); }
body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.ftm-two-cols,.ftadv-two-cols,.ftdoc-editor-grid,.ftdoc-templates-layout) { grid-template-columns:repeat(auto-fit,minmax(min(100%,400px),1fr))!important; }
body.ftaps-app :is(.ftdoc-template-grid,.ftinv-hub-cards) { grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr))!important; }
body.ftaps-app .ftaps-content :is(.ftm-card-head,.oq-card-head,.oq-panel-toolbar,.oq-calendar-section-head,.anagrafica-table-heading,.ftinv-workspace-heading) { flex-wrap:wrap!important; }
body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.form-actions,.ftm-form-actions,.oq-calendar-form-actions,.ftm-row-actions,.staff-actions,.ftaps-form-footer) { flex-wrap:wrap!important; max-width:100%; }
body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.btn,.button,button[type=submit],.ftaps-primary,.ftaps-secondary,.ftaps-legacy-button) { max-width:100%; height:auto!important; min-height:42px!important; padding-top:9px!important; padding-bottom:9px!important; white-space:normal!important; line-height:1.35!important; }
/* Wide tables scroll within their own region; the page never conceals columns. */
body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.ftm-table-wrap,.table-wrap,.oq-table-wrap,.staff-table-wrap,.iscrizioni-table-wrap,.mini-health-table-wrap,.ft411-table-scroll) { display:block; min-width:0!important; width:100%!important; max-width:100%!important; overflow-x:auto!important; overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch; }
body.ftaps-app .ft411-table-scroll:focus-visible { outline:2px solid #175ca7; outline-offset:3px; }
body.ftaps-app .ftaps-content :is(.staff-edit-tabs,.ftdoc-tabs,.ft344-tabs,.oq-dashboard-tabs,.oq-v345-tabs,.oq-v346-tabs,.ftinv-section-nav,.ftrm-tabs,.ftinv-quick-actions) { min-width:0; width:100%; max-width:100%; overflow-x:auto; }
body.ftaps-app .ftaps-content :is(.staff-edit-tabs,.ftdoc-tabs,.ft344-tabs,.oq-dashboard-tabs,.oq-v345-tabs,.oq-v346-tabs,.ftinv-section-nav,.ftrm-tabs)>* { flex-shrink:0; }
body.ftaps-app :is(.ftaps-content,.ftaps-modal) pre { max-width:100%; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; }
/* Useful fallback when JavaScript is unavailable. Supersedes the old forced single column. */
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form :is(.form-grid,.ftm-form-grid,.oq-calendar-form-grid,.oq-calendar-form-grid-two,.ftdoc-editor-fields) { grid-template-columns:repeat(auto-fit,minmax(min(100%,225px),1fr))!important; gap:12px 14px!important; max-width:100%!important; }
/* Progressive field sizing: original DOM order, field names and validation are retained. */
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form .ft411-fields { display:flex!important; flex-wrap:wrap!important; align-items:flex-start!important; gap:12px 14px!important; width:100%!important; min-width:0!important; max-width:100%!important; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form .ft411-fields>.ft411-field { flex:2 1 17rem; min-width:0!important; max-width:100%!important; width:auto!important; margin:0!important; grid-column:auto!important; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form .ft411-fields>.ft411-field[data-ft411-size=number] { flex:0 1 8.5rem; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form .ft411-fields>.ft411-field[data-ft411-size=short] { flex:1 1 10rem; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form .ft411-fields>.ft411-field[data-ft411-size=date] { flex:1 1 11rem; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form .ft411-fields>.ft411-field[data-ft411-size=full],
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form .ft411-fields>:not(.ft411-field) { flex:1 1 100%; min-width:0; max-width:100%; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form.ft411-form { gap:14px!important; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form.ft411-form :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=submit]):not([type=button]),select) { min-width:0!important; max-width:100%!important; min-height:42px!important; height:42px!important; padding:8px 10px!important; box-sizing:border-box!important; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form.ft411-form select[multiple] { height:auto!important; min-height:120px!important; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form.ft411-form input[type=file] { height:auto!important; min-height:42px!important; padding:6px!important; }
body.ftaps-app.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form.ft411-form textarea.ft411-short-note { min-height:76px!important; height:76px; resize:vertical!important; overflow:auto!important; }
body.ftaps-app .ft411-field small { display:block; font-size:12px!important; font-weight:400; margin-top:4px; }
body.ftaps-app .ft411-field:has(input[type=checkbox],input[type=radio]) { align-self:center; }
body.ftaps-app .ft411-editor-launch { display:flex; align-items:center; gap:8px 14px; flex-wrap:wrap; margin:0 0 14px; min-width:0; max-width:100%; }
body.ftaps-app .ft411-editor-launch small { color:#6e7b8d; font-size:12px; overflow-wrap:anywhere!important; }
body.ftaps-app .ft411-editor-launch small[data-dirty=true] { color:#946b00; }
body.ftaps-app .ft411-editor-launch .ftaps-primary { flex:0 1 auto; }
body.ftaps-app .ft411-launch-group { display:flex!important; flex-wrap:wrap; gap:10px 18px; align-items:flex-start; margin-block:12px!important; }
body.ftaps-app .ft411-launch-group>.ft411-editor-launch { flex:1 1 240px; }
body.ftaps-app .ft411-detail-launch { cursor:pointer; color:#175ca7; font-weight:700; white-space:normal!important; }
body.ftaps-app.ftaps-app form.ft411-form :is(input[type=checkbox],input[type=radio]) { min-height:18px!important; height:18px!important; min-width:18px!important; width:18px!important; padding:0!important; flex-shrink:0; }
body.ftaps-app.ftaps-app form.ft411-form :is(.check,.check-field) { min-height:42px!important; }
body.ftaps-app .ftaps-modal .ftaps-form-body>.eyebrow { display:none; }
/* Dialogs fit both axes, including a phone with its software keyboard open. */
body.ftaps-app .ftaps-dialog-layer { width:100%; height:100%; height:100dvh; min-width:0; padding:16px; overflow:auto; }
body.ftaps-app .ftaps-dialog-layer>.ftaps-modal { width:min(900px,100%); min-width:0!important; max-width:100%!important; max-height:calc(100vh - 32px)!important; max-height:calc(100dvh - 32px)!important; overflow:auto; overscroll-behavior:contain; }
body.ftaps-app .ftaps-modal>header { position:sticky; top:0; z-index:4; background:#fff; flex-shrink:0; min-width:0; gap:12px; }
body.ftaps-app .ftaps-modal>header>div { min-width:0; }
body.ftaps-app .ftaps-modal .ftaps-modal-close { flex:0 0 42px; width:42px; height:42px; }
body.ftaps-app .ftaps-modal form.ftaps-form-body { min-width:0!important; width:100%!important; max-width:none!important; padding:18px 22px!important; }
body.ftaps-app .ftaps-modal .ftaps-form-footer { position:sticky; bottom:0; background:#fff; padding:12px 0 0; border-top:1px solid #e3e9f0; display:flex; justify-content:flex-end; align-items:center; gap:10px; z-index:3; }
body.ftaps-app .ftaps-modal .ftaps-form-footer>p { flex:1 1 200px; margin:0; font-size:12px; color:#6e7b8d; }
@media screen and (max-width:1200px) {
 body.ftaps-app .ftaps-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body.ftaps-app .ftaps-dash-grid,body.ftaps-app .ftaps-two-columns { grid-template-columns:minmax(0,1fr); }
 body.ftaps-app :is(.ftaps-card-grid,.ftaps-feature-grid,.ftaps-register-grid) { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media screen and (max-width:1024px) {
 body.ftaps-app main.ftaps-main { margin-left:0; width:100%; max-width:100%; }
 body.ftaps-app .ftaps-sidebar { width:min(264px,calc(100% - 44px)); transform:translateX(-100%); visibility:hidden; transition:transform .2s,visibility .2s; }
 body.ftaps-app .ftaps-sidebar.ftaps-sidebar-open { transform:translateX(0); visibility:visible; box-shadow:20px 0 50px #0005; }
 body.ftaps-app :is(.ftaps-menu-button,.ftaps-mobile-close) { display:grid; place-items:center; min-width:42px; min-height:42px; }
 body.ftaps-app.ftaps-menu-lock .ftaps-menu-backdrop:not([hidden]) { display:block!important; }
 body.ftaps-app .ftaps-topbar { padding:0 16px; }
 body.ftaps-app .ftaps-profile span { display:none; }
 body.ftaps-app:not(.ftaps-js) .ftaps-sidebar { position:static; width:100%; height:auto; transform:none; visibility:visible; }
}
@media screen and (max-width:600px) {
 body.ftaps-app .ftaps-topbar { padding:0 10px; gap:7px; }
 body.ftaps-app .ftaps-search { padding:0 7px; gap:5px; }
 body.ftaps-app .ftaps-search>svg { display:none; }
 body.ftaps-app .ftaps-profile { padding-left:0; }
 body.ftaps-app .ftaps-content { padding:18px 12px 32px; }
 body.ftaps-app .ftaps-page-head>div:first-child { flex-basis:auto; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal) :is(.staff-card,.staff-editor-card,.ftm-panel,.ftac-card,.oq-dashboard-panel,.oq-calendar-section) { padding:14px!important; }
 body.ftaps-app .ftaps-dialog-layer { padding:8px!important; }
 body.ftaps-app .ftaps-dialog-layer>.ftaps-modal { max-height:calc(100vh - 16px)!important; max-height:calc(100dvh - 16px)!important; }
 body.ftaps-app .ftaps-modal form.ftaps-form-body { padding:14px!important; }
 body.ftaps-app .ftaps-modal>header { padding:14px; }
 body.ftaps-app .ftaps-modal>header h2 { font-size:21px; }
 body.ftaps-app :is(.ftaps-content,.ftaps-modal,.ftaps-auth-content) form.ft411-form :is(input,select,textarea) { font-size:16px!important; }
 body.ftaps-app .ftdoc-paper { padding:20px 14px; }
}
@media screen and (max-width:540px) {
 body.ftaps-app :is(.ftaps-stats,.ftaps-card-grid,.ftaps-feature-grid,.ftaps-register-grid) { grid-template-columns:minmax(0,1fr); }
 body.ftaps-app .ftaps-head-actions { width:100%; }
}
@media print {
 body.ftaps-app main.ftaps-main { width:100%!important; max-width:100%!important; margin:0!important; }
 body.ftaps-app .ftaps-dialog-layer { height:auto; overflow:visible; }
 body.ftaps-app .ftaps-dialog-layer>.ftaps-modal { max-height:none!important; overflow:visible; }
 body.ftaps-app :is(.ft411-editor-launch,.ftaps-modal .ftaps-form-footer) { display:none!important; }
}

/* 4.1.2 — Divise: one filter form, a compact dialog and a stable exports panel.
   Supersedes the old five-column .ftadv-filter-form grid even without JavaScript. */
body.ftaps-app :is(.ftaps-content,.ftaps-modal) form.ftuniform-filters {
 grid-template-columns:minmax(0,1fr)!important;
 min-width:0!important; width:100%!important; max-width:100%!important; margin-inline:0!important;
}
body.ftaps-app :is(.ftaps-content,.ftaps-modal) form.ftuniform-filters>.form-grid {
 width:100%!important; max-width:100%!important; margin:14px 0!important;
}
body.ftaps-app .ftaps-modal form.ft412-filter-form { display:block!important; }
body.ftaps-app .ft412-filter-panel { width:100%; min-width:0; }
body.ftaps-app .ft412-filter-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px 20px; }
body.ftaps-app .ft412-filter-head>div:first-child { flex:1 1 260px; min-width:0; }
body.ftaps-app .ft412-filter-head h3 { margin:0 0 4px; font-size:18px; color:#162235; }
body.ftaps-app .ft412-filter-head p { margin:0; color:#6e7b8d; font-size:14px; }
body.ftaps-app .ft412-filter-actions { display:flex; flex-wrap:wrap; gap:8px; min-width:0; max-width:100%; }
body.ftaps-app .ft412-filter-chips { display:flex; flex-wrap:wrap; gap:8px; padding:0; margin:14px 0 0; list-style:none; }
body.ftaps-app .ft412-filter-chips li { max-width:100%; min-width:0; overflow-wrap:anywhere!important; padding:6px 10px; border-radius:8px; background:#eaf3ff; color:#175ca7; font-size:13px; }
body.ftaps-app .ft412-filter-chips .ft412-no-filters { padding:0; background:none; color:#6e7b8d; }
body.ftaps-app .ft412-filter-pending { margin:12px 0 0; padding:9px 12px; border:1px solid #f2dc8e; border-radius:8px; background:#fff8df; color:#745710; font-size:13px; }
body.ftaps-app .ft412-filter-panel .ftuniform-export-grid { display:flex!important; flex-wrap:wrap; gap:8px; width:100%; margin-top:14px; padding-top:14px; }
body.ftaps-app .ft412-filter-panel .ftuniform-export-grid a { flex:0 1 auto; width:auto!important; min-width:0; max-width:100%; }
body.ftaps-app .ftaps-dialog-layer>.ft412-filter-modal { width:min(820px,100%); }
body.ftaps-app .ft412-filter-form>.ftaps-form-footer { margin-top:14px!important; padding-top:12px!important; }
body.ftaps-app .ft412-filter-form>.ftaps-form-footer button[type=submit],
body.ftaps-app .ft412-filter-form>.ftaps-form-footer button:not([type]) { margin-left:auto; }
body.ftaps-app .ftaps-modal.ft412-filter-modal>header h2 { min-width:0; overflow-wrap:anywhere!important; }
@media screen and (max-width:540px) {
 body.ftaps-app .ft412-filter-actions { width:100%; }
 body.ftaps-app .ft412-filter-actions>* { flex:1 1 130px; }
 body.ftaps-app .ft412-filter-panel .ftuniform-export-grid a { flex:1 1 180px; }
 body.ftaps-app .ft412-filter-form>.ftaps-form-footer>* { flex:1 1 130px; text-align:center; }
 body.ftaps-app .ftaps-modal.ft412-filter-modal>header h2 { font-size:21px; }
}

/* 4.1.3 — Original site logo, without the extra number or wordmark. */
body.ftaps-app :is(.ftaps-sidebar,.ftaps-auth-brand) .ftaps-brand {
 height:100px; min-height:100px; padding:10px 18px; gap:12px; justify-content:center;
}
body.ftaps-app :is(.ftaps-sidebar,.ftaps-auth-brand) .ftaps-brand>img {
 display:block; flex:0 1 160px; width:160px; min-width:0; max-width:100%; height:78px;
 object-fit:contain; object-position:center; margin:0; padding:0; border:0; border-radius:0;
}
body.ftaps-app .ftaps-auth-brand .ftaps-brand { width:264px; max-width:100%; }
body.ftaps-app .ftaps-brand .ftaps-mobile-close { flex:0 0 42px; }

/* 4.1.4: registro leggibile, dettagli a capo anche su schermi stretti. */
body.ftaps-app .ft414-activity { align-items: flex-start; }
body.ftaps-app .ft414-activity .ftaps-avatar { flex: 0 0 36px; }
body.ftaps-app .ft414-activity-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
body.ftaps-app .ft414-activity-body > strong,
body.ftaps-app .ft414-activity-body > small { white-space: normal; overflow: visible; text-overflow: clip; }
body.ftaps-app .ft414-activity-description { margin-top: 5px; line-height: 1.5; }
body.ftaps-app .ft414-activity-details { margin-top: 6px; font-size: 12px; line-height: 1.6; }
body.ftaps-app .ft414-activity-details > summary { cursor: pointer; color: #2563eb; font-weight: 600; }
body.ftaps-app .ft414-activity-details > summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
body.ftaps-app .ft414-activity-details > div { margin-top: 6px; }
body.ftaps-app .ft414-log-details { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
