/* ============================================================
   Tendero v2 — компактный экспериментальный вариант
   Подключается после app.css и переопределяет density/layout.
   ============================================================ */

body.v2 {
  font-size: 12.5px;
  line-height: 18px;
  background: var(--bg-canvas);
  letter-spacing: -0.005em;
}

/* — Палитра остаётся та же, но добавляем переменные плотности — */
body.v2 {
  --row-h: 32px;
  --sidebar-w: 200px;
  --sidebar-w-rest: 52px;
  --topbar-h: 44px;
}

/* === SHELL === */
body.v2 .shell {
  grid-template-columns: var(--sidebar-w-rest) 1fr;
}
/* Рельса — фиксированный оверлей: раскрытие меню не двигает страницу,
   контент всегда во 2-й колонке грида. */
body.v2 .main { grid-column: 2; }

/* === SIDEBAR — icon-only by default, expands on hover === */
body.v2 .sidebar {
  padding: 8px 6px;
  background: #1e1c18;
  border-right: 0;
  overflow: hidden;
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w-rest);
  height: 100vh;
  z-index: 50;
  transition: width 180ms cubic-bezier(.2,.7,.2,1);
}
body.v2 .sidebar:hover {
  width: var(--sidebar-w);
  box-shadow: 4px 0 18px rgba(0,0,0,.28);
}
body.v2 .sidebar__logo {
  padding: 6px 8px 12px;
  font-size: 14px;
}
body.v2 .sidebar__logo > span:last-child {
  color: #fff;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 150ms;
}
body.v2 .sidebar:hover .sidebar__logo > span:last-child { opacity: 1; }

body.v2 .sidebar__group {
  padding: 10px 8px 4px;
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 150ms;
}
body.v2 .sidebar:hover .sidebar__group { opacity: 1; }

body.v2 .sidebar__item {
  padding: 6px 10px;
  margin-bottom: 1px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
}
body.v2 .sidebar__item:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
body.v2 .sidebar__item--active,
body.v2 .sidebar__item--active:hover {
  background: var(--accent-500);
  color: #fff;
  font-weight: 500;
}

/* === Sidebar expandable items === */
body.v2 .sidebar__item-chev {
  width: 14px; height: 14px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
  transition: transform 150ms;
}
body.v2 .sidebar__item-chev [data-lucide] { width: 12px; height: 12px; }
body.v2 .sidebar__expandable--open > .sidebar__item .sidebar__item-chev { transform: rotate(90deg); color: #fff; }
body.v2 .sidebar__expandable .sidebar__item { display: flex; align-items: center; gap: 12px; }

body.v2 .sidebar__submenu {
  display: none;
  padding: 2px 0 6px 28px;
  margin-bottom: 4px;
}
body.v2 .sidebar__expandable--open .sidebar__submenu { display: block; }
body.v2 .sidebar__subitem {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px;
  margin-bottom: 1px;
  border-radius: 5px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
body.v2 .sidebar__subitem:hover { background: rgba(255,255,255,0.06); color: #fff; }
body.v2 .sidebar__subitem--active {
  background: rgba(237,106,90,0.18);
  color: #fff;
}
body.v2 .sidebar__subitem-label {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}
body.v2 .sidebar__subitem-count {
  font-family: var(--font-mono); font-size: 10.5px;
  color: rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
}
body.v2 .sidebar__subitem--active .sidebar__subitem-count { color: rgba(255,255,255,0.7); }
body.v2 .sidebar__subitem-star {
  width: 12px; height: 12px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 100ms;
}
body.v2 .sidebar__subitem:hover .sidebar__subitem-star { opacity: 1; }
body.v2 .sidebar__subitem--starred .sidebar__subitem-star {
  color: var(--accent-400);
  fill: var(--accent-400);
  opacity: 1;
}

/* Hide submenu when sidebar collapsed (icon-only) */
body.v2 .sidebar:not(:hover) .sidebar__submenu { display: none !important; }
body.v2 .sidebar:not(:hover) .sidebar__item-chev { opacity: 0; }
body.v2 .sidebar__item [data-lucide] { width: 15px; height: 15px; }
body.v2 .sidebar__item-label {
  opacity: 0;
  transition: opacity 150ms;
}
body.v2 .sidebar:hover .sidebar__item-label { opacity: 1; }
body.v2 .sidebar__item-count {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  opacity: 0;
  transition: opacity 150ms;
}
body.v2 .sidebar:hover .sidebar__item-count { opacity: 1; }
body.v2 .sidebar__item-count--accent { color: var(--accent-300); }
body.v2 .sidebar__item--active .sidebar__item-count { color: rgba(255,255,255,0.7); }

body.v2 .sidebar__user {
  background: rgba(255,255,255,0.05);
  border: 0;
  padding: 6px;
  border-radius: 8px;
}
body.v2 .sidebar__user-name { color: #fff; opacity: 0; transition: opacity 150ms; }
body.v2 .sidebar__user-tenant { color: rgba(255,255,255,0.5); opacity: 0; transition: opacity 150ms; }
body.v2 .sidebar:hover .sidebar__user-name,
body.v2 .sidebar:hover .sidebar__user-tenant { opacity: 1; }
body.v2 .sidebar__user-btn { color: rgba(255,255,255,0.5); opacity: 0; transition: opacity 150ms; }
body.v2 .sidebar:hover .sidebar__user-btn { opacity: 1; }
body.v2 .sidebar__user-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
body.v2 .sidebar__user-avatar { background: var(--accent-500); color: #fff; }

/* === TOPBAR — тонкая, всё в одну строку, с командной палитрой === */
body.v2 .topbar {
  height: var(--topbar-h);
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-1);
  gap: 12px;
}
body.v2 .topbar__icon {
  width: 22px; height: 22px;
  border: 0; background: transparent; color: var(--text-2);
}
body.v2 .topbar__icon [data-lucide] { width: 15px; height: 15px; }
body.v2 .topbar__title-block {
  flex-direction: row;
  align-items: baseline;
  gap: 8px;
}
body.v2 .topbar__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
}
body.v2 .topbar__subtitle {
  font-size: 11.5px;
  color: var(--text-3);
  margin: 0;
  display: inline;
}
body.v2 .topbar__subtitle::before { content: '· '; color: var(--text-4); }

/* === COMMAND PALETTE HINT === */
body.v2 .cmd-hint {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 8px 0 6px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  font-size: 11px; color: var(--text-3);
  cursor: pointer;
}
body.v2 .cmd-hint:hover { border-color: var(--border-2); color: var(--text-1); }
body.v2 .cmd-hint kbd {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 4px; background: var(--bg-sunken);
  border-radius: 3px; color: var(--text-2);
}

/* === TABS — компактные === */
body.v2 .tabs {
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-1);
  gap: 0;
}
body.v2 .tab {
  padding: 7px 10px;
  font-size: 12px;
  border-bottom-width: 2px;
}
body.v2 .tab__count {
  min-width: 16px; height: 14px;
  font-size: 10px;
  padding: 0 4px;
}

/* === CONTENT — меньше paddings === */
body.v2 .content {
  padding: 14px 16px 32px;
}

/* === CARDS — без обводок, плоские с фоном === */
body.v2 .card {
  background: var(--bg-surface);
  border: 0;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--border-1) inset;
}
body.v2 .card--lg { padding: 14px 16px; }
body.v2 .card--xl { padding: 16px 18px; }

body.v2 .section-label { margin-bottom: 8px; }
body.v2 .section-label__title {
  font-size: 10.5px;
  letter-spacing: .05em;
}

/* === KPI BAR — заменяем большие плитки на одну компактную полосу === */
body.v2 .kpi-bar {
  display: flex; align-items: stretch; gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 0; overflow: hidden;
  margin-bottom: 12px;
}
body.v2 .kpi-bar__item {
  flex: 1;
  display: grid; grid-template-columns: auto 1fr;
  gap: 10px; align-items: center;
  padding: 10px 14px;
  border-right: 1px solid var(--border-1);
  min-width: 0;
}
body.v2 .kpi-bar__item:last-child { border-right: 0; }
body.v2 .kpi-bar__icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-sunken); color: var(--text-2);
}
body.v2 .kpi-bar__item--accent .kpi-bar__icon { background: var(--accent-50); color: var(--accent-700); }
body.v2 .kpi-bar__item--success .kpi-bar__icon { background: var(--success-50); color: var(--success-700); }
body.v2 .kpi-bar__item--warn .kpi-bar__icon { background: var(--warn-50); color: var(--warn-700); }
body.v2 .kpi-bar__label {
  font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em;
}
body.v2 .kpi-bar__value {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 18px; font-weight: 700; line-height: 1.1;
  letter-spacing: -.01em;
}
body.v2 .kpi-bar__hint { font-size: 11px; color: var(--text-3); margin-left: 4px; font-weight: 400; }

