/* ==============================================================================
   LAZEBRA ERP — СТИЛИ БАЗЫ ЗНАНИЙ И РЕГЛАМЕНТОВ ПРОИЗВОДСТВА
   Соответствие: DESIGN_SYSTEM.md (Парящие острова, цвета Sky/Slate, чистота 100%)
   ============================================================================== */

:root {
  --color-brand: #0284c7;
  --color-brand-dark: #0369a1;
  --color-brand-light: #e0f2fe;
  --color-body-bg: #f8fafc;
  --color-card-bg: #ffffff;
  --color-border: #e2e8f0;
  --color-border-subtle: #f1f5f9;
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;

  --color-success-bg: #dcfce7;
  --color-success-text: #16a34a;
  --color-warning-bg: #fef3c7;
  --color-warning-text: #d97706;
  --color-danger-bg: #fee2e2;
  --color-danger-text: #dc2626;

  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --shadow-island: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.kb-body {
  font-family: var(--font-main);
  background-color: var(--color-body-bg);
  color: var(--color-text-main);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Оболочка всего экрана */
.kb-app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px;
  gap: 12px;
}

/* ==============================================================================
   1. ВЕРХНЯЯ ПАНЕЛЬ (TOPBAR ISLAND)
   ============================================================================== */
.kb-topbar-island {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.kb-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.kb-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-border-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-text-main);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.kb-back-btn:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand);
  color: var(--color-brand-dark);
}

.kb-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kb-brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-text-main);
}

.kb-brand-badge {
  background: var(--color-brand-light);
  color: var(--color-brand-dark);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kb-topbar-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 640px;
}

.kb-search-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

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

.kb-search-input {
  width: 100%;
  padding: 8px 36px 8px 36px;
  background: var(--color-body-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--color-text-main);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kb-search-input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
  background: #ffffff;
}

.kb-search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
}

.kb-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--color-body-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.kb-toggle-pill .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  transition: background 0.15s;
}

.kb-toggle-pill.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.kb-toggle-pill.active .pill-dot {
  background: #f59e0b;
}

.kb-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kb-primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-brand);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.2);
}

.kb-primary-btn:hover {
  background: var(--color-brand-dark);
}

.kb-primary-btn:active {
  transform: translateY(1px);
}

/* ==============================================================================
   2. ПОДЛЕНТА ФИЛЬТРАЦИИ ПО ДОЛЖНОСТЯМ (ROLES RIBBON)
   ============================================================================== */
.kb-roles-ribbon {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  flex-shrink: 0;
  overflow-x: auto;
}

.ribbon-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ribbon-chips-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.kb-role-chip {
  padding: 4px 10px;
  background: var(--color-border-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.kb-role-chip:hover {
  background: #e2e8f0;
}

.kb-role-chip.active {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: #ffffff;
  font-weight: 600;
}

/* ==============================================================================
   3. ГЛАВНАЯ РАБОЧАЯ ОБЛАСТЬ (2 КОЛОНКИ)
   ============================================================================== */
.kb-main-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

/* Сайдбар разделов */
.kb-sidebar-island {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kb-sidebar-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.kb-mini-btn {
  padding: 3px 8px;
  background: var(--color-border-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-brand-dark);
  cursor: pointer;
  transition: background 0.15s;
}

.kb-mini-btn:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand);
}

.kb-categories-tree {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* Элемент категории (аккордеон) */
.kb-category-group {
  margin-bottom: 6px;
}

.kb-category-header {
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
  transition: background 0.12s;
}

.kb-category-header:hover {
  background: var(--color-border-subtle);
}

.category-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-arrow {
  font-size: 10px;
  color: var(--color-text-muted);
  transition: transform 0.15s ease;
}

.kb-category-group.collapsed .category-arrow {
  transform: rotate(-90deg);
}

.category-badge-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  background: var(--color-border-subtle);
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
}

.kb-articles-list {
  padding-left: 18px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kb-category-group.collapsed .kb-articles-list {
  display: none;
}

.kb-article-item {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--color-text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition: all 0.12s ease;
  line-height: 1.3;
}

.kb-article-item:hover {
  background: var(--color-border-subtle);
}

.kb-article-item.active {
  background: var(--color-brand-light);
  color: var(--color-brand-dark);
  font-weight: 600;
}

.article-item-indicators {
  display: flex;
  align-items: center;
  gap: 4px;
}

.indicator-dot-video {
  color: #2563eb;
  font-size: 11px;
}

.indicator-dot-onboard {
  color: #d97706;
  font-size: 11px;
}

/* ==============================================================================
   4. КОНТЕНТНЫЙ ОСТРОВ (ПРОСМОТР РЕГЛАМЕНТА)
   ============================================================================== */
.kb-content-island {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px 32px;
}

.kb-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--color-text-muted);
  gap: 8px;
  padding: 40px;
}

