/* Navigazione per attività: un livello di gruppi, identità comune e pannello mobile. */
.sidebar { width: 256px; padding: 22px 18px 18px; height: 100dvh; }
.main-shell { margin-left: 256px; }
.sidebar-heading { display: flex; justify-content: center; position: relative; }
.sidebar .brand { width: 100%; gap: 8px; text-decoration: none; }
.sidebar .brand-logo { width: 128px; }
.sidebar .brand-caption { font: 700 12px/1.45 "Segoe UI",sans-serif; letter-spacing: 1.15px; text-align: center; color: var(--green); }
#navigation { display: flex; flex-direction: column; gap: 15px; margin: 24px 0 20px; overflow: visible; flex-shrink: 0; }
#navigation ul { list-style: none; padding: 0; margin: 3px 0 0 8px; border-left: 1px solid var(--line); }
#navigation li { margin: 2px 0; }
#navigation a { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 9px 12px; font-size: 14px; line-height: 1.4; white-space: normal; border-radius: 8px; }
#navigation .nav-create { justify-content: center; gap: 8px; background: var(--green); color: white; font-weight: 600; margin-bottom: 3px; border: 1px solid var(--green); }
#navigation .nav-create:hover { background: #1b4630; }
.nav-group h2 { margin: 0; line-height: 1; }
.nav-group h2 button { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; min-height: 38px; border: 0; border-radius: 6px; background: transparent; color: #55594f; text-align: left; font: 650 12px/1.4 "Segoe UI",sans-serif; letter-spacing: .3px; }
.nav-group h2 button:hover { background: #f3f5ef; }
.nav-group:has(a.active) h2 button { color: var(--green); }
.nav-chevron { border-right: 1.5px solid; border-bottom: 1.5px solid; width: 6px; height: 6px; transform: rotate(-45deg); margin-right: 3px; flex-shrink: 0; }
[aria-expanded="true"] > .nav-chevron { transform: rotate(45deg); margin-top: -3px; }
.nav-current-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; margin-left: 8px; }
.sidebar-bottom { display: flex; flex-direction: column; position: static; margin-top: auto; padding-top: 16px; gap: 2px; }
.sidebar-bottom .account-label { font-size: 11px; color: var(--muted); margin: 0 0 7px; }
.sidebar-bottom #user-name { font-size: 14px; }
.sidebar-bottom #user-role { display: block; font-size: 12px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 0 13px; margin-top: 8px; }
.account-actions .text-button { min-height: 34px; padding: 5px 0; font-size: 12px; text-align: left; }
.account-actions #security-button, .account-actions #password-button { display: block; }
.account-actions #logout { color: var(--muted); }
.account-actions .account-active { color: var(--green); font-weight: 700; text-decoration: underline; }
.topbar { gap: 18px; min-height: 74px; height: auto; padding-top: 12px; padding-bottom: 12px; }
.app-heading { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.app-title { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 1px; }
#navigation-context { font-size: 14px; color: var(--ink); }
#menu-toggle, #menu-close { display: none; }
#navigation-drawer { padding: 0; }
.login-card h1 { font-family: "Segoe UI",sans-serif; font-size: 23px; font-weight: 700; line-height: 1.4; letter-spacing: .7px; }
.login-card .login-logo { margin-bottom: 20px; }
@media (min-width: 721px) and (max-width: 1050px) {
 .sidebar { width: 224px; padding: 20px 14px 16px; }
 .main-shell { margin-left: 224px; }
}
@media (max-width: 720px) {
 .app-shell > .sidebar { display: none; }
 .main-shell { margin-left: 0; }
 .topbar { padding: 12px 18px; gap: 12px; align-items: center; }
 .app-heading { flex: 1; }
 .app-title { font-size: 10px; letter-spacing: .5px; }
 #navigation-context { font-size: 12px; }
 #today-label { display: none; }
 #menu-toggle { display: inline-flex; gap: 7px; align-items: center; padding: 10px; font-size: 13px; background: white; flex-shrink: 0; }
 #menu-close { display: block; font-size: 24px; min-width: 42px; min-height: 42px; padding: 0; position: absolute; top: 0; right: 0; }
 #navigation-drawer { width: min(340px,calc(100% - 32px)); max-width: none; height: 100dvh; max-height: 100dvh; margin: 0 auto 0 0; border: 0; border-radius: 0; overflow-y: auto; }
 #navigation-drawer::backdrop { background: #20392c66; }
 #navigation-drawer .sidebar { display: flex; flex-direction: column; position: static; width: 100%; height: auto; min-height: 100%; padding: 20px 18px; overflow: visible; }
 #navigation-drawer .brand { align-items: center; }
 #navigation { margin-top: 20px; gap: 14px; }
 #navigation a { min-height: 44px; padding: 10px 12px; }
 .nav-group h2 button { min-height: 42px; font-size: 13px; }
 .sidebar-bottom { max-width: none; align-self: stretch; text-align: left; }
 .sidebar-bottom #user-name, .sidebar-bottom #user-role { grid-column: auto; }
 .sidebar-bottom #security-button { text-align: left; }
 body.navigation-open { overflow: hidden; }
 footer { gap: 12px; flex-wrap: wrap; font-size: 10px; }
}
