/* ==========================================================================
   ЛК Консалт Плюс — стили
   Базируется на палитре основного сайта (см. /styles.css).
   ========================================================================== */

:root {
  /* Палитра — синхронизирована с основным сайтом */
  --ink: #0F1117;
  --ink-2: #1A1D26;
  --ink-3: #2A2E3A;
  --gold: #C9A84C;
  --gold-2: #B89539;
  --gold-soft: rgba(201, 168, 76, 0.12);
  --cream: #F8F7F4;
  --cream-2: #EFEDE6;
  --line: #E5E2D8;
  --line-dark: rgba(255, 255, 255, 0.08);
  --muted: #6B6B6B;
  --muted-dark: rgba(255, 255, 255, 0.62);
  --red: #C0392B;
  --green: #2E7D5B;

  --font-serif: 'Playfair Display', 'Times New Roman', serif;
  --font-sans: 'Manrope', 'Helvetica Neue', Arial, sans-serif;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 16px;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--gold-2); text-decoration: none; transition: color .15s; }
a:hover { color: var(--gold); }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; margin: 0 0 16px; color: var(--ink); }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

/* ===== Шапка ===== */
.lk-header {
  background: var(--ink);
  color: var(--cream);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 48px;
  border-bottom: 1px solid var(--line-dark);
}
.lk-header__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.lk-header__brand:hover { opacity: .85; }
.lk-header__brand img {
  height: 48px;
  width: auto;
  display: block;
  /* logo-light.png — тёмные буквы на прозрачном фоне.
     В шапке ЛК фон тёмный (var(--ink)), поэтому инвертируем цвета. */
  filter: invert(1) brightness(1.1);
}
.lk-header__user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted-dark);
}
.lk-header__user a { color: var(--cream); }
.lk-header__user a:hover { color: var(--gold); }

/* ===== Контейнер контента ===== */
.lk-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px;
}
.lk-page--narrow {
  max-width: 480px;
}

/* ===== Карточки ===== */
.lk-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.lk-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}
.lk-card__title {
  font-family: var(--font-serif);
  font-size: 20px;
  margin: 0;
}

/* ===== Формы ===== */
.lk-form { display: flex; flex-direction: column; gap: 16px; }
.lk-field { display: flex; flex-direction: column; gap: 6px; }
.lk-field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.lk-field input,
.lk-field select,
.lk-field textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.lk-field input:focus,
.lk-field select:focus,
.lk-field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.lk-field textarea { min-height: 120px; resize: vertical; }
.lk-field__hint { color: var(--muted); font-size: 12px; }
.lk-field__error { color: var(--red); font-size: 13px; }

/* ===== Кнопки ===== */
.lk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.lk-btn--primary {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
.lk-btn--primary:hover { background: var(--ink-2); }
.lk-btn--gold {
  background: var(--gold);
  color: var(--ink);
  border-color: var(--gold);
}
.lk-btn--gold:hover { background: var(--gold-2); border-color: var(--gold-2); }
.lk-btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.lk-btn--ghost:hover { background: var(--cream-2); }
.lk-btn--full { width: 100%; }

/* ===== Алёрты ===== */
.lk-alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid;
}
.lk-alert--error   { background: #FDECEA; color: #8A2A21; border-color: #F5BFBA; }
.lk-alert--success { background: #E7F4ED; color: #1E5E3F; border-color: #B8DBC7; }
.lk-alert--info    { background: var(--gold-soft); color: #6B5520; border-color: rgba(201,168,76,.35); }

/* ===== Логин-экран ===== */
.lk-auth {
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
}
.lk-auth__box {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 8px 32px rgba(15,17,23,.08);
  border: 1px solid var(--line);
}
.lk-auth__title {
  font-family: var(--font-serif);
  font-size: 24px;
  text-align: center;
  margin-bottom: 8px;
}
.lk-auth__subtitle {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  margin-bottom: 28px;
}
.lk-auth__footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
}

/* ===== Навигация в шапке (для залогиненных) ===== */
.lk-nav { display: flex; gap: 6px; flex: 1; }
.lk-nav__item {
  font-size: 14px;
  color: var(--muted-dark);
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.lk-nav__item:hover { color: var(--cream); background: rgba(255,255,255,.05); }
.lk-nav__item.is-active { color: var(--gold); background: rgba(201,168,76,.1); }
.lk-header__role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--gold);
  padding: 3px 8px;
  border: 1px solid rgba(201,168,76,.3);
  border-radius: 4px;
}

/* ===== Таблицы ===== */
.lk-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.lk-table thead { background: var(--cream-2); }
.lk-table th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.lk-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}
.lk-table tbody tr:last-child td { border-bottom: none; }
.lk-table tbody tr:hover { background: rgba(201,168,76,.04); }
.lk-table a.row-link { color: var(--ink); font-weight: 500; }
.lk-table a.row-link:hover { color: var(--gold-2); }