/* === DENSE LIST (плоский, дивайдеры вместо карточек) === */
body.v2 .dense-list {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  overflow: hidden;
}
body.v2 .dense-list__head {
  display: grid;
  padding: 6px 12px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
  font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 500;
  gap: 12px;
}
body.v2 .dense-list__row {
  display: grid;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-1);
  gap: 12px; align-items: center;
  font-size: 12.5px;
  cursor: pointer;
}
body.v2 .dense-list__row:last-child { border-bottom: 0; }
body.v2 .dense-list__row:hover { background: var(--bg-hover); }
body.v2 .dense-list__row.is-selected {
  background: var(--accent-50);
  box-shadow: inset 3px 0 0 var(--accent-500);
}

/* === BADGES & CHIPS — slimmer === */
body.v2 .badge { padding: 1px 7px; font-size: 11px; }
body.v2 .badge--sm { padding: 0 6px; font-size: 10.5px; }
body.v2 .stage-badge { padding: 1px 8px; font-size: 11px; }
body.v2 .stage-badge__dot { width: 5px; height: 5px; }
body.v2 .stage-badge__countdown { font-size: 10.5px; }
body.v2 .chip { padding: 1px 8px; font-size: 11px; }

/* === BUTTONS — узкие === */
body.v2 .btn { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
body.v2 .btn--sm { height: 24px; padding: 0 8px; font-size: 11px; }
body.v2 .btn--icon { width: 28px; padding: 0; }
body.v2 .btn--icon.btn--sm { width: 24px; }
body.v2 .btn--lg { height: 34px; font-size: 13px; }

/* === TABLES — плотные === */
body.v2 .table { font-size: 12px; border-radius: 8px; }
body.v2 .table th, body.v2 .table td { padding: 6px 12px; }
body.v2 .table th {
  font-size: 10.5px;
  background: var(--bg-canvas);
}

/* === DRAWER — узкий, плотный === */
body.v2 .drawer { width: 360px; }
body.v2 .shell--with-drawer .shell__main,
body.v2 .shell .shell__main[style*="grid-template"] {
  grid-template-columns: 1fr 360px !important;
}
body.v2 .drawer__head { padding: 10px 14px 10px; }
body.v2 .drawer__head h2 { font-size: 14px !important; line-height: 1.3 !important; margin-bottom: 6px !important; }
body.v2 .drawer__tabs { padding: 0 8px; }
body.v2 .drawer__tab { padding: 7px 8px; font-size: 11.5px; }
body.v2 .drawer__tab-count { font-size: 10px; padding: 0 5px; }
body.v2 .drawer__body { padding: 12px 14px; }
body.v2 .drawer__section { margin-bottom: 14px; }
body.v2 .drawer__section-title { font-size: 10.5px; margin-bottom: 6px; }
body.v2 .drawer__dates { font-size: 12px; gap: 4px 12px; }
body.v2 .drawer__footer { padding: 8px 12px; }

/* === TENDER CARD shell — sticky topbar instead of huge hero === */
body.v2 .tcard-header { padding: 10px 16px; }
body.v2 .tcard-header__crumbs { margin-bottom: 6px; font-size: 11.5px; gap: 6px; }
body.v2 .tcard-header__title { margin-bottom: 10px; gap: 12px; }
body.v2 .tcard-header__title h1 {
  font-size: 16px !important;
  line-height: 1.3 !important;
  letter-spacing: -.005em !important;
}
body.v2 .tcard-hero {
  grid-template-columns: auto auto 1fr auto;
  padding: 10px 14px;
  gap: 24px;
  border-radius: 8px;
}
body.v2 .tcard-hero__price { padding-right: 18px; }
body.v2 .tcard-hero__price-value { font-size: 22px; }
body.v2 .tcard-hero__deadline-value { font-size: 14px; }
body.v2 .tcard-workflow {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
}
body.v2 .tcard-workflow__head { margin-bottom: 8px; }
body.v2 .wf-step { padding: 6px 8px; font-size: 11.5px; }
body.v2 .tcard-tabs { gap: 2px; margin-bottom: 14px; }
body.v2 .tcard-tab { padding: 6px 10px; font-size: 11.5px; }
body.v2 .tcard-section { border-radius: 8px; margin-bottom: 10px; }
body.v2 .tcard-section__head { padding: 8px 12px; }
body.v2 .tcard-section__title { font-size: 11px; }
body.v2 .tcard-section__body { padding: 12px; }
body.v2 .kv { grid-template-columns: 180px 1fr; gap: 6px 18px; font-size: 12px; }
body.v2 .kv__name { font-size: 11.5px; }

/* === AI CARD — компактнее === */
body.v2 .ai-card { margin-bottom: 10px; border-radius: 8px; }
body.v2 .ai-card__head { padding: 8px 14px; }
body.v2 .ai-card__title { font-size: 11px; }
body.v2 .ai-card__title-icon { width: 18px; height: 18px; }
body.v2 .ai-card__title-icon [data-lucide] { width: 10px !important; height: 10px !important; }
body.v2 .ai-card__updated { font-size: 10.5px; }
body.v2 .ai-card__body { padding: 12px 14px; }
body.v2 .ai-verdict { padding: 10px 12px; gap: 14px; margin-bottom: 10px; }
body.v2 .ai-verdict__score { width: 44px; height: 44px; font-size: 16px; }
body.v2 .ai-verdict__recommend { font-size: 14px; }
body.v2 .ai-verdict__reason { font-size: 11.5px; }
body.v2 .ai-list { gap: 6px; margin-bottom: 10px; }
body.v2 .ai-list__head { font-size: 10.5px; }
body.v2 .ai-item { font-size: 12px; gap: 8px; }
body.v2 .ai-card__footer { padding: 8px 14px; font-size: 11px; }

/* === EMPTY STATE — компактный === */
body.v2 .empty--inline { padding: 18px; }
body.v2 .empty__illu { width: 44px; height: 44px; }
body.v2 .empty__illu [data-lucide] { width: 20px; height: 20px; }
body.v2 .empty__title { font-size: 13px; }
body.v2 .empty__hint { font-size: 12px; }

/* === INPUTS / SEARCH-BAR === */
body.v2 .input { height: 30px; padding: 0 10px; border-radius: 6px; }
body.v2 .input__field { font-size: 12.5px; }
body.v2 .search-bar { padding: 6px 10px; border-radius: 8px; }
body.v2 .search-bar__input { height: 22px; }
body.v2 .search-bar__input input { font-size: 13px; }

/* === EYEBROW и прочие label === */
body.v2 .eyebrow { font-size: 10px; }

/* === AVATAR & UTILITIES === */
body.v2 .avatar-xs { width: 16px; height: 16px; font-size: 9px; }

/* === V2 specific patterns === */
body.v2 .v2-rail {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  font-size: 12px;
  margin-bottom: 12px;
}
body.v2 .v2-rail__item {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2);
}
body.v2 .v2-rail__sep { color: var(--border-3); }
body.v2 .v2-rail__metric {
  display: inline-flex; align-items: center; gap: 4px;
}
body.v2 .v2-rail__num {
  font-family: var(--font-mono); font-weight: 600;
  color: var(--text-1);
}

