:root {
  --bg: #f7f8fb;
  --sidebar-bg: #ffffff;
  --column-bg: #eef0f5;
  --column-bg-hover: #e8ebf3;
  --card-bg: #ffffff;
  --border: #e6e8f0;
  --border-strong: #d7dbe6;
  --text: #1a1d29;
  --text-muted: #767c8f;
  --text-faint: #a3a8b8;
  --accent: #1f6b47;
  --accent-hover: #17573a;
  --accent-soft: #e7f3ec;
  --success: #12b76a;
  --success-soft: #e8faf1;
  --danger: #e6482e;
  --danger-soft: #fdeeec;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(21, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(21, 24, 40, 0.06), 0 1px 2px rgba(21, 24, 40, 0.08);
  --shadow-hover: 0 8px 20px rgba(21, 24, 40, 0.10), 0 2px 6px rgba(21, 24, 40, 0.08);
  --shadow-modal: 0 24px 48px -12px rgba(21, 24, 40, 0.35);
}

* { box-sizing: border-box; }

/* Author `display` rules on a class (.project-item, .board-tab, etc.) beat
   the UA's [hidden]{display:none} at equal specificity — the later rule in
   the sheet wins, and ours always comes later. Force it everywhere once,
   instead of re-discovering this per element (see modal-overlay[hidden],
   same bug, fixed 2026-09-08 morning). */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
  color: var(--text);
}

::selection { background: var(--accent-soft); color: var(--accent-hover); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  padding: 2px 8px 24px;
}

.logo-sparrow {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Своя картинка вместо воробья (lib/logo.js): стоит одна, без «CHEEK» (его прячет app.js), поэтому крупно —
   почти на всю ширину шапки (Константин 29.09.2026: «у ксении увеличить надо картинку, убрать зеленое CHEEK»). */
.logo-sparrow.logo-own {
  width: auto;
  height: 110px;
  max-width: 100%;
}

.brand-text {
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  padding: 4px 10px 8px;
}

.project-list { display: flex; flex-direction: column; gap: 1px; }

.project-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.project-item > span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item:hover { background: var(--bg); }
.project-item.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.project-item.add-item { color: var(--text-faint); font-weight: 500; margin-top: 6px; }
.project-item.add-item:hover { color: var(--accent); background: var(--accent-soft); }

.project-status {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.loading { color: var(--text-muted); font-size: 13px; padding: 8px 10px; }

.folder-block { margin-bottom: 2px; }

.folder-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.folder-header:hover { background: var(--bg); }

.folder-toggle {
  flex-shrink: 0;
  width: 10px;
  color: var(--text-faint);
  font-size: 10px;
  transition: transform 0.12s ease;
}

.folder-header.collapsed .folder-toggle { transform: rotate(-90deg); }

.folder-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}

.folder-projects {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  margin: 0 0 2px 20px;
}

.folder-projects:empty::after {
  content: 'Пусто — переместите проект значком 📁';
  display: block;
  font-size: 11.5px;
  color: var(--text-faint);
  padding: 6px 10px;
}

.item-folder-btn {
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 2px;
  opacity: 0;
  border-radius: 4px;
}

.project-item:hover .item-folder-btn { opacity: 0.6; }
.item-folder-btn:hover { opacity: 1 !important; background: var(--bg); }

.folder-picker-select {
  font-family: inherit;
  font-size: 12.5px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 4px;
  max-width: 120px;
}

/* ---- Main / boards ---- */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.boards-bar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.current-project-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.board-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

.board-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.board-tab > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.board-tab:hover { background: var(--accent-soft); color: var(--accent-hover); }
.board-tab.active { background: var(--accent); color: #fff; font-weight: 600; }
.board-tab.add-item { color: var(--text-faint); border: 1px dashed var(--border-strong); background: transparent; }
.board-tab.add-item:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.board-view {
  flex: 1;
  overflow: auto;
  padding: 22px 28px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
}
.empty-state h2 { color: var(--text); font-size: 17px; font-weight: 600; margin-bottom: 4px; }

/* ---- Kanban ---- */

.kanban {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 100%;
}

.kanban-column {
  background: var(--column-bg);
  border-radius: var(--radius);
  width: 284px;
  flex-shrink: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  max-height: 100%;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 12px;
  margin-bottom: 4px;
  position: relative;
}

.kanban-column-header::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 2.5px;
  border-radius: 999px;
  background: var(--col-accent, var(--accent));
  opacity: 0.55;
}

.kanban-column-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.kanban-column-title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-column-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: #fff;
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.kanban-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
  margin: -2px;
  border-radius: var(--radius-sm);
  transition: background-color 0.12s ease;
}

.task-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  box-shadow: var(--shadow);
  cursor: grab;
  border: 1px solid transparent;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.task-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border);
  transform: translateY(-1px);
}

.task-card.dragging {
  opacity: 0.4;
  transform: rotate(-1.5deg);
}

.kanban-cards.drag-over {
  background: rgba(91, 91, 240, 0.06);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

/* Кнопка стоит над карточками, под шапкой колонки (29.09.2026) — отступ снизу, не сверху. */
.add-task-btn {
  margin: 0 0 10px;
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.add-task-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.kanban-column.add-column {
  background: transparent;
  width: 224px;
  align-items: stretch;
  justify-content: flex-start;
  padding-top: 2px;
}

.add-column-btn {
  width: 100%;
  background: transparent;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease, background-color 0.12s ease;
}
.add-column-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.inline-create-input {
  width: 100%;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.inline-create-input:focus { outline: none; }
/* Поле новой задачи встаёт на место кнопки над карточками — с тем же отступом до первой. */
.kanban-column > .inline-create { margin-bottom: 10px; }

.inline-rename-input { flex: 1; min-width: 0; padding: 4px 6px; }

.project-item.dragging,
.board-tab.dragging,
.kanban-column.dragging {
  opacity: 0.4;
}

.kanban-column-title { cursor: text; }
.kanban-column-header { cursor: grab; }

.task-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 9px;
  padding-right: 20px;
  color: var(--text);
}

.task-card-sku {
  display: inline-block; margin: 0 4px;
  font-size: 11.5px; font-weight: 500; color: var(--text-muted);
  background: var(--bg-subtle, #f1f3f5); border-radius: 4px; padding: 0 5px;
}

.task-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 9px;
}

.tag-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  letter-spacing: 0.01em;
}

.task-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
}

.due-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 7px;
  border-radius: 6px;
}

.due-date.overdue { color: var(--danger); background: var(--danger-soft); }

.avatars { display: flex; align-items: center; }

.avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card-bg);
  margin-left: -7px;
  box-shadow: var(--shadow-xs);
}
.avatar:first-child { margin-left: 0; }
.avatar.avatar-overflow { background: var(--text-faint); font-size: 9px; }

/* ---- Modal ---- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 20, 33, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: overlay-in 0.15s ease;
}

.modal-overlay[hidden] {
  display: none;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 26px;
  position: relative;
  box-shadow: var(--shadow-modal);
  animation: modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: var(--bg);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: background-color 0.12s ease, color 0.12s ease;
}
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }

.modal h2 { margin: 0 24px 16px 0; font-size: 18px; }

.modal-field { margin-bottom: 18px; }
.modal-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.modal-field-value { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.modal-field-value.muted { color: var(--text-muted); font-style: italic; }
.modal-field-value a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.modal-field-value a:hover { color: var(--accent-hover); }

.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}

.value-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
}

.picker-panel {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
}

/* Прокручивается список, а не вся панель: строка поиска должна оставаться
   на виду, пока крутишь имена. */
.picker-list { max-height: 180px; overflow-y: auto; }

.picker-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  margin-bottom: 6px;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}
.picker-search:focus { border-color: var(--accent); }

.picker-empty { padding: 10px 7px; font-size: 12.5px; color: var(--text-muted); }

.picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.picker-row:hover { background: var(--bg); }
.picker-row input { cursor: pointer; }
/* Название занимает всю ширину, крестик удаления прижат к правому краю строки. */
.picker-row-label { flex: 1; min-width: 0; }
.picker-row-delete { margin-left: auto; }

.modal-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.modal-field-label-row .modal-field-label { margin-bottom: 0; }

/* Кнопок «Изменить» больше нет — поля открываются двойным кликом по значению.
   Чтобы это было видно без подсказки, под курсором поле подсвечивается, как
   строка, по которой можно кликнуть. */
