/* AD App — versione da computer (13 nov 2026, richiesta di Andrea; riferimento: cruscotto «Oasel»).
   Solo schermi da 821 px in su: il telefono resta com'è (barra in basso, css/app.css).
   - stile vetro più CHIARO: fondo grigio caldo sfumato invece del quasi nero, pannelli traslucidi, testi secondari più leggibili
   - campi di testo ben visibili (fondo chiaro, bordo evidente, segnaposto leggibile)
   - pannello di navigazione a sinistra con i nomi delle sezioni (da 1101 px), richiudibile a colonna di icone
   - barra in alto in vetro, staccata dai bordi, con la ricerca più larga
   Accento: il rosso AD (--accento), come da brand book (solo neutri + un accento). */

@media (min-width: 821px) {
  :root {
    --bg: #2b2a27;
    --card: rgba(255, 255, 255, .07); --card-2: rgba(255, 255, 255, .11); --solido: #33312d;
    --line: rgba(255, 255, 255, .12); --line-2: rgba(255, 255, 255, .22);
    --text: #f1efea; --muted: #b9b5ad; --white: #ffffff;
    --vetro: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .045));
    --ombra: inset 0 1px 0 rgba(255, 255, 255, .1), 0 22px 44px -26px rgba(0, 0, 0, .55);
    --pannello-w: var(--binario);
  }
  html, body { background: #2b2a27; }
  /* fondo: grigio caldo con una luce morbida dall'alto e un velo più scuro in basso, come una foto sfocata dietro al vetro */
  body::before {
    background:
      radial-gradient(80% 60% at 30% -10%, rgba(255, 244, 222, .22), transparent 60%),
      radial-gradient(60% 50% at 95% 10%, rgba(214, 205, 186, .14), transparent 65%),
      radial-gradient(70% 55% at 10% 110%, rgba(0, 0, 0, .35), transparent 70%),
      linear-gradient(180deg, #4a4740 0%, #34322e 45%, #262522 100%);
  }

  /* ---------- vetro: pannelli, elenchi, barre ---------- */
  .binario, .cima {
    background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .06)), rgba(40, 38, 35, .55);
    border-color: rgba(255, 255, 255, .14);
    -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
  }
  .pannello, .tile, .colonna, .elenco-prev, .dom, .esempio, .kit-note--pannello, .mb__tassello, .accesso form, .accesso .pannello, .elenco {
    background: var(--vetro), rgba(40, 38, 35, .5); border-color: var(--line);
    -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  }
  dialog.foglio { background: var(--vetro), var(--solido); border-color: var(--line-2); }
  .chips { background: rgba(255, 255, 255, .06); border-color: var(--line); }
  .chip { color: var(--muted); }
  .tasto--leggero { background: rgba(255, 255, 255, .08); border-color: var(--line-2); }
  .tasto--leggero:hover { background: rgba(255, 255, 255, .14); }
  .stato { background: rgba(255, 255, 255, .07); }
  a.riga:hover, a.riga:focus-visible { background: rgba(255, 255, 255, .08); }
  .miniatura { background: #efede8; }

  /* ---------- campi: si devono vedere ---------- */
  input, select, textarea {
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .26); color: var(--text);
  }
  input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .38); }
  input:focus, select:focus, textarea:focus { background: rgba(255, 255, 255, .14); border-color: var(--accento-chiaro); box-shadow: 0 0 0 3px var(--accento-velo); }
  input::placeholder, textarea::placeholder { color: #aeaaa2; opacity: 1; }
  select option { background: #33312d; color: var(--text); }
  input[type="search"] {
    background: rgba(255, 255, 255, .1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9c5bd' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4 4'/%3E%3C/svg%3E") no-repeat 15px 50% / 18px;
    border-color: rgba(255, 255, 255, .26);
  }
  .voce input, .kit-risposta select, .kit-risposta input { background: rgba(255, 255, 255, .1); }
  input[type="range"] { background: transparent; border: 0; box-shadow: none; }
  .campo > span { color: #c7c3bb; }
  /* la fascia della ricerca che resta in alto scorrendo: vetro, non più un nastro scuro */
  .cerca { background: linear-gradient(rgba(52, 50, 46, .82) 65%, rgba(52, 50, 46, 0)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

  /* ---------- barra in alto ---------- */
  .cima { left: calc(var(--pannello-w) + 24px); height: 56px; border-radius: 18px; transition: left .35s var(--esce); }
  .cima .utente { display: none; }   /* chi è collegato sta in fondo al pannello */
  .briciole { color: #c9c5bd; }
  .briciole a { color: #c9c5bd; }
  .cerca-rapida { min-width: 340px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .24); color: #d6d2ca; }
  .cerca-rapida:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .36); color: #fff; }
  .cerca-rapida kbd { border-color: rgba(255, 255, 255, .3); color: #d6d2ca; }
  .rete { background: rgba(255, 255, 255, .08); border-color: var(--line); }
  .nuovo-rapido { margin-right: 4px; }

  /* ---------- pannello: testata e scheda dell'utente (nascoste nella colonna di icone) ---------- */
  .pannello-testa { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
  .nome-app, .profilo-testo { display: none; }
  .richiudi { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06);
    color: #d6d2ca; cursor: pointer; transition: background .2s, color .2s; }
  .richiudi:hover { background: rgba(255, 255, 255, .14); color: #fff; }
  .richiudi svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  .profilo { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding-top: 10px; border-top: 1px solid var(--line); }
  .profilo .tasto { min-height: 32px; width: 36px; padding: 0; display: grid; place-items: center; border: 0; color: #c9c5bd; background: transparent; }
  .profilo .tasto:hover { color: #fff; background: rgba(255, 255, 255, .1); }
  .sezioni { border-top-color: var(--line); }
  .sezioni a { color: #c9c5bd; }
  .sezioni a:hover { background: rgba(255, 255, 255, .09); }
  .conta { box-shadow: 0 0 0 2px #3a3833; }

  /* il contenuto parte subito accanto al pannello (anche sugli schermi larghi) */
  main { margin: 0 auto 0 calc(var(--pannello-w) + 24px); padding-left: var(--g); padding-right: var(--g); max-width: 1360px;
    transition: margin-left .35s var(--esce); }
}

/* ---------- pannello aperto con i nomi: da 1101 px, se non è stato richiuso ---------- */
@media (min-width: 1101px) {
  :root:not(.pannello-chiuso) { --pannello-w: 248px; }
  .binario { transition: width .35s var(--esce); }
  :root:not(.pannello-chiuso) .binario { width: var(--pannello-w); align-items: stretch; padding: 14px 12px; }
  :root:not(.pannello-chiuso) .pannello-testa { flex-direction: row; gap: 11px; padding: 0 2px 4px; }
  :root:not(.pannello-chiuso) .nome-app { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
  :root:not(.pannello-chiuso) .nome-app b { font-size: 15.5px; font-weight: 500; color: #fff; white-space: nowrap; letter-spacing: .01em; }
  :root:not(.pannello-chiuso) .nome-app small { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
  :root:not(.pannello-chiuso) .richiudi { margin-left: auto; flex: none; }

  :root:not(.pannello-chiuso) .sezioni { align-items: stretch; gap: 4px; padding-top: 12px; }
  :root:not(.pannello-chiuso) .sezioni a { display: flex; align-items: center; justify-content: flex-start; gap: 13px; width: 100%; height: 44px; padding: 0 12px;
    border-radius: 13px; font-size: 15px; }
  :root:not(.pannello-chiuso) .sezioni .testo { position: static; transform: none; opacity: 1; padding: 0; background: none; box-shadow: none; color: inherit;
    font-size: 15px; font-weight: 400; letter-spacing: .01em; pointer-events: none; }
  :root:not(.pannello-chiuso) .sezioni a[aria-current] .testo { font-weight: 500; }
  :root:not(.pannello-chiuso) .sezioni .conta { position: static; margin-left: auto; box-shadow: none; }
  :root:not(.pannello-chiuso) .sezioni a[data-sez="codice"] { margin-top: auto; }
  /* la voce attiva: pillola rossa piena, come la voce scelta nel riferimento */
  :root:not(.pannello-chiuso) .sezioni .pillola { background: linear-gradient(180deg, rgba(255, 90, 76, .5), rgba(217, 47, 37, .38)); border-color: rgba(255, 120, 106, .55); }
  :root:not(.pannello-chiuso) .sezioni .pillola::before { display: none; }

  :root:not(.pannello-chiuso) .profilo { flex-direction: row; gap: 10px; padding: 12px 4px 2px; }
  :root:not(.pannello-chiuso) .profilo-testo { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
  :root:not(.pannello-chiuso) .profilo-nome { font-size: 14px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  :root:not(.pannello-chiuso) .profilo-ruolo { font-size: 12px; color: var(--muted); }
  :root:not(.pannello-chiuso) .profilo .tasto { margin-left: auto; }
}
/* il tasto per riaprire serve solo dove il pannello largo esiste */
@media (min-width: 821px) and (max-width: 1100px) { .richiudi { display: none; } }
@media (max-width: 820px) { .pannello-testa .nome-app, .richiudi, .profilo { display: none !important; } .pannello-testa { display: contents; } }
@media (prefers-reduced-motion: reduce) { .binario, .cima, main { transition: none !important; } }