.kb-empty-state .empty-icon {
  font-size: 42px;
}

.kb-article-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.kb-breadcrumbs {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.kb-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.kb-article-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-text-main);
  letter-spacing: -0.02em;
}

.kb-article-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.kb-action-btn {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-border);
  background: var(--color-body-bg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.kb-action-btn.edit-btn:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand);
  color: var(--color-brand-dark);
}

.kb-action-btn.delete-btn:hover {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-text);
  color: var(--color-danger-text);
}

.kb-article-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

.badge-tag.role {
  background: var(--color-border-subtle);
  color: var(--color-text-main);
  border: 1px solid var(--color-border);
}

.badge-tag.onboard {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.badge-tag.screen {
  background: var(--color-brand-light);
  color: var(--color-brand-dark);
}

/* ==============================================================================
   5. АДАПТИВНЫЙ ВИДЕОПЛЕЕР (16:9)
   ============================================================================== */
.kb-video-wrapper {
  margin-bottom: 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: #000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.kb-video-inner {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
}

.kb-video-inner iframe,
.kb-video-inner video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ==============================================================================
   6. ТЕЛО СТАТЬИ И СКРИНШОТЫ (QUILL RENDER)
   ============================================================================== */
.kb-article-body {
  font-size: 15px;
  line-height: 1.7;
  color: #1e293b;
}

.kb-article-body h1,
.kb-article-body h2,
.kb-article-body h3 {
  color: var(--color-text-main);
  margin-top: 24px;
  margin-bottom: 12px;
  font-weight: 700;
}

.kb-article-body p {
  margin-bottom: 14px;
}

.kb-article-body ul,
.kb-article-body ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.kb-article-body li {
  margin-bottom: 6px;
}

.kb-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
  margin: 14px 0;
  display: block;
}

/* ==============================================================================
   7. ПОЛНОЭКРАННОЕ МОДАЛЬНОЕ ОКНО РЕДАКТИРОВАНИЯ (95vw, 92vh)
   ============================================================================== */
.kb-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb-modal-island {
  background: #ffffff;
  width: 95vw;
  height: 92vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleIn 0.15s ease-out;
}

@keyframes modalScaleIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.kb-modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text-main);
}

.modal-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
}

.kb-modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all 0.12s;
}

.kb-modal-close:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
}

.kb-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}

.kb-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.kb-field.full-width {
  grid-column: span 2;
}

.kb-field label,
.kb-form-block label,
.kb-form-editor-block label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.req {
  color: #dc2626;
}

.kb-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--color-text-main);
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kb-select {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-main);
  outline: none;
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.kb-input:focus,
.kb-select:focus {
  background-color: #ffffff;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14);
}

.kb-input-action-row {
  display: flex;
  gap: 8px;
}

