/* ===== Menu 2026-10-14 (approved mock-ups: computer — «sidebar with group rows», phone — «bottom bar + the «Меню» screen»). Loaded after redesign.css.
   Only the shell: the side menu, the phone menu screen, the top bar's brand mark and the bottom bar. Sections, rights, routes, actions and counters are untouched (js/shell.js NAV_MODEL). */

/* ---------- a group row (computer and phone): icon, name, number of sections ---------- */
.side-group.side-grp-row{display:flex;align-items:center;gap:10px;width:100%;box-sizing:border-box;margin:0;padding:8px 10px;border:1px solid transparent;border-radius:10px;
  font:inherit;font-size:14px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--text);line-height:1.25;min-height:38px;}
.side-group.side-grp-row>svg:first-child{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:var(--faint,var(--muted));}
.side-group.side-grp-row>span:first-of-type{flex:1 1 auto;min-width:0;overflow-wrap:anywhere;}
.side-grp-row .grp-cnt{flex:none;font-size:12px;font-weight:500;color:var(--muted);}
.side-grp-row .chev{width:16px;height:16px;flex:none;color:var(--muted);}
/* ---------- computer (> 900 px): captions, a closed group looks like a folder, an open one shows its items on a guide line ---------- */
@media (min-width:901px){
.side-label{font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--faint,var(--muted));padding:6px 10px 2px;}
#sideNav .side-item{min-height:36px;padding:7px 10px;}   /* 2026-10-14: «Обучение» added a row; 2 px less per row keeps the owner's menu whole at 1440×900 */
.side-group.side-grp-row{min-height:36px;padding:7px 10px;}
.side-sep{height:1px;background:var(--border);margin:6px 4px 2px;}
.nav-grp.open>.side-grp-row .grp-cnt{display:none;}                       /* the count says what a closed folder holds; an open one shows the items themselves */
button.side-grp-h.side-grp-row:hover{background:var(--surface-3,var(--bg));color:var(--text);}
.nav-grp:not(.open)>button.side-grp-h{background:var(--surface-2,var(--bg));border-color:var(--border);}   /* a closed group never melts into the plain items around it */
.nav-grp.open>.side-grp-h .chev{transform:rotate(0);}
.nav-grp:not(.open)>.side-grp-h .chev{transform:rotate(-90deg);}
.nav-grp.open>.side-grp-row{margin-bottom:2px;}
.nav-grp.nav-titled.open>.side-grp-body{margin:0 0 6px 19px;padding-left:8px;border-left:2px solid var(--border);}
.nav-grp.nav-titled.open>.side-grp-body .side-item{padding:6px 10px;min-height:34px;}
.nav-grp[data-grp-box="team"]>.side-group{padding-top:8px;}
.nav-grp+.nav-grp{margin-top:2px;}
#sideNav .side-item.side-cta{margin:6px 0 2px;min-height:40px;}
}
.side-search,.side-title,.prof-chip,.mb-mark,.side-item .row-chev{display:none;}
/* a low computer screen (1280×720 and lower): tighter rows, no captions — the whole menu fits without scrolling (the list still scrolls inside when it must) */
@media (min-width:901px) and (max-height:880px){
  #sidebar{padding:10px 12px 12px;}
  .side-label{display:none;}
  .side-sep{margin:4px 4px 2px;}
  .nav-grp.open>.side-grp-row{margin-bottom:0;}
  #sideNav .side-item{min-height:32px;padding:5px 10px;}
  .side-group.side-grp-row{min-height:32px;padding:5px 10px;}
  .nav-grp.nav-titled.open>.side-grp-body .side-item{min-height:30px;padding:4px 10px;}
  #sideNav .side-item.side-cta{min-height:36px;margin:0 0 2px;}
  .side-logo{padding:0 8px 4px;}
  .side-logo img{width:160px;}
  #cabSide{padding:0 0 2px;}
  .side-bottom{margin-top:4px;padding-top:6px;}
  .profile{padding-top:6px;}
}

/* ---------- the list scrolls inside: a shade above the profile while items are left below (#sidebar.nav-more, js/shell.js navMoreMark) ---------- */
.side-bottom{position:relative;}
.side-bottom::before{content:"";position:absolute;left:0;right:0;top:-30px;height:30px;background:linear-gradient(to bottom,transparent,var(--card));pointer-events:none;opacity:0;transition:opacity .15s;}
#sidebar.nav-more .side-bottom::before{opacity:1;}
#sidebar.nav-more .side-bottom{box-shadow:0 -10px 14px -10px rgba(11,27,51,.22);}   /* a soft shadow line too: the gradient alone is hard to see in the dark theme */
:root[data-theme="dark"] #sidebar.nav-more .side-bottom{box-shadow:0 -10px 16px -10px rgba(0,0,0,.75);}
@media (max-width:900px){ .side-bottom::before{background:linear-gradient(to bottom,transparent,var(--bg));} }
@media (forced-colors:active){ .side-bottom::before{display:none;} }