/* Master-detail: split panel layout (общий шаблон под dense list + drawer) */
body.v2 .split-panel {
  display: grid; grid-template-columns: 1fr 360px;
  gap: 0;
  height: calc(100vh - var(--topbar-h) - 32px);
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  overflow: hidden;
}
body.v2 .split-panel__list {
  border-right: 1px solid var(--border-1);
  overflow: auto;
}
body.v2 .split-panel__detail {
  overflow: auto;
  background: var(--bg-surface);
}

/* Inline-row компонент: всё в одной строке */
body.v2 .row-line {
  display: grid;
  padding: 6px 12px;
  gap: 12px; align-items: center;
  border-bottom: 1px solid var(--border-1);
  font-size: 12px; cursor: pointer;
  transition: background 100ms;
}
body.v2 .row-line:last-child { border-bottom: 0; }
body.v2 .row-line:hover { background: var(--bg-hover); }
body.v2 .row-line.is-selected {
  background: var(--accent-50);
  box-shadow: inset 3px 0 0 var(--accent-500);
}
body.v2 .row-line__title {
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.v2 .row-line__sub {
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 1px;
}
body.v2 .row-line__num {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-weight: 600;
}
/* === V2 EVENT — compact dense row === */
body.v2 .event {
  grid-template-columns: 24px 1fr auto;
  padding: 8px 12px;
  border-left-width: 2px;
  border-radius: 6px;
  font-size: 12px;
  gap: 10px;
}
body.v2 .event__icon {
  width: 24px; height: 24px;
  border-radius: 5px;
}
body.v2 .event__icon [data-lucide] { width: 13px; height: 13px; }
body.v2 .event__title { font-size: 12.5px; margin-bottom: 2px; }
body.v2 .event__meta { font-size: 11px; gap: 6px; margin-bottom: 2px; }
body.v2 .event__subject { font-size: 11.5px; line-height: 1.4; -webkit-line-clamp: 1; }
body.v2 .event__when { font-size: 10.5px; }

/* === V2 TASK — single-line dense === */
body.v2 .task {
  grid-template-columns: 8px auto 1fr auto;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  gap: 10px;
}
body.v2 .task__priority { width: 6px; height: 6px; }
body.v2 .task__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.v2 .task__step { font-size: 12.5px; white-space: nowrap; margin-bottom: 0; }
body.v2 .task__step .task__role { display: none; }
body.v2 .task__tender { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
body.v2 .task__customer { display: none; }
body.v2 .task__deadline { font-size: 11px; }
body.v2 .task__priority-label { display: none; }

/* === V2 list (general) tighter gap === */
body.v2 .list { gap: 4px; }

/* === V2 KPI tile compact === */
body.v2 .kpi { padding: 10px 14px; border-radius: 8px; }
body.v2 .kpi__label { font-size: 10px; margin-bottom: 4px; }
body.v2 .kpi__value { font-size: 22px; }
body.v2 .kpi__hint { font-size: 11px; margin-top: 4px; }
body.v2 .kpi-row { gap: 8px; }

/* === V2 empty padding === */
body.v2 .empty { padding: 32px 16px; }

/* === V2 my-tender row compact === */
body.v2 .my-tender { padding: 7px 12px; border-radius: 6px; font-size: 12px; }
body.v2 .my-tender__head { font-size: 10.5px; margin-bottom: 2px; gap: 6px; }
body.v2 .my-tender__title { font-size: 12.5px; }
body.v2 .my-tender__amount { font-size: 13px; min-width: 90px; }
body.v2 .my-tender__phase { font-size: 10.5px; margin-bottom: 0; }
body.v2 .my-tender__date { font-size: 10.5px; }
.product-row {
  cursor: pointer;
  transition: background 100ms;
}
.product-row__chev {
  display: inline-flex; width: 14px; height: 14px;
  color: var(--text-3);
  transition: transform 150ms;
}
.product-row.is-open .product-row__chev { transform: rotate(90deg); color: var(--accent-600); }
.product-row.is-open { background: var(--accent-50); }
.product-row.is-open td { border-bottom-color: var(--accent-200); }

.product-detail { display: none; }
.product-detail.is-open { display: table-row; }
.product-detail td {
  padding: 0 !important;
  border-bottom: 1px solid var(--border-1) !important;
  background: var(--bg-canvas);
}
.product-detail__inner {
  padding: 12px 16px 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px;
}
.product-detail__inner h4 {
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  margin: 0 0 8px;
}
.product-detail__chars {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px;
  font-size: 12.5px;
}
.product-detail__chars dt { color: var(--text-3); }
.product-detail__chars dd { margin: 0; color: var(--text-1); text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.product-detail__chars dd.text { font-family: var(--font-sans); }

/* ============================================================
   DISCUSSION — комментарии сотрудников по тендеру/контракту
   ============================================================ */

.discussion {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  overflow: hidden;
}
.discussion__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
}
.discussion__title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.discussion__body { padding: 10px 14px; }

.dscn-msg {
  display: grid; grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-1);
}
.dscn-msg:last-child { border-bottom: 0; }
.dscn-msg__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent-100); color: var(--accent-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.dscn-msg__avatar--info { background: var(--info-50); color: var(--info-500); }
.dscn-msg__avatar--success { background: var(--success-50); color: var(--success-700); }
.dscn-msg__avatar--warn { background: var(--warn-50); color: var(--warn-700); }
.dscn-msg__head {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 3px;
}
.dscn-msg__author {
  font-size: 12.5px; font-weight: 600; color: var(--text-1);
}
.dscn-msg__role {
  font-size: 10.5px; color: var(--text-3);
  padding: 1px 6px; background: var(--bg-sunken); border-radius: 999px;
}
.dscn-msg__when {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3);
  margin-left: auto;
}
.dscn-msg__body {
  font-size: 12.5px; color: var(--text-1); line-height: 1.5;
}
.dscn-msg__body .mention {
  display: inline-block; padding: 0 4px;
  background: var(--accent-50); color: var(--accent-700);
  border-radius: 3px; font-weight: 500;
}
.dscn-msg__attach {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px; padding: 5px 10px;
  border: 1px solid var(--border-1); border-radius: 6px;
  background: var(--bg-canvas);
  font-size: 11.5px;
  text-decoration: none; color: inherit;
}
.dscn-msg__attach [data-lucide] { width: 12px; height: 12px; color: var(--text-3); }
.dscn-msg__actions {
  display: flex; gap: 12px; margin-top: 6px;
  font-size: 11px;
}
.dscn-msg__action {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-3); cursor: pointer;
  background: none; border: 0; padding: 0;
}
.dscn-msg__action:hover { color: var(--text-1); }
.dscn-msg__action [data-lucide] { width: 11px; height: 11px; }
.dscn-msg__reactions {
  display: inline-flex; gap: 4px;
  margin-top: 6px;
}
.dscn-msg__reaction {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--border-1); border-radius: 999px;
  background: var(--bg-surface);
  font-size: 11px; color: var(--text-2);
  cursor: pointer;
}
.dscn-msg__reaction--active {
  background: var(--accent-50); border-color: var(--accent-200); color: var(--accent-700);
}

