*{box-sizing:border-box}html{font-size:16px;-webkit-text-size-adjust:100%;background:#f2f2f7}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",sans-serif;color:#1c1c1e;background:#f2f2f7;min-height:100svh;-webkit-tap-highlight-color:transparent}button,input,select{font:inherit}button{border:0;min-height:44px;padding:10px 15px;border-radius:12px;background:#e5e5ea;color:#1c1c1e;font-weight:600;cursor:pointer}button.primary{background:#007aff;color:#fff}button.big{min-height:50px;padding:13px 18px;font-size:16px}button:disabled{opacity:.5}input,select{width:100%;min-height:46px;padding:10px 12px;border:1px solid #c7c7cc;border-radius:11px;background:#fff;color:#1c1c1e;font-size:16px}label{display:grid;gap:7px;font-size:13px;font-weight:700;color:#3a3a3c}h1,h2,h3,p{margin-top:0}.muted,.page-head p,.section-head p{color:#6e6e73}.err{padding:12px;border-radius:12px;background:#ffe5e5;color:#b42318}.empty{padding:18px;text-align:center;color:#6e6e73}.login{min-height:100svh;display:grid;place-items:center;padding:20px}.login-box{text-align:center;width:min(420px,100%);padding:30px 22px}.app-mark{width:64px;height:64px;border-radius:18px;background:#007aff;color:#fff;display:grid;place-items:center;margin:0 auto 18px;font-weight:800;font-size:22px}.login-box h1{font-size:26px;margin-bottom:5px}.form{display:grid;gap:12px;text-align:left}.login-box .form{margin-top:24px}.top{height:64px;padding:0 18px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:rgba(255,255,255,.92);border-bottom:1px solid #d1d1d6;position:sticky;top:0;z-index:20;backdrop-filter:saturate(180%) blur(18px)}.brand{display:flex;align-items:center;gap:8px;min-width:0}.brand b{font-size:17px;white-space:nowrap}.brand-dot{font-size:11px;color:#007aff}.top-user{display:flex;align-items:center;gap:8px;font-size:13px;color:#6e6e73}.top-user span{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.top-user button{min-height:38px;padding:7px 11px}.layout{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:calc(100svh - 64px)}aside{padding:14px 10px;background:#fff;border-right:1px solid #d1d1d6;display:flex;flex-direction:column;gap:4px}aside button{text-align:left;background:transparent;color:#3a3a3c}aside button.active{background:#e5e5ea;color:#007aff;font-weight:800}main{width:100%;max-width:1200px;margin:auto;padding:24px}.page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:15px;margin-bottom:16px}.page-head h1{font-size:30px;letter-spacing:-.5px;margin-bottom:4px}.page-head p{margin:0;font-size:14px}.head-actions{display:flex;gap:8px}.ios-card{background:#fff;border-radius:16px;padding:17px;margin-bottom:14px;box-shadow:0 1px 3px rgba(0,0,0,.05)}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.section-head h2{font-size:19px;margin:0}.section-head p{font-size:13px;margin:3px 0 0}.count{min-width:30px;height:30px;padding:0 9px;border-radius:99px;background:#e5e5ea;display:inline-flex;align-items:center;justify-content:center;font-weight:800}.simple-list,.operation-list{display:grid;gap:7px}.simple-row,.list-action{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #e5e5ea;border-radius:12px;background:#fafafa;text-align:left}.simple-row small,.list-action small,.counter-product small,.order-product small,.receive-line small{display:block;color:#6e6e73;margin-top:3px}.list-action{cursor:pointer}.list-action span{color:#8e8e93;white-space:nowrap}.link-btn{background:transparent;color:#007aff;padding:7px}.dashboard-grid{display:grid;gap:14px}.table-wrap{overflow:auto;border-radius:12px;-webkit-overflow-scrolling:touch}table{width:100%;border-collapse:collapse;min-width:700px}th,td{text-align:left;padding:12px;border-bottom:1px solid #e5e5ea;white-space:nowrap}th{font-size:12px;color:#6e6e73;text-transform:uppercase}tbody tr:last-child td{border-bottom:0}.click-table tbody tr{cursor:pointer}.click-table tbody tr:hover{background:#f2f2f7}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}.modal-head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:16px}.modal-head h2{margin-bottom:4px}.modal-head p{margin:0;color:#6e6e73;font-size:13px}.modal-head>button{min-height:36px;width:36px;padding:0;border-radius:50%;font-size:22px}.overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);display:grid;place-items:center;padding:20px;z-index:100}.modal{width:min(720px,100%);max-height:92svh;overflow:auto;background:#f2f2f7;border-radius:20px;padding:18px;box-shadow:0 20px 60px rgba(0,0,0,.25)}.modal .form,.modal>.form{background:#fff;padding:16px;border-radius:16px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin-top:14px}.order-list,.counter-list,.receive-list{display:grid;gap:8px}.order-line,.counter-row,.receive-line{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid #e5e5ea;border-radius:13px;background:#fff}.order-line.suggested{border-color:#b7d7ff;background:#f7fbff}.order-product,.counter-product{min-width:0;flex:1}.mini-badge{display:inline-block;margin-top:5px;padding:3px 7px;border-radius:99px;background:#dbeeff;color:#007aff;font-size:11px;font-weight:800}.stepper,.counter-input{display:flex;align-items:center;gap:5px;flex-shrink:0}.stepper button,.counter-input button{width:44px;height:44px;padding:0;font-size:22px}.stepper input,.counter-input input{width:65px;text-align:center;padding-left:5px;padding-right:5px}.counter-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}.counter-head h2{margin:0}.counter-head p{margin:4px 0 0;color:#6e6e73;font-size:13px}.filter-bar{display:grid;grid-template-columns:1fr 1fr 1.2fr auto auto;gap:8px;align-items:end}.detail-list,.print-preview{background:#fff;border-radius:14px;padding:8px}.detail-list>div,.print-preview>div{display:flex;justify-content:space-between;gap:10px;padding:11px 8px;border-bottom:1px solid #e5e5ea}.detail-list>div:last-child,.print-preview>div:last-child{border-bottom:0}.success-icon{width:54px;height:54px;border-radius:50%;background:#34c759;color:#fff;display:grid;place-items:center;font-size:30px;font-weight:800}.order-text{white-space:pre-wrap;background:#fff;border-radius:14px;padding:14px;font-family:ui-monospace,monospace}.toggle{display:flex;align-items:center;gap:9px}.toggle input{width:20px;min-height:20px}.tag,.badge{display:inline-block;padding:5px 8px;border-radius:99px;background:#e5e5ea;font-size:12px;font-weight:700}.filter-bar label{font-size:12px}.filter-bar button{height:46px}.counter-card{background:transparent;box-shadow:none;padding:0}.counter-card>.counter-head,.counter-card>.counter-list{background:#fff;border-radius:16px}.counter-card>.counter-head{padding:15px}.counter-card>.counter-list{padding:8px}.counter-row{border:0;border-bottom:1px solid #e5e5ea;border-radius:0;padding:12px 8px}.counter-row:last-child{border-bottom:0}.print-preview{margin-top:10px}.print-preview span{font-weight:800}.receive-line{align-items:flex-start;flex-wrap:wrap}.receive-line label{width:140px}.receive-line>small{width:100%}
@media(max-width:900px){.layout{display:block}.top{height:58px}aside{position:sticky;top:58px;z-index:15;flex-direction:row;overflow-x:auto;padding:7px 9px;border-right:0;border-bottom:1px solid #d1d1d6;scrollbar-width:none}aside::-webkit-scrollbar{display:none}aside button{white-space:nowrap;flex:0 0 auto}main{padding:14px}.filter-bar{grid-template-columns:1fr 1fr}.filter-bar button{width:100%}}
@media(max-width:600px){.head-actions{display:grid;grid-template-columns:1fr 1fr;width:100%}.head-actions button{min-width:0;padding:9px 7px}.top{padding:0 10px}.brand b{font-size:15px}.top-user span{display:none}.page-head{align-items:flex-start;flex-direction:column}.page-head h1{font-size:26px}.head-actions{width:100%}.head-actions button{flex:1}.ios-card{padding:13px;border-radius:14px}.section-head h2{font-size:18px}.simple-row,.list-action{padding:11px}.counter-head{align-items:stretch;flex-direction:column}.counter-head button{width:100%}.counter-row{align-items:center}.counter-product{max-width:calc(100% - 160px)}.counter-input button{width:40px;height:40px}.counter-input input{width:52px;min-height:40px}.two-col{grid-template-columns:1fr}.filter-bar{grid-template-columns:1fr}.overlay{padding:0;align-items:end}.modal{max-height:94svh;border-radius:20px 20px 0 0;padding:14px 12px calc(14px + env(safe-area-inset-bottom))}.modal-actions{display:grid;grid-template-columns:1fr}.modal-actions button{width:100%}.order-line,.receive-line{align-items:stretch;flex-direction:column}.stepper,.receive-line label{width:100%}.stepper{justify-content:center}.stepper input{width:80px}.receive-line label{width:100%}table{min-width:680px;font-size:14px}th,td{padding:10px 9px}.login-box{padding:24px 18px}}
/* iPhone-style quantity controls */
input[type=number]{-moz-appearance:textfield}
input[type=number]::-webkit-outer-spin-button,input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.qty-input{appearance:none;-webkit-appearance:none;border:1px solid #d1d1d6;background:#fff;text-align:center;font-weight:700;font-size:18px;min-height:44px;width:58px;padding:8px 4px;border-radius:12px}
.counter-input button,.stepper button{border-radius:13px;background:#e5e5ea;font-size:22px;font-weight:700}
.counter-input button:last-child,.stepper button:last-child{background:#007aff;color:#fff}
.inventory-list{display:grid;gap:8px;max-height:none}
.inventory-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 10px;background:#fff;border-bottom:1px solid #e5e5ea}
.inventory-row:last-child{border-bottom:0}
.inventory-product{min-width:0;flex:1}.inventory-product b{display:block}.inventory-product small{display:block;color:#6e6e73;margin-top:4px}
.success-note{margin-top:10px;padding:12px 14px;border-radius:13px;background:#e8f8ed;color:#1b7f3a;font-weight:700}
.modal{background:#f2f2f7}
.modal>.modal-head{padding:2px 2px 0}
@media(max-width:600px){
  body{background:#f2f2f7}
  .top{height:56px}
  aside{padding:6px 8px;background:rgba(255,255,255,.96)}
  aside button{border-radius:11px;padding:9px 12px}
  main{padding:12px 10px 24px}
  .page-head{margin-bottom:12px}
  .page-head h1{font-size:30px;letter-spacing:-.7px}
  .page-head p{font-size:15px;line-height:1.35}
  .ios-card{box-shadow:0 1px 2px rgba(0,0,0,.06)}
  .counter-row{padding:13px 8px;gap:8px}
  .counter-product b{font-size:16px;line-height:1.2}
  .counter-input{gap:4px}
  .counter-input button{width:42px;height:42px;min-height:42px;padding:0}
  .counter-input .qty-input{width:50px;min-height:42px}
  .modal{width:100%;max-height:96svh;overflow:auto;border-radius:22px 22px 0 0;padding:16px 12px calc(16px + env(safe-area-inset-bottom))}
  .modal-actions{gap:8px}
  .modal-actions button{min-height:50px;border-radius:14px;font-size:16px}
  .inventory-list{gap:0}
  .inventory-row{min-height:72px;padding:12px 6px}
  .inventory-product b{font-size:15px}
  .stepper{gap:4px}
  .stepper button{width:42px;height:42px;min-height:42px;padding:0}
  .stepper .qty-input{width:54px}
  .filter-bar{gap:10px}
}
/* Product images */
.product-thumb{width:46px;height:46px;border-radius:11px;object-fit:cover;display:block;background:#f2f2f7;border:1px solid #e5e5ea}.product-thumb.placeholder{display:grid;place-items:center;font-size:21px;color:#8e8e93}.image-upload{display:grid;gap:9px;padding:12px;border:1px solid #e5e5ea;border-radius:14px;background:#f8f8fa}.image-preview-wrap{display:flex;align-items:center;gap:12px}.image-preview{width:96px;height:96px;border-radius:16px;object-fit:cover;border:1px solid #e5e5ea;background:#f2f2f7}.placeholder-large{display:grid;place-items:center;font-size:38px;color:#8e8e93}.upload-btn{display:flex;align-items:center;justify-content:center;min-height:46px;padding:10px 14px;border-radius:13px;background:#e5e5ea;color:#007aff;font-weight:800;cursor:pointer}.upload-btn input{display:none}.image-upload small{color:#6e6e73;line-height:1.35}.image-remove{background:transparent;color:#ff3b30;padding:5px 0;font-size:13px}.counter-row>.product-thumb{width:52px;height:52px;flex:0 0 52px;border-radius:13px}.counter-product{min-width:0;flex:1}.counter-row>.counter-product{max-width:none}@media(max-width:600px){.product-thumb{width:44px;height:44px}.counter-row>.product-thumb{width:50px;height:50px;flex-basis:50px}.image-preview{width:88px;height:88px}}
/* Impostazioni */
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.settings-card{margin-bottom:0}.settings-card .section-head{align-items:flex-start}.settings-list{display:grid;gap:7px}.settings-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #e5e5ea}.settings-row:last-child{border-bottom:0}.settings-row>div{display:flex;gap:6px}.settings-row button{padding:8px 10px;border-radius:10px}.small-btn{min-height:40px;padding:9px 12px}.danger-btn{background:#fff0ef;color:#ff3b30}@media(max-width:700px){.settings-grid{grid-template-columns:1fr}.settings-row{align-items:center}.settings-row>div{flex-shrink:0}.settings-row button{min-height:40px}}
/* Impostazioni v8 */
.settings-hidden{display:inline-block;margin-left:8px;padding:3px 7px;border-radius:99px;background:#fff0ef;color:#ff3b30;font-size:10px;font-weight:800;vertical-align:middle}
.settings-sub{margin-top:5px;display:flex;gap:6px;flex-wrap:wrap}
.settings-users{grid-column:1 / -1}
.settings-row>div:first-child{min-width:0}
.settings-row>div:first-child>b{display:inline-block}
@media(max-width:700px){.settings-users{grid-column:auto}.settings-row{gap:8px}.settings-row>div{min-width:0}.settings-row>div:last-child{flex-shrink:0}.settings-row>div:last-child button{font-size:13px;padding:8px 9px}}

/* v9 - iPhone drawer + compact settings */
body.menu-open{overflow:hidden}
.top{height:68px;padding:0 16px;background:rgba(255,255,255,.88);border-bottom:1px solid rgba(60,60,67,.12);box-shadow:0 2px 14px rgba(0,0,0,.04)}
.top-left{display:flex;align-items:center;gap:10px;min-width:0}.hamburger{width:44px;height:44px;min-height:44px;padding:9px;border-radius:14px;background:#f2f2f7;display:flex;flex-direction:column;justify-content:center;gap:5px}.hamburger span{display:block;width:22px;height:2.5px;border-radius:99px;background:#1c1c1e}.brand{gap:8px}.brand b{font-size:18px;letter-spacing:-.3px}.brand-dot{color:#0a84ff;font-size:12px}
.menu-shade{position:fixed;inset:0;background:rgba(0,0,0,.28);opacity:0;pointer-events:none;transition:opacity .22s ease;z-index:90}.menu-shade.open{opacity:1;pointer-events:auto}
.menu-drawer{position:fixed!important;left:0;top:0;bottom:0;width:min(310px,86vw);height:100svh;z-index:100;background:rgba(248,248,250,.96);backdrop-filter:saturate(180%) blur(24px);-webkit-backdrop-filter:saturate(180%) blur(24px);box-shadow:14px 0 45px rgba(0,0,0,.16);transform:translateX(-105%);transition:transform .24s cubic-bezier(.2,.8,.2,1);display:flex!important;flex-direction:column;padding:calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));border:0!important}
.menu-drawer.open{transform:translateX(0)}.drawer-head{display:flex;align-items:center;gap:11px;padding:10px 8px 20px}.drawer-appmark{width:46px;height:46px;border-radius:15px;background:linear-gradient(145deg,#0a84ff,#5856d6);color:#fff;display:grid;place-items:center;font-weight:900;box-shadow:0 7px 18px rgba(10,132,255,.25)}.drawer-head b{display:block;font-size:17px}.drawer-head small{display:block;color:#6e6e73;margin-top:2px}.drawer-close{margin-left:auto;width:40px;height:40px;min-height:40px;padding:0;border-radius:50%;font-size:26px;background:#e5e5ea;color:#3a3a3c}.drawer-list{display:grid;gap:6px;padding:4px}.drawer-item{width:100%;min-height:54px;display:flex;align-items:center;gap:12px;text-align:left;padding:7px 11px;border-radius:16px;background:transparent;color:#1c1c1e;font-size:16px}.drawer-item.active{background:#e7f1ff;color:#0066d6;font-weight:800}.drawer-icon{width:38px;height:38px;border-radius:12px;background:#e5e5ea;display:grid;place-items:center;font-size:19px;font-weight:800;color:#007aff}.drawer-item.active .drawer-icon{background:#007aff;color:#fff}.drawer-chevron{margin-left:auto;color:#8e8e93;font-size:25px;line-height:1}.drawer-footer{margin-top:auto;padding:8px 4px}.drawer-footer button{width:100%;background:#fff0ef;color:#ff3b30;border-radius:15px;font-weight:800}
.layout{display:block;min-height:calc(100svh - 68px)}main{max-width:1240px;padding:24px}.page-head h1{font-size:32px;letter-spacing:-.8px}.ios-card{border-radius:20px;box-shadow:0 2px 10px rgba(0,0,0,.055);border:1px solid rgba(60,60,67,.06)}button.primary{background:linear-gradient(135deg,#0a84ff,#007aff);box-shadow:0 6px 15px rgba(0,122,255,.18)}
.settings-row{padding:9px 0}.settings-name{min-width:0;display:flex!important;flex-direction:column;gap:1px!important}.settings-name small{color:#6e6e73;font-size:12px}.settings-actions{display:flex!important;align-items:center;gap:7px}.settings-actions button{min-width:44px}.icon-btn{width:44px;height:44px;padding:0!important;display:grid;place-items:center;border-radius:13px!important;font-size:22px!important}.eye-btn{background:#e5e5ea;color:#007aff}.eye-btn.hidden{background:#fff0ef;color:#ff3b30}.user-row{min-height:58px}.user-main{display:flex!important;align-items:center;gap:10px}.user-meta{display:flex;align-items:center;gap:7px}.role-chip{width:27px;height:27px;border-radius:9px;background:#e5e5ea;display:grid;place-items:center;font-size:12px;font-weight:900;color:#3a3a3c}.status-dot{width:12px;height:12px;border-radius:50%;display:inline-block;box-shadow:0 0 0 3px rgba(0,0,0,.03)}.status-dot.on{background:#34c759}.status-dot.off{background:#ff3b30}.settings-sub{display:none}.settings-hidden{display:none}
@media(max-width:600px){.top{height:60px;padding:0 10px}.brand b{font-size:16px}.top-user span{display:none}main{padding:16px 12px 28px}.page-head h1{font-size:30px}.ios-card{border-radius:18px}.settings-grid{gap:12px}.settings-card{padding:14px}.settings-row{padding:9px 0}.settings-actions button:first-child{padding:8px 10px}.drawer-item{min-height:56px;font-size:17px}.drawer-icon{width:40px;height:40px}.menu-drawer{width:min(320px,88vw)}}

/* v9 visual polish */
body{background:linear-gradient(180deg,#f7f9fc 0%,#f2f2f7 34%,#f2f2f7 100%)}
.page-head h1{font-weight:850}.page-head p{color:#636366}.ios-card{background:rgba(255,255,255,.94)}
.settings-card:nth-child(1) h2{color:#007aff}.settings-card:nth-child(2) h2{color:#5856d6}.settings-card:nth-child(3) h2{color:#ff9500}.settings-card:nth-child(4) h2{color:#34c759}.settings-users h2{color:#ff2d55}

/* v11 - compatto, touch lock e ricezione ordine */
#busyOverlay{position:fixed;inset:0;z-index:10000;display:grid;place-items:center;background:rgba(0,0,0,.14);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);pointer-events:auto;cursor:wait}
.busy-box{display:flex;align-items:center;gap:10px;padding:12px 16px;border-radius:16px;background:rgba(255,255,255,.96);box-shadow:0 8px 30px rgba(0,0,0,.15);color:#1c1c1e;font-size:15px}
.busy-spinner{width:18px;height:18px;border:2px solid #d1d1d6;border-top-color:#007aff;border-radius:50%;animation:busyspin .7s linear infinite}
@keyframes busyspin{to{transform:rotate(360deg)}}

.eye-btn{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;padding:0!important;border-radius:11px!important;display:grid!important;place-items:center!important}
.eye-svg{width:20px;height:20px;display:block}
.settings-actions{gap:6px!important}
.settings-actions button:first-child{min-height:38px!important}
.user-row{min-height:52px!important}
.role-chip{width:26px!important;height:26px!important}
.status-dot{width:11px!important;height:11px!important}

.receive-line{display:grid!important;grid-template-columns:minmax(0,1fr) auto;align-items:center!important;gap:8px 12px!important;padding:12px!important}
.receive-main{min-width:0}
.receive-controls{display:flex;align-items:flex-end;gap:8px;flex-shrink:0}
.receive-qty{width:78px!important;display:grid!important;gap:4px!important}
.receive-input{width:78px!important;min-height:42px!important}
.receive-options{display:flex;align-items:center;gap:5px;height:42px}
.receive-option{min-height:38px!important;height:38px!important;padding:7px 9px!important;border-radius:11px!important;background:#e5e5ea!important;color:#3a3a3c!important;font-size:12px!important;font-weight:800!important;white-space:nowrap}
.receive-option.selected{background:#e7f1ff!important;color:#007aff!important}
.receive-option.selected.unavailable{background:#fff0ef!important;color:#ff3b30!important}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.receive-pending{grid-column:1/-1!important;margin-top:0!important}
@media(max-width:600px){
  .receive-line{grid-template-columns:1fr!important;gap:8px!important}
  .receive-controls{width:100%;justify-content:flex-start;align-items:flex-end}
  .receive-options{flex:1;justify-content:flex-start}
  .receive-option{flex:0 0 auto}
  .receive-qty{width:72px!important}
  .receive-input{width:72px!important}
  .eye-btn{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important}
  .eye-svg{width:19px;height:19px}
}

/* Sezioni a tendina della pagina Ordini */
.orders-sections{display:grid;gap:16px}
.order-section{overflow:hidden}
.order-section-summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:22px 24px;cursor:pointer}
.order-section-summary::-webkit-details-marker{display:none}
.order-section-summary:after{content:'⌄';font-size:26px;font-weight:700;transform:rotate(0deg);transition:transform .18s ease}
.order-section[open] .order-section-summary:after{transform:rotate(180deg)}
.order-section-summary h2{margin:0}
.order-section-summary p{margin:5px 0 0}.order-section-body{padding:0 24px 24px}
@media(max-width:700px){.order-section-summary{padding:18px}.order-section-body{padding:0 18px 18px}.order-section .table-wrap{overflow-x:auto}}

/* Mobile: evita il doppio tap che ingrandisce la pagina */
html,body,button,input,select,a{touch-action:manipulation;}
button{-webkit-tap-highlight-color:transparent;}
.dashboard-section > summary{cursor:pointer;list-style:none}
.dashboard-section > summary::-webkit-details-marker{display:none}
.dashboard-section .section-body{padding:0 18px 18px}
.dashboard-section[open] .chevron{transform:rotate(180deg)}.dashboard-section .chevron{transition:transform .18s ease}
.dashboard-section > summary{padding:18px 20px!important}.dashboard-section > summary:after{content:none!important}
.summary-actions{display:flex;align-items:center;gap:10px}
.warning-count{background:#fff1f0!important;color:#c92a2a!important}
.alert-list{display:grid;gap:10px}
.stock-alert{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-radius:16px;background:#fff6f5;border:1px solid #ffd9d5}
.stock-alert b{display:block}.stock-alert small{display:block;margin-top:4px;color:#747474}.stock-alert strong{color:#c92a2a;font-size:13px;white-space:nowrap}
@media(max-width:700px){.stock-alert{align-items:flex-start;flex-direction:column}.stock-alert strong{white-space:normal}}

/* v44 - new app icon, compact order cards, statistics, product ordering */
.brand{display:flex;align-items:center;min-width:0}.brand-logo{width:34px;height:34px;border-radius:10px;object-fit:cover;box-shadow:0 4px 12px rgba(0,0,0,.12)}
.drawer-appmark{object-fit:cover;background:none!important;box-shadow:0 5px 15px rgba(0,0,0,.16)}
.app-mark{width:86px;height:86px;border-radius:24px;object-fit:cover;display:block;margin:0 auto 14px;box-shadow:0 10px 26px rgba(0,0,0,.15)}
.product-name-link{padding:0!important;min-height:0!important;border:0!important;background:transparent!important;color:inherit!important;text-align:left;font:inherit;box-shadow:none!important}.product-name-link:hover{text-decoration:underline}
.counter-sort-label{min-width:170px}.counter-sort-label select{margin-top:5px}
.compact-order-section{border-radius:17px}.compact-summary{padding:15px 17px}.compact-summary h2{font-size:17px}.compact-summary p{margin-top:3px;font-size:13px}.mini-count{min-width:30px;height:30px;padding:0 9px;border-radius:999px;background:#eef5ff;color:#007aff;display:grid;place-items:center;font-weight:850}
.drag-products{display:grid;gap:8px;max-height:55vh;overflow:auto;padding:2px;-webkit-overflow-scrolling:touch}.drag-product{display:flex;align-items:center;gap:11px;padding:12px 13px;border:1px solid rgba(60,60,67,.09);border-radius:14px;background:#fff;cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.drag-product:active{cursor:grabbing}.drag-product.dragging{opacity:.55;transform:scale(.99);box-shadow:0 7px 20px rgba(0,0,0,.12)}.drag-handle{font-size:18px;color:#8e8e93}.drag-product span:nth-child(2){display:flex;flex-direction:column;gap:2px;min-width:0}.drag-product small{color:#8e8e93}
.settings-order-preview{display:grid;gap:5px}.order-preview-row{display:flex;align-items:center;gap:9px;padding:7px 0}.order-preview-row span{width:24px;height:24px;border-radius:8px;background:#eef5ff;color:#007aff;display:grid;place-items:center;font-size:12px;font-weight:800}.order-preview-row b{font-size:14px}
.statistics-card{padding:18px}.stats-filters{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;align-items:end}.stats-filters>label{display:grid;gap:5px;font-size:12px;font-weight:800;color:#636366}.stats-filters button{min-height:44px}.stats-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:18px}.stat-kpi{padding:15px;border-radius:16px;background:#f5f7fb;border:1px solid rgba(60,60,67,.06)}.stat-kpi small{display:block;color:#636366}.stat-kpi b{display:block;font-size:26px;margin-top:6px;letter-spacing:-.4px}.stat-kpi span{display:block;color:#8e8e93;margin-top:2px}.stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.chart-card{padding:16px;border-radius:17px;background:#fff;border:1px solid rgba(60,60,67,.08);box-shadow:0 2px 9px rgba(0,0,0,.035)}.chart-card h3{margin:0 0 12px}.bar-row{display:grid;grid-template-columns:80px 1fr 48px;gap:8px;align-items:center;margin:10px 0}.bar-label{font-size:12px;color:#636366}.bar-track{height:12px;background:#eef2f7;border-radius:99px;overflow:hidden}.bar-track i{display:block;height:100%;background:linear-gradient(90deg,#0a84ff,#5856d6);border-radius:99px}.bar-row>b{text-align:right;font-size:13px}.rank-row{display:grid;grid-template-columns:28px minmax(0,1fr) auto;align-items:center;gap:8px;padding:9px 0;border-bottom:1px solid #eee}.rank-row:last-child{border-bottom:0}.rank-row>span{width:24px;height:24px;border-radius:8px;background:#f0f0f5;display:grid;place-items:center;font-size:12px;font-weight:800}.rank-row strong{font-size:13px}.loading-inline{padding:26px;text-align:center;color:#636366}
@media(max-width:850px){.stats-filters{grid-template-columns:1fr 1fr}.stats-grid{grid-template-columns:1fr}}
@media(max-width:600px){.brand-logo{width:31px;height:31px;border-radius:9px}.counter-sort-label{min-width:145px}.stats-filters{grid-template-columns:1fr 1fr}.stats-summary{grid-template-columns:1fr}.statistics-card{padding:12px}.chart-card{padding:13px}.bar-row{grid-template-columns:68px 1fr 40px}.compact-summary{padding:14px}.drag-products{max-height:58vh}}
@media print{.top,.menu-drawer,.menu-shade,.page-head,.stats-filters,button{display:none!important}.statistics-card{border:0!important;box-shadow:none!important}.stats-grid{grid-template-columns:1fr}.stat-kpi{break-inside:avoid}}

/* v45 - ordine prodotti: sezioni ordini ancora piu compatte */
.orders-sections{gap:8px!important}.compact-order-section{border-radius:13px!important}.compact-summary{padding:10px 12px!important;min-height:46px}.compact-summary h2{font-size:15px!important}.compact-summary p{font-size:11px!important;line-height:1.2;margin-top:2px!important}.compact-summary .mini-count{min-width:24px;height:24px;padding:0 7px;font-size:12px}.compact-summary .chevron{font-size:19px}.order-section-body{padding:0 12px 12px!important}.compact-order-section .section-head{padding-top:8px!important;margin-bottom:8px!important}.compact-order-section .section-head button{min-height:36px!important;padding:7px 10px!important;font-size:13px!important}.compact-order-section .list-action{min-height:48px!important;padding:9px 10px!important}.compact-order-section .click-table th,.compact-order-section .click-table td,.compact-order-section .compact-table th,.compact-order-section .compact-table td{padding:7px 8px!important;font-size:12px!important}
#busyOverlay{cursor:wait}.action-busy{overflow:hidden!important}.action-busy input,.action-busy select,.action-busy textarea,.action-busy button{cursor:wait!important}
@media(max-width:600px){.compact-summary{padding:9px 10px!important}.compact-summary h2{font-size:14px!important}.compact-summary p{font-size:10.5px!important}.order-section-body{padding:0 10px 10px!important}}


/* v47 - scroll iPhone nell'ordine prodotti + caricamento login */
.drag-products{max-height:55vh;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;scrollbar-width:thin}
.drag-product{touch-action:pan-y}
.drag-handle{touch-action:none;cursor:grab;display:inline-flex;align-items:center;justify-content:center;min-width:38px;min-height:38px}
.drag-product.dragging{touch-action:none}

/* v49 - caricamento app: concept boccale + barra a quadratini */
#busyOverlay.login-loading-overlay{background:rgba(0,0,0,.42);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);z-index:9999}
.app-loader-box{width:min(175px,50vw);padding:0;background:transparent;box-shadow:none;border-radius:0;display:flex;flex-direction:column;align-items:center}
.beer-loader{position:relative;width:115px;height:103px;display:grid;place-items:center}
.beer-mug{position:relative;width:56px;height:65px;border:3px solid #8b571f;border-radius:6px 6px 12px 12px;background:linear-gradient(90deg,rgba(255,255,255,.78) 0 12%,rgba(255,255,255,.18) 13% 20%,transparent 21%);box-shadow:inset 4px 0 4px rgba(255,255,255,.3),0 4px 8px rgba(120,72,18,.12);overflow:visible;z-index:2}
.beer-mug:after{content:"";position:absolute;right:-21px;top:11px;width:21px;height:35px;border:3px solid #8b571f;border-left:0;border-radius:0 14px 14px 0;box-shadow:inset -3px 0 3px rgba(255,255,255,.25)}
.mug-beer{position:absolute;left:3px;right:3px;bottom:3px;height:0;border-radius:0 0 9px 9px;background:linear-gradient(180deg,#ffd15b 0%,#f2a51e 48%,#d4770d 100%);box-shadow:inset 4px 0 4px rgba(255,255,255,.18);animation:mugFill 2.25s cubic-bezier(.18,.72,.2,1) forwards}
.mug-foam{position:absolute;left:4px;right:4px;bottom:5px;height:0;border-radius:50% 50% 35% 35%;background:linear-gradient(180deg,#fffdf2,#fff1cf);box-shadow:0 -2px 7px rgba(255,255,255,.8);animation:mugFoam 2.25s cubic-bezier(.18,.72,.2,1) forwards}
.mug-bubble{position:absolute;width:5px;height:5px;border-radius:50%;background:rgba(255,250,220,.9);opacity:0;animation:mugBubble 1.55s ease-out 1 forwards}.mb1{left:31px;bottom:22px;animation-delay:.55s}.mb2{left:55px;bottom:30px;animation-delay:.9s}.mb3{left:72px;bottom:18px;animation-delay:1.15s}
.loader-bar{position:relative;width:100%;height:13px;padding:2px;border:2px solid #1d1d1f;border-radius:7px;background:rgba(255,255,255,.08);box-shadow:0 2px 7px rgba(0,0,0,.14);overflow:hidden}
.loader-fill{height:100%;width:var(--loader-progress,0%);border-radius:3px;background:repeating-linear-gradient(90deg,#f39a00 0 8px,#f39a00 8px 9px,transparent 9px 12px);box-shadow:0 0 6px rgba(243,154,0,.25);transition:width .12s linear}
.loader-complete .loader-fill{transition:width .18s ease-out}
@keyframes mugFill{0%{height:0}100%{height:80%}}
@keyframes mugFoam{0%{height:0;transform:translateY(4px)}100%{height:15%;transform:translateY(0)}}
@keyframes mugBubble{0%{transform:translateY(0) scale(.6);opacity:0}25%{opacity:.9}100%{transform:translateY(-55px) scale(1);opacity:0}}
@media(prefers-reduced-motion:reduce){.mug-beer,.mug-foam,.mug-bubble{animation:none}.mug-beer{height:80%}.mug-foam{height:15%}.mug-bubble{opacity:0}}


.my-counter-history{margin:0 0 18px;padding:14px;border:1px solid var(--border,#ddd);border-radius:14px;background:var(--card,#fff)}
.my-counter-list{display:grid;gap:8px}.my-counter-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid var(--border,#ddd)}.my-counter-row:first-child{border-top:0}.my-counter-row small{display:block;opacity:.7;margin-top:3px}.my-counter-row button{min-width:110px}@media(max-width:520px){.my-counter-row{align-items:center}.my-counter-row button{min-width:100px;padding:10px 8px}}

/* v51 - storico ordini solo consultazione + conferma non disponibili */
.history-status{display:inline-flex;align-items:center;justify-content:center;padding:7px 10px;border-radius:10px;background:#f2f2f7;color:#3a3a3c;font-size:12px;font-weight:800;white-space:nowrap}.history-receive-list .receive-line{align-items:center}.unavailable-confirm-line .history-status{background:#fff3e0;color:#9a5b00}.unavailable-confirm-line{border-left:3px solid #c62828}@media(max-width:600px){.app-loader-box{width:155px}.beer-loader{width:100px;height:90px}}

.history-status.history-unavailable{background:#ffe5e5;color:#c62828;border:1px solid #ffc7c7}

/* v54 finale - dashboard, statistiche e controlli compatti */
.dashboard-section{padding:0!important}.dashboard-section>.order-section-summary{padding:13px 16px!important}.dashboard-section .section-body{padding:0 14px 14px!important}.stock-warning-section>.order-section-summary{animation:stockPulse 1.05s ease-in-out infinite}.stock-warning-section>.order-section-summary .warning-count{animation:stockBadge 1.05s ease-in-out infinite}@keyframes stockPulse{0%,100%{box-shadow:inset 0 0 0 0 rgba(255,59,48,0)}50%{box-shadow:inset 0 0 0 2px rgba(255,59,48,.18)}}@keyframes stockBadge{0%,100%{opacity:1}50%{opacity:.45}}
.stats-filters{grid-template-columns:repeat(4,minmax(0,1fr))}.stats-filters>label{min-width:0}.stats-filters input,.stats-filters select{min-width:0;box-sizing:border-box}.stats-summary{grid-template-columns:repeat(3,minmax(0,1fr))}.stat-kpi{min-width:0}.order-price{display:flex;align-items:center;gap:3px;font-size:11px;color:#636366}.order-price input{width:78px!important;min-height:38px!important;padding:6px!important;font-size:14px!important}.order-stepper{flex-wrap:wrap;justify-content:flex-end}.counter-actions{display:flex;gap:8px;flex-wrap:wrap}.counter-suspended{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;margin-bottom:12px;border:1px solid #d8e8ff;border-radius:14px;background:#f5f9ff}.counter-suspended small{display:block;color:#6e6e73;margin-top:3px}.suspended-actions{display:flex;gap:7px;align-items:center}.suspended-actions button{min-height:40px}.history-price-line strong{white-space:nowrap}.history-total{margin-top:12px;padding:13px;border-radius:14px;background:#f5f5f7;display:grid;grid-template-columns:1fr auto;gap:7px 12px}.history-total span{color:#636366}.history-total b{text-align:right}.danger{background:#ffe5e5!important;color:#c62828!important}.history-status.history-unavailable{background:#ffe5e5;color:#c62828;border:1px solid #ffc7c7}.rank-row small{display:block;color:#8e8e93;font-weight:500;margin-top:2px}.notice{padding:11px 13px;border-radius:12px;background:#fff7e6;color:#8a5a00;margin-bottom:10px}
@media(max-width:850px){.stats-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.stats-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.dashboard-section>.order-section-summary{padding:11px 12px!important}.dashboard-section .section-body{padding:0 10px 10px!important}.stats-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.stats-summary{grid-template-columns:1fr}.statistics-card{padding:10px!important}.stats-filters label{font-size:11px}.stats-filters input,.stats-filters select{min-height:42px;padding:8px}.order-stepper{justify-content:center;width:100%}.order-price input{width:74px!important}.counter-actions{width:100%}.counter-actions button{flex:1}.counter-suspended{align-items:flex-start;flex-direction:column}.suspended-actions{width:100%}.suspended-actions button{flex:1}.history-price-line{align-items:flex-start!important}}

/* v55 - fix finali */
.stock-warning-section>.order-section-summary{background:#fff1f0!important;border:1px solid #ff3b30!important;color:#b42318;animation:stockWarningStrong 1s ease-in-out infinite}.stock-warning-section>.order-section-summary .warning-count{background:#ff3b30!important;color:#fff!important;animation:stockBadgeStrong 1s ease-in-out infinite}@keyframes stockWarningStrong{0%,100%{box-shadow:0 0 0 0 rgba(255,59,48,.08)}50%{box-shadow:0 0 0 5px rgba(255,59,48,.18)}}@keyframes stockBadgeStrong{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.08);opacity:.8}}
.inventory-open-warning-section>.order-section-summary{background:#fff1f0!important;border:1px solid #ff3b30!important;color:#b42318;animation:inventoryOpenPulse .9s ease-in-out infinite}.inventory-open-warning-section>.order-section-summary .warning-count{background:#ff3b30!important;color:#fff!important;animation:stockBadgeStrong .9s ease-in-out infinite}.inventory-open-alert{width:100%;text-align:left;cursor:pointer}@keyframes inventoryOpenPulse{0%,100%{box-shadow:0 0 0 0 rgba(255,59,48,.10)}50%{box-shadow:0 0 0 6px rgba(255,59,48,.24)}}
.inventory-alert-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.inventory-alert-actions button{min-height:40px;padding:8px 11px}
.missing-stock-target{background:#fff1f0!important}.missing-stock-target td{border-bottom-color:#ffd4d0!important}.missing-target-label{display:inline-block;padding:4px 7px;border-radius:8px;background:#ff3b30;color:#fff;font-size:12px;white-space:nowrap}
.dashboard-section{margin-bottom:10px!important}.dashboard-section>.order-section-summary{padding:10px 13px!important}.dashboard-section .section-body{padding:0 12px 12px!important}.dashboard-section .order-section-summary h2{font-size:16px!important}.dashboard-section .order-section-summary p{font-size:11px!important}
.stats-filters{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;align-items:end;min-width:0}.stats-filters>label{min-width:0;overflow:hidden}.stats-filters input,.stats-filters select{width:100%;min-width:0;max-width:100%;box-sizing:border-box}.stats-filters input[type=date]{-webkit-appearance:none;appearance:none;padding-right:8px}.order-price-fixed{display:grid;gap:2px;min-width:92px;font-size:11px;color:#636366}.order-price-fixed b{font-size:13px;color:#1c1c1e}.status-dot{display:inline-block;flex:0 0 13px;width:13px;height:13px;border-radius:50%;margin-left:auto}.status-arrived{background:#34c759;box-shadow:0 0 0 3px rgba(52,199,89,.14)}.status-unavailable{background:#ff3b30;box-shadow:0 0 0 3px rgba(255,59,48,.14)}.history-price-line{display:grid!important;grid-template-columns:minmax(0,1fr) 18px auto;align-items:center!important;gap:10px!important}.history-price-line strong{white-space:nowrap}.history-receive-list .receive-main small{line-height:1.35}
@media(max-width:850px){.stats-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.stats-filters{grid-template-columns:1fr 1fr!important}.stats-filters>label{width:100%;min-width:0}.stats-filters input[type=date],.stats-filters input,.stats-filters select{width:100%!important;max-width:100%!important;min-width:0!important}.order-price-fixed{min-width:0;width:100%;text-align:center}.order-stepper{gap:6px}.history-price-line{grid-template-columns:minmax(0,1fr) 18px auto!important}.dashboard-section>.order-section-summary{padding:9px 10px!important}}@media(prefers-reduced-motion:reduce){.stock-warning-section>.order-section-summary,.stock-warning-section>.order-section-summary .warning-count{animation:none}}

.inventory-readonly-row{background:#f8f8fa}.inventory-readonly-row>strong{min-width:42px;text-align:center;font-size:18px}.inventory-readonly-row .inventory-product small{line-height:1.35}

/* v62 - ordini suggeriti e righe ordine responsive */
.order-line{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto auto;align-items:center;gap:12px}.order-stepper{flex-wrap:nowrap!important;justify-content:center}.order-price-fixed{width:94px}.order-qty-total{min-width:118px;text-align:right;font-size:12px;white-space:nowrap}.draft-order-card{cursor:default}.draft-order-card>div:first-child{cursor:pointer;min-width:0}.draft-actions{display:flex;gap:7px;flex-shrink:0}.suggested-draft-list{display:grid;gap:8px;background:#fff;border-radius:14px;padding:8px}.draft-line{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border-bottom:1px solid #e5e5ea}.draft-line:last-child{border-bottom:0}.draft-line small{display:block;color:#6e6e73;margin-top:3px}.draft-line strong{white-space:nowrap}
@media(max-width:700px){.order-line{grid-template-columns:minmax(0,1fr) auto;align-items:center}.order-line .order-product{grid-column:1/-1}.order-price-fixed{width:auto;text-align:left}.order-qty-total{min-width:0;text-align:right}.draft-actions{width:100%}.draft-actions button{flex:1}.draft-order-card{flex-wrap:wrap}.draft-order-card>div:first-child{width:100%}}
