body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.admin-layout { flex: 1; display: flex; min-height: 0; }
.admin-side { background: var(--bs-body-bg); }
@media (min-width: 992px) {
  .admin-side { width: 220px; flex: 0 0 220px; border-right: 1px solid var(--bs-border-color); }
}
.admin-side .list-group-item { border: 0; display: flex; justify-content: space-between; align-items: center; }
.admin-side .list-group-item.active { background: var(--bs-primary-bg-subtle); color: var(--bs-emphasis-color); }
.admin-main { flex: 1; min-width: 0; padding: 1rem; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { font-size: .8rem; color: var(--bs-secondary-color); }
.table-admin td, .table-admin th { vertical-align: middle; }
.table-admin .actions { white-space: nowrap; text-align: right; }
.cell-text { max-width: 28rem; white-space: pre-wrap; word-break: break-word; }
.mfa-card { max-width: 420px; margin: 2rem auto; }
.mfa-card img { width: 220px; height: 220px; background: #fff; border-radius: .5rem; }
.secret { font-family: var(--bs-font-monospace); word-break: break-all; }

/* Restyling: menu a sinistra come scheda arrotondata, contenuto sullo sfondo del tema. */
.admin-layout { gap: .75rem; padding: 0 .75rem .75rem; }
.admin-layout .admin-side { background-color: var(--wc-surface) !important; }
@media (min-width: 992px) {
  .admin-side { border-right: 0; border-radius: var(--wc-radius); box-shadow: var(--wc-shadow); padding: .5rem; align-self: flex-start; }
}
.admin-side .list-group-item { border-radius: 12px; margin: 1px 0; font-weight: 600; background: transparent; color: var(--wc-text); }
.admin-side .list-group-item:hover { background: var(--wc-surface-2); }
.admin-side .list-group-item.active { background: var(--wc-accent-soft); color: var(--wc-accent-text); }
.admin-main { padding: 0 .25rem 1rem; }
.admin-main .card { border: 0; border-radius: var(--wc-radius); box-shadow: var(--wc-shadow); }
.stat-card .stat-value { font-weight: 800; color: var(--wc-accent-text); }
.stat-card .stat-label { color: var(--wc-muted); }
.mfa-card img { border-radius: 14px; }
.admin-avatar { width: 1.8rem; height: 1.8rem; border-radius: 50%; object-fit: cover; margin-right: .45rem; vertical-align: middle; }

/* Storie: anteprima piccola nel pannello (sezione Storie e segnalazioni). */
.story-thumb { display: grid; place-items: center; width: 54px; height: 96px; border-radius: 8px; overflow: hidden; background: #1b1f2a; color: #fff; font-size: .62rem; font-weight: 700; text-align: center; padding: 4px; box-sizing: border-box; word-break: break-word; text-decoration: none; }
.story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.story-thumb.muted { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }

/* R-0015 (PROGETTO 11.37, I8): finché il pannello non è aperto (accesso, codice della verifica in due passaggi, accesso
   negato) il menu delle sezioni e il pulsante che lo apre sul telefono non si vedono. */
body.admin-locked #adminNav, body.admin-locked [data-bs-target="#adminNav"] { display: none !important; }

/* R-0018 (PROGETTO 11.38): menu a tendine; stessa grafica delle voci, sottovoci rientrate. */
.admin-side .nav-group-head { width: 100%; text-align: left; }
.nav-group-end { display: inline-flex; align-items: center; gap: .4rem; margin-left: .5rem; }
.nav-chev { flex: 0 0 auto; transition: transform .15s; opacity: .7; }
.nav-group.open .nav-chev { transform: rotate(90deg); }
.nav-group-items { display: none; padding-left: .75rem; }
.nav-group.open .nav-group-items { display: block; }
.nav-group.open .nav-group-badge { display: none !important; }
.admin-side .nav-group.open > .nav-group-head { background: var(--wc-surface-2); }
.plus-icon { border-radius: 12px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
/* R-0086 (T3 di R-0077): la riga nuova del Registro azioni si illumina e poi torna normale */
@keyframes logNew { from { box-shadow: inset 0 0 0 9999px rgba(255, 193, 7, .38); } to { box-shadow: inset 0 0 0 9999px rgba(255, 193, 7, 0); } }
.table-admin tr.log-new > td { animation: logNew 6s ease-out forwards; }
/* R-0102 (A2, tavola P1): la campanella dei nuovi iscritti nel pannello. */
.new-bell { position: relative; }
.new-bell-n { position: absolute; top: -7px; right: -9px; background: #D93A47; color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 6px; line-height: 1.4; }
.new-bell-n.pop { animation: nb-pop .6s ease both; }
@keyframes nb-pop { 0% { transform: scale(.3); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
.new-bell-list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 1060; width: 380px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: 14px; box-shadow: 0 16px 34px rgba(20, 23, 43, .16); }
.new-bell-list .nb-h { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--bs-border-color); font-size: 14px; }
.new-bell-list .nb-h button { border: 0; background: none; color: var(--bs-primary); font-size: 12.5px; padding: 0; }
.new-bell-list .nb-it { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--bs-border-color); background: none; color: inherit; padding: 10px 14px; font-size: 13.5px; }
.new-bell-list .nb-it:first-of-type { border-top: 0; }
.new-bell-list .nb-it.new { background: rgba(75, 85, 214, .07); }
.new-bell-list .nb-it small { display: block; color: var(--bs-secondary-color); font-size: 12px; }
.new-bell-list .nb-none { padding: 14px; color: var(--bs-secondary-color); font-size: 13.5px; }
/* R-0208, pannello Account (24/11, «1b, 2c»): tasti a icona e legenda in cima alla pagina. */
.ibtn { padding: .3rem .45rem; line-height: 1; display: inline-flex; align-items: center; gap: .2rem; }
.ibtn .ibtn-ico { width: 17px; height: 17px; }
.ibtn .ibtn-num { font-size: 12px; }
.ibtn-legenda-box { margin: 0 0 .6rem; }
.ibtn-legenda-box > summary { cursor: pointer; width: max-content; }
.ibtn-legenda { display: flex; flex-wrap: wrap; gap: .3rem .7rem; margin: .4rem 0 0; }
.ibtn-legenda > span { display: inline-flex; align-items: center; gap: .3rem; }
.ibtn-legenda .ibtn-ico { width: 15px; height: 15px; }