/* ---------- phone (≤ 900 px): the bar is «Обзор · Заполнить · Чаты · Задачи · Меню», the menu is a screen above the page, the bar stays in reach ---------- */
@media (max-width:900px){
  /* the top bar: the brand mark instead of «☰» (the same button: it still opens the menu) */
  #menuBtn{width:44px;height:44px;border:0;background:transparent;border-radius:12px;padding:0;}   /* the tap area stays 44 px; the mark inside is 34 px */
  #menuBtn .mb-burger{display:none;}
  #menuBtn .mb-mark{display:block;width:34px;height:34px;}
  /* the bar: five equal places, the open one in the accent colour (no pill, no line) */
  #bottomNav{padding-top:8px;}
  #bottomNav:not(.bn-big) button.active::after{display:none;}
  #bottomNav:not(.bn-big) .bn-chats .bn-ico{width:22px;height:22px;margin:0;border:0;border-radius:0;background:transparent;color:inherit;}
  #bottomNav:not(.bn-big) .bn-chats .bn-lbl{color:inherit;font-weight:500;}
  #bottomNav:not(.bn-big) .bn-chats.active .bn-ico{background:transparent;border-color:transparent;color:inherit;}
  #bottomNav:not(.bn-big) .bn-chats .nav-badge{top:-7px;left:calc(100% - 9px);}
  #bottomNav button.active .bn-lbl{font-weight:600;}
  body.menu-open #bottomNav{z-index:61;}                                   /* above the menu screen: «Меню» closes it, another place opens its section */
  body.menu-open #sideBackdrop{display:none;}
  /* the menu screen: between the top of the screen and the bar; fades in instead of sliding from the left */
  #sidebar{left:0;right:0;top:0;bottom:var(--bn-h,64px);width:auto;max-width:none;background:var(--bg);border:0;box-shadow:none;
    padding:calc(8px + var(--sat)) 0 0;transform:translateY(100%);opacity:0;pointer-events:none;transition:transform .18s,opacity .18s;}   /* closed: below the screen (as the old sheet stood left of it) — no visibility:hidden, the tests and the focus order treat the closed menu as before */
  body.menu-open #sidebar{transform:none;opacity:1;pointer-events:auto;}
  body.kb-open.menu-open #sidebar{bottom:0;}                               /* the bar steps aside for the keyboard (search): the screen takes its place */
  /* the head: «Меню» and the profile chip; the logo and the close button are not drawn (the bar's «Меню» place closes the screen) */
  .side-logo{display:flex;align-items:center;gap:10px;padding:8px max(16px,var(--sar)) 6px max(16px,var(--sal));}
  .side-logo .brand-logo,.side-close{display:none;}
  .side-title{display:block;flex:1 1 auto;min-width:0;margin:0;font-size:22px;font-weight:700;line-height:1.2;outline:none;}
  .prof-chip{display:inline-flex;align-items:center;gap:8px;max-width:60%;padding:4px 8px 4px 4px;border:1px solid var(--border);border-radius:12px;background:var(--card);color:var(--text);font:inherit;text-align:left;cursor:pointer;min-height:44px;}
  .prof-chip .avatar{width:30px;height:30px;font-size:12px;}
  .prof-chip-t{display:flex;flex-direction:column;min-width:0;}
  .prof-chip-n{font-size:13px;font-weight:600;line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .prof-chip-r{font-size:11px;color:var(--muted);line-height:1.15;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .prof-chip .chev{width:14px;height:14px;flex:none;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;color:var(--muted);}
  .prof-chip.active{border-color:var(--accent);background:var(--accent-soft,var(--bg));}
  /* the search */
  .side-search{display:flex;align-items:center;gap:10px;margin:4px max(16px,var(--sar)) 10px max(16px,var(--sal));padding:0 12px;background:var(--card);border:1px solid var(--border);border-radius:12px;}
  .side-search svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:var(--muted);}
  .side-search input{flex:1 1 auto;min-width:0;min-height:44px;border:0;background:transparent;color:var(--text);font:inherit;font-size:16px;padding:0;outline:none;}
  .side-search input::placeholder{color:var(--muted);}
  .side-search:focus-within{border-color:var(--accent);box-shadow:var(--focus-ring,0 0 0 3px rgba(21,87,255,.25));}
  #sideNav{padding:0 max(16px,var(--sar)) 8px max(16px,var(--sal));}
  .nav-miss{display:none!important;}
  .nav-none,.nav-empty{padding:14px 4px;font-size:14px;line-height:1.4;}
  /* the first block: tiles in two columns (reports, analytics, purchases, my points — what the bar does not hold) */
  .nav-grp.nav-daily::before{content:"Ещё разделы";display:block;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--faint,var(--muted));padding:4px 4px 8px;}
  .nav-grp.nav-daily{padding-top:0;margin-bottom:12px;}
  .nav-grp.nav-daily>.side-grp-body{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .nav-grp.nav-daily .side-item{margin:0;padding:11px 12px;min-height:48px;border:1px solid var(--border);border-radius:12px;background:var(--card);font-weight:500;}
  .nav-grp.nav-daily .side-item svg:first-child{width:20px;height:20px;align-self:center;margin:0;color:var(--faint,var(--muted));}
  .nav-grp.nav-daily .side-item .row-chev{display:none;}
  .nav-grp.nav-daily .side-item.active{border-color:var(--accent);}
  .nav-grp.nav-daily .side-item.side-cta{grid-column:1 / -1;border-color:transparent;background:var(--accent);color:#fff;font-weight:600;}
  .nav-grp.nav-daily .side-item.side-cta svg:first-child{color:#fff;}
  /* the groups: a card with a head row (icon, name, number of sections) and list rows with a chevron */
  .nav-grp.nav-titled{background:var(--card);border:1px solid var(--border);border-radius:14px;overflow:hidden;margin:0 0 10px;}
  .nav-grp.nav-titled+.nav-grp.nav-titled{margin-top:0;}
  .nav-grp.nav-titled>.side-group.side-grp-row{padding:11px 14px;min-height:44px;border:0;border-bottom:1px solid var(--border);border-radius:0;background:var(--surface-2,var(--bg));}
  .nav-grp.nav-titled>.side-grp-row>svg:first-child{color:var(--accent);}
  .nav-grp.nav-titled>.side-grp-row .grp-cnt{display:inline;margin-left:auto;}
  .nav-grp.nav-titled>.side-grp-body{margin:0;padding:0;border:0;}
  .nav-grp.nav-titled .side-item{margin:0;padding:11px 14px;min-height:46px;border-radius:0;border-bottom:1px solid var(--line-2,var(--border));font-weight:500;}
  .nav-grp.nav-titled .side-item:last-child{border-bottom:0;}
  .nav-grp.nav-titled .side-item svg:first-child{width:20px;height:20px;align-self:center;margin:0;}
  .side-item .row-chev{display:block;width:16px;height:16px;flex:none;margin-left:auto;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;color:var(--muted);}
  .side-item .nav-badge+.row-chev{margin-left:8px;}
  .side-item.active .row-chev{color:inherit;}
  /* a group without a name on the phone (e.g. «Мои ПВЗ» alone for a role without the tiles): the same card */
  .nav-grp:not(.nav-titled):not(.nav-daily){background:var(--card);border:1px solid var(--border);border-radius:14px;overflow:hidden;margin:0 0 10px;}
  .nav-grp:not(.nav-titled):not(.nav-daily) .side-item{margin:0;padding:11px 14px;min-height:46px;border-radius:0;}
  /* the foot: the theme and the profile with «Выйти» (the same controls as on the computer) */
  .side-bottom{background:var(--bg);border-top:1px solid var(--border);margin:0;padding:8px max(16px,var(--sar)) 10px max(16px,var(--sal));}
  .side-bottom .theme-sw{background:var(--card);}
}
@media (max-width:900px) and (max-height:600px){ .side-search{margin-bottom:6px;} .side-logo{padding-bottom:2px;} }
@media (forced-colors:active){ .nav-grp:not(.open)>button.side-grp-h{border-color:ButtonText;} .prof-chip,.side-search{border-color:ButtonText;} }
/* 2026-11-06: «Видеонаблюдение» is the longest label of the phone tiles; it must not break inside the word at 360-390 px */
@media(max-width:899px){.nav-grp.nav-daily .side-item[data-nav="video"]{gap:8px;padding-left:10px;padding-right:8px;}.nav-grp.nav-daily .side-item[data-nav="video"]>span{font-size:13.5px;letter-spacing:-.01em;overflow-wrap:normal;word-break:normal;white-space:nowrap;}}
@media(max-width:380px){.nav-grp.nav-daily .side-item[data-nav="video"]>span{font-size:12px;}}
