/* APP SHELL: desktop sidebar, shared header, and six-link mobile bottom bar. */
.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: 2.5rem; padding: 2rem 1.1rem 1.5rem; background: var(--navigation); border-right: 1px solid var(--border); overflow-y: auto; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--text); font-size: 1.4rem; font-weight: 750; line-height: 1.1; text-decoration: none; }
.brand-mark { width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; color: var(--link); border: 1px solid var(--border); border-radius: .85rem; background: var(--surface); }
.brand-tagline { display: block; color: var(--muted); font-size: .68rem; font-weight: 450; margin-top: .35rem; }
.main-nav { display: grid; gap: .45rem; }
.nav-link { display: flex; align-items: center; gap: .8rem; min-height: 3rem; color: var(--muted); padding: .7rem .9rem; border-radius: .8rem; text-decoration: none; font-size: .9rem; font-weight: 550; border: 1px solid transparent; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.is-active { background: var(--surface); color: var(--link); border-color: var(--border); font-weight: 700; }
.sidebar-footer { margin-top: auto; padding: .8rem; color: var(--muted); font-size: .75rem; }
.admin-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; }
.admin-link .icon { width: .9rem; height: .9rem; }
.workspace { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 5.5rem; padding: 1rem clamp(1.25rem, 4vw, 3rem); border-bottom: 1px solid var(--border); }
.section-label { display: grid; gap: .05rem; font-size: .85rem; }
.section-label span { color: var(--muted); font-size: .65rem; }
.section-label strong { font-weight: 650; }
.mobile-brand { display: none; }
.topbar-actions { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.account-chip { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.avatar-initial { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--surface); color: var(--link); border: 1px solid var(--border); font-size: .85rem; font-weight: 700; flex-shrink: 0; }
.account-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14ch; font-size: .8rem; color: var(--muted); }
.signout-form { margin: 0; }
.signout-button .icon { width: 1rem; height: 1rem; }
.page-content { width: 100%; max-width: var(--content-width); margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem); flex: 1; min-width: 0; }
.workspace-footer { padding: 0 1.5rem 1.5rem; text-align: center; color: var(--muted); font-size: .7rem; }
.access-layout .app-shell { display: block; }
.access-layout .workspace { min-height: 100vh; min-height: 100dvh; }
.access-layout .topbar { max-width: var(--content-width); width: 100%; margin: auto; border-bottom: 0; }
.access-layout .page-content { padding-top: .75rem; }
@media (max-width: 900px) and (min-width: 761px) {
  :root { --sidebar-width: 12.5rem; }
  .sidebar { padding-inline: .7rem; }
  .account-name { display: none; }
  .topbar { padding-inline: 1.5rem; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .workspace { min-height: 100vh; min-height: 100dvh; }
  .sidebar { display: contents; }
  .sidebar-brand, .sidebar-footer, .section-label { display: none; }
  .mobile-brand { display: inline-flex; font-size: 1.2rem; }
  .topbar { min-height: 4.5rem; padding: .85rem 1rem; gap: .5rem; }
  .topbar-actions { gap: .5rem; }
  .account-name { display: none; }
  .main-nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .15rem; min-height: var(--mobile-nav-height); padding: .45rem .4rem calc(.45rem + env(safe-area-inset-bottom, 0px)); background: var(--navigation); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px #00000008; }
  .nav-link { flex-direction: column; justify-content: center; gap: .2rem; min-height: 3.5rem; padding: .3rem .1rem; font-size: .65rem; border-radius: .65rem; }
  .nav-link .icon { width: 1.2rem; height: 1.2rem; }
  .page-content { padding: 1.5rem 1rem; }
  .app-layout .workspace-footer { padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 1.25rem); }
  .access-layout .page-content { padding-top: .25rem; }
}
@media (max-width: 420px) {
  .signout-label { display: none; }
  .signout-button { width: 2.75rem; padding: .5rem; }
  .topbar-actions { gap: .35rem; }
  .theme-picker-compact select { width: 5.35rem; }
  .account-chip .avatar-initial { width: 1.9rem; height: 1.9rem; }
  .access-brand { font-size: 1.2rem; gap: .5rem; }
  .access-brand .brand-mark { width: 2rem; height: 2rem; }
}
