/* moderno.css: finitura e movimento condivisi da tutte le pagine (anagrafiche, dashboard, fatturazione, turni, registro, guida). Va collegato DOPO lo stile della pagina. */
/* =====================================================================================================================
   FINITURA MODERNA E MOVIMENTO (12/11/2026, richiesta di Luca: «grafica più moderna, meno statica»).
   Solo aspetto e movimento: nessun cambiamento di struttura, colori o funzioni. Vale per tutte le pagine che usano questo file.
   Regole: si animano solo transform e opacity; tutto si spegne con «riduci movimento» del sistema; le tabelle NON si animano al ridisegno
   (si ridisegnano mentre si scrive nei filtri: un movimento a ogni tasto darebbe fastidio).
   ===================================================================================================================== */
:root { --radius:14px; --ease-molla:cubic-bezier(.16,1,.3,1); --ombra-alta:0 2px 4px rgba(15,32,55,.06), 0 14px 30px -12px rgba(15,32,55,.28); }
html { scroll-behavior:smooth; }
@view-transition { navigation:auto; }
@media (prefers-reduced-motion: no-preference) {
  /* passaggio tra pagine: dissolvenza morbida (browser che lo supportano; gli altri ignorano la regola) */
  ::view-transition-old(root) { animation:pa-esce .18s ease both; }
  ::view-transition-new(root) { animation:pa-entra .28s var(--ease-molla) both; }
  @keyframes pa-esce { to { opacity:0; } }
  @keyframes pa-entra { from { opacity:0; } }

  /* ingresso dei contenuti: salgono e compaiono, a scalini */
  @keyframes pa-sale { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }
  @keyframes pa-sale-poco { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
  @keyframes pa-pop { from { opacity:0; transform:translateY(10px) scale(.97); } to { opacity:1; transform:none; } }
  @keyframes pa-sfondo { from { opacity:0; } to { opacity:1; } }
  .app > .panel, .app > .st-wrap > *, .hub-grid > .hub-card, .app > .st-wrap .st-stat { animation:pa-sale .5s var(--ease-molla) both; }
  .app > .panel:nth-of-type(2), .app > .st-wrap > *:nth-child(2) { animation-delay:.06s; }
  .app > .panel:nth-of-type(3), .app > .st-wrap > *:nth-child(3) { animation-delay:.12s; }
  .hub-grid > .hub-card:nth-child(1) { animation-delay:.02s; } .hub-grid > .hub-card:nth-child(2) { animation-delay:.06s; } .hub-grid > .hub-card:nth-child(3) { animation-delay:.10s; }
  .hub-grid > .hub-card:nth-child(4) { animation-delay:.14s; } .hub-grid > .hub-card:nth-child(5) { animation-delay:.18s; } .hub-grid > .hub-card:nth-child(6) { animation-delay:.22s; }
  .hub-grid > .hub-card:nth-child(7) { animation-delay:.26s; } .hub-grid > .hub-card:nth-child(8) { animation-delay:.30s; }
  .app > .st-wrap .st-stat:nth-child(2) { animation-delay:.08s; } .app > .st-wrap .st-stat:nth-child(3) { animation-delay:.16s; }
  /* finestre: lo sfondo si sfuma, la finestra sale con una piccola molla */
  .modal-backdrop { animation:pa-sfondo .2s ease both; backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); }
  .modal-backdrop > .modal { animation:pa-pop .32s var(--ease-molla) both; }
  .form-error, .avviso { animation:pa-sale-poco .25s var(--ease-molla) both; }

  /* risposta al tocco */
  .btn, [class*="btn-az-"], .btn-disp-evidente, .add-row-btn, .sb-item, .main-tabbar .mt-item, .hub-card, .who-pill button, .topbar .navlink, .btn-aggiungi { transition:transform .18s var(--ease-molla), box-shadow .2s ease, background-color .15s ease, border-color .15s ease, color .15s ease, filter .15s ease; }
  .btn:not(:disabled):hover, [class*="btn-az-"]:not(:disabled):hover, .btn-disp-evidente:not(:disabled):hover { transform:translateY(-4px); box-shadow:0 14px 26px -10px rgba(15,32,55,.42); }
  .btn:not(:disabled):active, [class*="btn-az-"]:not(:disabled):active, .add-row-btn:active, .btn-aggiungi:active { transform:translateY(0) scale(.97); }
  .btn.primary:not(:disabled):hover { box-shadow:0 16px 28px -8px rgba(108,63,199,.6); }
  .hub-card:hover { transform:translateY(-4px); box-shadow:var(--ombra-alta); }
  .hub-card:active { transform:translateY(-1px) scale(.99); }
  .sb-item .chip { transition:transform .22s var(--ease-molla); }
  .sb-item:hover .chip { transform:scale(1.12); }
  .main-tabbar .mt-item { transition:color .15s ease, border-color .25s var(--ease-molla); }
  .st-card, .st-stat { transition:transform .22s var(--ease-molla), box-shadow .22s ease; }
  .st-stat:hover { transform:translateY(-2px); box-shadow:var(--ombra-alta); }
  .st-tabella tbody tr, .wrap-table tbody tr { transition:background-color .15s ease; }
}
/* anche senza movimento: aspetto più rifinito */
.wrap-table table:not(.griglia-turni) tbody tr:hover td { background:var(--accent-soft); }
.wrap-table table:not(.griglia-turni) td { transition:background-color .15s ease; }
input[type="text"], input[type="search"], input[type="date"], input[type="password"], input[type="number"], input[type="email"], input[type="tel"], select, textarea { border-radius:9px; transition:border-color .15s ease, box-shadow .2s ease; }
input[type="text"]:focus, input[type="search"]:focus, input[type="date"]:focus, input[type="password"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="tel"]:focus, select:focus, textarea:focus { outline:none; border-color:var(--accent-2); box-shadow:0 0 0 4px var(--accent-soft); }
.panel, .modal, .gate-card, .hub-card { box-shadow:var(--shadow); }
::selection { background:var(--accent-soft); color:var(--text); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior:auto; } ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation:none !important; } *, *::before, *::after { animation-duration:.01ms !important; animation-delay:0s !important; transition-duration:.01ms !important; } }