/* Replies — vertical thread indent */
.dscn-msg--reply {
  margin-left: 38px;
  grid-template-columns: 22px 1fr;
  padding: 6px 0;
  position: relative;
}
.dscn-msg--reply::before {
  content: ''; position: absolute;
  left: -10px; top: 0; bottom: 0;
  width: 2px; background: var(--border-1);
}
.dscn-msg--reply .dscn-msg__avatar {
  width: 22px; height: 22px; font-size: 9.5px;
}

/* Event-style entry inside discussion (system) */
.dscn-event {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  font-size: 11.5px; color: var(--text-3);
  border-bottom: 1px solid var(--border-1);
}
.dscn-event [data-lucide] { width: 12px; height: 12px; }
.dscn-event__author { color: var(--text-1); font-weight: 500; }
.dscn-event__when { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; }

/* Composer */
.dscn-composer {
  padding: 10px 14px;
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-1);
}
.dscn-composer__field {
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 120ms;
}
.dscn-composer__field:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-50);
}
.dscn-composer__input {
  width: 100%;
  border: 0; outline: none; background: transparent;
  font: inherit; font-size: 12.5px; color: var(--text-1);
  resize: none;
  min-height: 28px;
}
.dscn-composer__bar {
  display: flex; align-items: center; gap: 4px;
}
.dscn-composer__hint {
  font-size: 10.5px; color: var(--text-3);
  margin-left: auto;
}
.dscn-composer__hint kbd {
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 1px 4px; background: var(--bg-canvas); border: 1px solid var(--border-1); border-radius: 3px;
}