.modal-field-value.editable {
  cursor: text;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
.modal-field-value.editable:hover {
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
}

.modal-title-input {
  width: 100%;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 24px 18px 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  margin-left: -8px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.modal-title-input:hover { background: var(--bg); }
.modal-title-input:focus {
  border-color: var(--accent);
  background: #fff;
  outline: none;
}

.modal-field-input,
.modal-field-textarea {
  width: 100%;
  font-size: 13.5px;
  font-family: inherit;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.modal-field-input:focus,
.modal-field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.modal-save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.modal-save-status {
  font-size: 12px;
  color: var(--text-muted);
}
/* Автосохранение не прошло — видно сразу, а не серым шёпотом (29.09.2026). */
.modal-save-status.is-error { color: var(--danger); }

.modal-save-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s ease, transform 0.05s ease;
}
.modal-save-btn:hover { background: var(--accent-hover); }
.modal-save-btn:active { transform: scale(0.97); }
.modal-save-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.login-modal { width: 360px; text-align: center; }
.login-modal h2 { margin: 0 0 8px; }
.login-modal p { color: var(--text-muted); font-size: 14px; margin: 0 0 18px; }

.login-link-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.12s ease;
}
.login-link-btn:hover { background: var(--accent-hover); }

.login-status { margin-top: 16px; font-size: 12px; color: var(--text-muted); }

/* Запасной путь входа: код, который можно отправить боту текстом. */
.login-fallback { margin-top: 18px; border-top: 1px solid var(--border, #e3e6ee); padding-top: 14px; }
.login-fallback .login-status { margin-top: 0; }
.login-code {
  display: block;
  margin: 10px 0;
  padding: 8px 10px;
  background: var(--column-bg, #eef0f5);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  word-break: break-all;
  user-select: all;
}
.login-copy { padding: 7px 16px; font-size: 13px; border: none; cursor: pointer; }

/* ---- Delete controls ---- */

.item-delete-btn {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  border-radius: 50%;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.project-item:hover .item-delete-btn,
.board-tab:hover .item-delete-btn,
.folder-header:hover .item-delete-btn,
.kanban-column-header:hover .item-delete-btn,
.picker-row:hover .item-delete-btn {
  opacity: 1;
}

.item-delete-btn:hover { background: var(--danger-soft); color: var(--danger); }

.board-tab.active .item-delete-btn { color: rgba(255, 255, 255, 0.75); }
.board-tab.active .item-delete-btn:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }

.task-card {
  position: relative;
}

.task-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  background: var(--card-bg);
  border-radius: 50%;
  color: var(--text-faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  box-shadow: var(--shadow-xs);
  transition: opacity 0.12s ease, background-color 0.12s ease, color 0.12s ease;
}

.task-card:hover .task-delete-btn { opacity: 1; }
.task-delete-btn:hover { background: var(--danger-soft); color: var(--danger); }

/* «Задача выполнена» — крупная кнопка сразу под названием: это главное действие
   карточки, а не пункт в ряду мелких. Отмеченная задача красится зелёным. */
.modal-done-row { display: flex; align-items: center; gap: 10px; margin: 2px 0 14px; }
.modal-done-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.modal-done-btn:hover { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.modal-done-btn.is-done { background: var(--success-soft); border-color: var(--success); color: var(--success); }
.modal-done-btn:disabled { opacity: 0.6; cursor: default; }
/* «Сдать на проверку» — закрыть чужую задачу нельзя, закрывает постановщик (25.09.2026). */
.modal-done-btn.is-handover:not(.is-done) { border-color: var(--accent, #4f6bed); color: var(--accent, #4f6bed); }
.modal-done-btn.is-handover:not(.is-done):hover { background: var(--card-bg); filter: brightness(0.97); }
.modal-done-hint { font-size: 12px; color: var(--text-muted); }
/* «На проверке» (25.09.2026, lib/review.js): плашка на карточке и в списках, «Вернуть в работу» в карточке. */
.review-chip {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 6px; padding: 1px 6px;
  border: 1px solid var(--accent, #4f6bed); border-radius: 999px;
  font-size: 11px; line-height: 16px; color: var(--accent, #4f6bed); white-space: nowrap;
}
.modal-return-btn {
  display: inline-flex; align-items: center;
  padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--text);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.modal-return-btn:hover { border-color: var(--danger, #d64545); color: var(--danger, #d64545); }
.modal-return-btn:disabled { opacity: 0.6; cursor: default; }
.modal-return-btn[hidden] { display: none; }
.modal-done-undo { margin-left: 6px; padding: 0; border: 0; background: none; font: inherit; color: var(--accent, #4f6bed); text-decoration: underline; cursor: pointer; }
.modal-done-undo:disabled { opacity: .5; cursor: default; }

/* Выполненная задача остаётся видна на доске — на случай досок без «Готово». */
.task-card.is-done .task-card-title { text-decoration: line-through; color: var(--text-muted); }

.modal-delete-btn {
  margin-right: auto;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.modal-delete-btn:hover { background: var(--danger-soft); border-color: var(--danger-soft); }

/* ---- Mobile (<=768px) ---- */

.sidebar-toggle {
  display: none;
  border: none;
  background: var(--bg);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 82vw;
    max-width: 300px;
    z-index: 101;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-modal);
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(21, 24, 40, 0.35);
    z-index: 100;
  }
  .sidebar-overlay[hidden] { display: none; }

  .boards-bar {
    padding: 12px 14px;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .current-project-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-tabs {
    flex-wrap: nowrap;
  }

  .board-tab {
    flex-shrink: 0;
  }

  .board-view {
    padding: 14px;
  }

  .kanban-column {
    width: 82vw;
    max-width: 320px;
  }

  /* No hover on touch — keep otherwise hover-only controls visible */
  .item-delete-btn,
  .item-folder-btn,
  .task-delete-btn {
    opacity: 1;
  }

  .modal {
    width: 100%;
    padding: 20px;
  }
}

/* ---- срезы: задачи по человеку и по тегу ------------------------------- */

.sidebar-section-title.section-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin-top: 14px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.sidebar-section-title.section-toggle:hover { color: var(--text-muted); }
.section-caret { font-size: 9px; }
/* плюс/минус мельче галочки по рисунку, поэтому чуть крупнее и по центру */
.section-caret-plus { font-size: 12px; width: 9px; display: inline-block; text-align: center; }
/* сколько сейчас сотрудников — видно и когда секция свёрнута */
.section-count { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--text-faint); }

.filter-list { display: flex; flex-direction: column; gap: 1px; }
.filter-list.collapsed { display: none; }

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.filter-item:hover { background: var(--bg); }
.filter-item.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }

.filter-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.filter-avatar {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--column-bg);
  color: var(--text-muted);
  font-size: 9.5px; font-weight: 700;
}
.filter-avatar.sm { width: 20px; height: 20px; font-size: 9px; }

.filter-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); }

/* --- сам срез в главной области --- */

.board-view.filter-view { display: block; overflow-y: auto; padding: 20px 24px 40px; }

.filter-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-title { margin: 0; font-size: 20px; font-weight: 700; color: var(--text); }
.filter-count { font-size: 13px; color: var(--text-muted); }
.filter-toggle {
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
}
.filter-toggle:hover { background: var(--bg); color: var(--text); }

.filter-group { margin-bottom: 22px; }
.filter-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.filter-group-name { font-size: 13px; font-weight: 700; color: var(--text); }
.filter-group-count {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
  background: var(--column-bg);
  border-radius: 10px;
  padding: 1px 7px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}
.filter-row:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.filter-row.is-done { opacity: 0.55; }
.filter-row.is-done .filter-row-title { text-decoration: line-through; }

.filter-row-main { flex: 1; min-width: 0; }
.filter-row-title { font-size: 13.5px; color: var(--text); margin-bottom: 4px; }
.filter-row-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-crumb { font-size: 11.5px; color: var(--text-faint); }
.filter-due { font-size: 11.5px; color: var(--text-muted); }
.filter-due.is-overdue { color: var(--danger); font-weight: 600; }
.filter-chip {
  font-size: 10.5px;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 7px;
}
.filter-row-who { display: flex; flex: none; }
.filter-row-who .filter-avatar + .filter-avatar { margin-left: -6px; border: 2px solid var(--card-bg); }

/* ---- подзадачи на карточке — как в Weeek (25.09.2026) ------------------ */

.subtasks { margin-top: 10px; }

/* Шапка «значок · полоска · 3/5». Она же — кнопка свернуть/раскрыть список. */
.subtasks-head {
  display: block; width: 100%; padding: 2px 0;
  border: 0; background: none; cursor: pointer;
  font-family: inherit; text-align: left;
}
.subtasks-progress {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-faint); font-size: 12px;
}
.subtasks-head:hover .subtasks-progress { color: var(--text-muted); }
.subtasks-icon {
  flex: none; width: 15px; height: 15px;
  background: currentColor;
  -webkit-mask: url(/assets/icon-subtasks.svg) center / contain no-repeat;
  mask: url(/assets/icon-subtasks.svg) center / contain no-repeat;
}
.subtasks-bar {
  flex: 1; min-width: 40px; height: 4px;
  border-radius: 2px; background: var(--border); overflow: hidden;
}
.subtasks-bar-fill {
  display: block; height: 100%; width: 0;
  border-radius: 2px; background: var(--success);
  transition: width 0.2s ease;
}
.subtasks-count { flex: none; font-variant-numeric: tabular-nums; }
.subtasks-progress.is-complete .subtasks-count { color: var(--success); font-weight: 600; }

.subtasks-list { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.subtasks-more {
  align-self: flex-start; margin: 2px 0 0 30px; padding: 2px 0;
  border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--text-muted);
}
.subtasks-more:hover { color: var(--text); text-decoration: underline; }

.subtask {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 4px 6px; border-radius: 6px;
  font-size: 13px; line-height: 1.35; color: var(--text); cursor: pointer;
}
.subtask:hover { background: var(--bg); }
.subtask.is-done { color: var(--text-faint); }
.subtask.is-done .subtask-title { text-decoration: line-through; }
/* Кружок — кнопка «выполнено», как в Weeek: пустой круг, у выполненной — зелёный с
   галочкой. Размер под палец и мышь; сверху выровнен по первой строке названия. */
.subtask-mark {
  flex: none; width: 20px; height: 20px; margin-top: -1px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 1.5px solid var(--border-strong); border-radius: 50%;
  background: transparent; color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1; cursor: pointer;
}
.subtask-mark:hover { border-color: var(--success); background: var(--success-soft); }
.subtask-mark:disabled { opacity: 0.5; cursor: default; }
.subtask.is-done .subtask-mark { border-color: var(--success); background: var(--success); color: #fff; }

/* Крестик подзадачи — как у карточки: не мозолит глаза, появляется на наведении. */
.subtask-delete-btn {
  flex: none; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 50%;
  background: transparent; color: var(--text-faint);
  font-size: 13px; line-height: 1; cursor: pointer;
  /* Не прячем совсем, как на карточке: жалоба была ровно на то, что кнопки
     «удалить подзадачу» не видно, да и на телефоне наведения не существует. */
  opacity: 0.4; transition: opacity 0.12s ease;
}
.subtask:hover .subtask-delete-btn { opacity: 1; }
.subtask-delete-btn:hover { background: var(--danger-soft); color: var(--danger); }
/* Название переносится целиком, как в Weeek: обрезанное «план 4 рассылок в бота (тз…»
   не говорит, что именно надо сделать. */
.subtask-title { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.subtask-due { flex: none; font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
/* Ветка подзадач второго уровня и глубже — та же линия слева, что у цепочки
   комментариев, чтобы вложенность читалась одинаково по всему интерфейсу. */
.subtasks-kids { margin-left: 7px; padding-left: 9px; border-left: 2px solid var(--border); }
.subtask .filter-avatar.sm { flex: none; margin-left: 2px; }
.subtask-due.is-overdue { color: var(--danger); font-weight: 600; }

/* ---- раскрывающиеся секции в карточке задачи --------------------------- */

.modal-parent { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px; }
.modal-parent-label { color: var(--text-faint); }
.modal-parent-link {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 12px; color: var(--accent); text-decoration: underline;
}

.modal-section { border-top: 1px solid var(--border); margin-top: 4px; }
.modal-section.is-empty .modal-section-title,
.modal-section.is-empty .modal-section-count { color: var(--text-faint); }

/* Строка добавления в разделах карточки: подзадача, комментарий, файл.
   Поле тянется, кнопка и подпись о ходе дела прижаты к нему справа; на узком
   экране всё переносится в столбик, иначе поле схлопывается до пары букв. */
.section-list:empty { display: none; }
.add-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  /* якорь для выпадающей подсказки «@» */
  position: relative;
}
.add-form-input {
  flex: 1 1 200px;
  min-width: 0;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  resize: vertical;
}
.add-form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.add-form-btn {
  flex-shrink: 0;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.add-form-btn:hover { background: var(--accent-hover); }
.add-form-btn:disabled { opacity: 0.6; cursor: default; }
.add-form-status { font-size: 12px; color: var(--text-muted); }
.add-file-btn {
  display: inline-block;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.add-file-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Скриншоты в комментарии: кнопка выбора, полоска превью и подсветка при
   перетаскивании файла на форму. */
.add-form-shot {
  flex-shrink: 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.add-form-shot:hover { border-color: var(--accent); color: var(--accent); }
.add-form.is-dropping {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}
/* Полоска занимает всю ширину формы — иначе превью втискиваются между полем
   и кнопкой и ломают строку. */
.add-form-atts {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.add-form-att {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.add-form-att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.add-form-att-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  padding: 0;
  line-height: 16px;
  text-align: center;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 24, 40, 0.62);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.add-form-att-del:hover { background: var(--danger); }

.modal-section-head {
  display: flex; align-items: center; gap: 7px;
  width: 100%; padding: 11px 2px;
  border: 0; background: none; cursor: pointer;
  font-family: inherit; text-align: left;
}
.modal-section-head:hover .modal-section-title { color: var(--accent-hover); }
.modal-section-caret { font-size: 9px; color: var(--text-faint); }
.modal-section-title { font-size: 13px; font-weight: 600; color: var(--text); }
.modal-section-count {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  background: var(--column-bg); border-radius: 10px; padding: 1px 7px;
}
.modal-section-body { padding: 0 2px 12px; }

.file-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.file-kind { flex: none; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.file-size { flex: none; font-size: 11px; color: var(--text-faint); }
.file-warn {
  margin-top: 8px; padding: 7px 10px;
  background: var(--danger-soft); border-radius: var(--radius-sm);
  font-size: 11.5px; color: var(--danger);
}

.comment { padding: 9px 0; }
.comment-root { border-bottom: 1px solid var(--border); }
.comment-root:last-child { border-bottom: 0; }
/* Ветка ответов: вертикальная линия слева, как в Weeek. Отступ небольшой —
   цепочки бывают в 4 уровня, крупный сдвиг сплющил бы текст. */
.comment-kids { margin: 6px 0 0 9px; padding-left: 11px; border-left: 2px solid var(--border); }
.comment-kids .comment { padding: 7px 0; }
.comment-kids .comment:first-child { padding-top: 2px; }
.comment-kids .comment:last-child { padding-bottom: 0; }
.comment-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.comment-author { font-size: 12.5px; font-weight: 600; color: var(--text); }
.comment-date { font-size: 11px; color: var(--text-faint); }
.comment-text { font-size: 12.5px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.comment-att { margin-top: 5px; font-size: 12px; }
.comment-att a { color: var(--accent); }
.att-note { color: var(--text-faint); font-size: 11px; margin-left: 6px; }

/* Сетка превью. auto-fill вместо фиксированного числа колонок: в комментарии бывает
   и одна картинка, и десяток, а карточка задачи узкая. */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.photo { position: relative; }

.photo-img {
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--border);
  background: var(--bg-soft, #f3f4f6);
  cursor: zoom-in;
  display: block;
}

.photo-img:hover { border-color: var(--accent); }

/* Просмотр во весь экран — поверх модалки задачи (у неё z-index 200). */
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 12, 20, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  cursor: zoom-out;
  animation: overlay-in 0.15s ease;
}

.photo-viewer[hidden] { display: none; }

.photo-viewer-img {
  max-width: 100%;
  max-height: calc(100vh - 90px);
  object-fit: contain;
  border-radius: var(--radius-sm, 6px);
}

.photo-viewer-cap { color: #fff; font-size: 12.5px; opacity: 0.85; }

/* ---- верхняя строка с поиском (видна на всех экранах) ------------------ */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 28px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 720px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  color: var(--text-faint);
  pointer-events: none;
}

.global-search {
  width: 100%;
  padding: 9px 34px 9px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.global-search:focus { border-color: var(--accent); background: #fff; }
.global-search::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: 8px;
  border: none;
  background: none;
  color: var(--text-faint);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.search-clear:hover { color: var(--text); background: var(--column-bg); }

.whoami {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- «Мои задачи» / «Все задачи» в боковой панели --------------------- */
.quick-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 18px;
}

.quick-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.quick-item:hover { background: var(--column-bg); }
.quick-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.quick-icon { font-size: 13px; color: var(--text-faint); width: 16px; text-align: center; }
.quick-item.active .quick-icon { color: var(--accent); }

/* ---- таблица списка задач --------------------------------------------- */
.board-view.list-view { display: block; padding: 22px 28px 40px; overflow: auto; }

.list-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.list-title { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.list-count { font-size: 12.5px; color: var(--text-muted); }
.list-toggle {
  margin-left: auto;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.list-toggle:hover { border-color: var(--border-strong); color: var(--text); }

.task-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: clip;
  font-size: 13px;
}

/* Шапка — обычным регистром, как в самом Weeek: в верхнем регистре
   «Наименование» и «Исполнитель» не влезали в свои доли и обрезались
   многоточием (проверено скриншотом). */
.task-table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 11px 8px;
  border-bottom: 1px solid var(--border);
  background: #fcfcfe;
  white-space: nowrap;
}
.task-table th.sortable { cursor: pointer; user-select: none; }
.task-table th.sortable:hover { color: var(--text); background: var(--column-bg); }
.task-table th.sorted { color: var(--accent); }
.sort-caret { margin-left: 5px; font-size: 11px; }

.task-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}
.task-table tr:last-child td { border-bottom: none; }

.task-row { cursor: pointer; }
.task-row:hover td { background: var(--accent-soft); }
.task-row.is-done { opacity: 0.55; }
.task-row.is-done .row-title { text-decoration: line-through; }

.row-dot {
  display: inline-block;
  width: 11px; height: 11px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  margin-right: 9px;
  vertical-align: -1px;
  flex-shrink: 0;
}
.row-dot.done { background: var(--success); border-color: var(--success); }

/* Девять колонок должны поместиться в ноутбучные 1440px рядом с боковой
   панелью, иначе «Дата», «Приоритет» и «Теги» уезжают за край и до них
   приходится скроллить вбок — а это как раз то, по чему просили сортировать. */
/* table-layout: fixed + доли в процентах: колонок девять, и без явных долей
   «Наименование» либо съедает всю строку, либо схлопывается в столбик из
   отдельных слов (проверено скриншотом — было и то, и другое). */
.task-table { table-layout: fixed; }
.col-title { width: 24%; }
.row-title { display: inline; }
.col-num { width: 6%; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.col-person { width: 11%; }
.col-project { width: 10%; }
.col-board { width: 9%; }
.col-column { width: 9%; }
.col-date { width: 7%; }
/* «Замороженный» — самая длинная плашка приоритета, а тегам 9% не хватало:
   чип обрезался посреди слова («#OzonKayd»). Доли перераспределены внутри
   тех же 100%, за счёт названия и даты — им запаса хватает. */
.col-prio { width: 12%; }
.col-tags { width: 12%; }
.task-table td.col-tags { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-table td.col-title { white-space: normal; }
.task-table td.col-person, .task-table td.col-project,
.task-table td.col-board, .task-table td.col-column {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.col-date { white-space: nowrap; }
.row-due.is-overdue { color: var(--danger); font-weight: 600; }
.row-empty { color: var(--text-faint); }

/* Выбор приоритета в карточке задачи: цвет ему дают те же классы prio-N, что и
   плашке в списке, — чтобы выбранное значение читалось взглядом. Правило стоит
   ДО них намеренно: белый фон нужен только варианту «Без приоритета», у
   которого класса prio-N нет; ниже по файлу он перебивал бы цвет. */
.prio-select { background: #fff; font-weight: 600; }
.prio-status { display: inline-block; margin-top: 4px; }

.prio {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
/* Страховка: что бы ни попало в ячейку приоритета, оно не должно наползать
   на соседнюю колонку — раньше «Замороженный» ложился поверх тегов. */
.task-table td.col-prio { overflow: hidden; }
.prio-2 { background: var(--danger-soft); color: var(--danger); }        /* высокий */
.prio-1 { background: #fff4e5; color: #b54708; }                          /* средний */
.prio-0 { background: var(--column-bg); color: var(--text-muted); }       /* низкий */
.prio-3 { background: #eef2ff; color: #5b5bd6; }                          /* заморожен */

.row-tag {
  display: inline-block;
  max-width: calc(100% - 34px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  padding: 2px 8px;
  margin: 1px 3px 1px 0;
  border-radius: 20px;
  font-size: 11.5px;
  background: var(--column-bg);
  color: var(--text-muted);
  border-left: 3px solid var(--tag-color, var(--border-strong));
  white-space: nowrap;
}

.group-row { cursor: pointer; }
.group-cell {
  background: #f3f5fa;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 8px 12px !important;
}
.group-row:hover .group-cell { background: var(--column-bg-hover); }
.group-row.is-overdue .group-cell { color: var(--danger); background: var(--danger-soft); }
.group-caret { display: inline-block; width: 14px; font-size: 10px; }
.group-name { margin-right: 8px; }
.group-count { color: var(--text-faint); font-weight: 600; }

@media (max-width: 900px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .whoami { display: none; }
  .board-view.list-view { padding: 16px 12px 32px; }
  .task-table { font-size: 12.5px; }
  .col-board, .col-column, .col-prio { display: none; }
}
.row-tag-more { font-size: 11.5px; color: var(--text-faint); margin-left: 3px; cursor: default; }
.task-table td.col-tags { white-space: nowrap; }

/* ---------------- Фильтры списка задач (2026-09-11) ---------------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-field { position: relative; }
.filter-input {
  width: 150px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}
.filter-input::placeholder { color: var(--text-faint); }
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filter-field.is-active .filter-input { border-color: var(--accent); background: var(--accent-soft); }

/* Панель раскрывается поверх таблицы, поэтому у обёртки свой контекст
   наложения: без него строки таблицы с собственным фоном перекрывают её. */
.filter-drop { position: relative; }
.filter-drop.is-open { z-index: 30; }

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--text); }
.filter-drop.is-active .filter-btn { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.filter-drop.is-open .filter-btn { border-color: var(--accent); }
.filter-btn-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.filter-caret { font-size: 10px; color: var(--text-faint); }

.filter-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 8px;
}
.filter-panel-search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  margin-bottom: 6px;
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}
.filter-panel-search:focus { border-color: var(--accent); }

/* Колонок в выборке бывает под сотню — панель обязана скроллиться,
   иначе она уезжает за нижний край экрана вместе с кнопкой «Сбросить». */
.filter-options { max-height: 260px; overflow-y: auto; }

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
}
.filter-option:hover { background: var(--bg); }
.filter-option.checked { background: var(--accent-soft); }
.filter-check { accent-color: var(--accent); margin: 0; flex: none; cursor: pointer; }
.filter-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.filter-option-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-option-label.is-none { color: var(--text-muted); font-style: italic; }
.filter-option-hint {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-option-count { flex: none; font-size: 11.5px; color: var(--text-faint); }

.filter-panel-clear {
  width: 100%;
  margin-top: 6px;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  padding: 8px 0 4px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.filter-panel-clear:hover { color: var(--danger); }

.filter-panel-date { min-width: 260px; }
.filter-range { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; }
.filter-range-title { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.filter-range-cell { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.filter-range-label { width: 18px; font-size: 12.5px; color: var(--text-muted); }
.filter-range-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
}
.filter-range-input:focus { border-color: var(--accent); }

.filter-reset {
  border: none;
  background: none;
  padding: 7px 4px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.filter-reset:hover { color: var(--danger); }

.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 260px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-radius: 999px;
  padding: 3px 4px 3px 10px;
  font-size: 12px;
  font-weight: 500;
}
.filter-chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip-x {
  flex: none;
  border: none;
  background: none;
  color: var(--accent-hover);
  font-size: 15px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  opacity: 0.65;
}
.filter-chip-x:hover { opacity: 1; }

.filter-empty { padding: 10px 7px; font-size: 12.5px; color: var(--text-muted); }

@media (max-width: 768px) {
  /* Ниже этой ширины таблица едет вбок вместе с разделом, а не сплющивает колонки.
     900px — то, при котором «Наименование» перестаёт рваться на отдельные
     слова, а плашки приоритета и тегов остаются читаемыми. */
  .task-table { min-width: 900px; }
  .filter-input { width: 120px; }
  /* Вдвигает панель внутрь экрана JS (buildDropFilter) — он один знает, где
     кнопка оказалась после переноса строки. Тут только ограничиваем ширину,
     чтобы вдвигать было что. */
  .filter-panel { min-width: 200px; max-width: calc(100vw - 24px); }
}

/* ---- «Где лежит» и перенос задачи (2026-09-11) ---- */
.loc-path { font-size: 13px; }
.loc-path + .loc-path { margin-top: 2px; }
.loc-move-btn {
  margin-top: 6px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}
.loc-move-btn:hover { border-color: var(--border-strong); color: var(--text); }
.loc-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.loc-select {
  flex: 1 1 150px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-family: inherit;
  font-size: 12.5px;
  background: #fff;
  color: var(--text);
}
.loc-select:disabled { background: var(--bg); color: var(--text-faint); }
.loc-confirm {
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.loc-confirm:disabled { background: var(--border-strong); cursor: default; }
.loc-status { font-size: 12px; color: var(--text-muted); }

/* ---------------- Дашборд (2026-09-11) ---------------- */

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  align-items: start;
}
.dash-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: var(--shadow-xs);
}
/* Плитка со счётчиками — единственная во всю ширину: это шапка страницы. */
.dash-counter-row { display: flex; flex-wrap: wrap; gap: 10px; }
/* Счётчики — шапка страницы, поэтому во всю ширину сетки. */
.dash-card.dash-counters { grid-column: 1 / -1; }
.dash-card-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* Числовая плитка, не график: заголовок и подпись несут смысл, цвет только
   усиливает. Поэтому «Просрочено» читается и без цвета. */
.dash-tile {
  flex: 1 1 120px;
  min-width: 110px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.dash-tile-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.dash-tile-label { margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.dash-tile.tone-danger { background: var(--danger-soft); }
.dash-tile.tone-danger .dash-tile-value { color: var(--danger); }
.dash-tile.tone-warn { background: #fff4e5; }
.dash-tile.tone-warn .dash-tile-value { color: #b54708; }

.dash-tasks { list-style: none; margin: 0; padding: 0; }
.dash-task {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.dash-task:last-child { border-bottom: none; }
.dash-task:hover .dash-task-title { color: var(--accent-hover); }
.dash-task-title { font-size: 13px; }
.dash-task-meta { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 11.5px; color: var(--text-faint); }
.dash-task.tone-danger .dash-task-due { color: var(--danger); font-weight: 600; }
.dash-task.tone-warn .dash-task-due { color: #b54708; font-weight: 600; }
/* «Моя команда»: неразобранные автозадачи — тем же янтарным, что «срок подходит». */
.dash-task-inbox.is-some { color: #b54708; font-weight: 600; }

/* Одна серия — одна краска, без легенды: заголовок плитки уже говорит, что
   меряем. Значение подписано у кончика, поэтому и ось не нужна.
   Столбик тонкий, конец скруглён на 4px, у основания квадратный. */
.dash-bars { display: flex; flex-direction: column; gap: 2px; }
.dash-bar-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 10px; }
.dash-bar-label {
  font-size: 12.5px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-bar-track { display: block; height: 14px; background: var(--column-bg); border-radius: 2px; }
.dash-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
}
.dash-bar-value { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text); min-width: 24px; text-align: right; }

.dash-empty { font-size: 12.5px; color: var(--text-muted); padding: 4px 0 2px; }

.dash-setup { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.dash-setup-hint { font-size: 12.5px; color: var(--text-muted); margin-bottom: 10px; }
.dash-setup-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px; }
.dash-setup-row { display: flex; gap: 9px; align-items: flex-start; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.dash-setup-row:hover { background: var(--bg); }
.dash-setup-row.checked { background: var(--accent-soft); }
.dash-setup-row .filter-check { margin-top: 2px; }
.dash-setup-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dash-setup-title { font-size: 13px; font-weight: 500; }
.dash-setup-desc { font-size: 11.5px; color: var(--text-muted); }

/* ---- Карточка задачи — панель справа, как в Weeek (2026-09-11) ----
   Раньше она открывалась модалкой по центру: содержимое (описание, файлы,
   комментарии, подзадачи) вытягивалось в длинный столбец, и доска под ней
   полностью скрывалась. Панель во всю высоту справа даёт больше места по
   вертикали и оставляет список задач на виду — из него понятно, какую
   карточку ты смотришь. Правило адресное (#task-modal), окно логина
   остаётся по центру: диалог входа сбоку выглядел бы поломкой. */

#task-modal {
  justify-content: flex-end;
  align-items: stretch;
  /* Подложка светлее обычной модалки: доска за панелью должна читаться. */
  background: rgba(17, 20, 33, 0.28);
}

#task-modal .modal {
  width: 620px;
  max-width: calc(100vw - 56px);
  height: 100%;
  max-height: none;
  border-radius: 0;
  padding: 24px 28px 48px;
  box-shadow: -16px 0 40px rgba(21, 24, 40, 0.16);
  animation: drawer-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* Крестик прилипает к верху панели и не уезжает при прокрутке длинной
   карточки — в модалке он был «где-то там наверху» после скролла. */
#task-modal .modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -4px -8px 0 0;
  z-index: 2;
}

@media (max-width: 768px) {
  /* На телефоне панель во весь экран: 620px там всё равно не поместятся,
     а полоска доски сбоку только мешает попадать по кнопкам. */
  #task-modal .modal {
    width: 100%;
    max-width: 100%;
    padding: 20px 16px 40px;
  }
}

/* Поля карточки в две колонки — как в оригинальном Weeek: подпись слева,
   значение справа. Подписи над значениями растягивали карточку вдвое по
   высоте, и в панели приходилось скроллить ради четырёх строк. */
#task-modal .modal-field {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  column-gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}
#task-modal .modal-field-label { margin-bottom: 0; padding-top: 4px; }
/* Подпись и «Изменить» встают друг под другом в левой колонке — на 128px
   в строку они не помещаются. */
#task-modal .modal-field-label-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
#task-modal .modal-field-body { min-width: 0; }

/* Шапка карточки: номер, просрочка, автор — как в Weeek. Номер задачи важнее,
   чем кажется: именно им задачу называют в переписке («глянь 535»), а в
   карточке его раньше не было вовсе. */
.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-right: 40px;   /* место под крестик */
  position: relative;    /* под номером всплывает ссылка на задачу */
}
.modal-task-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  /* это кнопка «ссылка на задачу» — выглядит как прежний номер */
  background: none;
  border: 0;
  padding: 2px 4px;
  margin: -2px -4px;
  border-radius: 4px;
  font-family: inherit;
  cursor: pointer;
}
.modal-task-num:hover {
  color: var(--accent);
  background: var(--panel-hover, rgba(0, 0, 0, 0.05));
  text-decoration: underline dotted;
}
.task-link-pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  width: min(360px, 90vw);
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}
.task-link-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  font: 13px/1.3 inherit;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  background: #f7f8fa;
}
.task-link-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.modal-overdue {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.modal-head-meta {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: right;
}

/* ---- приоритет на карточке доски (21.09.2026) ----------------------------
   Цвет плашке дают те же классы prio-N, что списку и карточке задачи, — один
   источник палитры. Базовое правило нарочно НЕ задаёт background/color: оно
   лежит ниже prio-N по файлу и при равной специфичности перебило бы цвет
   (на этом уже обожглись с .prio-select). */
.task-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.card-prio {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  padding: 1px 8px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.12s ease, box-shadow 0.12s ease;
}

/* Без приоритета плашка не кричит, но остаётся видимой и на телефоне, где
   наведения нет вовсе. */
.card-prio.is-empty {
  background: transparent;
  color: var(--text-faint);
  /* Раздельные border-* вместо сокращения: сокращение с var() внутри переживают
     не все разборщики CSS (на проверке в jsdom оно отвалилось целиком), а так
     рамка останется даже там, где переменная не подхватится. */
  border-width: 1px;
  border-style: dashed;
  border-color: var(--border-strong);
  padding: 0 7px;
  opacity: 0.75;
}

.task-card:hover .card-prio.is-empty { opacity: 1; }
.card-prio:hover { box-shadow: 0 0 0 2px rgba(91, 91, 240, 0.15); }

/* Меню приоритета живёт в <body>: .kanban-cards прокручивается и обрезала бы
   его до полоски, поэтому координаты — fixed, по месту плашки. */
.prio-menu {
  position: fixed;
  z-index: 60;
  min-width: 170px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
}

.prio-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: none;
  background: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.prio-menu-item:hover { background: var(--column-bg); }
.prio-menu-item.is-current { font-weight: 700; }

.prio-menu-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(21, 24, 40, 0.08);
}

.prio-menu-dot.is-empty {
  box-shadow: none;
  border-width: 1px;
  border-style: dashed;
  border-color: var(--border-strong);
}

/* Упоминания в комментариях: подсказка по «@» и плашка в готовом тексте. */
.mention-box {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 260px;
  max-width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  overflow: hidden;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
}
.mention-item.active,
.mention-item:hover { background: var(--accent-soft); }
.mention-item-name { color: var(--text); white-space: nowrap; }
.mention-item-nick { color: var(--text-muted); font-size: 12px; }
.mention-item-mute {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
}
.mention {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 600;
}
/* Позвали человека, у которого телеграм не подключён: плашка есть, но приглушена —
   видно, что уведомление не ушло. */
.mention-mute {
  color: var(--text-muted);
  background: var(--column-bg);
  font-weight: 500;
}
/* «@cheek» — сам CHEEK, не сотрудник: плашка в рамке, чтобы робота не путали с человеком. */
.mention-bot {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.mention-item-bot .mention-item-name { font-weight: 600; }

/* Правка комментария в ленте (22.09.2026). Кнопка держится у правого края шапки
   и проявляется на наведении: в спокойном состоянии лента не должна пестреть. */
.comment-edited { font-size: 11px; color: var(--text-faint); font-style: italic; }
.comment-edit-btn {
  margin-left: auto; border: 0; background: none; padding: 2px 6px; cursor: pointer;
  font-size: 11px; color: var(--text-faint); border-radius: 5px; opacity: 0; transition: opacity .12s;
}
.comment:hover .comment-edit-btn, .comment-edit-btn:focus-visible { opacity: 1; }
.comment-edit-btn:hover { color: var(--text); background: var(--bg-hover, rgba(127,127,127,.12)); }
.comment-edit-btn:disabled { opacity: .4; cursor: default; }
.comment-editor { margin: 4px 0 2px; }
.comment-editor-area {
  width: 100%; box-sizing: border-box; resize: vertical; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg-input, var(--bg));
  color: var(--text); font: inherit; line-height: 1.45;
}
.comment-editor-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.comment-editor-err { font-size: 12px; color: var(--danger, #d14343); }

/* «Смотреть как сотрудник» (22.09.2026). Полоса висит снизу и не закрывает шапку:
   проверять интерфейс приходится именно сверху, где меню и поиск. */
.viewas-pick {
  border: 1px solid var(--border); background: none; color: var(--text-faint);
  font-size: 12px; padding: 3px 9px; border-radius: 999px; cursor: pointer; margin-right: 10px;
}
.viewas-pick:hover { color: var(--text); border-color: var(--text-faint); }
/* z-index выше карточки задачи (у неё 200): под ней полосы не было видно, и 24.09.2026
   Константин отвечал в задаче из чужого лица, не зная об этом. Ниже просмотра картинки (300). */
.viewas-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 14px; z-index: 250;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: 999px;
  background: #7a4b00; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.28);
  font-size: 13px;
}
.viewas-eye { font-size: 14px; }
.viewas-back {
  border: 0; border-radius: 999px; padding: 4px 11px; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff; font: inherit;
}
.viewas-back:hover { background: rgba(255,255,255,.3); }
body.is-viewas { box-shadow: inset 0 0 0 3px #7a4b00; }
/* Та же плашка внутри карточки — на месте поля комментария (24.09.2026). */
.viewas-note {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 10px; padding: 9px 12px; border-radius: 8px;
  background: #7a4b00; color: #fff; font-size: 13px;
}

/* Чужая личная задача, куда человека позвали в комментариях (24.09.2026). */
.mention-only-note {
  margin: 0 0 12px; padding: 9px 12px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-faint); font-size: 13px; line-height: 1.4;
}
.modal-title-static {
  font-size: 19px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 24px 14px 0; color: var(--text); overflow-wrap: anywhere;
}
.viewas-menu {
  position: fixed; right: 18px; top: 54px; z-index: 70; width: 280px;
  background: var(--bg-panel, var(--bg)); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 8px;
}
.viewas-search {
  width: 100%; box-sizing: border-box; padding: 6px 9px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg-input, var(--bg));
  color: var(--text); font: inherit;
}
.viewas-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; }
.viewas-row {
  text-align: left; border: 0; background: none; color: var(--text);
  padding: 6px 9px; border-radius: 7px; cursor: pointer; font: inherit;
}
.viewas-row:hover { background: var(--bg-hover, rgba(127,127,127,.12)); }
.viewas-empty { padding: 8px 9px; color: var(--text-faint); font-size: 13px; }

/* Повтор задачи — строкой под сроком (22.09.2026). */
.repeat-row { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.repeat-label { font-size: 12px; color: var(--text-faint); }
.repeat-select {
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg-input, var(--bg)); color: var(--text); font: inherit; font-size: 13px;
}
.repeat-hint { font-size: 11px; color: var(--text-faint); }

/* Аналитика сотрудника (22.09.2026): план → воронка → рычаги. */
.an-block { background: var(--bg-panel, var(--bg)); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; margin: 0 0 16px; }
.an-title { margin: 0 0 4px; font-size: 17px; }
.an-sub { font-size: 12px; color: var(--text-faint); margin: 10px 0 8px; }
.an-plan-row { display: flex; gap: 10px; flex-wrap: wrap; }
.an-tile { flex: 1 1 150px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.an-tile.ok { border-color: #2e7d32; }
.an-tile.warn { border-color: #b8860b; }
.an-tile.bad { border-color: #c0392b; }
.an-tile-label { font-size: 12px; color: var(--text-faint); }
.an-tile-value { font-size: 22px; font-weight: 600; line-height: 1.25; }
.an-tile-hint { font-size: 11px; color: var(--text-faint); }
.an-table { display: flex; flex-direction: column; gap: 2px; }
.an-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 7px; }
.an-row:nth-child(odd) { background: rgba(127,127,127,.06); }
.an-row.rate .an-cell.name { color: var(--text-faint); }
.an-cell.name { flex: 1 1 auto; }
.an-cell.val { min-width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.an-cell.delta { min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.an-cell.delta.up { color: #2e7d32; }
.an-cell.delta.down { color: #c0392b; }
.an-cell.delta.flat { color: var(--text-faint); }
/* Шапка таблицы носит те же классы ячеек, что и строки под ней — иначе подписи
   не встают над цифрами. Цвет приглушаем здесь, ПОСЛЕ правил .an-cell.delta.up/down:
   у колонки «Расхождение» заголовок должен быть серым, а не зелёным. */
.an-row.an-head .an-cell { color: var(--text-faint); font-weight: 500; }

/* Таблицы продаж и истории СПП: колонки задаются один раз на таблицу (--an-cols),
   строки только расставляют по ним ячейки. Раньше каждая строка была самостоятельным
   flex-рядом и раскладывалась сама по себе: «1 234 567 ₽ (+12%)» шире своих 110 px,
   соседняя строка с коротким числом — нет, столбцы разъезжались, а подписи стояли
   не над цифрами (Константин 22.09.2026). Аналитика осталась на flex: там значения
   короткие, а разметка другая. */
.an-table.an-grid {
  display: grid;
  grid-template-columns: var(--an-cols);
  row-gap: 2px;
  column-gap: 0;
}
.an-table.an-grid .an-row { display: contents; }
.an-table.an-grid .an-cell { padding: 6px 8px; align-self: center; }
/* Полоска через строку: строка коробкой больше не является — красим её ячейки. */
.an-table.an-grid .an-row:nth-child(odd) .an-cell { background: rgba(127, 127, 127, .06); }
.an-table.an-grid .an-row .an-cell:first-child { border-radius: 7px 0 0 7px; }
.an-table.an-grid .an-row .an-cell:last-child { border-radius: 0 7px 7px 0; }
.an-table.an-grid .an-row.sales-cab .an-cell.name { padding-left: 22px; }
.an-story { margin: 12px 0 4px; padding: 10px 12px; border-radius: 9px;
  background: rgba(192,57,43,.09); font-size: 13px; line-height: 1.5; }
.an-lever { padding: 9px 0; border-top: 1px solid var(--border); }
.an-lever-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.an-lever-art { font-weight: 600; }
.an-lever-sku { font-size: 12px; color: #2f6fb3; text-decoration: none; border-bottom: 1px dashed #9cc0e4; }
.an-lever-sku:hover { color: #1b4f88; border-bottom-color: #1b4f88; }
.an-lever-name { font-size: 12px; color: #5a6472; margin: 2px 0 4px; }
.an-lever-lost { color: #c0392b; font-size: 13px; }
.an-lever-cab { color: var(--text-faint); font-size: 12px; margin-left: auto; }
.an-lever-nums { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.an-lever-why { font-size: 13px; margin-top: 4px; line-height: 1.45; }
/* «СПП и заказы» в WB-связке (27.09.2026): разметка рычагов, плюс СПП «было → сейчас»
   цветом — зелёная, если выросла на шаг сигнала и больше, красная — если упала. */
.an-spp-total { font-size: 13px; margin: 2px 0 6px; }
.an-spp-badge { font-size: 13px; font-variant-numeric: tabular-nums; }
.an-spp-badge.up { color: #2e7d32; }
.an-spp-badge.down { color: #c0392b; }
.an-spp-badge.flat { color: var(--text-faint); }
.an-foot { font-size: 11px; color: var(--text-faint); padding: 0 4px 20px; }

/* Остатки. Таблица узкая по цифрам и широкая по названию: смотрят в неё ради
   колонки «дней», а опознают товар по имени, а не по коду. */
.st-updated { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.st-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.st-chip { border: 1px solid var(--border); background: transparent; color: var(--text-faint);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.st-chip:hover { color: var(--text); }
.st-chip.active { border-color: var(--accent, #4a90d9); color: var(--text); }
/* Поиск: направление (сантехника / ножи) — крупнее площадок под ним. */
.sp-lines { margin-bottom: 2px; }
.sp-lines .st-chip { font-size: 13px; font-weight: 600; padding: 4px 12px; }
.delegation-wrap { padding: 4px 4px 28px; max-width: 1180px; }
.delegation-modes { margin: 6px 0 4px; }
.delegation-own { font-size: 13px; color: var(--text-faint); margin: 0 0 12px; }
.delegation-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin: 0 0 10px; }
.delegation-search { flex: 0 1 260px; min-width: 200px; padding: 6px 10px; font-size: 13px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--card-bg); color: var(--text); }
.delegation-editor { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-bg); }
.delegation-editor-title { font-weight: 600; font-size: 14px; }
.delegation-editor-now { font-size: 13px; color: var(--text-faint); margin: 2px 0 10px; }
.delegation-hint, .delegation-locked { font-size: 13px; color: var(--text-faint); }
.delegation-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.delegation-pill { border: 1px solid var(--border); background: transparent; color: var(--text-faint);
  border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; }
.delegation-pill:hover:not(:disabled) { color: var(--text); }
.delegation-pill[aria-pressed="true"] { border-color: var(--accent, #4a90d9); background: var(--accent-soft);
  color: var(--text); font-weight: 600; }
.delegation-pill:disabled { opacity: 0.45; cursor: default; }
.delegation-notice { font-size: 13px; min-height: 18px; margin-top: 8px; color: var(--text-faint); }
.delegation-notice.bad { color: #c0392b; }
.delegation-table { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
.delegation-table th, .delegation-table td { padding: 0; text-align: left; vertical-align: middle; font-weight: 400; }
.delegation-table thead th { position: sticky; top: 0; z-index: 12; padding: 4px 3px 8px; background: var(--card-bg);
  vertical-align: bottom; box-shadow: 0 4px 4px -4px rgba(21, 24, 40, 0.2); }
.delegation-table thead .delegation-who { z-index: 13; }
.delegation-table .delegation-who { padding: 4px 10px 4px 2px; }
.delegation-who { position: sticky; left: 0; z-index: 11; min-width: 170px; max-width: 200px; background: var(--card-bg); }
.delegation-col { min-width: 92px; }
.delegation-col-title { font-size: 12px; font-weight: 600; line-height: 1.25; }
.delegation-col-meter { height: 4px; margin-top: 6px; border-radius: 2px; background: #e3e5eb; overflow: hidden; }
.delegation-col-meter span { display: block; height: 100%; background: var(--accent); }
.delegation-col-count { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.delegation-table .delegation-sum-col { padding: 4px 8px 8px; }
.delegation-table .delegation-sum { padding: 0 8px; font-weight: 600; white-space: nowrap; }
.delegation-table .delegation-hint { padding: 12px 8px; }
.delegation-name { font-weight: 600; }
.delegation-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; font-size: 11px; color: var(--text-faint); }
.delegation-tag { border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; }
.delegation-table .delegation-group-title { padding-top: 14px; font-size: 12px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.delegation-table .delegation-group-count { padding: 14px 0 0; font-size: 11px; text-align: center; color: var(--text-muted); }
.delegation-nocheek .delegation-name { color: var(--text-faint); }
.delegation-cell { position: relative; display: block; width: 100%; min-width: 80px; padding: 7px 6px; border: 0; border-radius: 6px;
  background: #f2f3f7; color: #5f6578; font: inherit; font-size: 12px; text-align: center; cursor: pointer; }
.delegation-cell:hover { box-shadow: inset 0 0 0 2px rgba(11, 11, 11, 0.22); }
.delegation-cell.lv-full { background: var(--accent); color: #ffffff; font-weight: 600; }
.delegation-cell.lv-part { background: #78c098; color: #0f2a1d; }
.delegation-cell.lv-locked { background: #e3e5eb; color: #4a4f60; cursor: help; }
.delegation-cell.picked { box-shadow: 0 0 0 2px var(--card-bg), 0 0 0 4px var(--accent); }
.delegation-cell.has-hidden::before { content: ''; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.delegation-hidden { font-size: 13px; color: var(--text); margin: 0 0 10px; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; }
.delegation-cell[data-tip]::after { content: attr(data-tip); position: absolute; z-index: 20; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); width: max-content; max-width: 260px; padding: 6px 9px; border-radius: 6px; background: #1b1f24;
  color: #ffffff; font-size: 12px; font-weight: 400; line-height: 1.35; text-align: left; white-space: normal;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.delegation-cell.edge[data-tip]::after { left: auto; right: 0; transform: none; }
.delegation-cell[data-tip]:hover::after, .delegation-cell[data-tip]:focus-visible::after { opacity: 1; }
.delegation-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: var(--text-muted); }
.delegation-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.delegation-legend .delegation-cell { display: inline-block; width: auto; min-width: 44px; padding: 3px 6px; cursor: default; }
.delegation-journal { margin-top: 24px; font-size: 13px; }
.delegation-journal-title { font-weight: 600; margin-bottom: 6px; }
.delegation-journal-row { padding: 5px 0; border-bottom: 1px solid var(--border); color: var(--text-faint); }
@media (max-width: 720px) { .delegation-table-wrap { overflow-x: auto; } .delegation-who { min-width: 150px; max-width: 170px; } }
.st-table { display: flex; flex-direction: column; gap: 1px; }
.st-row { display: grid; grid-template-columns: minmax(180px, 3fr) repeat(7, minmax(52px, 0.7fr));
  gap: 6px; align-items: center; padding: 5px 6px; border-radius: 6px; font-size: 13px; }
.st-row:nth-child(even) { background: rgba(127, 127, 127, 0.06); }
.st-row.head { font-size: 11px; color: var(--text-faint); background: none; }
.st-row.bad { box-shadow: inset 2px 0 0 #c0392b; }
.st-row.warn { box-shadow: inset 2px 0 0 #b8860b; }
.st-cell { text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cell.art { text-align: left; display: flex; flex-direction: column; min-width: 0; }
.st-art { font-weight: 600; }
.st-name { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-cell.total { font-weight: 600; }
.st-cell.days.bad { color: #c0392b; font-weight: 600; }
.st-cell.days.warn { color: #b8860b; }
.st-cell.net { color: var(--text-faint); }
/* У кого есть склады сетей — колонок больше, поэтому сетка шире. */
.st-row.net-wide { grid-template-columns: minmax(160px, 2.4fr) repeat(11, minmax(46px, 0.6fr)); }
@media (max-width: 720px) {
  .st-row { grid-template-columns: minmax(120px, 2fr) repeat(7, minmax(44px, 0.6fr)); font-size: 12px; }
}
/* Колонка денег появляется только у тех, кому открыта себестоимость — сетка шире на один столбец. */
.st-row.money-wide { grid-template-columns: minmax(170px, 2.8fr) repeat(8, minmax(50px, 0.7fr)); }
.st-row.net-wide.money-wide, .st-row.net-wide { grid-template-columns: minmax(150px, 2.2fr) repeat(12, minmax(44px, 0.55fr)); }
.st-cell.money { font-weight: 600; }

/* Выбор исполнителя прямо в строке «Нераспределённых»: разбор — это действие, а не просмотр. */
.assign-pick { max-width: 100%; font: inherit; font-size: 12px; padding: 2px 4px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); }
.assign-pick:hover { border-color: var(--accent, #4a90d9); }

/* Поиск по истории СПП: одна строка — артикул, две даты, кнопка. */
.spp-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 10px; }
.spp-input { flex: 1 1 220px; min-width: 160px; font: inherit; padding: 5px 8px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.spp-date { font: inherit; padding: 4px 6px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text); }
.spp-sep { font-size: 12px; color: var(--text-faint); }
.spp-go { font: inherit; padding: 5px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent, #4a90d9); background: transparent; color: var(--text); }
.spp-go:hover { background: rgba(74, 144, 217, 0.12); }
.spp-total { font-size: 15px; font-weight: 600; margin: 6px 0 8px; }

/* Продажи: крупная цифра дня и подстрочные кабинеты внутри связки. */
.sales-hero { font-size: 30px; font-weight: 700; line-height: 1.2; margin: 4px 0 6px; }
.an-row.sales-cab { font-size: 12px; color: var(--text-faint); }
.an-row.sales-cab .an-cell.name { padding-left: 10px; }

/* Управление таблицей остатков: поиск, выбор склада, сортировка по колонкам. */
.stock-controls { margin: 4px 0 8px; }
.wh-pick { max-width: 260px; }
.st-cell.sortable { cursor: pointer; user-select: none; }
.st-cell.sortable:hover { color: var(--text); }
.st-cell.sorted { color: var(--text); font-weight: 600; }
.st-cell.here { font-weight: 600; }
/* Выбран склад — в таблице появляется его колонка, сетка на один столбец шире. */



/* Кабинет, где по этому артикулу пусто, — точка вместо нуля: ноль в таблице читается
   как цифра и мешает видеть, где товар действительно есть. */
.st-cell.dim0 { color: var(--text-faint); }

/* Ссылки наверху раздела «Аналитика» (data/section-links.json) — «Seller Desk» зелёной кнопкой, Константин 30.09.2026. */
.an-ext-link { display: inline-flex; align-items: center; margin-left: 14px; padding: 6px 16px; border-radius: 18px;
  font-weight: 600; font-size: 14px; text-decoration: none; color: var(--accent, #2563eb); border: 1px solid currentColor; }
.an-ext-green { background: #1e8e3e; border-color: #1e8e3e; color: #fff; box-shadow: 0 1px 3px rgba(30, 142, 62, 0.35); }
.an-ext-green:hover { background: #17753a; border-color: #17753a; color: #fff; }

/* Ссылка на полный разбор продаж в блоке аналитики — красная, чтобы её замечали. */
.an-rop-link { display: inline-block; margin: 2px 0 10px; color: #c0392b; font-weight: 600;
  font-size: 14px; text-decoration: none; border-bottom: 1px dashed rgba(192, 57, 43, 0.5); }
.an-rop-link:hover { color: #a93226; border-bottom-style: solid; }
.an-rop-frame { width: 100%; height: calc(100vh - 150px); border: 1px solid var(--border);
  border-radius: 10px; margin-top: 10px; background: #fff; }

/* Сроки доставки WB: цвет цифры — сколько ждать покупателю. Зелёный до двух дней,
   обычный — три, жёлтый — 4–5, красный — неделя и дольше. */
.dl-cell.fast { color: #2e7d32; font-weight: 600; }
.dl-cell.slow { color: #b8860b; font-weight: 600; }
.dl-cell.bad { color: #c0392b; font-weight: 700; }
.dl-cell.none { color: var(--text-faint); }
.dl-arrow { font-size: 9px; margin-left: 2px; vertical-align: 1px; }
.dl-arrow.up { color: #c0392b; }
.dl-arrow.down { color: #2e7d32; }
.dl-long { display: block; font-size: 10px; font-weight: 400; color: var(--text-faint); }
.dl-sum { margin: 8px 0 12px; }
.dl-sum .st-row.dl-total { font-weight: 600; }
.dl-cab { text-align: left; font-size: 12px; color: var(--text-faint); }
.an-sub.dl-warn { color: #b8860b; }

/* ---- админка: боты, персонал и доступы, кабинеты и ключи ------------------
   Три вкладки переехали из пульта (22.09.2026). Разметку перенесли как была,
   а цвета взяли здешние: свои переменные пульта тут не живут, и без этого
   блока таблицы выглядели бы чужими. Всё внутри .adm — наружу не протекает. */

.adm { padding: 4px 2px 40px; max-width: 1100px; }
.adm .list-title { margin: 6px 0 4px; }
.adm-h { font-size: 15px; font-weight: 650; margin: 26px 0 8px; }
.adm-sub { color: var(--text-muted); font-size: 11.5px; text-transform: uppercase;
           letter-spacing: 0.5px; margin: 14px 0 6px; }
.adm-hint { color: var(--text-muted); font-size: 13px; line-height: 1.5; margin: 0 0 14px; max-width: 900px; }
.adm-dim { color: var(--text-muted); }
.adm-small { font-size: 12px; }
.adm-nowrap { white-space: nowrap; }
.adm-bad { color: var(--danger); }
.adm-ok-ink { color: var(--success); }
.adm-warn { color: #a86a00; }
.adm tr.adm-bad td { background: var(--danger-soft); }
.adm code { background: var(--column-bg); border-radius: 6px; padding: 1px 6px;
            font-size: 12.5px; color: var(--text); }

.adm-table { width: 100%; border-collapse: separate; border-spacing: 0; margin-bottom: 6px; font-size: 13px; }
.adm-table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 11.5px;
                text-transform: uppercase; letter-spacing: 0.4px; padding: 6px 10px;
                border-bottom: 1px solid var(--border-strong); }
.adm-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.adm-table tr:hover td { background: var(--bg); }

.adm-act, .adm-mini {
  font-family: inherit; font-size: 13px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--text); padding: 7px 14px;
}
.adm-act { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.adm-act:hover { background: var(--accent-hover); }
.adm-act:disabled { opacity: 0.6; cursor: default; }
.adm-mini { padding: 3px 8px; font-size: 12px; }
.adm-mini:hover { background: var(--column-bg); }
.adm-mini.adm-bad { color: var(--danger); }
.adm-mini.adm-act { padding: 3px 9px; font-size: 12px; color: #fff; }

.adm-msg { border-radius: var(--radius-sm); padding: 9px 14px; margin: 0 0 12px; font-size: 13px; }
.adm-ok { background: var(--success-soft); color: var(--accent-hover); }
.adm-err { background: var(--danger-soft); color: var(--danger); }
.adm-warnbox { background: var(--danger-soft); border: 1px solid var(--danger);
               border-radius: var(--radius); padding: 12px 16px; margin: 14px 0; line-height: 1.5; }
.adm-warnbox ul { margin: 8px 0 6px 18px; padding: 0; }

/* Боты — карточками: у каждого свой список людей, таблицей это не читается. */
.adm-botlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin-top: 14px; }
.adm-bot { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
           padding: 14px 16px; box-shadow: var(--shadow-xs); }
.adm-bhead { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.adm-about { font-size: 12.5px; margin: 8px 0; line-height: 1.45; }
.adm-row { margin-top: 8px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.adm-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--column-bg);
            border-radius: 999px; padding: 3px 5px 3px 10px; font-size: 12.5px; }
.adm-x { border: 0; background: none; cursor: pointer; color: var(--text-faint);
         font-size: 12px; line-height: 1; padding: 2px 4px; border-radius: 50%; }
.adm-x:hover { color: var(--danger); background: var(--danger-soft); }

.adm-picker { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
              background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; }
.adm-picker select, .adm-picker input, .adm-add select, .adm-add input {
  font-family: inherit; font-size: 13px; padding: 5px 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--text);
}

.adm-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px;
           align-items: end; background: var(--card-bg); border: 1px solid var(--border);
           border-radius: var(--radius); padding: 14px 16px; max-width: 900px; }
.adm-add label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.adm-add input, .adm-add select { width: 100%; }

@media (max-width: 768px) {
  .adm-table, .adm-table tbody, .adm-table tr, .adm-table td { display: block; width: 100%; }
  .adm-table th { display: none; }
  .adm-table tr { border-bottom: 1px solid var(--border-strong); padding: 6px 0; }
  .adm-table td { border: 0; padding: 4px 8px; }
}

/* Поисковые запросы (тест): строка вывода по площадке */
.sp-verdict { margin-top: 10px; font-weight: 500; }
.sp-verdict.red { color: var(--danger, #c0392b); }
.sp-verdict.yellow { color: var(--warn, #b7791f); }
.sp-verdict.green { color: var(--ok, #2f855a); }

/* Поисковые запросы: у колонки одно выравнивание и у шапки, и у строк — текст слева, числа
   по центру (Константин 24.09.2026: «поехали надписи, не друг под другом»). */
.sp-table .st-cell.l { text-align: left; }
.sp-table .st-cell.c { text-align: center; font-variant-numeric: tabular-nums; }
.sp-table .st-row.head .st-cell { white-space: normal; line-height: 1.2; }
.sp-table .st-cell.sp-dim { color: var(--text-faint); font-size: 12px; }
.sp-table .st-row.sp-link { cursor: pointer; }
.sp-table .st-row.sp-link:hover { background: rgba(74, 144, 217, 0.08); }
.sp-table .st-row.sp-lost { color: var(--text-faint); }
.sp-delta { font-size: 11px; font-weight: 400; margin-left: 6px; }
.sp-delta.up { color: var(--ok, #2f855a); }
.sp-delta.down { color: var(--danger, #c0392b); }
.sp-light.green { color: var(--ok, #2f855a); font-weight: 600; }
.sp-light.yellow { color: var(--warn, #b7791f); font-weight: 600; }
.sp-light.red { color: var(--danger, #c0392b); font-weight: 600; }
.sp-team { margin-top: -4px; }
/* Первая десятка — сеткой 5 × 2, место отдельной колонкой, длинное имя обрезается. */
.sp-top { margin-top: 12px; }
.sp-top-title { font-size: 11px; color: var(--text-faint); margin-bottom: 4px; }
.sp-top-list { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px 14px; }
.sp-top-item { display: flex; gap: 6px; min-width: 0; font-size: 12px; }
.sp-top-pos { flex: 0 0 18px; text-align: right; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.sp-top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sp-top-item.ours .sp-top-name { font-weight: 600; color: var(--accent, #4a90d9); }
@media (max-width: 720px) {
  .sp-top-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* В сводке на телефоне запрос и вывод переносятся, а не обрезаются многоточием. */
  .sp-sum .st-cell { white-space: normal; line-height: 1.25; }
}

/* ---- подзадачи в списке задач (25.09.2026) -------------------------------- */

/* Значок у названия: видно, что подзадачи есть и сколько сделано; клик раскрывает их. */
.row-subtasks {
  display: inline-flex; width: 118px; margin-left: 10px; vertical-align: middle;
  padding: 2px 8px; gap: 6px;
  border: 1px solid var(--border); border-radius: 10px;
  background: none; cursor: pointer; font-family: inherit; font-size: 11.5px;
}
.row-subtasks:hover, .row-subtasks.is-open { border-color: var(--border-strong); color: var(--text-muted); }
.row-subtasks .subtasks-icon { width: 13px; height: 13px; }
.row-subtasks .subtasks-bar { min-width: 28px; }
.task-table td.row-subtasks-cell { padding: 0 12px 8px 34px; }
/* Раскрытые подзадачи читаются как часть строки задачи — без черты между ними. */
.task-table tr.task-row:has(+ .row-subtasks-holder) td { border-bottom-color: transparent; }
.row-subtasks-cell .subtasks-list { margin-top: 0; max-width: 640px; }

/* ---- «Что нового» — окно при входе раз в день (25.09.2026) ------------------ */

.whatsnew-modal { width: 540px; }
.whatsnew-modal .whatsnew-title { margin-bottom: 4px; }
.whatsnew-note { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }
.whatsnew-day {
  margin: 16px 0 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint);
}
.whatsnew-item { padding: 10px 12px; margin-bottom: 8px; border-radius: var(--radius-sm); background: var(--bg); }
.whatsnew-item-title { font-size: 14px; font-weight: 600; }
.whatsnew-item-text { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--text); }
.whatsnew-ok {
  display: block; margin: 18px 0 0 auto; padding: 10px 22px;
  border: none; border-radius: var(--radius-sm); background: var(--accent); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background-color 0.12s ease;
}
.whatsnew-ok:hover { background: var(--accent-hover); }
@media (max-width: 720px) {
  .whatsnew-modal { padding: 20px 16px; }
  .whatsnew-ok { width: 100%; }
}

/* ---- Поздравление в день праздника при первом входе (Константин 17.10.2026, День отца) ---- */

.holiday-greeting-modal { width: 400px; padding: 30px 28px 26px; text-align: center; z-index: 1; }
.holiday-greeting-logo { display: block; max-width: 100%; max-height: 150px; margin: 0 auto 14px; object-fit: contain; }
.holiday-greeting-modal .holiday-greeting-title { margin: 0 0 8px; font-size: 24px; }
.holiday-greeting-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.holiday-greeting-modal .whatsnew-ok { margin: 22px auto 0; }
.holiday-greeting-modal .whatsnew-ok:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Две бутылки, пробки и короткий фонтан шампанского (27.10.2026). */
.holiday-celebration { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.holiday-pop { position: absolute; top: min(calc(50% + 175px), calc(100% - 128px)); width: 0; height: 0; }
.holiday-pop--left { left: calc(50% - min(32vw, 265px)); --bottle-angle: 24deg; }
.holiday-pop--right { left: calc(50% + min(32vw, 265px)); --bottle-angle: -24deg; }
.holiday-bottle {
  position: absolute; left: -27px; top: -4px; width: 54px; height: 135px;
  transform-origin: 50% 4px; filter: drop-shadow(0 7px 9px rgba(0, 0, 0, .18));
  animation: holiday-bottle-pop 3450ms both;
}
.holiday-bottle svg { display: block; width: 100%; height: 100%; }
.holiday-splash {
  position: absolute; left: 0; top: 0; display: block;
  width: var(--splash-size); height: var(--splash-length); border-radius: 60%;
  box-shadow: 0 0 5px rgba(255, 228, 152, .35); opacity: 0;
  animation: holiday-splash-flight var(--splash-duration) var(--splash-delay) both;
}
.holiday-splash--cork { border-radius: 3px 3px 2px 2px; background: #c99654; border-top: 4px solid #e7bf83; box-shadow: 0 2px 3px rgba(0, 0, 0, .16); }
.holiday-splash--sparkle { border-radius: 0; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
@keyframes holiday-bottle-pop {
  0% { opacity: 0; transform: translateY(35px) rotate(var(--bottle-angle)) scale(.8); }
  8% { opacity: 1; transform: translateY(0) rotate(var(--bottle-angle)) scale(1); }
  12% { transform: translateY(9px) rotate(var(--bottle-angle)) scale(.96); }
  18%, 76% { opacity: 1; transform: translateY(0) rotate(var(--bottle-angle)) scale(1); }
  100% { opacity: 0; transform: translateY(32px) rotate(var(--bottle-angle)) scale(.9); }
}
@keyframes holiday-splash-flight {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(-25deg) scale(.3); animation-timing-function: cubic-bezier(.15, .6, .35, 1); }
  5% { opacity: 1; }
  46% { opacity: 1; transform: translate3d(var(--splash-x-mid), var(--splash-y-mid), 0) rotate(30deg) scale(1); animation-timing-function: cubic-bezier(.6, 0, .85, .45); }
  80% { opacity: .8; }
  100% { opacity: 0; transform: translate3d(var(--splash-x-end), var(--splash-y-end), 0) rotate(var(--splash-turn)) scale(.55); }
}
@media (prefers-reduced-motion: reduce) {
  .holiday-celebration { display: none; }
}
@media (max-width: 720px) {
  .holiday-greeting-modal { padding: 24px 18px 20px; }
  .holiday-greeting-modal .whatsnew-ok { width: 100%; }
}

/* Ошибка в правилах продаж — считается по умолчанию, говорим об этом прямо (25.09.2026). */
.sales-rules-error { color: var(--danger); }

/* ---- «🐥 Яндекс» — Яндекс Маркет KAYDZO (25.09.2026) ------------------------ */
.ym-alert { color: var(--danger); }
.an-row.ym-burn .an-cell.name { color: var(--danger); font-weight: 600; }
/* «🐥 Яндекс» → Экономика: маржа в минус, подсказка по товару, калькулятор цены, «что сделать» (25.09.2026). */
.an-cell.ym-neg { color: var(--danger); font-weight: 600; }
.an-cell.ym-hint { font-size: 12px; color: var(--text-faint); }
.ym-calc-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.ym-calc-select { max-width: 100%; min-width: 220px; flex: 1 1 320px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 8px; background: transparent; color: var(--text); }
.ym-calc-price { width: 130px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--text); font-variant-numeric: tabular-nums; }
.ym-calc-out { display: flex; flex-direction: column; gap: 6px; }
.ym-calc-result { font-weight: 600; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); }
.ym-calc-result.ok { border-color: #2e7d32; }
.ym-calc-result.bad { border-color: #c0392b; color: var(--danger); }
.an-row.ym-sum .an-cell { font-weight: 600; }
.ym-todo { border-top: 1px solid var(--border); padding: 8px 0 4px; }
.ym-todo-title { font-weight: 600; }
.ym-todo-task { font-weight: 400; margin-left: 4px; }
.ym-todo-list { margin: 4px 0 0 18px; padding: 0; font-size: 13px; }
.ym-todo-list li { margin: 2px 0; }
.ym-todo-more { color: var(--text-faint); cursor: pointer; list-style: none; }
/* «🐥 Яндекс и сети»: меню площадок и загрузка отчётов М.Видео / Золотого Яблока / Lamoda (25.09.2026). */
.ym-menu { margin-top: 0; }
.mp-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mp-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mp-label { min-width: 140px; font-size: 13px; color: var(--text-faint); }
.mp-input { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); }
.mp-date { width: 150px; }
.mp-commission { width: 160px; font-variant-numeric: tabular-nums; }
.mp-file { font-size: 13px; }
.mp-info { font-size: 13px; }
.mp-save { align-self: flex-start; }
.mp-save:disabled { opacity: .5; cursor: default; }
.an-cell.mp-open { cursor: pointer; text-decoration: underline dotted; }
.an-row.mp-period.active .an-cell { font-weight: 600; }
.mp-del { font-size: 12px; padding: 2px 8px; }
.mp-sample { font-size: 12px; overflow-x: auto; }

/* ---- «🛒 Авито» (25.09.2026) --------------------------------------------------- */
.av-label-btn {
  padding: 3px 10px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent); font-family: inherit; font-size: 12px; cursor: pointer;
}
.av-label-btn:hover { background: var(--accent); color: #fff; }
.an-row.av-canceled .an-cell { color: var(--text-faint); }
.an-row.av-on_confirmation .av-status, .an-row.av-ready_to_ship .av-status { font-weight: 600; }
.av-event { display: flex; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.av-event:last-child { border-bottom: none; }
.av-event-at { flex: 0 0 96px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.av-event-text { flex: 1; min-width: 0; }
/* воронка по объявлениям (26.09.2026) */
.av-listings .an-row.av-bad .an-cell { background: rgba(220, 80, 60, .07); }
.av-listings .av-low { color: #c0392b; font-weight: 600; }
.av-listings .av-why { font-size: 12px; color: var(--text-muted, inherit); }
.av-link { color: inherit; text-decoration: underline dotted; }
.av-task-btn {
  padding: 2px 8px; border: 1px solid var(--accent); border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent); font-family: inherit; font-size: 12px; cursor: pointer;
}
.av-task-btn:hover { background: var(--accent); color: #fff; }

/* Подразделы разделов «📦 Товародвижение» и «🐥 Яндекс Маркет» (26.09.2026: «сейчас это простыня обычная»):
   вкладки под шапкой, на вкладке — счётчик; красный счётчик — там есть что срочно разбирать. */
.an-subtabs { margin: 2px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.an-subtabs .st-chip { font-size: 13px; padding: 4px 12px; }
.an-subtabs .st-chip.active { background: var(--accent-soft); font-weight: 600; }
.an-subtab-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--border);
  color: var(--text-muted); font-size: 11px; line-height: 16px; font-weight: 600; }
.an-subtabs .st-chip.hot .an-subtab-badge { background: var(--danger); color: #fff; }
.an-dkt-hot { display: flex; flex-direction: column; gap: 6px; }
.an-dkt-hot-item { text-align: left; font: inherit; color: var(--text); background: transparent; cursor: pointer;
  border: 1px solid var(--border); border-left-width: 3px; border-radius: 8px; padding: 8px 10px; }
.an-dkt-hot-item:hover { border-color: var(--accent); }
.an-dkt-hot-item.bad { border-left-color: var(--danger); }
.an-dkt-hot-item.ok { border-left-color: var(--accent); }

/* «🛒 Авито» → «Продажи и маржа» (28.09.2026): таблица как РНП — строки показателей, колонки периодов */
.av-rnp-wrap { margin: 4px 0 8px; }
.av-rnp { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: clip; }
.av-rnp th, .av-rnp td { padding: 5px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
.av-rnp th { background: var(--column-bg); font-weight: 600; font-size: 12px; color: var(--text-muted); position: sticky; top: 0; z-index: 3; box-shadow: 0 4px 4px -4px rgba(21,24,40,.2); }
.av-rnp .av-rnp-name { text-align: left; position: sticky; left: 0; background: var(--card-bg); z-index: 1; font-weight: 500; }
.av-rnp th.av-rnp-name { background: var(--column-bg); z-index: 4; }
.av-rnp tr.av-rnp-group td { border-top: 2px solid var(--border-strong); }
.av-rnp th.av-rnp-partial { color: var(--accent); }
.av-rnp td.av-rnp-fc { background: var(--accent-soft); font-style: italic; }
.av-rnp td.av-nocost { color: var(--text-faint); font-style: italic; }
.av-rnp td.ym-neg { color: var(--danger); font-weight: 600; }
.av-rnp tbody tr:hover td { background: var(--column-bg-hover); }

/* «🎁 Подарки блогерам» — сайт отправок в окне раздела (28.09.2026) */
.gifts-wrap { display: flex; flex-direction: column; height: calc(100vh - 120px); min-height: 560px; }
.gifts-bar { display: flex; justify-content: flex-end; padding: 0 4px 8px; font-size: 13px; }
.gifts-frame { flex: 1; width: 100%; border: 1px solid rgba(0, 0, 0, .08); border-radius: 12px; background: #fff; }
.turnover-wrap { display: flex; flex-direction: column; height: calc(100vh - 120px); min-height: 560px; }
.turnover-frame { flex: 1; width: 100%; border: 1px solid rgba(0, 0, 0, .08); border-radius: 12px; background: #fff; }
.prices-wrap { display: flex; flex-direction: column; height: calc(100vh - 120px); min-height: 560px; }
.prices-frame { flex: 1; width: 100%; border: 1px solid rgba(0, 0, 0, .08); border-radius: 12px; background: #fff; }
.prices-refresh-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 12px; }
.prices-refresh-btn { background: var(--danger); color: #fff; border: 0; border-radius: 12px; padding: 14px 28px; font-size: 18px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 14px rgba(230, 72, 46, .35); }
.prices-refresh-btn:hover:not(:disabled) { filter: brightness(.94); }
.prices-refresh-btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.prices-refresh-note { font-size: 14px; color: var(--text-muted); }
.prices-refresh-note.is-error { color: var(--danger); }

/* ---- Отзывы и вопросы покупателей (29.09.2026) ---- */
.rv-page { max-width: 980px; }
.rv-note { color: var(--text-muted, #6b7280); font-size: 13px; margin: 4px 0 10px; }
.rv-row { display: flex; flex-wrap: wrap; gap: 6px; }
.an-subtab-badge.hot { background: #fde68a; }
.rv-filters { display: flex; gap: 8px; align-items: center; margin: 4px 0 12px; flex-wrap: wrap; }
.rv-select, .rv-search { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface, #fff); color: var(--text); }
.rv-search { flex: 1; min-width: 180px; }
.rv-total { color: var(--text-muted, #6b7280); font-size: 12px; }
.rv-list { display: flex; flex-direction: column; gap: 10px; }
.rv-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface, #fff); }
.rv-card.rv-notpl { border-left: 3px solid #f59e0b; }
.rv-card.rv-waiting { border-left: 3px solid #3b82f6; }
.rv-card.rv-published { opacity: .92; }
.rv-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.rv-kind { color: #d97706; font-weight: 600; letter-spacing: 1px; }
.rv-meta { color: var(--text-muted, #6b7280); font-size: 12px; }
.rv-text { font-size: 14px; line-height: 1.45; white-space: pre-wrap; margin: 2px 0 6px; }
.rv-reason { font-size: 12px; color: #92400e; margin-bottom: 6px; }
.rv-draft { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; line-height: 1.45; padding: 8px; border: 1px solid var(--border); border-radius: 8px; resize: vertical; background: var(--bg, #fafafa); color: var(--text); }
.rv-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.rv-btn { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface, #fff); color: var(--text); cursor: pointer; }
.rv-btn.primary { background: #16a34a; border-color: #16a34a; color: #fff; }
.rv-btn:disabled { opacity: .45; cursor: default; }
.rv-status { font-size: 12px; color: var(--text-muted, #6b7280); }
.rv-answer { font-size: 13px; line-height: 1.45; white-space: pre-wrap; background: var(--bg, #f6f7f9); border-radius: 8px; padding: 8px; margin: 4px 0; }
.rv-done { font-size: 12px; color: #15803d; }

/* Плашка «CHEEK обновился» (30.09.2026): вкладка открыта давно, а сервер отдал новую версию страницы (refreshMe в app.js). */
.update-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 400;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 18px; border-radius: var(--radius-sm);
  background: var(--text); color: #fff; font-size: 14px; line-height: 1.35;
  box-shadow: 0 8px 28px rgba(15, 20, 35, 0.28);
}
.update-bar-btn {
  flex: none; padding: 8px 16px; border: none; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.update-bar-btn:hover { background: var(--accent-hover); }
@media (max-width: 720px) {
  .update-bar { left: 12px; right: 12px; bottom: 12px; transform: none; max-width: none; }
}

/* Delivery headings stay visible in the board scroll container. */
.delivery-page-heading { background: var(--bg); padding: 8px 0; }
.delivery-summary-heading { padding: 8px 0; }
/* Шапки таблиц прилипают к верху #board-view: у таблицы и её обёрток не должно быть своей прокрутки, иначе sticky не работает. */
.st-table > .st-row.head, .an-table.an-grid .an-row.an-head .an-cell, .adm-table th {
  position: sticky; top: 0; z-index: 12; background: var(--bg); box-shadow: 0 4px 4px -4px rgba(21,24,40,.2);
}
.task-table th { position: sticky; top: 0; z-index: 12; box-shadow: 0 4px 4px -4px rgba(21,24,40,.2); }

/* Переключатель личных задач: кнопки стоят рядом, без отступа кнопки выполненных. */
.list-head:has(> .list-toggle[aria-pressed]) { justify-content: flex-start; gap: 8px; }
.list-head > .list-toggle[aria-pressed] { margin-left: 0; }
.list-head > .list-toggle[aria-pressed="true"] {
  color: var(--text); border-color: var(--border-strong); background: var(--bg, #f5f6fa);
  font-weight: 600; cursor: default; opacity: 1;
}

/* Resizable task drawer, 22.10.2026 */
@media (min-width:769px) {
 #task-modal .modal {width:var(--task-drawer-width,620px);flex-shrink:0;}
 #task-modal .task-width-handle {position:fixed;top:0;bottom:0;right:calc(min(var(--task-drawer-width,620px),100vw - 56px) - 5px);width:10px;cursor:ew-resize;touch-action:none;z-index:5;}
 #task-modal .task-width-handle:hover,#task-modal .task-width-handle:focus-visible {background:rgba(40,130,100,.28);outline:none;}
}
@media (max-width:768px) {#task-modal .task-width-handle {display:none;}}

/* ---- «Отметить выполнение» — личный раздел наверху панели (26.10.2026, lib/my-confirm.js) ---------------- */
.quick-top { background: var(--accent-soft); color: var(--accent); font-weight: 600; margin-bottom: 6px; }
.quick-top .quick-icon { color: var(--accent); }
.quick-top:hover { background: #d9ecdf; }
.quick-top.active { background: var(--accent); color: #fff; }
.quick-top.active .quick-icon { color: #fff; }
.quick-badge {
  margin-left: auto; min-width: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center;
}
.mc-wrap { max-width: 980px; }
.mc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mc-refresh { margin-left: auto; }
.mc-lead { margin: 6px 0 20px; font-size: 13px; color: var(--text-muted); }
.mc-block { margin-bottom: 28px; }
.mc-block-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.mc-count {
  min-width: 22px; padding: 0 7px; border-radius: 999px;
  background: var(--column-bg); color: var(--text-muted);
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
.mc-hint { margin: 0 0 10px; font-size: 12.5px; color: var(--text-muted); }
.mc-rows { display: flex; flex-direction: column; gap: 8px; }
.mc-row {
  padding: 12px 14px; background: var(--card-bg);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs);
}
.mc-row-done { background: var(--success-soft); border-color: var(--success); color: var(--success); font-weight: 600; font-size: 13px; }
.mc-task-link {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text); text-align: left; cursor: pointer;
}
.mc-task-link:hover { color: var(--accent); text-decoration: underline; }
.mc-meta { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.mc-meta .is-overdue { color: var(--danger); font-weight: 600; }
.mc-quote {
  margin-top: 8px; padding: 7px 10px;
  border-left: 3px solid var(--border-strong); border-radius: 0 6px 6px 0; background: var(--column-bg);
  font-size: 13px; white-space: pre-wrap; word-break: break-word; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mc-quote.expanded { display: block; }
.mc-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mc-btn {
  padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card-bg); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.mc-btn:hover { border-color: var(--text-faint); }
.mc-btn:disabled { opacity: 0.6; cursor: default; }
.mc-btn-ok { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.mc-btn-ok:hover:not(:disabled) { background: var(--success); border-color: var(--success); color: #fff; }
.mc-btn-back:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }
.mc-btn-ghost { font-weight: 500; color: var(--text-muted); }
.mc-status { font-size: 12px; color: var(--danger); }
.mc-empty {
  padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius);
  text-align: center; font-size: 13px; color: var(--text-muted);
}
.mc-foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted);
}
@media (max-width: 768px) {
  .mc-task-link { font-size: 14px; }
  .mc-btn { padding: 9px 12px; }
}

/* Рейтинг связок — вторая вкладка раздела «Отзывы» (Константин 30.10.2026) */
.rv-views { margin: 6px 0 4px; }
.rr-page { max-width: 1060px; }
.rr-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.rr-count { border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.rr-count b { font-weight: 700; }
.rr-count.rr-below { border-color: #dc2626; color: #b91c1c; }
.rr-count.rr-edge { border-color: #f59e0b; color: #b45309; }
.rr-count.rr-ok { border-color: #16a34a; color: #15803d; }
.rr-cab { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin: 12px 0; background: var(--surface, #fff); }
.rr-cab-top { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.rr-cab-name { font-weight: 700; font-size: 15px; }
.rr-cab-sum { color: var(--text-muted, #6b7280); font-size: 12px; }
.rr-stale { color: #b45309; font-size: 12px; }
.rr-empty { color: var(--text-muted, #6b7280); font-size: 13px; padding: 6px 2px; }
.rr-row { display: grid; grid-template-columns: minmax(200px, 1fr) 96px 64px 86px 78px 100px 104px; gap: 8px; align-items: center; padding: 6px 4px; border-top: 1px solid var(--border); }
.rr-hdr { color: var(--text-muted, #6b7280); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; border-top: 0; }
.rr-title { color: var(--text); text-decoration: none; font-size: 13px; font-weight: 600; }
.rr-title:hover { text-decoration: underline; }
.rr-sub { color: var(--text-muted, #6b7280); font-size: 11px; }
.rr-rate { display: flex; flex-direction: column; }
.rr-num { font-size: 20px; font-weight: 700; line-height: 1.1; }
.rr-num.rr-below { color: #dc2626; }
.rr-num.rr-edge { color: #d97706; }
.rr-num.rr-ok { color: #16a34a; }
.rr-num.rr-none { color: var(--text-muted, #6b7280); }
.rr-cell { font-size: 13px; }
.rr-up { color: #16a34a; }
.rr-down { color: #dc2626; }
.rr-neg { font: inherit; font-size: 13px; background: none; border: 0; padding: 0; color: #b91c1c; cursor: pointer; text-decoration: underline dotted; }
.rr-more { display: none; padding: 4px 8px 8px; background: var(--bg, #f6f7f9); border-radius: 8px; margin: 2px 0 4px; }
.rr-item.open .rr-more { display: block; }
.rr-neg-line { font-size: 12px; line-height: 1.45; padding: 2px 0; }
@media (max-width: 720px) {
  .rr-row { grid-template-columns: 1fr 80px; }
  .rr-hdr { display: none; }
}
.rr-row.rr-minor { opacity: .55; }
.rr-how summary { cursor: pointer; }
.rr-how-line { margin: 3px 0 3px 14px; }
.rr-stale-note { color: #b45309; font-size: 13px; margin: 4px 0; }

/* Выгрузка остатков в Excel (09.11.2026): обычная кнопка в блоке бренда и большая красная у руководителя отдела продаж. */
.st-export-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.st-export-status { font-size: 12px; color: var(--text-faint); }
.st-export-status:empty { display: none; }
.st-export-status.bad { color: var(--danger, #d62828); font-weight: 600; }
.st-export-big { margin: 10px 0 14px; padding: 16px; border: 2px solid #d62828; border-radius: 16px; background: rgba(214, 40, 40, .07); display: flex; flex-direction: column; gap: 10px; }
.st-export-main { width: 100%; padding: 22px 24px; font-size: 22px; font-weight: 800; letter-spacing: .02em; color: #fff; background: linear-gradient(#e63946, #c1121f); border: 0; border-radius: 14px; cursor: pointer; box-shadow: 0 6px 0 #8d0801, 0 12px 26px rgba(193, 18, 31, .35); transition: transform .08s, box-shadow .08s; }
.st-export-main:hover:not(:disabled) { filter: brightness(1.06); }
.st-export-main:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 #8d0801, 0 6px 14px rgba(193, 18, 31, .3); }
.st-export-main:disabled { opacity: .75; cursor: progress; }
.st-export-sub { display: flex; gap: 10px; flex-wrap: wrap; }
.st-export-one { padding: 8px 16px; font-size: 14px; font-weight: 700; color: #c1121f; background: transparent; border: 2px solid #c1121f; border-radius: 10px; cursor: pointer; }
.st-export-one:hover:not(:disabled) { background: rgba(193, 18, 31, .1); }
.st-export-one:disabled { opacity: .6; cursor: progress; }
@media (max-width: 640px) { .st-export-main { font-size: 18px; padding: 18px 14px; } }
