/* /assets/css/app.css — stili di modulo del portale Magazzino 3D (solo token --hd-*) */

[hidden]{display:none!important}

/* Accesso e installazione */
.mg-auth{min-height:100dvh;display:grid;place-items:center;padding:var(--hd-s4);background:var(--hd-bg)}
.mg-auth__card{width:100%;max-width:400px;display:flex;flex-direction:column;gap:var(--hd-s4);padding:var(--hd-s6)}
.mg-auth__card .hd-brand{padding:0}
.mg-auth__error{color:var(--hd-danger);font-size:var(--hd-t-sm);margin:0}
.mg-auth [hidden]{display:none!important}

/* Guscio */
.mg-userlink{text-decoration:none;color:inherit}
.mg-logout{margin:0 var(--hd-s3) var(--hd-s3);justify-content:flex-start}
.mg-bell{position:relative}
.mg-bell__dot{position:absolute;top:8px;right:8px;width:8px;height:8px;border-radius:50%;background:var(--hd-danger)}
.mg-list-icon{display:inline-grid;place-items:center;width:28px;height:28px;color:var(--hd-accent)}
.mg-list-icon svg{width:20px;height:20px}
.mg-wrap{white-space:normal}
.mg-dialog-text{margin:0 0 var(--hd-s4)}
.mg-skel{display:block;height:14px}
.mg-skel--0{width:70%}.mg-skel--1{width:45%}.mg-skel--2{width:60%}
.mg-toolbar-grow{flex:1 1 180px;min-width:0}
.mg-select-auto{width:auto;min-width:160px;flex:0 1 auto}
.mg-actions{display:flex;gap:var(--hd-s1);justify-content:flex-end}
.mg-gap{margin-top:var(--hd-s4)}
.mg-note{font-size:var(--hd-t-sm);color:var(--hd-text-2);margin:var(--hd-s2) 0 0}
.mg-code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:var(--hd-t-xs);background:var(--hd-fill);border-radius:var(--hd-r-sm);padding:var(--hd-s3);overflow:auto;white-space:pre;margin:var(--hd-s2) 0 0;color:var(--hd-text)}
.mg-secret{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:var(--hd-t-md);background:var(--hd-fill);border-radius:var(--hd-r-sm);padding:var(--hd-s3);word-break:break-all;user-select:all;text-align:center}
.mg-codes{display:grid;grid-template-columns:repeat(2,1fr);gap:var(--hd-s2)}
.mg-qr{display:grid;place-items:center;padding:var(--hd-s3);background:#fff;border-radius:var(--hd-r);width:fit-content;margin:0 auto}

/* Mappa magazzini */
.mg-map{height:300px;border-radius:var(--hd-r-lg);overflow:hidden;background:var(--hd-fill);z-index:0;position:relative}
@media (min-width:1024px){.mg-map{height:380px}}
.mg-wh{display:flex;flex-direction:column;gap:var(--hd-s3)}
.mg-wh__meta{display:flex;flex-wrap:wrap;gap:var(--hd-s2)}
.mg-wh__foot{display:flex;gap:var(--hd-s2);margin-top:auto}
.mg-wh__foot .hd-btn--primary{flex:1}

/* Barre percentuali */
.mg-bar{height:6px;border-radius:var(--hd-r-pill);background:var(--hd-fill);overflow:hidden;min-width:80px}
.mg-bar > span{display:block;height:100%;background:var(--hd-accent);border-radius:inherit}
.mg-bar--warning > span{background:var(--hd-warning)}
.mg-bar--danger > span{background:var(--hd-danger)}
.mg-chart{position:relative;height:260px}

/* Permessi utente */
.mg-perms{display:grid;grid-template-columns:1fr auto;gap:var(--hd-s2) var(--hd-s3);align-items:center}
.mg-perms .hd-select{min-width:150px}
.mg-checks{display:flex;flex-wrap:wrap;gap:var(--hd-s2) var(--hd-s4)}
.mg-checks label{display:inline-flex;align-items:center;gap:var(--hd-s2);font-size:var(--hd-t-sm)}

/* Scansione */
.mg-scan{max-width:520px;margin:0 auto}
.mg-scan__video{border-radius:var(--hd-r-lg);overflow:hidden;background:var(--hd-fill);min-height:60px}
.mg-scan__video video{display:block;width:100%}

/* Inventario */
.mg-count{width:110px;text-align:right}
.mg-diff-pos{color:var(--hd-success)}.mg-diff-neg{color:var(--hd-danger)}

/* Etichette */
.mg-labels{display:grid;gap:var(--hd-s2);justify-content:start}
.mg-label{background:#fff;color:#000;border:0.5px dashed var(--hd-border);border-radius:var(--hd-r-xs);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1mm;padding:2mm;overflow:hidden;text-align:center;box-sizing:border-box}
.mg-label canvas{max-width:100%;max-height:62%;height:auto;image-rendering:pixelated}
.mg-label__title{font-size:9pt;font-weight:600;line-height:1.1;max-height:2.3em;overflow:hidden}
.mg-label__sub{font-size:7.5pt;line-height:1.1}
.mg-pick{max-height:340px;overflow:auto}
@media print{
  .hd-sidebar,.hd-topbar,.hd-tabbar,.hd-fab,.hd-toasts,.mg-noprint{display:none!important}
  .hd-app,.hd-main,.hd-container{display:block!important;margin:0!important;padding:0!important;max-width:none!important;background:#fff!important}
  body{background:#fff!important}
  .mg-label{border:0;border-radius:0;break-inside:avoid;page-break-inside:avoid}
  .mg-labels{gap:0}
  .mg-printarea{margin:0!important;padding:0!important;box-shadow:none!important;background:#fff!important}
}

/* Visore 3D incorporato (ubicazioni, prelievo) */
.mg-3d{position:relative;width:100%;height:100%;min-height:320px;border-radius:var(--hd-r-lg);overflow:hidden;background:var(--hd-fill)}
.mg-3d canvas{display:block}
.mg-3d--panel{height:440px}
.mg-3dwrap{position:relative}
.mg-3d__legend{position:absolute;left:var(--hd-s3);bottom:var(--hd-s3);display:flex;flex-wrap:wrap;gap:var(--hd-s3);padding:6px 12px;border-radius:var(--hd-r-pill);background:var(--hd-surface);font-size:var(--hd-t-xs);color:var(--hd-text-2);box-shadow:0 2px 12px rgba(0,0,0,.08);pointer-events:none;max-width:calc(100% - 24px)}
.mg-3d__legend span{display:inline-flex;align-items:center;gap:6px}
.mg-dot{width:9px;height:9px;border-radius:50%;display:inline-block}
.mg-dot--todo{background:var(--hd-success)}.mg-dot--cur{background:var(--hd-accent)}.mg-dot--done{background:var(--hd-text-3)}
.mg-3d__info{position:absolute;top:var(--hd-s3);left:var(--hd-s3);right:var(--hd-s3);display:flex;align-items:center;gap:var(--hd-s3);padding:var(--hd-s3) var(--hd-s4);border-radius:var(--hd-r);background:var(--hd-surface);box-shadow:0 6px 24px rgba(0,0,0,.12)}
.mg-find{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hd-s2);margin-bottom:var(--hd-s3)}
.mg-find button.hd-badge{border:0;cursor:pointer;font:inherit;font-size:var(--hd-t-xs)}
.mg-loclink{border:0;background:none;padding:0;font:inherit;color:var(--hd-accent);cursor:pointer;text-align:left}

/* Prelievo immersivo: elenco a sinistra, magazzino 3D sempre visibile a destra */
.mg-imm{display:flex;flex-direction:column;gap:var(--hd-s4)}
.mg-imm__side{display:flex;flex-direction:column;gap:var(--hd-s3);min-width:0}
.mg-imm__view{position:relative;height:46vh;min-height:300px;order:-1}
.mg-addrow{display:grid;grid-template-columns:minmax(0,1fr) 84px auto;gap:var(--hd-s2)}
.mg-step{display:flex;align-items:center;gap:var(--hd-s3);width:100%;border:0;background:none;font:inherit;color:inherit;text-align:left;cursor:pointer}
.mg-step__n{flex:0 0 28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:var(--hd-t-sm);font-weight:600;color:#fff;background:var(--hd-success)}
.mg-step.is-cur .mg-step__n{background:var(--hd-accent)}
.mg-step.is-done .mg-step__n{background:var(--hd-text-3)}
.mg-step.is-done .hd-list__title{text-decoration:line-through;color:var(--hd-text-2)}
.mg-step.is-cur{box-shadow:inset 3px 0 0 var(--hd-accent)}
.mg-guide{border:1.5px solid var(--hd-accent)}
.mg-guide__code{font-size:var(--hd-t-xl);font-weight:700;letter-spacing:-.02em;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;word-break:break-all}
.mg-guide__qty{font-size:var(--hd-t-lg);font-weight:600}
@media (min-width:1024px){
  .mg-imm{display:grid;grid-template-columns:minmax(380px,460px) minmax(0,1fr);align-items:start}
  .mg-imm__view{order:0;position:sticky;top:calc(var(--hd-topbar-h,56px) + var(--hd-s4));height:calc(100dvh - var(--hd-topbar-h,56px) - var(--hd-s8,48px))}
}
@media print{.mg-imm{display:block}.mg-step__n{color:#000;background:none;border:1px solid #000}}