/* ============================================================
   NOTIFICATIONS — bell + dropdown panel
   ============================================================ */
.notif-bell {
  position: relative;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-2);
}
.notif-bell:hover { background: var(--bg-hover); color: var(--text-1); }
.notif-bell [data-lucide] { width: 14px; height: 14px; }
.notif-bell__dot {
  position: absolute; top: 3px; right: 3px;
  min-width: 14px; height: 14px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-500);
  color: #fff;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bg-surface);
}

.notif-panel {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  width: 380px; max-height: 480px;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  box-shadow: var(--shadow-3);
  z-index: 999;
  display: none;
  overflow: hidden;
}
.notif-panel.is-open { display: flex; flex-direction: column; }

.notif-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-canvas);
}
.notif-panel__title {
  font-size: 13px; font-weight: 600;
}
.notif-panel__tabs {
  display: flex; gap: 2px;
  padding: 0 8px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
}
.notif-panel__tab {
  padding: 8px 10px;
  font-size: 11.5px; font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.notif-panel__tab:hover { color: var(--text-1); }
.notif-panel__tab--active {
  color: var(--accent-700);
  border-bottom-color: var(--accent-500);
  font-weight: 600;
}
.notif-panel__tab-count {
  font-family: var(--font-mono); font-size: 10px;
  padding: 0 5px;
  background: var(--bg-sunken); color: var(--text-2);
  border-radius: 999px;
}
.notif-panel__tab--active .notif-panel__tab-count {
  background: var(--accent-50); color: var(--accent-700);
}

.notif-list {
  flex: 1; overflow: auto;
}
.notif-item {
  display: grid; grid-template-columns: 32px 1fr auto;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-1);
  cursor: pointer;
  transition: background 100ms;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item--unread { background: var(--accent-50); }
.notif-item--unread:hover { background: #fbe7e2; }
.notif-item__avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent-100); color: var(--accent-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
  position: relative;
}
.notif-item__avatar--info { background: var(--info-50); color: var(--info-500); }
.notif-item__avatar--success { background: var(--success-50); color: var(--success-700); }
.notif-item__avatar--warn { background: var(--warn-50); color: var(--warn-700); }
.notif-item__avatar--system { background: var(--bg-sunken); color: var(--text-2); }
.notif-item__avatar-icon {
  position: absolute;
  right: -2px; bottom: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg-surface);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bg-surface);
}
.notif-item__avatar-icon [data-lucide] { width: 9px; height: 9px; }
.notif-item__avatar-icon--mention { background: var(--accent-500); color: #fff; border-color: var(--bg-surface); }
.notif-item__avatar-icon--task { background: var(--warn-500); color: #fff; border-color: var(--bg-surface); }
.notif-item__avatar-icon--alert { background: var(--danger-500); color: #fff; border-color: var(--bg-surface); }

.notif-item__body { min-width: 0; }
.notif-item__title {
  font-size: 12.5px; line-height: 1.4;
  margin-bottom: 2px;
}
.notif-item__title strong { font-weight: 600; }
.notif-item__title .mention {
  background: var(--accent-50); color: var(--accent-700);
  padding: 0 4px; border-radius: 3px; font-weight: 500;
}
.notif-item__context {
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notif-item__when {
  font-size: 10.5px; color: var(--text-3);
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}
.notif-item__unread-dot {
  width: 7px; height: 7px;
  background: var(--accent-500);
  border-radius: 50%;
  margin-top: 6px;
  align-self: start;
}

.notif-panel__footer {
  padding: 8px 14px;
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px;
}

.notif-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
}
.notif-empty [data-lucide] { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 6px; }

/* ============================================================
   TASKS — view modes
   ============================================================ */
.tv-switch {
  display: inline-flex; gap: 2px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  padding: 2px;
}
.tv-switch__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px; font-weight: 500;
  color: var(--text-3);
  background: transparent;
  border: 0; cursor: pointer;
  white-space: nowrap;
}
.tv-switch__btn [data-lucide] { width: 12px; height: 12px; }
.tv-switch__btn:hover { color: var(--text-1); }
.tv-switch__btn--active {
  background: var(--bg-surface); color: var(--text-1);
  box-shadow: var(--shadow-1);
}

.tv-view { display: none; }
.tv-view--active { display: block; }

/* Compact task row (used in list & grouped views) */
.tv-row {
  display: grid;
  grid-template-columns: 18px auto 1fr auto auto auto;
  gap: 10px; align-items: center;
  padding: 7px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 100ms, border-color 100ms;
  text-decoration: none; color: inherit;
}
.tv-row + .tv-row { margin-top: 4px; }
.tv-row:hover { border-color: var(--border-2); background: var(--bg-hover); }
.tv-row__check {
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-3);
  border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tv-row__check [data-lucide] { display: none; width: 9px; height: 9px; }
.tv-row--done .tv-row__check {
  background: var(--success-500); border-color: var(--success-500); color: #fff;
}
.tv-row--done .tv-row__check [data-lucide] { display: block; }
.tv-row--done .tv-row__title { color: var(--text-3); text-decoration: line-through; }
.tv-row__priority {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-3);
  flex-shrink: 0;
}
.tv-row--now .tv-row__priority { background: var(--danger-500); }
.tv-row--soon .tv-row__priority { background: var(--warn-500); }
.tv-row--later .tv-row__priority { background: var(--text-3); }
.tv-row--done .tv-row__priority { background: var(--success-500); }
.tv-row__step {
  font-weight: 600; font-size: 12.5px;
  white-space: nowrap; flex-shrink: 0;
}
.tv-row__title {
  font-size: 12px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.tv-row__title-sep { color: var(--text-4); margin: 0 6px; }
.tv-row__assignee {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3);
}
.tv-row__deadline {
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
  color: var(--text-2);
}
.tv-row--now .tv-row__deadline { color: var(--danger-700); font-weight: 600; }
.tv-row__menu {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); border-radius: 4px;
  flex-shrink: 0; opacity: 0; transition: opacity 100ms;
}
.tv-row:hover .tv-row__menu { opacity: 1; }
.tv-row__menu:hover { background: var(--bg-sunken); color: var(--text-1); }