/* ===== Бейджи статусов ===== */
.lk-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.lk-badge--new      { background: #E7F0FA; color: #2557A7; }
.lk-badge--active   { background: #E7F4ED; color: #1E5E3F; }
.lk-badge--waiting  { background: #FFF4D6; color: #856200; }
.lk-badge--closed   { background: #F0F0F0; color: #555; }
.lk-badge--archived { background: #E8E6E0; color: #888; }

/* ===== Toolbar над таблицей ===== */
.lk-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.lk-toolbar__filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lk-toolbar__filters select,
.lk-toolbar__filters input[type=search] {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

/* ===== Чат внутри дела ===== */
.lk-chat { display: flex; flex-direction: column; gap: 12px; max-height: 600px; overflow-y: auto; overflow-x: clip; padding: 8px 8px; }

/* Цитата в сообщении-ответе */
.lk-msg__quote {
  display: block;
  background: rgba(255,255,255,.08);
  border-left: 3px solid var(--gold);
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.lk-msg--theirs .lk-msg__quote { background: rgba(0,0,0,.04); border-left-color: var(--gold-2); }
.lk-msg__quote-author { font-weight: 600; display: block; color: var(--gold); margin-bottom: 1px; }
.lk-msg--theirs .lk-msg__quote-author { color: var(--gold-2); }
.lk-msg__quote-text { opacity: .75; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Список событий в правой колонке */
.lk-eventlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.lk-eventlist__item { position: relative; padding-right: 60px; }
.lk-eventlist__item.is-past { opacity: .55; }
.lk-eventlist__actions {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.lk-eventlist__item:hover .lk-eventlist__actions,
.lk-eventlist__actions:hover { opacity: 1; }
.lk-eventlist__actions .lk-msg__action {
  width: 26px; height: 26px;
}
.lk-eventlist__actions .lk-msg__action svg { width: 13px; height: 13px; }

/* Подсветка сообщения при переходе по ссылке-цитате */
.lk-msg.is-highlight { animation: lk-msg-highlight 1.5s ease-out; }
@keyframes lk-msg-highlight {
  0%, 30% { box-shadow: 0 0 0 3px var(--gold); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Цитата в форме отправки */
.lk-chat-form__reply {
  display: none;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 13px;
}
.lk-chat-form__reply.is-active { display: flex; }
.lk-chat-form__reply > div { flex: 1; min-width: 0; }
.lk-chat-form__reply-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.lk-chat-form__reply-author { font-weight: 600; color: var(--gold-2); }
.lk-chat-form__reply-text { color: var(--ink); opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lk-chat-form__reply-clear { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; padding: 0; }
.lk-chat-form__reply-clear:hover { color: var(--red); }

/* ===== Полноэкранный режим чата ===== */
.lk-card--fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column;
  padding: 20px 28px 16px !important;
  background: #fff;
  overflow: auto;
}
.lk-card--fullscreen .lk-chat { max-height: calc(100vh - 220px); flex: 1; }
.lk-card--fullscreen .lk-chat-form { margin-top: 12px; }
.lk-card__fullscreen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  padding: 0;
}
.lk-card__fullscreen-btn:hover { color: var(--gold-2); border-color: var(--gold); background: var(--gold-soft); }
.lk-card__fullscreen-btn svg { width: 14px; height: 14px; }
body.has-fullscreen { overflow: hidden; }
.lk-msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
}
.lk-msg__meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.lk-msg--mine { align-self: flex-end; background: var(--ink); color: var(--cream); border-bottom-right-radius: 4px; }
.lk-msg--mine .lk-msg__meta { color: rgba(255,255,255,.6); text-align: right; }
.lk-msg--theirs { align-self: flex-start; background: var(--cream-2); color: var(--ink); border-bottom-left-radius: 4px; }
.lk-msg--system { align-self: center; background: transparent; color: var(--muted); font-size: 12px; font-style: italic; padding: 4px 12px; }
.lk-msg--deleted { opacity: .6; font-style: italic; }

/* Вложения внутри сообщения (скрепка из чата) */
.lk-msg__atts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.lk-msg__atts:first-child { margin-top: 0; }
.lk-msg__att-img {
  display: block;
  max-width: 280px;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
}
.lk-msg__att-img img {
  display: block;
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
}
.lk-msg__att-audio {
  width: 100%;
  max-width: 280px;
  border-radius: 6px;
}
.lk-msg--mine .lk-msg__att-audio { filter: invert(.92) hue-rotate(180deg); /* плеер виден на тёмном пузыре */ }
.lk-msg__att-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,.08);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  font-size: 12px;
  max-width: 280px;
}
.lk-msg--theirs .lk-msg__att-file { background: rgba(0,0,0,.04); }
.lk-msg__att-file:hover { background: rgba(255,255,255,.16); }
.lk-msg--theirs .lk-msg__att-file:hover { background: rgba(0,0,0,.08); }
.lk-msg__att-file .lk-fileicon { width: 24px; height: 24px; font-size: 8px; }
.lk-msg__att-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.lk-msg__att-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-msg__att-size { font-size: 10px; opacity: .7; }
.lk-msg__actions {
  position: absolute;
  top: 0;
  right: 100%;
  padding: 4px 6px 4px 4px;   /* визуальный отступ + увеличенная hover-зона */
  display: flex;
  gap: 4px;
  z-index: 2;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.lk-msg--theirs .lk-msg__actions {
  right: auto;
  left: 100%;
  padding: 4px 4px 4px 6px;
}
.lk-msg:hover .lk-msg__actions,
.lk-msg__actions:hover {
  opacity: 1;
  pointer-events: auto;
}
.lk-msg__action {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s;
  font: inherit;
  box-shadow: 0 1px 4px rgba(15,17,23,.08);
  padding: 0;
}
.lk-msg__action:hover { color: var(--gold-2); border-color: var(--gold); transform: scale(1.08); }
.lk-msg__action svg { width: 15px; height: 15px; }
.lk-msg__edit { display: none; margin-top: 8px; }
.lk-msg__edit.is-open { display: block; }
.lk-msg__edit textarea {
  width: 100%;
  min-height: 60px;
  background: rgba(255,255,255,.1);
  color: inherit;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 8px;
  font: inherit;
  resize: vertical;
}
.lk-msg--theirs .lk-msg__edit textarea { background: #fff; color: var(--ink); border-color: var(--line); }
.lk-msg__edit-actions { display: flex; gap: 6px; margin-top: 6px; }
.lk-msg__edit-actions button {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: .9;
}
.lk-msg__edit-actions button:hover { opacity: 1; }

/* ===== Inline-редактирование полей дела ===== */
.lk-edit-btn {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  cursor: pointer;
  vertical-align: middle;
  background: none;
  border: none;
  padding: 2px 4px;
  font: inherit;
}
.lk-edit-btn:hover { color: var(--gold-2); }
.lk-edit-btn svg { width: 14px; height: 14px; vertical-align: middle; }
.lk-inline-edit { display: none; margin-top: 8px; }
.lk-inline-edit.is-open { display: block; }
.lk-inline-edit input, .lk-inline-edit textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
.lk-inline-edit textarea { min-height: 100px; resize: vertical; }
.lk-inline-edit__actions { display: flex; gap: 8px; margin-top: 8px; }

/* ===== Кастомный file-input ===== */
.lk-fileinput { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lk-fileinput input[type=file] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.lk-fileinput__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold-2);
  background: transparent;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.lk-fileinput__btn:hover { background: var(--gold-soft); border-color: var(--gold-2); }
.lk-fileinput__btn svg { width: 18px; height: 18px; }
.lk-fileinput input[type=file]:focus + .lk-fileinput__btn {
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.lk-fileinput__name {
  color: var(--muted);
  font-size: 13px;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lk-fileinput__name.is-selected {
  color: var(--ink);
  font-weight: 500;
}

/* ===== Скрепка в чате ===== */
.lk-chat-form { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.lk-chat-form textarea {
  width: 100%;
  min-height: 80px;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  resize: vertical;
  transition: border-color .15s;
}
.lk-chat-form textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.lk-chat-form__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.lk-chat-form__attach {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lk-chat-form__attach input[type=file] {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.lk-chat-form__attach label {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--muted);
  transition: all .15s;
  background: #fff;
}
.lk-chat-form__attach label:hover { color: var(--gold-2); border-color: var(--gold); background: var(--gold-soft); }
.lk-chat-form__attach label svg { width: 18px; height: 18px; }
.lk-chat-form__attach-preview {
  display: none;
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  align-items: center;
  gap: 8px;
}
.lk-chat-form__attach-preview img { height: 32px; width: 32px; object-fit: cover; border-radius: 4px; }
.lk-chat-form__attach-preview.is-active { display: inline-flex; }
.lk-chat-form__attach-clear {
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 16px; line-height: 1;
}
.lk-chat-form__attach-clear:hover { color: var(--red); }

/* Кнопки записи аудио и эскалации в чате */
.lk-chat-action {
  width: 40px; height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  padding: 0;
  flex-shrink: 0;
}
.lk-chat-action:hover { color: var(--gold-2); border-color: var(--gold); background: var(--gold-soft); }
.lk-chat-action svg { width: 18px; height: 18px; }
.lk-chat-action--rec { color: var(--red, #C0392B); border-color: rgba(192,57,43,.3); }
.lk-chat-action--rec:hover { background: rgba(192,57,43,.08); border-color: var(--red, #C0392B); color: var(--red, #C0392B); }
.lk-chat-action--rec.is-active { background: var(--red, #C0392B); color: #fff; border-color: var(--red, #C0392B); }
.lk-chat-action--rec.is-active svg { animation: lk-voice-pulse 1s ease-in-out infinite; }
.lk-chat-action--escalate { color: #B89539; border-color: rgba(184,149,57,.4); }
.lk-chat-action--escalate:hover { background: rgba(184,149,57,.1); border-color: var(--gold); color: var(--gold-2); }
.lk-chat-action[disabled] { opacity: .4; cursor: not-allowed; }

@keyframes lk-voice-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* Индикатор «эскалировано» в шапке дела */
.lk-escalated-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(192,57,43,.08), rgba(201,168,76,.12));
  border: 1px solid var(--gold);
  border-left: 4px solid #B89539;
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-size: 13px;
}
.lk-escalated-banner__icon { font-size: 18px; }
.lk-escalated-banner__text { flex: 1; }
.lk-escalated-banner__text strong { color: #B89539; }

/* Подсветка строки эскалированного дела в админ-списке */
.lk-table tr.is-escalated {
  background: linear-gradient(90deg, rgba(184,149,57,.08), transparent);
  border-left: 3px solid #B89539;
}
.lk-table tr.is-escalated td:first-child { padding-left: 14px; }

/* Аудио-плеер в форме чата (превью записанного перед отправкой) */
.lk-voice-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  flex: 1;
  min-width: 200px;
}
.lk-voice-preview.is-active { display: flex; }
.lk-voice-preview audio { flex: 1; max-width: 100%; height: 30px; }
.lk-voice-preview__clear {
  background: none; border: none; color: var(--muted); cursor: pointer; padding: 0;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.lk-voice-preview__clear:hover { color: var(--red, #C0392B); background: rgba(192,57,43,.1); }

/* ===== Полоска документов над чатом ===== */
.lk-docs-bar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: visible;
}
.lk-docs-bar__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  height: 44px;
  cursor: pointer;
  user-select: none;
}
.lk-docs-bar__head:hover { background: rgba(201,168,76,.04); }
.lk-docs-bar__icon { color: var(--gold-2); font-size: 16px; display: inline-flex; }
.lk-docs-bar__icon svg { width: 18px; height: 18px; }
.lk-docs-bar__title { font-weight: 600; font-size: 14px; color: var(--ink); }
.lk-docs-bar__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px; height: 20px;
  padding: 0 7px;
  background: var(--gold-soft);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
}
.lk-docs-bar__spacer { flex: 1; }
.lk-docs-bar__add {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--gold);
  color: var(--gold-2);
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  padding: 0;
  flex-shrink: 0;
}
.lk-docs-bar__add:hover { background: var(--gold); color: var(--ink); transform: scale(1.08); }
.lk-docs-bar__add svg { width: 14px; height: 14px; }
.lk-docs-bar__toggle {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--gold-soft);
  color: var(--gold-2);
  cursor: pointer;
  padding: 0;
  transition: transform .2s;
  flex-shrink: 0;
}
.lk-docs-bar__toggle svg { width: 14px; height: 14px; transition: transform .2s; }
.lk-docs-bar.is-expanded .lk-docs-bar__toggle svg { transform: rotate(180deg); }

/* Лента-карусель */
.lk-docs-bar__list {
  display: none;
  gap: 8px;
  padding: 0 12px 10px;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--cream-2);
}
.lk-docs-bar.is-expanded .lk-docs-bar__list { display: flex; }
.lk-docs-bar__list::-webkit-scrollbar { height: 6px; }
.lk-docs-bar__list::-webkit-scrollbar-track { background: var(--cream-2); border-radius: 3px; }
.lk-docs-bar__list::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
.lk-docs-bar__empty { padding: 6px 14px 14px; color: var(--muted); font-size: 13px; font-style: italic; }

/* Чипс файла */
.lk-docs-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 6px;
  background: var(--cream-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  width: 180px;
  transition: all .15s;
}
.lk-docs-chip:hover { background: var(--gold-soft); border-color: var(--gold); }
.lk-docs-chip__icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-sans);
}
.lk-docs-chip__body { flex: 1; min-width: 0; line-height: 1.2; }
.lk-docs-chip__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lk-docs-chip__size { font-size: 10px; color: var(--muted); margin-top: 1px; }
.lk-docs-chip__more {
  flex-shrink: 0;
  width: 22px; height: 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.lk-docs-chip__more:hover { color: var(--gold-2); background: rgba(255,255,255,.5); }

/* Выпадающее меню действий на чипсе */
.lk-docs-chip__menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  z-index: 50;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(15,17,23,.15);
  padding: 4px;
  flex-direction: column;
}
.lk-docs-chip.is-menu-open .lk-docs-chip__menu { display: flex; }
.lk-docs-chip__menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink);
  border-radius: 4px;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.lk-docs-chip__menu-item:hover { background: var(--cream-2); }
.lk-docs-chip__menu-item--danger { color: var(--red); }
.lk-docs-chip__menu-item--danger:hover { background: rgba(192,57,43,.08); }
.lk-docs-chip__menu-item svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== Список файлов ===== */
.lk-files { display: flex; flex-direction: column; gap: 8px; }
.lk-file {
  position: relative;
  padding: 12px 14px;
  background: var(--cream-2);
  border-radius: var(--radius);
  color: var(--ink);
  transition: background .15s;
  border: 1px solid transparent;
}
.lk-file:hover { background: #fff; border-color: var(--line); }
.lk-file__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.lk-fileicon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
  font-family: var(--font-sans);
  margin-top: 1px;
}
.lk-file__name {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
  color: var(--ink);
}
.lk-file__actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.lk-file:hover .lk-file__actions,
.lk-file:focus-within .lk-file__actions { opacity: 1; }
.lk-file__btn {
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  padding: 0;
}
.lk-file__btn:hover { background: rgba(201,168,76,.15); color: var(--gold-2); }
.lk-file__btn--danger:hover { background: rgba(192,57,43,.1); color: var(--red); }
.lk-file__btn svg { width: 14px; height: 14px; }
.lk-file__bottom {
  font-size: 11px;
  color: var(--muted);
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.lk-file__author { font-weight: 500; }
.lk-file__date { color: var(--muted); }

/* ===== Кнопка «+» в шапках карточек (события, документы) ===== */
.lk-card__add-btn {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold-2);
  background: #fff;
  cursor: pointer;
  transition: all .2s var(--ease, ease);
  padding: 0;
  position: relative;
}
.lk-card__add-btn svg { width: 18px; height: 18px; transition: transform .2s; }
.lk-card__add-btn:hover {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 0 0 4px var(--gold-soft);
  transform: scale(1.05);
}
.lk-card__add-btn:hover svg { transform: rotate(90deg); }
.lk-card__add-btn:active { transform: scale(0.95); }

/* лёгкая «привлекающая» подсветка раз в несколько секунд */
@keyframes lk-pulse-attract {
  0%, 100% { box-shadow: 0 0 0 0 var(--gold-soft); }
  50% { box-shadow: 0 0 0 8px transparent; }
}
.lk-card__add-btn:not(:hover) { animation: lk-pulse-attract 3s ease-in-out infinite; }

/* ===== Модальное окно ===== */
.lk-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.lk-modal.is-open { display: flex; }
.lk-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,17,23,.55);
  backdrop-filter: blur(2px);
}
.lk-modal__box {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: calc(100% - 32px);
  padding: 28px 28px 24px;
  box-shadow: 0 20px 60px rgba(15,17,23,.35);
  border: 1px solid var(--line);
  animation: lk-modal-in .18s ease-out;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.lk-modal__box--wide { max-width: 560px; }
.lk-modal__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; border: none; background: transparent;
  color: var(--muted); cursor: pointer; transition: all .15s;
  padding: 0;
}
.lk-modal__close:hover { background: var(--cream-2); color: var(--ink); }
.lk-modal__close svg { width: 16px; height: 16px; }
@keyframes lk-modal-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.lk-modal__title {
  font-family: var(--font-serif);
  font-size: 20px;
  margin: 0 0 10px;
  color: var(--ink);
}
.lk-modal__text { color: var(--ink); font-size: 14px; line-height: 1.5; margin: 0 0 22px; }
.lk-modal__text strong { color: var(--gold-2); }
.lk-modal__actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ===== Двухколоночный layout ===== */
.lk-cols { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .lk-cols { grid-template-columns: 1fr; } }

.lk-page--wide { max-width: 1440px; }

/* ===== Календарь — мини-месяцы ===== */
.cal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 1100px) { .cal-grid { grid-template-columns: 1fr; } }

.cal-month {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 18px 14px;
}
.cal-month__head {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  color: var(--ink);
  text-transform: capitalize;
}
.cal-month__head small {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}
.cal-month__dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-month__dow span {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 4px 0;
}
.cal-month__dow span:nth-child(6),
.cal-month__dow span:nth-child(7) { color: var(--gold-2); }

.cal-month__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink);
  border-radius: 6px;
  cursor: default;
  transition: background .15s;
}
.cal-day--other { color: rgba(0,0,0,.18); pointer-events: none; }
.cal-day--weekend { color: var(--gold-2); }
.cal-day--today {
  background: var(--ink);
  color: var(--cream);
  font-weight: 600;
}
.cal-day--has-events {
  background: var(--gold-soft);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.cal-day--has-events:hover { background: var(--gold); color: var(--ink); }
.cal-day--has-events.cal-day--today { background: var(--gold-2); color: #fff; }
.cal-day--has-events::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-2);
}
.cal-day--today.cal-day--has-events::after,
.cal-day--today::after { background: var(--gold); }

/* Popover при hover на день с событиями */
.cal-day__popover {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  z-index: 30;
  min-width: 240px;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(15,17,23,.18);
  padding: 12px 14px;
  display: none;
  text-align: left;
  white-space: normal;
  pointer-events: none;
}
.cal-day:hover .cal-day__popover { display: block; }
.cal-day__pop-date {
  font-size: 12px;
  color: var(--gold-2);
  font-weight: 600;
  margin-bottom: 6px;
}
.cal-day__pop-event { padding: 6px 0; border-top: 1px dashed var(--line); }
.cal-day__pop-event:first-of-type { border-top: none; padding-top: 0; }
.cal-day__pop-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.cal-day__pop-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ===== Пустое состояние ===== */
.lk-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
}

/* ===== Утилиты ===== */
.muted  { color: var(--muted); }
.small  { font-size: 13px; }
.center { text-align: center; }
.right  { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.row { display: flex; gap: 12px; align-items: center; }
.flex-1 { flex: 1; }
