/* Дизайн-система портирована из nexlab.crm: нейтральные серые, один оранжевый акцент, мягкие тени. */
:root {
  --bg: #131315; --panel: #1b1b1f; --panel-2: #26262b; --panel-3: #303036;
  --line: rgba(255,255,255,.09); --line-strong: rgba(255,255,255,.16);
  --text: #f1f1f3; --text-soft: #c6c6cc; --muted: #8d8d95; --faint: #5b5b63;
  --accent: #f0673a; --accent-2: #f5825a; --accent-soft: rgba(240,103,58,.16);
  --mine: #f0673a; --ok: #5cc275; --warn: #e3a23d; --danger: #f0635a;
  --radius: 14px; --r-md: 12px; --r-sm: 9px; --r-lg: 18px;
  --shadow-soft: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -24px rgba(0,0,0,.6);
  --shadow: 0 2px 6px rgba(0,0,0,.4), 0 40px 90px -26px rgba(0,0,0,.75);
  --ease: cubic-bezier(.22,1,.36,1);
  --sidebar-w: 232px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'SF Pro Text', Roboto, Helvetica, Arial, sans-serif;
}
html.light {
  --bg: #e7e7e9; --panel: #ffffff; --panel-2: #f3f3f5; --panel-3: #ebebee;
  --line: rgba(0,0,0,.09); --line-strong: rgba(0,0,0,.14);
  --text: #1b1b1d; --text-soft: #3a3a3f; --muted: #86868d; --faint: #aeaeb4;
  --accent: #e15a2b; --accent-2: #c64c20; --accent-soft: rgba(225,90,43,.1);
  --mine: #e15a2b; --ok: #3f9d57; --warn: #d98a1f; --danger: #d6453b;
  --shadow-soft: 0 1px 2px rgba(0,0,0,.04), 0 14px 30px -20px rgba(0,0,0,.18);
  --shadow: 0 2px 4px rgba(0,0,0,.05), 0 34px 72px -22px rgba(0,0,0,.28);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* hidden должен побеждать .screen{display:flex} и .admin{display:block} */
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 14.5px/1.5 var(--font);
  background: var(--bg); color: var(--text);
  display: flex; flex-direction: column; -webkit-font-smoothing: antialiased;
}
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ---- Вход ---- */
.login { align-items: center; justify-content: center; padding: 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.login-card { width: 100%; max-width: 360px; padding: 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; margin-bottom: 6px; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 15px; outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,138,138,.25); }
.btn { border: none; border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-2); }
.hint { color: var(--muted); font-size: 12px; text-align: center; margin: 2px 0 0; }
.theme-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: transparent; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; padding: 4px; }
.theme-link svg { width: 15px; height: 15px; }
.theme-link:hover { color: var(--text); }
.err { color: #ff7a7a; font-size: 13px; margin: 0; }

/* ============ Шейл приложения: сайдбар разделов + рабочая зона ============ */
.chat { background: var(--bg); flex-direction: row; }

/* — Сайдбар — */
.sidebar { width: var(--sidebar-w); flex: none; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 12px 10px; gap: 2px;
  padding-top: calc(12px + env(safe-area-inset-top)); }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.sb-logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; font-size: 14px; box-shadow: var(--shadow-soft); }
.sb-brand b { font-size: 15px; letter-spacing: .2px; }
.sb-brand small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-md);
  background: transparent; border: none; color: var(--text-soft); cursor: pointer; font: inherit; font-size: 14px; text-decoration: none; width: 100%; text-align: left; position: relative; transition: background .15s; }
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge { margin-left: auto; min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sb-spacer { flex: 1; }
.sb-foot { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.sb-me { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: var(--r-md); cursor: pointer; }
.sb-me:hover { background: var(--panel-2); }
.sb-me .avatar { width: 30px; height: 30px; font-size: 12px; }
.sb-me-info { min-width: 0; }
.sb-me-info b { font-size: 13px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-work { font-size: 11px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); cursor: pointer; }
.sb-foot-row { display: flex; gap: 2px; }
.sb-foot-row .iconbtn { flex: 1; height: 34px; border-radius: var(--r-sm); }
.sb-foot-row .iconbtn:hover { background: var(--panel-2); }

/* — Рабочая зона и представления — */
.work { flex: 1; min-width: 0; display: flex; }
.view { flex: 1; min-width: 0; display: none; }
.view.active { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
#viewDialogs.active { flex-direction: row; }

/* Заголовок раздела (Сотрудники/Структура) */
.view-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.view-head h1 { font-size: 19px; font-weight: 700; }
.view-head .sub { color: var(--muted); font-size: 13px; }
.view-head .spacer { flex: 1; }
.view-body { flex: 1; overflow-y: auto; padding: 18px 22px; }

/* — Диалоги: список + переписка — */
.dlg-list { width: 320px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--panel); }
.dlg-list-head { padding: 14px 14px 10px; display: flex; align-items: center; gap: 10px; }
.dlg-list-head h2 { font-size: 17px; font-weight: 700; }
.dlg-search { margin: 0 12px 8px; }
.dlg-search input { width: 100%; }
.dlg-conv { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.conv-empty { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
@media (max-width: 760px) {
  .dlg-list { width: 100%; }
  #viewDialogs.show-conv .dlg-list { display: none; }
  #viewDialogs:not(.show-conv) .dlg-conv { display: none; }
}

/* мобильный гамбургер */
.menu-btn { display: none; }
.sb-backdrop { position: fixed; inset: 0; z-index: 39; background: rgba(0,0,0,.45); }
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; transform: translateX(-110%); transition: transform .22s var(--ease); box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-grid; }
}
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.title { display: flex; flex-direction: column; }
.title strong { font-size: 16px; }
.muted { color: var(--muted); font-size: 12px; }
.bar-actions { display: flex; gap: 6px; }
.iconbtn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text); cursor: pointer; text-decoration: none;
}
.iconbtn:active { background: var(--panel-2); }
.iconbtn svg { width: 20px; height: 20px; }