/* Group label inside list views */
.tv-group {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 0 8px;
  font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.tv-group:first-child { margin-top: 0; }
.tv-group__line { flex: 1; height: 1px; background: var(--border-1); }
.tv-group--danger { color: var(--danger-700); }
.tv-group--warn { color: var(--warn-700); }
.tv-group--success { color: var(--success-700); }
.tv-group__count {
  font-family: var(--font-mono); font-size: 11px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--bg-sunken); color: var(--text-2);
  text-transform: none; letter-spacing: 0; font-weight: 500;
}

/* ===== KANBAN ===== */
.tv-board {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.tv-col {
  background: var(--bg-canvas);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 380px;
}
.tv-col__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px;
}
.tv-col__title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.tv-col__count {
  font-family: var(--font-mono); font-size: 11px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--bg-surface); color: var(--text-2);
}
.tv-col--danger .tv-col__title { color: var(--danger-700); }
.tv-col--warn .tv-col__title { color: var(--warn-700); }
.tv-col--success .tv-col__title { color: var(--success-700); }

.tv-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  display: block; text-decoration: none; color: inherit;
  font-size: 12px;
  transition: border-color 100ms, transform 100ms;
}
.tv-card:hover { border-color: var(--accent-300); transform: translateY(-1px); }
.tv-card__head {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.tv-card__step { font-size: 12px; font-weight: 600; line-height: 1.2; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-card__title {
  font-size: 11.5px; color: var(--text-2);
  line-height: 1.35; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tv-card__foot {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; color: var(--text-3);
}
.tv-card__deadline { font-family: var(--font-mono); margin-left: auto; }
.tv-card--now { border-left: 2px solid var(--danger-500); }
.tv-card--soon { border-left: 2px solid var(--warn-500); }

/* ===== TIMELINE (week) ===== */
.tv-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.tv-day {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  padding: 8px;
  min-height: 240px;
  display: flex; flex-direction: column; gap: 6px;
}
.tv-day__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px;
}
.tv-day__name {
  font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.tv-day__date {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
}
.tv-day--today { background: var(--accent-50); border-color: var(--accent-200); }
.tv-day--today .tv-day__date { color: var(--accent-700); }
.tv-day--past { background: var(--bg-canvas); }
.tv-day--past .tv-day__date { color: var(--text-3); }

.tv-mini {
  background: var(--bg-canvas);
  border-radius: 5px;
  padding: 5px 7px;
  font-size: 11px;
  display: block; text-decoration: none; color: inherit;
  cursor: pointer;
  border-left: 2px solid var(--text-3);
}
.tv-mini:hover { background: var(--bg-sunken); }
.tv-mini__step { font-weight: 600; font-size: 11px; line-height: 1.2; margin-bottom: 1px; }
.tv-mini__time { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-3); }
.tv-mini--now { border-left-color: var(--danger-500); background: var(--danger-50); }
.tv-mini--now .tv-mini__time { color: var(--danger-700); }
.tv-mini--soon { border-left-color: var(--warn-500); }
.tv-mini--done { opacity: .6; }
.tv-mini--done .tv-mini__step { text-decoration: line-through; }

/* ===== Grouped by tender ===== */
.tv-tender-group {
  border: 1px solid var(--border-1);
  border-radius: 8px;
  background: var(--bg-surface);
  margin-bottom: 8px;
  overflow: hidden;
}
.tv-tender-group__head {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 10px; align-items: center;
  padding: 10px 12px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
  cursor: pointer;
}
.tv-tender-group__title {
  font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tv-tender-group__sub {
  font-size: 11px; color: var(--text-3);
  margin-top: 2px; font-family: var(--font-mono);
}
.tv-tender-group__count {
  font-family: var(--font-mono); font-size: 11px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--bg-sunken); color: var(--text-2);
}
/* ============================================================
   ASANA-STYLE FILTER BUILDER — для tasks, auctions, contracts
   ============================================================ */

.fb {
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
}
.fb__head {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
  cursor: pointer;
  font-size: 11.5px;
  user-select: none;
}
.fb__head-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--accent-700);
  flex-shrink: 0;
}
.fb__head-icon [data-lucide] { width: 12px; height: 12px; }
.fb__head-chev {
  width: 14px; height: 14px;
  color: var(--text-3);
  transition: transform 150ms;
}
.fb__head-title {
  font-weight: 600; font-size: 12px;
  display: inline-flex; align-items: center; gap: 6px;
}
.fb__head-pill {
  padding: 1px 6px; border-radius: 999px;
  background: var(--accent-50); color: var(--accent-700);
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
}
.fb__head-summary {
  font-size: 11px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.fb--collapsed .fb__head-chev { transform: rotate(-90deg); }
.fb--collapsed .fb__body { display: none; }

.fb__body {
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.fb__row {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  background: var(--bg-canvas);
  font-size: 12px;
}
.fb__row:hover { background: var(--bg-sunken); }

.fb__field {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 5px;
  font-size: 11.5px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.fb__field:hover { border-color: var(--border-2); }
.fb__field [data-lucide] { width: 11px; height: 11px; color: var(--text-3); }
.fb__field--active { background: var(--accent-50); border-color: var(--accent-200); color: var(--accent-700); }
.fb__field--active [data-lucide] { color: var(--accent-600); }

.fb__op {
  font-size: 10.5px; color: var(--text-3);
  font-weight: 500;
  padding: 0 6px;
  white-space: nowrap;
  text-transform: lowercase;
}

.fb__value {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-1);
  border-radius: 5px;
  font-size: 11.5px;
  cursor: pointer;
  min-width: 0;
}
.fb__value:hover { border-color: var(--border-2); }
.fb__value-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 6px; background: var(--bg-sunken); border-radius: 4px;
  font-size: 10.5px;
}
.fb__value [data-lucide] { width: 11px; height: 11px; color: var(--text-3); }

.fb__remove {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); border-radius: 4px;
  opacity: 0; transition: opacity 100ms;
  cursor: pointer; background: none; border: 0;
  margin-left: auto;
}
.fb__row:hover .fb__remove { opacity: 1; }
.fb__remove:hover { background: var(--danger-50); color: var(--danger-700); }
.fb__remove [data-lucide] { width: 11px; height: 11px; }

