.app-nav{position:fixed;inset:0 auto 0 0;z-index:25;display:flex;width:64px;flex-direction:column;gap:12px;overflow:hidden;padding:14px 9px;border-right:1px solid var(--line);background:var(--panel);box-shadow:2px 0 12px rgba(0,0,0,.08);transition:width .18s ease}
.app-nav[hidden]{display:none}
.app-nav [hidden]{display:none!important}
.app-nav-mobile-bar,.app-nav-backdrop{display:none}
.app-nav:hover,.app-nav:focus-within,.app-nav.is-open{width:238px}
.app-nav-head{display:flex;align-items:center;gap:11px;min-height:42px;padding:0 3px}
.app-nav-toggle,.app-nav-brand-mark{display:grid;width:38px;height:38px;flex:none;place-items:center;border:0;border-radius:11px;background:var(--brand);color:#fff;font-size:13px;font-weight:750}
.app-nav-toggle{position:relative;cursor:pointer}
.app-nav-toggle img{position:absolute;inset:0;z-index:1;width:100%;height:100%;padding:5px;border-radius:inherit;object-fit:contain}
.app-nav-toggle img[hidden]{display:none}
.app-nav-brand{overflow:hidden;color:var(--ink);font-size:16px;font-weight:750;white-space:nowrap}
.app-nav-section{overflow:hidden;max-height:14px;padding:5px 8px 0;color:var(--mute);font-size:9px;font-weight:700;letter-spacing:.1em;opacity:0;text-transform:uppercase;white-space:nowrap}
.app-nav:hover .app-nav-section,.app-nav:focus-within .app-nav-section,.app-nav.is-open .app-nav-section{opacity:1}
.app-nav-list{display:grid;gap:4px}
.app-nav-link{display:flex;align-items:center;gap:11px;min-width:0;min-height:42px;padding:6px;border-radius:9px;color:var(--mute);font-size:13px;font-weight:550;text-decoration:none;white-space:nowrap}
.app-nav-link:hover{background:var(--bg);color:var(--ink)}
.app-nav-link[aria-current=page]{background:var(--out,var(--bg));color:var(--brand);font-weight:700}
.app-nav-icon{display:grid;width:38px;height:38px;flex:none;place-items:center;border:1px solid var(--line);border-radius:11px;background:var(--panel);color:inherit}
.app-nav-icon svg{display:block;width:20px;height:20px}
.app-nav-link[aria-current=page] .app-nav-icon{border-color:transparent;background:var(--brand);color:#fff}
.app-nav-label,.app-nav-profile-copy,.app-nav-footer-label{overflow:hidden;max-width:0;opacity:0;transition:max-width .18s ease,opacity .12s ease}
.app-nav:hover .app-nav-label,.app-nav:hover .app-nav-profile-copy,.app-nav:hover .app-nav-footer-label,.app-nav:focus-within .app-nav-label,.app-nav:focus-within .app-nav-profile-copy,.app-nav:focus-within .app-nav-footer-label,.app-nav.is-open .app-nav-label,.app-nav.is-open .app-nav-profile-copy,.app-nav.is-open .app-nav-footer-label{max-width:180px;opacity:1}
.app-nav-spacer{flex:1}
.app-nav-profile{display:flex;align-items:center;gap:10px;min-height:52px;padding:8px 3px 4px;border-top:1px solid var(--line)}
.app-nav-avatar{display:grid;width:38px;height:38px;flex:none;place-items:center;border-radius:50%;background:var(--out,var(--bg));color:var(--brand);font-size:13px;font-weight:700}
.app-nav-profile-copy{display:grid;min-width:0;gap:2px;white-space:nowrap}
.app-nav-profile-copy strong{overflow:hidden;color:var(--ink);font-size:12px;text-overflow:ellipsis}
.app-nav-profile-copy small{color:var(--mute);font-size:11px}
.app-nav-footer{display:grid;gap:4px}
.app-nav-footer button{display:flex;align-items:center;gap:11px;min-width:0;min-height:42px;padding:6px;border:0;background:transparent;color:var(--mute);text-align:left}
.app-nav-footer button:hover{background:var(--bg);color:var(--ink)}
.app-nav-footer .app-nav-icon{background:transparent}
body.with-app-nav #app{width:calc(100% - 64px);margin-left:64px}
body.with-app-nav #usersPage{width:calc(100% - 64px);margin-left:64px}
body.with-app-nav.dashboard-page{padding-left:88px}
@media(hover:none),(max-width:850px){
 .app-nav-mobile-bar{position:fixed;inset:0 0 auto;z-index:60;display:flex;height:56px;align-items:center;gap:12px;padding:5px 12px;border-bottom:1px solid var(--line);background:var(--panel);color:var(--ink);box-shadow:0 2px 10px rgba(0,0,0,.08)}
 .app-nav-mobile-bar[hidden]{display:none}
 .app-nav-mobile-bar strong{font-size:15px}
 .app-nav-mobile-toggle{display:grid;width:44px;height:44px;align-content:center;justify-items:center;gap:5px;padding:0;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--ink);cursor:pointer}
 .app-nav-mobile-toggle span{width:20px;height:2px;border-radius:2px;background:currentColor;transition:transform .18s ease,opacity .18s ease}
 .app-nav-mobile-toggle.is-open span:first-child{transform:translateY(7px) rotate(45deg)}
 .app-nav-mobile-toggle.is-open span:nth-child(2){opacity:0}
 .app-nav-mobile-toggle.is-open span:last-child{transform:translateY(-7px) rotate(-45deg)}
 .app-nav-backdrop{position:fixed;inset:56px 0 0;z-index:50;display:block;width:100%;height:auto;padding:0;border:0;border-radius:0;background:rgba(0,0,0,.42)}
 .app-nav-backdrop[hidden]{display:none}
 .app-nav{inset:56px auto 0 0;z-index:55;width:min(300px,calc(100vw - 52px));gap:14px;overflow-x:hidden;overflow-y:auto;padding:14px 12px calc(14px + env(safe-area-inset-bottom));border-right:1px solid var(--line);box-shadow:4px 0 22px rgba(0,0,0,.18);transform:translateX(-105%);transition:transform .2s ease}
 .app-nav:hover,.app-nav:focus-within,.app-nav.is-open{width:min(300px,calc(100vw - 52px))}
 .app-nav.is-open{transform:translateX(0)}
 .app-nav-head{min-height:46px}
 .app-nav-section{display:block;max-height:none;opacity:1}
 .app-nav-link{min-height:46px;padding:5px}
 .app-nav-icon{width:38px;height:38px}
 .app-nav-label,.app-nav-profile-copy,.app-nav-footer-label{max-width:200px;opacity:1}
 body.with-app-nav #app{position:relative;width:100%;height:calc(100dvh - 56px);margin:56px 0 0}
 body.with-app-nav #usersPage{width:100%;height:calc(100dvh - 56px);margin:56px 0 0}
 body.with-app-nav.dashboard-page{padding:70px 14px 14px}
 body.with-app-nav.section-page #usersModal,
 body.with-app-nav.section-page #assignUsersModal,
 body.with-app-nav.section-page #groupsModal,
 body.with-app-nav.section-page #webClientsModal,
 body.with-app-nav.section-page #settingsModal,
 body.with-app-nav.section-page #newChatModal,
 body.with-app-nav.section-page #templateParameterModal,
 body.with-app-nav.section-page #qrModal{inset:56px 0 0;padding:10px}
 body.with-app-nav #usersPage .users-page-main{padding-top:20px}
}
@media(max-width:700px){
 body.with-app-nav #app.chat aside,
 body.with-app-nav #app.chat main{inset:0}
 body.with-app-nav #app.chat aside>header{padding-left:64px}
}
@media(prefers-reduced-motion:reduce){.app-nav,.app-nav-label,.app-nav-profile-copy,.app-nav-footer-label,.app-nav-mobile-toggle span{transition:none}}