/* BARRA LATERALE (12/11/2026, Luca: icone più grandi; il nome NON sempre visibile ma solo al passaggio; niente scorrimento della barra).
   Compatta: tutte le voci entrano senza scorrere (negli schermi bassi le icone si rimpiccioliscono). Il nome compare come etichetta a destra dell'icona.
   Per far uscire l'etichetta dalla barra, la barra non taglia il contenuto (overflow visibile). Su schermi stretti resta la disposizione in riga di prima. */
@media (min-width:901px) {
  .sidebar { width:84px; gap:10px; padding:14px 0; overflow:visible; }
  .sidebar .sb-brand { width:50px; height:50px; }
  .sb-nav { gap:4px; margin-top:8px; }
  .sb-item { width:62px; height:54px; min-height:0; padding:0; gap:0; border-radius:16px; }
  .sb-item .chip { width:42px; height:42px; border-radius:13px; }
  .sb-item .chip svg { width:24px; height:24px; }
  .sb-item.active { background:rgba(255,255,255,.2); box-shadow:inset 3px 0 0 #fff; }
  /* il nome: etichetta a destra, visibile solo al passaggio o con la tastiera */
  .sb-item .sb-label { position:absolute; left:calc(100% + 10px); top:50%; width:auto; height:auto; clip:auto; overflow:visible; white-space:nowrap;
    transform:translateY(-50%) translateX(-6px); opacity:0; visibility:hidden; pointer-events:none; z-index:60;
    background:#0F1B2E; color:#fff; font-size:13px; font-weight:600; line-height:1.2; padding:8px 12px; border-radius:10px; box-shadow:0 8px 22px -6px rgba(0,0,0,.45); }
  .sb-item .sb-label::before { content:""; position:absolute; left:-5px; top:50%; width:10px; height:10px; background:#0F1B2E; transform:translateY(-50%) rotate(45deg); border-radius:2px; }
  .sb-item:hover .sb-label, .sb-item:focus-visible .sb-label { opacity:1; visibility:visible; transform:translateY(-50%) translateX(0); }
}
@media (min-width:901px) and (max-height:760px) {
  .sidebar { gap:6px; padding:10px 0; }
  .sidebar .sb-brand { width:40px; height:40px; }
  .sb-nav { gap:2px; margin-top:4px; }
  .sb-item { height:46px; }
  .sb-item .chip { width:36px; height:36px; border-radius:11px; }
  .sb-item .chip svg { width:21px; height:21px; }
}
@media (prefers-reduced-motion: no-preference) and (min-width:901px) {
  .sb-item { transition:background-color .18s ease, transform .2s var(--ease-molla); }
  .sb-item .chip { transition:transform .25s var(--ease-molla), box-shadow .25s ease; }
  .sb-item:hover .chip { transform:scale(1.15); box-shadow:0 6px 14px -4px rgba(0,0,0,.4); }
  .sb-item:active .chip { transform:scale(1.03); }
  .sb-item .sb-label { transition:opacity .16s ease, transform .22s var(--ease-molla), visibility 0s linear .16s; }
  .sb-item:hover .sb-label, .sb-item:focus-visible .sb-label { transition-delay:.08s, .08s, 0s; }
}