.kb-secondary-btn {
  padding: 8px 14px;
  background: var(--color-border-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.kb-secondary-btn:hover {
  background: #e2e8f0;
}

.kb-text-btn {
  background: none;
  border: none;
  color: var(--color-brand);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.kb-text-btn:hover {
  text-decoration: underline;
}

.kb-form-block {
  margin-bottom: 16px;
  background: var(--color-body-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.kb-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.kb-role-checkboxes-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kb-role-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.kb-role-label input {
  display: none;
}

.kb-role-label.checked {
  background: var(--color-brand-light);
  border-color: var(--color-brand);
  color: var(--color-brand-dark);
  font-weight: 600;
}

.kb-form-row-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
}

.kb-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.kb-sort-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.kb-input-mini {
  width: 70px;
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  text-align: center;
  font-size: 13px;
}

.kb-video-input-container {
  margin-top: 10px;
}

.input-hint {
  display: block;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Блок редактора Quill */
.kb-form-editor-block {
  margin-bottom: 16px;
}

.kb-editor-wrapper {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ffffff;
}

.ql-snow .ql-picker.ql-header {
  width: 175px !important;
}

.ql-snow .ql-picker.ql-header .ql-picker-label {
  white-space: nowrap !important;
  padding-right: 28px !important;
}

.ql-snow .ql-picker.ql-header .ql-picker-options {
  width: 175px !important;
}

.kb-editor-surface {
  min-height: 280px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}

.kb-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #ffffff;
}

/* ==============================================================================
   8. МИНИ-МОДАЛКИ БЫСТРОГО СОЗДАНИЯ (РАЗДЕЛ / РОЛЬ)
   ============================================================================== */
.kb-prompt-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kb-prompt-island {
  background: #ffffff;
  width: 380px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-modal);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.kb-prompt-island h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-main);
}

.prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Списки управления существующими сущностями (удаление) */
.kb-manage-box {
  margin-top: 8px;
  border-top: 1px solid var(--color-border);
  padding-top: 10px;
}

.kb-manage-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.kb-manage-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-body-bg);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kb-manage-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  font-size: 12px;
}

.manage-item-info {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-item-count {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  background: var(--color-border-subtle);
  color: var(--color-text-muted);
}

.manage-item-del-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.12s;
  flex-shrink: 0;
}

.manage-item-del-btn:hover:not(:disabled) {
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
}

.manage-item-del-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ==============================================================================
   9. VIBE TOAST NOTIFICATIONS & QUICK ACTIONS
   ============================================================================== */
.kb-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
}

.kb-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.4), 0 8px 10px -6px rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transform: translateY(12px);
  opacity: 0;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.kb-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.kb-toast.hide {
  transform: translateY(12px);
  opacity: 0;
}

.kb-toast-icon {
  font-size: 15px;
}

.kb-toast.toast-success .kb-toast-icon {
  color: #22c55e;
}

.kb-toast.toast-error .kb-toast-icon {
  color: #ef4444;
}

.kb-toast.toast-info .kb-toast-icon {
  color: #3b82f6;
}

/* Кнопка быстрого удаления пустого раздела в аккордеоне сайдбара */
.kb-cat-quick-del-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
  opacity: 0.65;
  transition: all 0.15s ease;
  margin-left: 6px;
}

.kb-cat-quick-del-btn:hover {
  opacity: 1;
  background: var(--color-danger-bg);
  color: var(--color-danger-text);
  transform: scale(1.1);
}

/* Мультиселектор экранов ERP в модальном окне */
.kb-screens-picker-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kb-screens-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}

.kb-screen-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--color-brand-light);
  color: var(--color-brand-dark);
  border: 1px solid rgba(2, 132, 199, 0.25);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.kb-screen-chip-remove {
  background: none;
  border: none;
  color: var(--color-brand-dark);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  opacity: 0.7;
  transition: all 0.12s;
}

.kb-screen-chip-remove:hover {
  opacity: 1;
  background: rgba(2, 132, 199, 0.2);
}

.kb-screen-empty-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Анимация исчезновения удаляемого элемента */
.kb-article-item.deleting,
.kb-category-group.deleting {
  opacity: 0;
  transform: translateX(-12px);
  transition: all 0.2s ease-out;
  pointer-events: none;
}
