/* Боковое меню: 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); white-space: normal; line-height: 1.35; }
.sb-me small.sb-adm { color: var(--accent-dark); font-weight: 600; }
.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-sick i, .st-leave i, .st-dayoff i, .st-late 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; flex-direction: column; gap: 8px; background: var(--soft); border-radius: 14px; padding: 10px 12px; }
.cab-row { display: flex; align-items: center; gap: 10px; }
.dc-ph.cab { width: 32px; height: 32px; font-size: 11px; }
.cab-line { display: flex; gap: 4px; }
.cab-line button { flex: 1; border: none; background: var(--panel); border-radius: 9px; padding: 5px 4px; font: inherit; font-size: 11.5px; cursor: pointer; color: #3d4350; }
.cab-line button:hover { background: #e4e9ef; }
.cab-line button.on { background: var(--accent); color: #fff; }
.cab-line-note { font-size: 11.5px; padding: 4px 0; }
.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-row, .cab-person.st-dayoff .cab-row, .cab-person.st-vacation .cab-row, .cab-person.st-sick .cab-row, .cab-person.st-leave .cab-row, .cab-person.st-late .cab-row { 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; }

/* кабинет: вкладки и календарь дежурств («мягкие плитки») */
.cab-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.cab-tabs a { padding: 8px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; background: var(--panel); }
.cab-tabs a.on { background: var(--accent); color: #fff; }
.dc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.dc-head h2 { margin: 0; font-size: 18px; min-width: 150px; }
.dc-nav { display: flex; gap: 6px; }
.dc-btn { display: grid; place-items: center; min-width: 32px; height: 32px; border-radius: 10px; background: var(--soft); color: var(--text); text-decoration: none; font-size: 16px; }
.dc-btn.wide { padding: 0 12px; font-size: 13px; font-weight: 600; }
.dc-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.dc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dc-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--soft); box-shadow: inset 0 0 0 1px #d8dee5; }
.dc-dot.none { background: none; box-shadow: none; }
.dc-dot.wk { background: #fff6e5; box-shadow: inset 0 0 0 1px #f0dcb4; }
.dc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.dc-wd { margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.dc-wd .wk { color: #8a5a00; }
.dc-day { background: var(--soft); border-radius: 14px; padding: 10px; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; min-width: 0; }
.dc-day.wk { background: #fff6e5; }
.dc-day:not(.past):hover { box-shadow: inset 0 0 0 1px #c9d2db; }
.dc-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dc-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.dc-day.out { opacity: .45; }
.dc-day.past { cursor: default; }
.dc-day.past:not(.out) .dc-who { opacity: .7; }
.dc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.dc-top b { font-size: 14px; }
.dc-now { font-size: 11px; font-weight: 700; color: var(--accent); }
.dc-sub { font-size: 11px; color: #8a5a00; }
.dc-who { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; font-weight: 600; min-width: 0; }
.dc-who span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-ph { width: 26px; height: 26px; border-radius: 50%; flex: none; object-fit: cover; display: inline-grid; place-items: center;
         background: var(--accent-ring); color: var(--accent-dark); font-size: 10px; font-weight: 700; }
.dc-ph.sm { width: 22px; height: 22px; font-size: 9px; }
.dc-count { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.dc-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 20px; padding: 3px 10px 3px 3px; font-size: 12px; font-weight: 600; }
.dc-chip b { color: var(--accent); }
.dc-hint { font-size: 12px; }
.dc-sum { display: flex; gap: 12px; align-items: baseline; cursor: pointer; list-style: none; }
.dc-sum::-webkit-details-marker { display: none; }
.dc-pop { position: fixed; z-index: 50; background: var(--panel); border-radius: 14px; box-shadow: 0 8px 30px rgba(16, 24, 40, .18); padding: 6px; min-width: 240px; max-height: 60vh; overflow: auto; }
.dc-pop-h { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; }
.dc-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; text-align: left; padding: 7px 10px; border-radius: 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.dc-pop button:hover { background: var(--soft); }
.dc-pop .dc-clear { color: var(--muted); border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; margin-top: 4px; }
@media (max-width: 700px) {
  .dc-grid { gap: 4px; }
  .dc-day { padding: 6px; min-height: 64px; border-radius: 10px; }
  .dc-who span:last-child { display: none; }
}

/* кабинет: общий график — сотрудники строками, дни месяца столбцами */
.schedule-count { margin-left: auto; font-size: 12px; }
.schedule-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.schedule-period-title { margin-right: 4px; font-size: 18px; font-weight: 700; color: var(--text); }
.schedule-period label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.schedule-period .input { width: 150px; min-height: 0; padding: 7px 9px; }
.schedule-modes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.schedule-mode { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 12px; padding: 7px 13px 7px 8px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
                 transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease; }
.schedule-mode > span { display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; background: var(--soft); color: var(--text); font-size: 11px; font-weight: 800; transition: background-color .16s ease, color .16s ease; }
.schedule-mode:hover { box-shadow: 0 3px 10px rgba(20, 30, 50, .08); transform: translateY(-1px); }
.schedule-mode:active { transform: translateY(0); }
.schedule-mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.schedule-mode.on[data-mode="vacation"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }
.schedule-mode.on[data-mode="vacation"] > span { background: var(--accent); color: #fff; }
.schedule-mode.on[data-mode="duty"] { border-color: #d99a00; background: #fff6e5; color: #8a5a00; }
.schedule-mode.on[data-mode="duty"] > span { background: #d99a00; color: #fff; }
.schedule-mode.on[data-mode="sick"] { border-color: #b3261e; background: #fde8e8; color: #8f1d17; }
.schedule-mode.on[data-mode="sick"] > span { background: #b3261e; color: #fff; }
.schedule-mode.on[data-mode="leave"] { border-color: #7c3aed; background: #ede9fe; color: #5b21b6; }
.schedule-mode.on[data-mode="leave"] > span { background: #7c3aed; color: #fff; }
.schedule-mode[data-mode="leave"] > span { font-size: 9px; }
.schedule-hint { min-height: 18px; margin: 4px 0 12px; font-size: 12.5px; transition: color .16s ease; }
.vc-scroll { overflow-x: auto; padding-bottom: 6px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #c6d0d9 transparent; }
.vc { display: grid; gap: 4px 0; align-items: center; min-width: 980px; transition: opacity .16s ease; }
.vc.saving { opacity: .6; pointer-events: none; }
.vc-corner { position: sticky; left: 0; z-index: 4; align-self: stretch; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 0; background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.vc-corner small { font-size: 10px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.vc-h { display: flex; flex-direction: column; align-items: center; font-size: 10.5px; color: var(--muted); padding-bottom: 2px; font-variant-numeric: tabular-nums; }
.vc-h b { font-size: 12px; color: var(--text); font-weight: 600; }
.vc-mon { height: 12px; color: var(--accent); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.vc-h.wk, .vc-h.wk b { color: #8a5a00; }
.vc-h.today b { color: #fff; background: var(--accent); border-radius: 7px; padding: 0 5px; }
.vc-who { position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; min-width: 0; padding-right: 8px; background: var(--panel); }
.vc-corner, .vc-who { border-right: 1px solid var(--line); }
.vc-person { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.vc-person b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.vc-c { position: relative; display: grid; place-items: center; height: 30px; background: var(--soft); margin: 0 1px; border-radius: 6px; cursor: pointer;
        transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease; }
.vc-c.wk { background: #fff6e5; }
.vc-c:hover { box-shadow: inset 0 0 0 1px #aebac5, 0 2px 5px rgba(20, 30, 50, .08); }
.vc-c:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.vc-c.today { box-shadow: inset 0 0 0 2px var(--accent); }
.vc-mark { font-size: 11px; line-height: 1; font-weight: 800; pointer-events: none; animation: vc-mark-in .18s ease-out; }
.vc-c.on { background: var(--accent-soft); color: var(--accent-dark); margin: 0; border-radius: 0; }
.vc-c.on.sick { background: #fde8e8; color: #8f1d17; }
.vc-c.on.leave { background: #ede9fe; color: #5b21b6; }
.vc-c.on.leave .vc-mark { font-size: 9px; }
.vc-c.duty:not(.on) { background: #fff3d6; color: #8a5a00; }
.vc-c.on.first { border-radius: 8px 0 0 8px; margin-left: 1px; }
.vc-c.on.last { border-radius: 0 8px 8px 0; margin-right: 1px; }
.vc-c.on.first.last { border-radius: 8px; }
.vc-c.on.bad { background: #b3261e; color: #fff; }
.vc-c.selecting { outline: 2px solid var(--text); outline-offset: -2px; }
.vc-c.preview { box-shadow: inset 0 0 0 2px #8795a3; }
.vc-duty { position: absolute; right: 3px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: #d99a00; display: inline-block; pointer-events: none; }
.vc-c.on.bad .vc-duty { background: #fff; }
.vc-pop { position: fixed; z-index: 50; background: var(--panel); border-radius: 14px; box-shadow: 0 8px 30px rgba(16, 24, 40, .18);
          padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 280px; transform-origin: top left; animation: vc-pop-in .14s ease-out; }
.vc-pop[hidden], .vc-pop [hidden], .dc-pop[hidden] { display: none !important; }
.vc-pop-h { font-weight: 600; font-size: 13px; }
.vc-dates { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.vc-dates .pill { background: var(--soft); width: 140px; }
.vc-days { font-size: 12px; min-height: 16px; }
.vc-act { display: flex; gap: 8px; }
@keyframes vc-mark-in { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: scale(1); } }
@keyframes vc-pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .schedule-mode, .schedule-mode > span, .vc, .vc-c { transition: none; }
  .vc-mark, .vc-pop { animation: none; }
  .vc-scroll { scroll-behavior: auto; }
}

/* робот: список автоответов, редактор и живой предпросмотр */
.rb-page { max-width: 1400px; }
.rb-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.rb-title h2 { margin: 0 0 4px; font-size: 24px; }
.rb-title p { margin: 0; font-size: 13px; }
.rb-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.rb-sidebar { position: sticky; top: 14px; padding: 12px; }
.rb-search { width: 100%; margin-bottom: 10px; }
.rb-items { display: flex; flex-direction: column; gap: 5px; }
.rb-item { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid transparent; border-radius: 12px; color: var(--text); text-decoration: none; transition: background-color .15s ease, border-color .15s ease; }
.rb-item:hover { background: var(--soft); }
.rb-item.on { background: var(--accent-soft); border-color: var(--accent-ring); }
.rb-item > b { font-size: 14px; }
.rb-item > span:last-child { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.rb-status { align-self: flex-start; padding: 2px 7px; border-radius: 8px; background: var(--ok-bg); color: var(--ok); font-size: 10px; font-weight: 700; }
.rb-status.off { background: var(--soft); color: var(--muted); }
.rb-item[hidden], .rb-empty[hidden] { display: none; }
.rb-empty { padding: 16px 8px; text-align: center; font-size: 13px; }
.rb-editor { padding: 20px; }
.rb-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; align-items: start; }
.rb-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.rb-editor-head h2 { margin: 3px 0 0; font-size: 19px; }
.rb-overline { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.rb-editor-head .switch input { appearance: none; position: relative; width: 38px; height: 22px; margin: 0; border: none; border-radius: 12px; background: #c8d0d8; cursor: pointer; transition: background-color .16s ease; }
.rb-editor-head .switch input::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20,30,50,.2); transition: transform .16s ease; }
.rb-editor-head .switch input:checked { background: var(--accent); }
.rb-editor-head .switch input:checked::before { transform: translateX(16px); }
.rb-editor-head .switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rb-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; }
.rb-text { width: 100%; resize: vertical; font: inherit; font-size: 14px; line-height: 1.5; }
.rb-counter { margin-top: 4px; text-align: right; font-size: 11px; }
.rb-vars { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; }
.rb-title-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rb-name { width: 100%; margin-bottom: 16px; }
.rb-or { margin: -4px 0 10px; font-size: 11.5px; }
.rb-condition-switch { font-size: 13px; }
.rb-condition-fields { margin-top: 12px; }
.rb-condition-fields[hidden], #rbStatusField[hidden] { display: none; }
.rb-times { display: flex; gap: 10px; flex-wrap: wrap; }
.rb-times label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.rb-times .input { width: 130px; min-height: 0; padding: 7px 9px; background: var(--panel); }
.rb-weekdays { display: grid; grid-template-columns: repeat(7, 38px); gap: 5px; margin-top: 10px; }
.rb-weekdays label { cursor: pointer; }
.rb-weekdays input { position: absolute; opacity: 0; pointer-events: none; }
.rb-weekdays span { display: grid; place-items: center; height: 30px; border-radius: 9px; background: var(--panel); color: var(--muted); font-size: 11px; transition: background-color .15s ease, color .15s ease; }
.rb-weekdays input:checked + span { background: var(--accent); color: #fff; }
.rb-weekdays input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rb-repeat-select { width: 170px; min-height: 0; padding: 7px 10px; background: var(--panel); }
.rb-dates { display: flex; gap: 10px; flex-wrap: wrap; }
.rb-dates label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.rb-dates .input { width: 155px; min-height: 0; padding: 7px 9px; background: var(--panel); }
.rb-date-note, .rb-override-note { margin: 9px 0 0; font-size: 11.5px; line-height: 1.45; }
#rbOverrideFields[hidden] { display: none; }
.rb-danger { color: var(--late); }
.rb-conditions { margin-top: 18px; }
.rb-conditions > h3, .rb-preview > h3 { margin: 0 0 10px; font-size: 14px; }
.rb-condition { padding: 14px; border-radius: 12px; background: var(--soft); margin-bottom: 8px; font-size: 13px; }
.rb-condition > b { display: block; margin-bottom: 5px; }
.rb-condition p { margin: 0 0 10px; line-height: 1.45; }
.rb-event { margin-bottom: 0 !important; }
.rb-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rb-tags span { padding: 5px 8px; border-radius: 8px; background: var(--panel); color: var(--muted); font-size: 11px; }
.rb-repeat { display: flex; flex-direction: column; gap: 4px; }
.rb-repeat > b { margin: 0; }
.rb-days { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.rb-day { padding: 4px 4px 4px 12px; }
.rb-day button { border: none; background: none; cursor: pointer; font-size: 15px; color: var(--muted); padding: 0 6px; border-radius: 50%; }
.rb-day button:hover { color: var(--text); background: var(--panel); }
.rb-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rb-add .input { width: auto; min-height: 0; padding: 7px 10px; background: var(--panel); }
.rb-preview { padding: 16px; border-radius: 14px; background: var(--soft); }
.rb-chat { display: flex; align-items: flex-start; gap: 9px; }
.rb-bot { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; }
.rb-bubble { padding: 12px 14px; border-radius: 4px 14px 14px 14px; background: var(--panel); box-shadow: 0 1px 3px rgba(20,30,50,.06); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.rb-preview > p { margin: 12px 0 0; font-size: 10.5px; line-height: 1.4; }
.rb-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 1100px) { .rb-layout { grid-template-columns: 230px minmax(0, 1fr); } .rb-edit-grid { grid-template-columns: 1fr; } }
@media (max-width: 750px) { .rb-layout { grid-template-columns: 1fr; } .rb-sidebar { position: static; } .rb-title { flex-direction: column; } }

/* кабинет: сигналы — массовые проблемы и повторные обращения */
.sig-list { display: flex; flex-direction: column; gap: 6px; }
.sig-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; background: var(--soft); color: var(--text); text-decoration: none; font-size: 13px; }
.sig-item span { color: var(--muted); font-size: 12.5px; }
.sig-item.mass { background: #fde8e8; }
.sig-item.mass b { color: #8f1d17; }
.sig-item:hover { box-shadow: inset 0 0 0 1px #c9d2db; }
.sr-table td { vertical-align: middle; }
.sr-table .input { padding: 7px 10px; font-size: 13px; min-height: 0; width: 100%; }
.sr-table .num-in { width: 80px; text-align: right; }

/* кабинет руководителя: «Обзор» — командный центр */
.mc { display: flex; flex-direction: column; gap: 14px; }
.mc .cab-tabs { margin-bottom: 0; }
.mc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.mc-kpi { background: var(--panel); border-radius: var(--r); padding: 14px 18px; display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; min-width: 0; }
a.mc-kpi:hover { color: var(--text); box-shadow: inset 0 0 0 1px #d3dbe3; }
.mc-kpi .k { font-size: 12.5px; color: var(--muted); }
.mc-kpi .v { font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mc-kpi .v small { font-size: 14px; font-weight: 500; color: var(--muted); }
.mc-kpi .s { font-size: 12px; color: var(--muted); }
.mc-kpi .s b.r, .mc-sub.r { color: var(--late); font-weight: 700; }
.mc-kpi.warn .v { color: var(--late); }
.mc-kpi.ok .v { color: var(--ok); }
.mc-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.mc-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mc-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.mc-incs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.mc-inc { border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: #fde8e8; color: #8f1d17; min-width: 0; }
.mc-inc.amber { background: var(--warn-bg); color: var(--warn); }
.mc-inc.calm { background: var(--panel); color: var(--muted); }
.mc-inc.ok { background: var(--ok-bg); color: var(--ok); }
.mc-inc .t { font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mc-inc .t span { font-weight: 500; color: var(--muted); }
.mc-inc-n { display: flex; align-items: flex-end; gap: 12px; }
.mc-inc-n b { font-size: 32px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.mc-inc-n span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.mc-inc .btn { align-self: flex-start; }
.mc-inc .btn.ghost { background: var(--panel); }
.mc-spark { display: block; width: 100%; height: 34px; }
.mc-gaps { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.mc-note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; }
.mc-inc .mc-note { margin: 0; }
.mc-p { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mc-p h3 { margin: 0 0 6px; font-size: 15px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mc-p h3 span { font-weight: 500; font-size: 12px; color: var(--muted); }
.mc-li { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 12px; padding: 8px 10px; min-width: 0; color: var(--text); text-decoration: none; font-size: 13px; }
a.mc-li:hover { color: var(--text); box-shadow: inset 0 0 0 1px #d3dbe3; }
.mc-li .grow { flex: 1; min-width: 0; }
.mc-li .grow > b, .mc-li .grow > span:not(.mc-bar) { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-li .grow > span:not(.mc-bar) { font-size: 12px; color: var(--muted); }
.mc-num { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.mc-sub { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.mc-rk { width: 14px; font-size: 12px; color: var(--muted); text-align: right; }
.mc-bar { display: block; height: 6px; border-radius: 3px; background: #e3e8ee; overflow: hidden; margin-top: 4px; }
.mc-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.mc-bar i.s3 { background: #d99a00; }
.mc-bar i.s2, .mc-bar i.s1 { background: var(--late); }
.mc-dist { display: grid; grid-template-columns: 70px 1fr 28px; gap: 8px; align-items: center; font-size: 13px; }
.mc-dist .mc-bar { margin: 0; height: 8px; }
.mc-stars { color: #d99a00; letter-spacing: 1px; white-space: nowrap; }
.mc-stars i { font-style: normal; color: #c9d0d8; }
.mc-empty { margin: 0; font-size: 13px; color: var(--muted); }
.mc-rules summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.mc-rules summary::-webkit-details-marker { display: none; }
.mc-rules summary h2 { margin: 0; font-size: 16px; }
.mc-rules summary h2::before { content: '▸ '; color: var(--muted); }
.mc-rules[open] summary h2::before { content: '▾ '; }
.mc-rules[open] summary { margin-bottom: 10px; }

/* «Жалобы»: блок в стиле презентации — тёплый фон, терракотовый акцент */
.mc-period { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mc-period label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.mc-period .input { padding: 7px 10px; min-height: 0; }
.mc-period .grow { flex: 1; }
.mc-quick { font-size: 13px; padding: 6px 12px; border-radius: 16px; background: var(--soft); color: var(--text); text-decoration: none; }
.cp-sheet { background: #F6F3EE; color: #1E2A36; border-radius: var(--r); padding: 26px 30px; display: flex; flex-direction: column; gap: 16px; }
.cp-sheet h2 { margin: 0; font-size: 26px; font-weight: 700; }
.cp-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.cp-theme { background: #FFFDF9; border: 1px solid #E2DACD; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cp-theme h3 { margin: 0; font-size: 17px; }
.cp-theme h3 em { font-style: normal; color: #B4441C; }
.cp-theme ul { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.4; color: #3B4654; display: flex; flex-direction: column; gap: 4px; }
.cp-more { font-size: 12px; color: #6B7280; }
.cp-foot { margin: 0; font-size: 13px; font-weight: 600; color: #B4441C; }
.mc-ctable { padding: 0; }
.mc-thead { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 16px 18px 6px; font-size: 12.5px; }
.mc-thead h3 { margin: 0; font-size: 15px; }
.mc-ctable td { vertical-align: top; font-size: 13px; }
.cp-key { min-width: 260px; max-width: 460px; line-height: 1.4; }
.cp-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.cp-chip { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 20px; padding: 1px 8px; background: #F6F3EE; color: #8a4a2c; white-space: nowrap; }
.cp-chip.r { background: #fde8e8; color: #8f1d17; }
.nowrap { white-space: nowrap; }

/* «Сотрудники»: каталог и форма добавления/редактирования */
.staff-layout { display: grid; grid-template-columns: minmax(480px, 1fr) minmax(480px, 620px); gap: 16px; align-items: start; margin-bottom: 16px; }
.staff-directory { padding: 12px; position: sticky; top: 14px; }
.staff-tools { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 8px; }
.staff-tools .input { min-height: 0; padding: 9px 12px; }
.staff-add { grid-column: 1 / -1; justify-content: center; white-space: nowrap; }
.staff-list { margin-top: 12px; }
.staff-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) 100px 90px; gap: 10px; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.staff-row:hover { background: var(--soft); }
.staff-row.on { background: var(--accent-soft); }
.staff-row.off { opacity: .55; }
.staff-row[hidden], .staff-empty[hidden] { display: none; }
.staff-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.staff-info b, .staff-info span, .staff-info code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-info b { font-size: 13px; }
.staff-info span { color: var(--muted); font-size: 11px; }
.staff-info code { color: var(--faint); font-size: 10px; }
.staff-dept { justify-self: start; padding: 3px 8px; border-radius: 9px; background: var(--soft); color: var(--muted); font-size: 10.5px; }
.staff-status { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.staff-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.staff-status.off { color: var(--muted); }
.staff-total { padding: 12px 8px 2px; text-align: right; font-size: 11px; }
.staff-empty { padding: 24px 8px; text-align: center; }
.staff-editor { padding: 20px; }
.staff-editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.staff-editor-head h2 { margin: 0; font-size: 19px; }
.staff-close { color: var(--muted); text-decoration: none; font-size: 24px; line-height: 1; }
.staff-section { margin: 0 0 16px; padding: 0; border: none; }
.staff-section legend { display: block; width: 100%; margin-bottom: 12px; padding: 9px 12px; border-radius: 10px; background: var(--soft); font-size: 13px; font-weight: 700; }
.staff-section legend span { display: inline-grid; place-items: center; width: 21px; height: 21px; margin-right: 6px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; }
.staff-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.staff-form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; }
.staff-active { margin-top: 12px; }
.staff-level { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; background: var(--soft); font-size: 12px; }
.staff-level span { color: var(--muted); line-height: 1.45; }
.staff-pipes { display: flex; gap: 8px 16px; flex-wrap: wrap; margin-top: 12px; }
.staff-distribute { margin-top: 12px; }
.staff-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
@media (max-width: 1250px) { .staff-layout { grid-template-columns: 1fr; } .staff-directory { position: static; } }
@media (max-width: 650px) { .staff-tools { grid-template-columns: 1fr; } .staff-form-grid { grid-template-columns: 1fr; } .staff-row { grid-template-columns: 30px minmax(0, 1fr) 80px; } .staff-dept { display: none; } }

/* «Сотрудники»: должности и люди */
.mc-staff tr.off { opacity: .5; }
.mc-who { display: inline-flex; gap: 8px; align-items: center; }
.mc-who > span { display: flex; flex-direction: column; }
.mc-who code { font-size: 11.5px; color: var(--muted); }
.adm-chip { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 2px 9px; background: var(--accent-soft); color: var(--accent-dark); white-space: nowrap; }
.positions-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.positions-head h2 { margin: 0 0 3px; font-size: 19px; }
.positions-head p { margin: 0; font-size: 12.5px; }
.positions-shield { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-dark); }
.positions-help { margin-left: auto; padding: 6px 10px; border-radius: 12px; background: var(--soft); color: var(--muted); font-size: 12px; white-space: nowrap; }
.position-columns, .mc-pos-row { display: grid; grid-template-columns: 30px minmax(180px, 1.2fr) minmax(240px, 1.3fr) 65px 90px 90px; gap: 10px; align-items: center; }
.position-columns { padding: 0 10px 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.mc-pos { display: flex; flex-direction: column; gap: 9px; }
.mc-pos-row { padding: 9px 10px; border-radius: 12px; background: var(--soft); }
.mc-pos-row .input { padding: 8px 12px; min-height: 0; background: var(--panel); }
.mc-pos-row .btn { min-height: 36px; padding: 7px 10px; justify-content: center; }
.position-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--panel); color: var(--accent-dark); }
.position-icon.new { font-size: 20px; font-weight: 600; }
.position-count { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.pos-delete { width: 90px; min-height: 34px; border: none; border-radius: 10px; padding: 7px 10px; background: #fde8e8; color: var(--late); cursor: pointer; font-size: 12px; }
.pos-delete:hover { background: #fbd5d5; }
.pos-delete.disabled { background: var(--soft); color: var(--faint); cursor: not-allowed; }
.mc-pos-row.new { margin-top: 5px; padding-top: 14px; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; background: transparent; }
.positions-foot { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 12px; line-height: 1.45; }
@media (max-width: 1000px) { .mc-grid { grid-template-columns: 1fr; } .position-columns { display: none; } .mc-pos-row { grid-template-columns: 30px minmax(120px, 1fr) minmax(160px, 1fr) 75px 75px; } .position-count { display: none; } .pos-delete { width: 75px; } }
/* Скрываем подписи после правил бренда, профиля и линии: они иначе раскрывались снова. */
@media (max-width: 900px) {
  .sidebar .sb-text, .sidebar .sb-n, .sidebar .sb-sep { display: none; }
  .sidebar .sb-top { padding-left: 0; padding-right: 0; }
  .sidebar .sb-brand { justify-content: center; }
  .sidebar .sb-line-state { justify-content: center; padding: 6px 0; }
}