/* ---- Панель звонка ---- */
.iconbtn.active { background: var(--accent); color: #fff; }
.callpanel { background: var(--panel-2); border-bottom: 1px solid var(--line); padding: 10px 14px; }
.call-head { display: flex; align-items: center; gap: 8px; }
.call-dot { width: 9px; height: 9px; border-radius: 50%; background: #43c463; box-shadow: 0 0 0 0 rgba(67,196,99,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(67,196,99,.5); } 70% { box-shadow: 0 0 0 7px rgba(67,196,99,0); } 100% { box-shadow: 0 0 0 0 rgba(67,196,99,0); } }
.call-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); cursor: pointer; }
.call-btn svg { width: 18px; height: 18px; }
.call-btn.off { background: #6a3a3a; color: #fff; }
.call-btn.danger { background: #b8433f; color: #fff; border-color: transparent; }

/* ---- Видеоплитки группового звонка (п.1) ---- */
.call-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.call-tile { position: relative; aspect-ratio: 4 / 3; background: #0c0e12; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; }
.call-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.call-tile.self video { transform: scaleX(-1); } /* зеркалим себя */
.call-tile.novideo video { display: none; }
.call-tile .call-name { position: absolute; left: 6px; bottom: 5px; font-size: 11px; color: #fff;
  background: rgba(0,0,0,.45); padding: 1px 6px; border-radius: 6px; }
.call-tile .call-novideo { position: absolute; inset: 0; display: none; place-items: center; font-size: 24px; }
.call-tile.novideo .call-novideo { display: grid; }

.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { display: flex; align-items: flex-end; gap: 7px; }
.msg.mine { justify-content: flex-end; }
/* Аватары */
.avatar { flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg-ava { width: 28px; height: 28px; font-size: 12px; margin-bottom: 2px; }
.msg-ava-spacer { width: 28px; flex: none; }
.person-ava { width: 30px; height: 30px; font-size: 13px; }
/* Группировка подряд идущих сообщений одного автора */
.msg.grouped { margin-top: -5px; }
.bubble { max-width: min(78%, 560px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 8px 11px 5px; }
.msg.mine .bubble { background: var(--mine); border-color: transparent; color: #fff; }
.author { font-size: 12px; color: var(--accent-2); font-weight: 600; margin-bottom: 2px; padding-right: 62px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.mine .author { color: rgba(255,255,255,.92); }
.body { white-space: pre-wrap; word-break: break-word; }
.time { font-size: 10px; color: var(--muted); text-align: right; margin-top: 2px;
  display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.msg.mine .time { color: rgba(255,255,255,.7); }
/* Статус своего сообщения (п.5): отправлено / доставлено / прочитано */
.status { display: inline-flex; }
.status svg { width: 13px; height: 13px; }
.status.sent { opacity: .55; }
.status.delivered { opacity: .85; }
.status.read { color: #8fd3ff; opacity: 1; }
html.light .msg.mine .status.read { color: #d6f0ff; }

/* ---- Пересылка (п.2): источник скрыть нельзя ---- */
.bubble { position: relative; }
.fwd { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent-2); margin-bottom: 3px; }
.fwd svg { width: 13px; height: 13px; }
.msg.mine .fwd { color: rgba(255,255,255,.85); }

/* ---- Цитата ответа ---- */
.quote { display: flex; flex-direction: column; gap: 1px; padding: 3px 8px; margin-bottom: 4px;
  border-left: 3px solid var(--accent); border-radius: 4px; background: rgba(43,138,138,.10); }
.msg.mine .quote { border-left-color: rgba(255,255,255,.6); background: rgba(255,255,255,.14); }
.quote .qa { font-size: 11px; font-weight: 600; color: var(--accent-2); }
.msg.mine .quote .qa { color: rgba(255,255,255,.9); }
.quote .qt { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.msg.mine .quote .qt { color: rgba(255,255,255,.75); }

/* ---- Действия на сообщении (ответ / переслать) ---- */
.msg-actions { position: absolute; top: -10px; right: 6px; left: auto; display: flex; gap: 3px; opacity: 0; transition: opacity .12s;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 2px; z-index: 2; }
.bubble:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.ma { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: transparent; border: none; color: var(--muted); cursor: pointer; }
.ma:hover { color: var(--text); background: var(--panel); }
.ma svg { width: 15px; height: 15px; }
@media (hover: none) { .msg-actions { opacity: 1; } } /* на тач-устройствах всегда видно */

/* ---- Черновик ответа над composer ---- */
.reply-draft { display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: var(--panel); border-top: 1px solid var(--line); }
.reply-draft-body { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0;
  border-left: 3px solid var(--accent); padding-left: 9px; }
.reply-draft .qa { font-size: 12px; font-weight: 600; color: var(--accent-2); }
.reply-draft .qt { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Вложения (п.1): картинка / видео / аудио / голос / файл ---- */
.att-img { display: block; margin-bottom: 4px; }
.att-img img { max-width: 260px; max-height: 280px; border-radius: 10px; display: block; }
.att-video { max-width: 280px; max-height: 300px; border-radius: 10px; margin-bottom: 4px; background: #000; }
.att-audio { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.att-audio audio { height: 34px; max-width: 240px; }
.att-dur { font-size: 11px; color: var(--muted); }
.msg.mine .att-dur { color: rgba(255,255,255,.7); }
.att-file { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; padding: 8px 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; max-width: 260px; }
.msg.mine .att-file { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); }
.att-ic { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px;
  background: var(--accent); color: #fff; }
.att-ic svg { width: 18px; height: 18px; }
.att-meta { display: flex; flex-direction: column; min-width: 0; }
.att-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-size { font-size: 11px; color: var(--muted); }
.msg.mine .att-size { color: rgba(255,255,255,.7); }

/* Вложение удалено / срок хранения истёк (п.4) */
.att-deleted { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; padding: 8px 11px;
  border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; font-style: italic; }
.att-deleted svg { width: 16px; height: 16px; flex: none; }
.msg.mine .att-deleted { border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.75); }

/* Черновик вложения над composer */
.attach-draft { display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: var(--panel); border-top: 1px solid var(--line); }
.attach-draft .att-name { flex: 1; }
.attach-draft .att-size { white-space: nowrap; }

/* Кнопка записи голосового — пульсация при записи */
#voiceBtn.recording { color: #fff; background: #b8433f; }
#voiceBtn.recording svg { animation: pulse 1.4s infinite; }

/* ---- Реакции-кнопки (п.3 ТЗ): иду / не знаю / отказываюсь ---- */
.reactions { display: flex; gap: 5px; margin-top: 5px; }
.react {
  display: inline-flex; align-items: center; gap: 4px; min-width: 30px; justify-content: center;
  padding: 2px 7px; border-radius: 11px; cursor: pointer; font-size: 11px; line-height: 1;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.msg.mine .react { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.8); }
.react .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .5; }
.react.go { --rc: #43c463; }
.react.maybe { --rc: #9aa3b2; }
.react.no { --rc: #e1574a; }
.react.active { color: var(--rc); border-color: var(--rc); background: color-mix(in srgb, var(--rc) 16%, transparent); }
.react.active .dot { opacity: 1; }
.react .rc { font-variant-numeric: tabular-nums; }
.react:active { transform: scale(.94); }

.composer {
  display: flex; gap: 8px; padding: 10px 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--panel); border-top: 1px solid var(--line);
}
.composer input { flex: 1; }

/* «печатает…» */
.typing-line { color: var(--accent-2); }

/* Лицензия (п.17) */
.lic-banner { padding: 7px 14px; font-size: 13px; text-align: center; border-bottom: 1px solid var(--line); }
.lic-banner.demo { background: rgba(54,163,163,.15); color: var(--accent-2); }
.lic-banner.expired { background: rgba(225,87,74,.15); color: #e1574a; font-weight: 600; }
.lic-block { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.75); padding: 24px; }
.lic-block-card { max-width: 360px; text-align: center; }
.lic-pay { margin-left: 8px; background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 4px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.lic-pay:active { opacity: .85; }

/* Заголовок чата + кнопка списка */
.title-row { display: flex; align-items: center; gap: 6px; }
.chats-toggle { width: 30px; height: 30px; margin-left: -6px; }
.chats-toggle svg { width: 18px; height: 18px; }

/* Панель списка чатов */
.chats-panel { background: var(--panel); border-bottom: 1px solid var(--line); max-height: 50vh; overflow-y: auto; }
.chats-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px; font-weight: 600; font-size: 13px; }
.btn-mini { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 5px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.chat-list { display: flex; flex-direction: column; padding: 0 8px 8px; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; cursor: pointer; }
.chat-item:hover { background: var(--panel-2); }
.chat-item.active { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
.chat-ava { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; }
.chat-meta { display: flex; flex-direction: column; min-width: 0; }
.chat-name { font-size: 14px; font-weight: 600; }
.chat-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
.chat-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.chat-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.pin-btn { background: none; border: none; color: var(--muted); cursor: pointer; padding: 2px; display: grid; place-items: center; }
.pin-btn svg { width: 15px; height: 15px; }
.pin-btn.on { color: var(--accent-2); }
.chat-ava { position: relative; }
.pin-dot { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); border: 2px solid var(--panel); }
.group-members { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto; }

/* Профиль + календарь смен (пп.7,8) */
.person { cursor: pointer; }
.prof-top { display: flex; gap: 14px; margin-bottom: 12px; }
.prof-ava-wrap { position: relative; flex: none; }
.prof-ava { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; display: block; }
.prof-ava.stub { display: grid; place-items: center; font-size: 28px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.prof-photo-edit { position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; border: 2px solid var(--panel); display: grid; place-items: center; cursor: pointer; }
.prof-photo-edit svg { width: 14px; height: 14px; }
.prof-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.prof-fields label { font-size: 12px; }
.prof-work { font-size: 12px; }
.prof-work.on { color: #43c463; } .prof-work.off { color: #e1574a; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.cal-head strong { font-size: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { text-align: center; font-size: 11px; color: var(--muted); padding-bottom: 2px; }
.cal-cell { aspect-ratio: 1; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 8px; font-size: 13px; display: grid; place-items: center; padding: 0; }
.cal-cell.empty { border: none; background: none; }
.cal-cell.clickable { cursor: pointer; }
.cal-cell.shift { background: color-mix(in srgb, var(--accent) 35%, transparent); border-color: var(--accent); font-weight: 600; }
.cal-cell.swap { background: repeating-linear-gradient(45deg, color-mix(in srgb, #d98a2b 38%, transparent) 0 5px, transparent 5px 10px); border-color: #d98a2b; font-weight: 600; }
.lg { display: inline-block; width: 11px; height: 11px; border-radius: 3px; vertical-align: -1px; margin: 0 1px; }
.lg.shift { background: color-mix(in srgb, var(--accent) 45%, transparent); border: 1px solid var(--accent); }
.lg.swap { background: repeating-linear-gradient(45deg, #d98a2b 0 4px, transparent 4px 8px); border: 1px solid #d98a2b; }
.cal-cell.today { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.cal-cell.bday { position: relative; }
.cal-cell .bday-dot { position: absolute; top: -4px; right: -2px; font-size: 11px; }
.att-block { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; }
.att-block strong { display: block; margin-bottom: 6px; font-size: 13px; }
.att-line { margin-bottom: 6px; }
.att-break { font-size: 12px; color: var(--muted); padding: 2px 0; }
.att-break.long { color: #e1574a; font-weight: 600; }

/* Рабочий статус (п.10) */
.work-dot { width: 11px; height: 11px; border-radius: 50%; background: #e1574a; display: inline-block; flex: none;
  box-shadow: 0 0 0 2px rgba(225,87,74,.25); }
.work-dot.on { background: #43c463; box-shadow: 0 0 0 2px rgba(67,196,99,.3); }
.workbtn.on .work-dot, .sb-work.on .work-dot { background: #43c463; box-shadow: 0 0 0 2px rgba(67,196,99,.3); }
.sb-work.on { color: #2bb673; }

/* Список людей (п.10) */
.people-panel { background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 14px 10px; max-height: 40vh; overflow-y: auto; }
.people-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; font-weight: 600; font-size: 13px; }
.people-list { display: flex; flex-direction: column; gap: 2px; }
.person { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 8px; }
.person:hover { background: var(--panel-2); }
.person .pname { flex: 1; font-size: 14px; }
.person .small { font-size: 11px; }

/* Модалка настроек приватности */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); padding: 20px; }
.modal-card { width: 100%; max-width: 360px; padding: 18px 18px 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-head strong { font-size: 16px; }
.toggle { display: flex; align-items: center; gap: 10px; flex-direction: row; padding: 9px 2px; color: var(--text);
  font-size: 14px; cursor: pointer; border-top: 1px solid var(--line); }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.notif-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.notif-col { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 8px; }
.notif-h { display: block; font-size: 12px; font-weight: 600; color: var(--accent-2); margin: 2px 0 2px; }
.notif-col .toggle { border-top: none; padding: 5px 0; font-size: 13px; }
.mute-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); padding: 0 2px 2px; }
.mute-cols { display: inline-flex; gap: 14px; }
.mute-cols span { width: 18px; text-align: center; }
.mute-list { display: flex; flex-direction: column; max-height: 180px; overflow-y: auto; }
.mute-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px; border-top: 1px solid var(--line); }
.mute-name { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mute-cols input { width: 18px; height: 18px; accent-color: var(--accent); }
.send { background: var(--accent); color: #fff; }
.send:active { background: var(--accent-2); }

/* ============ Редизайн: общие ============ */
input, textarea, select { font-family: var(--font); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn-mini { background: var(--accent); color: #fff; border: none; border-radius: var(--r-sm); padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.btn-mini.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn-mini.dirty { background: var(--warn); box-shadow: 0 0 0 3px rgba(227,162,61,.2); }
.btn-mini:active { transform: translateY(1px); }
.head-search { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: 13px; width: 200px; max-width: 40vw; }
.conv-back { display: none; }
.menu-btn { display: none; }
@media (max-width: 760px) { .menu-btn { display: inline-grid; } #viewDialogs.show-conv .conv-back { display: inline-grid; } }

/* Шапка переписки */
.bar { gap: 10px; }
.dlg-conv .bar { background: var(--panel); }

/* Список диалогов */
.dlg-list-head h2 { font-size: 18px; font-weight: 700; }
.dlg-list-head .iconbtn { width: 34px; height: 34px; }
.chat-list { flex: 1; overflow-y: auto; padding: 4px 8px 10px; }
.chat-item { border-radius: var(--r-md); }
.chat-item.active { background: var(--accent-soft); box-shadow: none; }
.chat-item.active .chat-name { color: var(--accent-2); }
.chat-ava { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: var(--shadow-soft); }

/* ============ Сотрудники: сетка карточек ============ */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.person-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.person-card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.pc-ava-wrap { position: relative; flex: none; }
.pc-ava { width: 44px; height: 44px; font-size: 16px; }
.pc-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--panel); background: var(--faint); }
.pc-dot.work { background: var(--ok); } .pc-dot.net { background: var(--accent); }
.pc-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pc-info b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-pos { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ Структура: орг-дерево ============ */
.org { position: relative; overflow: auto; width: 100%; height: 100%; background:
  radial-gradient(circle, var(--line) 1px, transparent 1px) 0 0 / 24px 24px; }
.org.connecting { cursor: crosshair; }
.org.edge-hot .org-edges { cursor: pointer; }
.org-world { position: relative; min-width: 100%; min-height: 100%; }
.org-edges { position: absolute; left: 0; top: 0; z-index: 0; }
.dep-card { position: absolute; width: 280px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-soft); padding: 14px; z-index: 1; }
.dep-card.dragging { box-shadow: var(--shadow); z-index: 5; opacity: .96; }
.dep-head { cursor: grab; }
.dep-head:active { cursor: grabbing; }
.dep-connect { color: var(--accent-2) !important; }
.dep-connect svg { width: 15px; height: 15px; }
.dep-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dep-name { font-weight: 700; font-size: 15px; flex: 1; }
.dep-count { background: var(--panel-2); color: var(--muted); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 2px 8px; }
.dep-actions { display: inline-flex; gap: 2px; }
.dep-actions button { width: 24px; height: 24px; border-radius: 6px; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.dep-actions button:hover { background: var(--panel-2); color: var(--text); }
.dep-mgrs { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--accent-soft); border-radius: var(--r-md); margin-bottom: 8px; }
.dep-mgr { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.dep-mgr small { display: block; color: var(--muted); font-size: 11px; }
.dep-mgr b { font-size: 13px; }
.mgr-ava, .emp-ava { width: 30px; height: 30px; font-size: 12px; }
.dep-nomgr { font-size: 12px; padding: 6px 2px 8px; font-style: italic; }
.dep-emps { display: flex; flex-direction: column; gap: 3px; }
.dep-emp { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: var(--r-sm); }
.dep-emp:hover { background: var(--panel-2); }
.dep-emp-main { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; }
.emp-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-pos { font-size: 11px; margin-left: auto; white-space: nowrap; }
.emp-star { width: 24px; height: 24px; border: none; background: transparent; color: var(--faint); cursor: pointer; font-size: 14px; flex: none; }
.emp-star.on { color: var(--warn); }
.emp-move { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; font-size: 11px; max-width: 90px; padding: 2px; }

/* ============ График: сетка с полосами-интервалами ============ */
.sched-body { padding: 0; overflow: auto; }
.month-nav { display: inline-flex; align-items: center; gap: 6px; }
.month-nav strong { min-width: 130px; text-align: center; font-size: 14px; }
.sc2 { font-size: 12px; width: max-content; }
.sc2-name { width: 230px; min-width: 230px; box-sizing: border-box; padding: 4px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; left: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; }
.sc2-name b { font-weight: 600; cursor: pointer; line-height: 1.2; }
.sc2-name small { color: var(--muted); font-size: 10px; margin-top: 1px; }
.sc2-head { display: flex; position: sticky; top: 0; z-index: 5; }
.sc2-head .sc2-days { display: flex; }
.sc2-hname { background: var(--panel-2); font-weight: 700; z-index: 6; }
.sc2-hday { box-sizing: border-box; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel-2); text-align: center; padding: 4px 0; font-weight: 700; }
.sc2-hday small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; }
.sc2-hday.we { background: var(--panel-3); }
.sc2-hday.sun, .sc2-cell.sun { border-right: 2px solid var(--text-soft, #98a2b3); }
/* заголовок отдела (повтор дат/дней недели) */
.sc2-grouphead { position: sticky; top: 36px; z-index: 4; }
.sc2-grouphead .sc2-name { background: var(--accent-soft); font-weight: 700; color: var(--accent-2); }
.sc2-grouphead .sc2-hday { background: var(--accent-soft); color: var(--accent-2); }
.sc2-gname { font-size: 12px; }
.sc2-row { display: flex; align-items: stretch; position: relative; }
.sc2-row:hover { z-index: 4; } /* наведённая строка выше соседних — её полоса не перекрывается */
.sc2-days { position: relative; min-height: 46px; }
.sc2-cells { position: absolute; inset: 0; display: flex; }
.sc2-cells .sc2-cell { height: 100%; }
.sc2-cell { box-sizing: border-box; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); position: relative; }
.sc2-cell.we { background: var(--panel-3); }
.sc2-cell.filled { background: rgba(232, 116, 43, .11); }
.sc2-cell.filled.we { background: rgba(232, 116, 43, .17); }
.sc2-ctext { position: absolute; top: 1px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; color: var(--accent-2); line-height: 14px; min-height: 14px; cursor: text; }
.sc2-ctext[contenteditable]:focus { outline: 1px solid var(--accent); background: var(--panel); border-radius: 3px; }
.sc2-bars { position: absolute; left: 0; right: 0; top: 22px; bottom: 2px; pointer-events: none; z-index: 1; }
.sc2-bar { position: absolute; top: 0; height: 20px; box-sizing: border-box; background: var(--accent); color: #fff; border-radius: 5px; pointer-events: auto; cursor: grab; display: flex; align-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.18); overflow: hidden; }
/* чередование цвета соседних полос в одной строке — оранжевый и бирюзовый (комплементарные, оба яркие) */
.sc2-bar--a { background: var(--accent); }
.sc2-bar--b { background: #0ea5a4; }
.sc2-bar:active { cursor: grabbing; }
/* наведение — на передний план (без сдвига); уход — возврат как было */
.sc2-bar:hover { z-index: 50; box-shadow: 0 4px 12px rgba(0,0,0,.32); }
.sc2-bar.ghost { background: var(--accent-soft); border: 1.5px dashed var(--accent); opacity: .8; pointer-events: none; }
.sc2-btext { flex: 1; text-align: center; font-size: 10px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.sc2-rz { width: 7px; align-self: stretch; cursor: ew-resize; flex: none; }
.sc2-rz.l { margin-right: -8px; } .sc2-rz.r { margin-left: -8px; }
.sc2[data-admin] .sc2-days { cursor: crosshair; }
.title-row { display: flex; align-items: center; gap: 12px; }
.sched-saved { color: #2bb673; font-size: 13px; font-weight: 600; opacity: 0; transition: opacity .2s; white-space: nowrap; pointer-events: none; }
.sched-saved.show { opacity: 1; }
.sched-print-bars { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; gap: 3px; padding-top: 5px; padding-bottom: 4px; }
.sched-print-bars .ppb-bar { width: 80%; height: 5px; border-radius: 3px; background: var(--accent); }
/* форма интервала в попапе */
.barform { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.barform .bf-row { display: flex; gap: 10px; }
.barform label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); flex: 1; }
.barform input { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--text); }
.barform .bf-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.barform .bf-acts .danger { margin-right: auto; }

/* ============ Техподдержка (сторона проекта) ============ */
.sup-body { display: flex; flex-direction: column; height: 100%; padding: 0; }
.sup-msgs { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.sup-empty { margin: auto; color: var(--muted); max-width: 360px; text-align: center; }
.sup-row { display: flex; }
.sup-row.me { justify-content: flex-end; }
.sup-item { display: flex; flex-direction: column; max-width: 72%; }
.sup-row.me .sup-item { align-items: flex-end; }
.sup-author { font-size: 11px; font-weight: 600; color: var(--accent-2); margin: 0 4px 3px; }
.sup-bub { padding: 8px 12px; border-radius: var(--r-md); background: var(--panel-2); border: 1px solid var(--line); font-size: 14px; line-height: 1.35; word-break: break-word; display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.sup-row.me .sup-bub { background: var(--accent); color: #fff; border-color: transparent; }
.sup-row.me .sup-author { color: var(--accent-2); }
.sup-txt { flex: 1; min-width: 0; }
.sup-time { font-size: 10px; opacity: .7; white-space: nowrap; align-self: flex-end; }
.sup-live { padding: 2px 18px 4px; color: var(--muted); font-size: 12px; font-style: italic; }
.sup-compose { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.sup-compose input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); color: var(--text); }
.on-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2bb673; vertical-align: middle; }

/* ============ Раздел: заголовок ============ */
.view-head .head-search { width: 240px; }

/* ============ LMPopup — плавающие окна ============ */
.lmw-root { position: fixed; inset: 0; pointer-events: none; }
.lmw-root.has-overlay { pointer-events: auto; }
.lmw-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.lmw { position: absolute; pointer-events: auto; min-width: 240px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px);
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; animation: lmw-in .16s var(--ease); }
@keyframes lmw-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.lmw-centered { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.lmw-head { display: flex; align-items: center; gap: 9px; padding: 11px 12px 11px 14px; border-bottom: 1px solid var(--line);
  user-select: none; flex: none; }
.lmw-head.movable { cursor: grab; }
.lmw-head.movable:active { cursor: grabbing; }
.lmw-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-2); flex: none; }
.lmw-ic svg { width: 16px; height: 16px; }
.lmw-title { font-weight: 700; font-size: 15px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lmw-save { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; flex: none; }
.lmw-save.saved { color: var(--ok); background: rgba(92,194,117,.12); }
.lmw-save.saving { color: var(--muted); background: var(--panel-2); }
.lmw-save.dirty { color: var(--warn); background: rgba(227,162,61,.14); }
.lmw-spin { width: 11px; height: 11px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: lmw-spin .7s linear infinite; }
@keyframes lmw-spin { to { transform: rotate(360deg); } }
.lmw-btn { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: none; background: transparent; color: var(--muted); border-radius: var(--r-sm); cursor: pointer; }
.lmw-btn:hover { background: var(--panel-2); color: var(--text); }
.lmw-btn svg { width: 16px; height: 16px; }
.lmw-close:hover { background: rgba(240,99,90,.15); color: var(--danger); }
.lmw-body { overflow: auto; padding: 16px 18px 18px; flex: 1; }
.lmw.collapsed .lmw-body, .lmw.collapsed .lmw-rez { display: none; }
.lmw-rez { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--line-strong) 50% 60%, transparent 60% 70%, var(--line-strong) 70% 80%, transparent 80%); }

/* ============ Кастомные тултипы ============ */
.lm-tip { position: fixed; z-index: 99999; background: var(--text); color: var(--bg); font-size: 12.5px; font-weight: 500;
  padding: 6px 10px; border-radius: 8px; max-width: 260px; box-shadow: var(--shadow-soft); opacity: 0; transform: scale(.96);
  transition: opacity .12s, transform .12s; pointer-events: none; line-height: 1.35; }
.lm-tip.show { opacity: 1; transform: scale(1); }
.lm-tip-arrow { position: absolute; width: 8px; height: 8px; background: var(--text); transform: rotate(45deg); }
.lm-tip[data-side="top"] .lm-tip-arrow { bottom: -4px; }
.lm-tip[data-side="bottom"] .lm-tip-arrow { top: -4px; }
.lm-tip[data-side="right"] .lm-tip-arrow { left: -4px; }
.lm-tip[data-side="left"] .lm-tip-arrow { right: -4px; }

/* ============ Логотип ============ */
.logo.logo-img, .sb-logo { padding: 0; overflow: hidden; }
.logo.logo-img img, .sb-logo img { width: 100%; height: 100%; display: block; }

/* ============ Сворачивание сайдбара ============ */
.sb-brand { position: relative; }
.sb-collapse { position: absolute; right: 2px; top: 6px; width: 26px; height: 26px; border: none; background: transparent; color: var(--muted); border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.sb-collapse:hover { background: var(--panel-2); color: var(--text); }
.sb-collapse svg { width: 16px; height: 16px; transition: transform .2s; }
.chat.sb-collapsed { --sidebar-w: 66px; }
.chat.sb-collapsed .sb-brand-txt, .chat.sb-collapsed .nav-item > span:not(.nav-badge), .chat.sb-collapsed .sb-me-info { display: none; }
.chat.sb-collapsed .nav-item { justify-content: center; padding: 10px; }
.chat.sb-collapsed .nav-item .nav-badge { position: absolute; top: 2px; right: 6px; margin: 0; min-width: 15px; height: 15px; font-size: 9px; padding: 0 3px; }
.chat.sb-collapsed .sb-collapse { right: 50%; transform: translateX(50%); top: 4px; }
.chat.sb-collapsed .sb-collapse svg { transform: rotate(180deg); }
.chat.sb-collapsed .sb-brand { justify-content: center; padding: 36px 0 14px; }
.chat.sb-collapsed .sb-me { justify-content: center; padding: 8px 0; }
.chat.sb-collapsed .sb-foot-row { flex-direction: column; }
@media (max-width: 760px) { .chat.sb-collapsed { --sidebar-w: 232px; } .chat.sb-collapsed .sb-brand-txt, .chat.sb-collapsed .nav-item > span, .chat.sb-collapsed .sb-me-info { display: revert; } }

/* ============ Профиль — широкий, в колонки ============ */
.prof-cols { display: grid; grid-template-columns: 200px 270px minmax(180px, 1fr); gap: 20px; }
.prof-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.prof-col .prof-ava-wrap { align-self: flex-start; }
.prof-col label { gap: 5px; }
@media (max-width: 780px) { .prof-cols { grid-template-columns: 1fr; } }

/* ============ Структура: drag-drop сотрудников ============ */
.dep-card.drop-hl { outline: 2px dashed var(--accent); outline-offset: 3px; }
.dep-emp.dragging { opacity: .4; }
.dep-emp-main[draggable="true"] { cursor: grab; }

/* ============ LMDialog ============ */
.lmd { min-width: 260px; }
.lmd-msg { font-size: 14px; margin-bottom: 12px; white-space: pre-wrap; color: var(--text); }
.lmd-input { width: 100%; margin-bottom: 14px; }
.lmd-actions { display: flex; justify-content: flex-end; gap: 8px; }
.lmd-btn { border: none; border-radius: var(--r-sm); padding: 9px 18px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.lmd-ok { background: var(--accent); color: #fff; }
.lmd-ok.danger { background: var(--danger); }
.lmd-cancel { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.lmd-btn:active { transform: translateY(1px); }

/* Структура: canvas заполняет область (без внутренних отступов/двойного скролла) */
#viewStructure .view-body { padding: 0; overflow: hidden; }
#structureTree { height: 100%; }

/* ============ Бренд «Сwiток» (хайтек) ============ */
.brand .wi, .sb-brand-txt .wi, .abar .brand .wi { color: var(--accent); font-style: italic; letter-spacing: -.5px; }
.sb-brand-txt b { letter-spacing: .3px; }
.sb-logo, .logo.logo-img { box-shadow: 0 6px 18px -6px var(--accent-soft), 0 0 0 1px var(--line); }

/* ============ Структура v2: ФИО, иконка-группа, drag&drop ============ */
.dep-emp { position: relative; }
.emp-info { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.emp-info .emp-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-info .emp-pos { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 0; text-align: left; }
.emp-move-btn { width: 26px; height: 26px; flex: none; border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: 7px; display: grid; place-items: center; }
.emp-move-btn:hover { background: var(--panel-2); color: var(--accent-2); }
.emp-move-btn svg { width: 15px; height: 15px; }
.mgr-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mgr-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dep-mgr { width: 100%; }
.dep-mgr .emp-star { margin-left: auto; }
.droppable.drop-hl { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: var(--r-sm); background: var(--accent-soft); }
.dep-mgrs.droppable { min-height: 30px; }
/* попап выбора отдела */
.move-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.move-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; }
.move-opt:hover { background: var(--panel-2); }
.move-opt input { width: 17px; height: 17px; accent-color: var(--accent); }