.fb__add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: transparent;
  border: 1px dashed var(--border-2);
  border-radius: 6px;
  color: var(--text-3);
  font-size: 11.5px; font-weight: 500;
  cursor: pointer;
  align-self: flex-start;
}
.fb__add:hover { border-color: var(--accent-300); color: var(--accent-700); background: var(--accent-50); }
.fb__add [data-lucide] { width: 11px; height: 11px; }

.fb__foot {
  display: flex; align-items: center; gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-1);
  margin-top: 2px;
}
.fb__logic {
  display: inline-flex; background: var(--bg-canvas);
  border: 1px solid var(--border-1); border-radius: 5px; padding: 2px;
}
.fb__logic-btn {
  padding: 2px 8px; font-size: 10.5px; font-weight: 600;
  border-radius: 3px; border: 0; background: transparent;
  color: var(--text-3); cursor: pointer;
}
.fb__logic-btn--active {
  background: var(--accent-500); color: #fff;
}
.fb__count {
  font-size: 11.5px; color: var(--text-2);
}
.fb__count strong { color: var(--text-1); font-family: var(--font-mono); font-size: 13px; }

/* ============================================================
   ASANA-STYLE FILTER POPOVER
   ============================================================ */
.flt-trigger {
  position: relative;
  display: inline-flex;
}
.flt-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 440px;
  max-height: 540px;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  box-shadow: var(--shadow-3);
  display: none;
  flex-direction: column;
  z-index: 998;
  overflow: hidden;
}
.flt-popover.is-open { display: flex; }

