/* Боковое меню: CRM, Аналитика, База знаний, настройки; сворачивается до иконок */
.shell { display: flex; min-height: 100vh; }
.shell > .page { flex: 1; min-width: 0; }
.sidebar { flex: none; width: 232px; height: 100vh; position: sticky; top: 0; background: #fff; display: flex; flex-direction: column;
           padding: 14px 10px; gap: 6px; border-right: 1px solid #e1e6ec; transition: width .15s ease; z-index: 20; }
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
.sb-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 17px; }
.sb-brand .mark { width: 36px; height: 36px; font-size: 11.5px; }
.sb-toggle { width: 32px; height: 32px; border-radius: 10px; border: none; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.sb-toggle:hover { background: var(--soft); color: var(--text); }
.sb-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.sb-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #3d4350; text-decoration: none;
           font-size: 14px; border: none; background: none; width: 100%; cursor: pointer; text-align: left; white-space: nowrap; }
.sb-item svg { flex: none; }
.sb-item:hover { background: var(--soft); color: var(--text); }
.sb-item.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.sb-n { margin-left: auto; background: #2a78d6; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; line-height: 18px; }
.sb-sep { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; padding: 14px 12px 4px; }
.sb-bottom { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.sb-me .sb-text { display: flex; flex-direction: column; min-width: 0; }
.sb-me b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.sb-me small { font-size: 11px; color: var(--muted); }
.sb-out { color: var(--muted); }

/* свёрнутое меню: только иконки, подписи — подсказками */
.shell.collapsed .sidebar { width: 68px; }
.shell.collapsed .sb-text, .shell.collapsed .sb-n, .shell.collapsed .sb-sep { display: none; }
.shell.collapsed .sb-top { flex-direction: column; gap: 8px; padding-bottom: 6px; }
.shell.collapsed .sb-toggle svg { transform: rotate(180deg); }
.shell.collapsed .sb-item { justify-content: center; padding: 10px 0; position: relative; }
.shell.collapsed .sb-nav .sb-item.on::after { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }

/* заголовок разделов без шапки «Сделки» */
.hd-simple .hd-title { font-size: 24px; }

@media (max-width: 900px) {
  .sidebar { width: 68px; }
  .sb-text, .sb-n, .sb-sep { display: none; }
  .sb-top { flex-direction: column; gap: 8px; }
  .sb-toggle { display: none; }
  .sb-item { justify-content: center; padding: 10px 0; }
}

/* база знаний */
.kb { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.kb-cats { padding: 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 14px; }
.kb-search { margin-bottom: 8px; }
.kb-cat { display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: #3d4350; font-size: 14px; }
.kb-cat span { color: var(--faint); font-size: 12px; }
.kb-cat:hover { background: var(--soft); color: var(--text); }
.kb-cat.on { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.kb-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); min-height: 150px; }
.kb-card:hover { color: var(--text); box-shadow: 0 4px 16px rgba(20,30,50,.10); }
.kb-card b { font-size: 15px; }
.kb-card-cat { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.kb-card-text { font-size: 13px; color: var(--muted); line-height: 1.45; flex: 1; }
.kb-article { max-width: 860px; padding: 26px 30px; }
.kb-article h1 { font-size: 26px; margin: 6px 0 6px; }
.kb-body { margin-top: 18px; font-size: 15px; line-height: 1.65; }
.kb-body h2 { font-size: 18px; margin: 22px 0 6px; }
.kb-body ul { padding-left: 22px; }
@media (max-width: 900px) { .kb { grid-template-columns: 1fr; } .kb-cats { position: static; } }

/* разделитель обращений в одном диалоге */
.session-sep { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; color: var(--accent-dark); font-size: 12px; font-weight: 700; }
.session-sep::before, .session-sep::after { content: ''; flex: 1; height: 1px; background: #cfe3df; }

/* logo: emblem | bar | name + system (variant 9) */
.sb-brand { gap: 10px; }
.sb-em { width: 36px; aspect-ratio: 240 / 130; background: #e02020; flex: none;
         -webkit-mask: var(--emblem) center / contain no-repeat; mask: var(--emblem) center / contain no-repeat; }
.sb-bar { width: 3px; height: 32px; border-radius: 2px; background: var(--accent); flex: none; }
.sb-names { display: flex; flex-direction: column; line-height: 1.15; }
.sb-names b { font-weight: 800; font-size: 15px; color: var(--text); }
.sb-names small { font-weight: 500; font-size: 13px; color: var(--muted); }

/* line status */
.sb-line { padding: 4px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sb-line-state { display: flex; align-items: center; gap: 8px; padding: 4px 12px 6px; font-size: 13px; font-weight: 600; }
.sb-line-state i, .line-chip i { width: 9px; height: 9px; border-radius: 50%; background: #9aa1ad; flex: none; display: inline-block; }
.st-online i { background: #1c8a4a; }
.st-break i { background: #eda100; }
.st-off i, .st-vacation i, .st-dayoff i { background: #9aa1ad; }
.sb-line-btns { display: flex; gap: 4px; padding: 0 8px; }
.sb-line-btns button { flex: 1; border: none; background: var(--soft); border-radius: 9px; padding: 6px 4px; font-size: 11.5px; cursor: pointer; color: #3d4350; }
.sb-line-btns button:hover { background: #e6ebf0; }
.sb-line-btns button.on { background: var(--accent); color: #fff; font-weight: 600; }
.shell.collapsed .sb-line-state { justify-content: center; padding: 6px 0; }
.line-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.wd { display: inline-flex; align-items: center; gap: 2px; margin-right: 6px; font-size: 12px; }

/* manager cabinet */
.cab { display: flex; flex-direction: column; gap: 14px; max-width: 1100px; }
.cab-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.cab-head h2 { margin: 0; font-size: 17px; }
.cab-note { font-size: 13px; line-height: 1.5; margin: 0 0 12px; }
.cab-badge { font-size: 12.5px; font-weight: 600; background: var(--ok-bg); color: var(--ok); border-radius: 14px; padding: 4px 12px; }
.cab-badge.wk { background: #fff3d6; color: #6b4a00; }
.cab-now { padding: 18px 20px; }
.cab-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-top: 8px; }
.cab-person { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 14px; padding: 10px 12px; }
.cab-name { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 13px; }
.cab-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cab-open { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--muted); }
.cab-person.st-off, .cab-person.st-dayoff, .cab-person.st-vacation { opacity: .65; }
.cab-window { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cab-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.cab-range .pill { background: var(--soft); }
tr.cab-cur td { background: #fffaf0; }