.flt-popover__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-1);
}
.flt-popover__title {
  font-size: 14px; font-weight: 600;
}
.flt-popover__clear {
  font-size: 12px; color: var(--text-3);
  background: none; border: 0; cursor: pointer;
}
.flt-popover__clear:hover { color: var(--text-1); }

.flt-popover__body {
  padding: 12px 14px;
  overflow: auto;
  flex: 1;
}

.flt-section-label {
  font-size: 11px; color: var(--text-3);
  margin-bottom: 8px;
  font-weight: 500;
}

.flt-quick {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.flt-quick__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-1);
  white-space: nowrap;
}
.flt-quick__chip:hover { background: var(--bg-hover); }
.flt-quick__chip [data-lucide] { width: 13px; height: 13px; color: var(--text-3); }
.flt-quick__chip--active {
  background: var(--accent-50);
  border-color: var(--accent-200);
  color: var(--accent-700);
}
.flt-quick__chip--active [data-lucide] { color: var(--accent-600); }
.flt-quick__chip-disclosure {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border-left: 1px solid var(--border-2);
  margin-left: 2px; padding-left: 4px;
  color: var(--text-3);
}

.flt-add {
  position: relative;
}
.flt-add__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 0; cursor: pointer;
}
.flt-add__btn:hover { color: var(--text-1); }
.flt-add__btn [data-lucide]:first-child { width: 14px; height: 14px; color: var(--text-3); }
.flt-add__btn [data-lucide]:last-child { width: 12px; height: 12px; color: var(--text-3); }

.flt-field-list {
  margin-top: 4px;
  display: flex; flex-direction: column;
}
.flt-field-list__item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-1);
}
.flt-field-list__item:hover { background: var(--bg-hover); }
.flt-field-list__icon {
  width: 16px; height: 16px;
  color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.flt-field-list__icon [data-lucide] { width: 15px; height: 15px; }
.flt-field-list__label { flex: 1; }
.flt-field-list__custom-mark {
  color: var(--text-3); font-size: 11px;
}

.flt-popover__footer {
  padding: 8px 14px;
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px;
}
.flt-popover__footer-info { color: var(--text-3); }
.flt-popover__footer-info strong { color: var(--text-1); font-family: var(--font-mono); }

/* === Catalog match block (правая колонка в раскрытой позиции) === */
.catalog-match {
  border: 1px solid var(--border-1);
  border-radius: 8px;
  background: var(--bg-surface);
  overflow: hidden;
}
.catalog-match__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-canvas);
  border-bottom: 1px solid var(--border-1);
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}
.catalog-match__head [data-lucide] { width: 11px; height: 11px; vertical-align: -2px; margin-right: 4px; }
.catalog-match__body { padding: 10px 12px; }

/* Matched product */
.catalog-match--matched .catalog-match__head { background: var(--success-50); color: var(--success-700); border-bottom-color: rgba(46,157,87,.25); }
.catalog-match--matched { border-color: rgba(46,157,87,.3); }

.match-product {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 12px;
  align-items: baseline;
}
.match-product__name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.match-product__sku { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.match-product__price { font-family: var(--font-mono); font-size: 14px; font-weight: 700; }
.match-product__stock { font-size: 11px; color: var(--success-700); }
.match-product__stock--warn { color: var(--warn-700); }

.match-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-1);
}
.match-stat {
  padding: 8px 10px;
  background: var(--bg-canvas);
  border-radius: 6px;
  font-size: 11px;
}
.match-stat__label { color: var(--text-3); }
.match-stat__value { font-family: var(--font-mono); font-weight: 600; font-size: 13px; margin-top: 2px; color: var(--text-1); }
.match-stat__value--success { color: var(--success-700); }
.match-stat__value--warn { color: var(--warn-700); }

/* Suggested candidates */
.match-candidate {
  display: grid; grid-template-columns: 16px 1fr auto auto; gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border-1);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 100ms;
}
.match-candidate:hover { border-color: var(--accent-300); background: var(--accent-50); }
.match-candidate:last-child { margin-bottom: 0; }
.match-candidate__radio {
  width: 14px; height: 14px;
  border: 1.5px solid var(--border-3);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.match-candidate--selected { border-color: var(--accent-500); background: var(--accent-50); }
.match-candidate--selected .match-candidate__radio { border-color: var(--accent-500); }
.match-candidate--selected .match-candidate__radio::after {
  content: ''; width: 7px; height: 7px;
  background: var(--accent-500); border-radius: 50%;
}
.match-candidate__name { font-weight: 500; }
.match-candidate__meta { font-size: 10.5px; color: var(--text-3); }
.match-candidate__price { font-family: var(--font-mono); font-weight: 600; }
.match-candidate__similarity {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 6px; border-radius: 999px;
  background: var(--success-50); color: var(--success-700);
}
.match-candidate__similarity--mid { background: var(--warn-50); color: var(--warn-700); }

/* Empty: no match */
.catalog-match--empty .catalog-match__head { background: var(--bg-sunken); color: var(--text-3); }
.catalog-match__empty {
  text-align: center;
  padding: 20px 12px;
  font-size: 12px; color: var(--text-3);
}
.catalog-match__empty [data-lucide] { width: 22px; height: 22px; color: var(--text-3); margin-bottom: 6px; }
.product-detail__supply {
  background: var(--bg-surface); border: 1px solid var(--border-1);
  border-radius: 6px; padding: 10px;
  font-size: 12px; color: var(--text-2);
}
.product-detail__tz {
  background: var(--bg-sunken); border-radius: 6px;
  padding: 10px 12px; font-size: 12px; color: var(--text-2);
  line-height: 1.55;
}
