/* ════════════════════════════════════════════════════════════════
   ОЦЕНИКС · App entry stylesheet
   Приложение подключает ТОЛЬКО этот файл. Здесь — лишь @import
   токенов и компонентов + app-специфичная вёрстка страниц
   (топбар, hero, калькулятор, кабинеты, чаты, нотификации,
   трёхколоночник отчёта). Бренд и базовые компоненты меняются
   в tokens/* и components.css — без правок ниже.
   ════════════════════════════════════════════════════════════════ */

/* Токены — единый источник правды (палитра → семантика). */
@import "tokens/fonts.css";
@import "tokens/colors.css";
@import "tokens/typography.css";
@import "tokens/spacing.css";
@import "tokens/effects.css";

/* Переиспользуемые компоненты на токенах. */
@import "components.css";

/* ══ ТОП-БАР ══════════════════════════════════════════════════════ */
.topbar {
  background: var(--sf);
  border-bottom: 1px solid var(--brl);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  /* Раньше 1120px — header заметно ýже content-блоков на широких экранах.
     bugs-29-05 #6: «должны быть одинаковые границы по горизонтали». */
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  height: 60px;
  display: flex; align-items: center; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 36px; height: 36px; background: var(--y);
  border-radius: var(--r2); display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--n900);
}
.logo-name {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--n900);
}
.logo-sub { font-size: 12px; color: var(--n400); margin-left: -6px; }

.nav { margin-left: 24px; display: flex; gap: 2px; }
.nav a {
  padding: 8px 14px; border-radius: var(--r2);
  font-size: 13px; font-weight: 500; color: var(--n500);
  transition: all .15s;
}
.nav a:hover { background: var(--n50); color: var(--n900); }
.nav a.active { background: var(--n900); color: var(--n0); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 6px;
  background: var(--n50); border-radius: var(--rf);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.user-chip:hover { background: var(--n100); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--y); color: var(--n900);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.user-menu { position: relative; }
.user-menu-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--sf); border: 1px solid var(--brl);
  border-radius: var(--r3); box-shadow: var(--sh3);
  min-width: 200px; overflow: hidden;
  display: none; z-index: 200;
}
.user-menu-dropdown.open { display: block; }
.user-menu-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; font-size: 13px; color: var(--n700);
  border-bottom: 1px solid var(--brl);
  cursor: pointer; background: transparent; transition: background .1s;
}
.user-menu-item:last-child { border-bottom: none; }
.user-menu-item:hover { background: var(--n50); }
.user-menu-item.danger { color: var(--rd); }

/* ══ ХИРО (welcome) ══════════════════════════════════════════════ */
.hero {
  padding: 80px 0 72px;
  background: var(--sf);
  border-bottom: 1px solid var(--brl);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--y); color: var(--n900);
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 12px; border-radius: var(--rf); margin-bottom: 20px;
}
.hero-h {
  font-size: 52px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05;
  margin-bottom: 16px;
}
.hero-h span { color: var(--n300); }
.hero-p {
  font-size: 17px; color: var(--n500); max-width: 560px;
  line-height: 1.6; margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .hero { padding: 48px 0 40px; }
  .hero-h { font-size: 36px; }
  .hero-p { font-size: 15px; }
}
/* ══ ПРЕЙСБЛОК (калькулятор) ════════════════════════════════════ */
.price-panel {
  position: sticky; top: 80px;
  background: var(--n900); color: var(--n0);
  border-radius: var(--r4); padding: 24px;
}
/* BUG-07: sticky-обёртка для случаев, когда в боковой колонке несколько
   блоков (цена + действия) — двигаются вместе, нет перекрытий. */
/* width:100% — иначе как flex-ребёнок .col (flex-column) с align-self:start
   обёртка съёживается до ширины контента (≈220px) и чёрный блок стоимости
   не занимает всю боковую колонку 380px (баги №2/№4/№10/№11). */
.sticky-wrap { position: sticky; top: 80px; align-self: start; width: 100%; }
.sticky-wrap > .price-panel { position: static; top: auto; }
.price-label {
  font-size: 11px; font-weight: 600; color: var(--n300);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
}
.price-val {
  font-size: 36px; font-weight: 800; letter-spacing: -.03em;
  margin-bottom: 4px;
}
.price-sub { font-size: 12px; color: var(--n300); margin-bottom: 18px; }
.price-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 13px;
}
.price-row:last-of-type { border-bottom: none; margin-bottom: 16px; }
.price-row .val { color: var(--n0); font-weight: 600; }
.price-row .key { color: var(--n300); }
.price-total {
  background: var(--y); color: var(--n900);
  padding: 16px; border-radius: var(--r3);
  display: flex; align-items: center; justify-content: space-between;
}
.price-total-l { font-size: 12px; font-weight: 600; }
.price-total-v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

/* ══ Аккордеон (единый стиль: профиль + подача заявки) ════════ */
/* Стрелка-шеврон рисуется CSS-границей и поворачивается при раскрытии. */
.acc { border: 1px solid var(--brl); border-radius: var(--r3); background: var(--sf); margin-bottom: 10px; }
.acc > summary {
  cursor: pointer; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 700; list-style: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary > .acc-title { flex: 1; min-width: 0; }
.acc > summary::after {
  content: ""; flex-shrink: 0; width: 8px; height: 8px;
  border-right: 2px solid var(--n500); border-bottom: 2px solid var(--n500);
  transform: rotate(45deg); transition: transform .15s ease; margin-top: -3px;
}
.acc[open] > summary::after { transform: rotate(-135deg); margin-top: 2px; }
.acc > .acc-body { padding: 2px 16px 16px; }
/* Тот же шеврон для кастомного переключателя «Документы» (он не <details>,
   т.к. над ним всегда видна подсказка ФНС). Раскрыт по умолчанию → стрелка вверх. */
.docs-toggle .docs-chev {
  display: inline-block; width: 8px; height: 8px;
  border-right: 2px solid var(--n500); border-bottom: 2px solid var(--n500);
  transform: rotate(-135deg); transition: transform .15s ease; margin-top: 2px;
}
.docs-toggle.collapsed .docs-chev { transform: rotate(45deg); margin-top: -3px; }

/* ══ МИСК ═════════════════════════════════════════════════════ */
.hide { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

/* ══ НОВЫЕ БЕЙДЖИ ═════════════════════════════════════════════ */
.badge-violet {
  background: #F5E8FF; color: #6B21A8; border-color: #DDB8FF;
}
.badge-violet .pip { background: #8B5CF6; }
.badge-orange {
  background: #FFF4E3; color: #C2410C; border-color: #FFC78B;
}
.badge-orange .pip { background: #F97316; }

/* ══ ПЛИТКИ ДЕМО-РОЛЕЙ НА СТРАНИЦЕ ВХОДА ═════════════════════ */
.demo-tiles-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--br);
}
.demo-tiles-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--n400);
  margin-bottom: 4px;
}
.demo-tiles-sub {
  font-size: 12px; color: var(--n500); margin-bottom: 16px; line-height: 1.5;
}
.demo-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.demo-tile {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border: 1px solid var(--br);
  border-radius: var(--r3); background: var(--sf);
  cursor: pointer; transition: all .15s;
  text-align: left; font-family: inherit; font-size: inherit;
  width: 100%;
}
.demo-tile:hover {
  border-color: var(--y);
  background: var(--y-pale);
  transform: translateY(-1px);
}
.demo-tile-icon {
  width: 32px; height: 32px; border-radius: var(--r2);
  background: var(--n100);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.demo-tile-body { flex: 1; min-width: 0; }
.demo-tile-label { font-size: 13px; font-weight: 700; color: var(--n900); margin-bottom: 2px; }
.demo-tile-desc { font-size: 11px; color: var(--n500); line-height: 1.4; }

/* ══ КАБИНЕТЫ: QC / ADMIN / HR / SECURITY ═════════════════════ */
.role-page-head {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: var(--y-pale);
  border: 1px solid #FFE89D; border-radius: var(--r3);
  margin-bottom: 24px;
  font-size: 13px; color: var(--n700);
}
/* Bug1: иконки у плашек-баннеров и заголовков карточек убраны
   (декоративные эмодзи не нужны). */
.role-page-head .ic { display: none; }
.rb-card__head-icon { display: none; }

.kpi-grid-6 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* Таблица пользователей */
.tbl {
  width: 100%; border-collapse: collapse; background: var(--sf);
  border: 1px solid var(--br); border-radius: var(--r3); overflow: hidden;
  font-size: 13px;
}
.tbl th {
  background: var(--n50); padding: 10px 14px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--n500); text-align: left;
  border-bottom: 1px solid var(--br);
}
.tbl td {
  padding: 12px 14px; border-bottom: 1px solid var(--brl);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover { background: var(--n50); }
.tbl .r-right { text-align: right; }
.tbl .r-actions { width: 120px; text-align: right; }

.role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--rf);
  font-size: 11px; font-weight: 600;
  background: var(--n100); color: var(--n700);
}

.verified-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
}
.verified-chip.yes { color: var(--gn); }
.verified-chip.no { color: var(--wn); }

/* Аудит лог */
.audit-list {
  background: var(--sf); border: 1px solid var(--br);
  border-radius: var(--r3); overflow: hidden;
}
.audit-row {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  gap: 16px; padding: 12px 16px;
  border-bottom: 1px solid var(--brl);
  font-size: 13px;
  align-items: center;
}
.audit-row:last-child { border-bottom: none; }
.audit-row:hover { background: var(--n50); }
.audit-time { color: var(--n500); font-family: var(--font-mono); font-size: 12px; }
.audit-main { }
.audit-main strong { color: var(--n900); }
.audit-actor { text-align: right; color: var(--n600); font-size: 12px; }

/* Проверка независимости */
.check-list { }
.check-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--brl);
}
.check-row:last-child { border-bottom: none; }
.check-icon {
  width: 28px; height: 28px; border-radius: var(--rf);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.check-icon.ok { background: var(--gn-bg); color: var(--gn); }
.check-icon.warn { background: var(--wn-bg); color: var(--wn); }
.check-icon.bad { background: var(--rd-bg); color: var(--rd); }
.check-text { flex: 1; font-size: 13px; color: var(--n700); }
.check-sev {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; padding: 2px 6px; border-radius: var(--r2);
}
.check-sev.CRITICAL { background: var(--rd-bg); color: var(--rd); }
.check-sev.MAJOR { background: var(--wn-bg); color: var(--wn); }
.check-sev.WARN { background: var(--bl-bg); color: var(--bl); }

.overall-badge {
  padding: 14px; border-radius: var(--r3);
  text-align: center; font-size: 18px; font-weight: 700;
  margin-bottom: 16px;
}
.overall-badge.OK { background: var(--gn-bg); color: var(--gn); border: 1px solid var(--gn-br); }
.overall-badge.POSSIBLE_CONFLICT { background: var(--wn-bg); color: var(--wn); border: 1px solid var(--wn-br); }
.overall-badge.CONFLICT { background: var(--rd-bg); color: var(--rd); border: 1px solid var(--rd-br); }

/* КК — возврат с комментарием */
.qc-actions-bar {
  background: var(--sf); border: 1px solid var(--br);
  border-radius: var(--r3); padding: 16px;
  margin-bottom: 20px;
}
.qc-comment-textarea {
  width: 100%; min-height: 90px;
  font-family: inherit; font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--br); border-radius: var(--r2);
  resize: vertical;
}


/* ══ КОЛОКОЛЬЧИК НОТИФИКАЦИЙ ══════════════════════════════════ */
.bell-btn {
  position: relative;
  background: var(--n50);
  border: 1px solid var(--brl);
  width: 36px; height: 36px;
  border-radius: var(--rf);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.bell-btn:hover { background: var(--n100); }
.bell-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--rd);
  color: var(--n0);
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--rf);
  min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--n0);
}
.bell-panel {
  position: absolute;
  top: 56px; right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: 480px;
  background: var(--n0);
  border: 1px solid var(--br);
  border-radius: var(--r3);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.bell-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--brl);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--n50);
}
.bell-mark-all {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--n500);
}
.bell-mark-all:hover { color: var(--n900); }
.bell-list { overflow-y: auto; max-height: 420px; }
.bell-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--brl);
  cursor: pointer;
  transition: background .12s;
}
.bell-item:hover { background: var(--n50); }
.bell-item.read { opacity: .6; }
.bell-item-title { font-size: 13px; font-weight: 600; color: var(--n900); margin-bottom: 4px; }
.bell-item-body { font-size: 12px; color: var(--n600); margin-bottom: 4px; line-height: 1.4; }
.bell-item-time { font-size: 11px; color: var(--n400); }

/* ══ ЧАТЫ — список ════════════════════════════════════════════ */
.chats-list { display: flex; flex-direction: column; gap: 8px; }
.chat-list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 16px;
  background: var(--sf);
  border: 1px solid var(--br);
  border-radius: var(--r3);
  text-decoration: none; color: inherit;
  transition: border-color .12s, transform .12s;
}
.chat-list-item:hover { border-color: var(--y); }
.chat-list-main { flex: 1; min-width: 0; }
.chat-list-title { font-weight: 600; font-size: 14px; color: var(--n900); margin-bottom: 4px; }
.chat-list-last { font-size: 12px; color: var(--n500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.chat-list-time { font-size: 11px; color: var(--n400); }
.chat-unread-badge {
  background: var(--y); color: var(--n900);
  font-size: 11px; font-weight: 700;
  border-radius: var(--rf);
  padding: 2px 8px;
  min-width: 22px; text-align: center;
}

/* ══ ЧАТ — окно сообщений ════════════════════════════════════ */
.chat-window {
  background: var(--sf);
  border: 1px solid var(--br);
  border-radius: var(--r3);
  display: flex; flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 480px;
  overflow: hidden;
  margin-top: 16px;
}
.chat-msgs {
  flex: 1; overflow-y: auto;
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--n0);
}
.chat-msg {
  background: var(--n50);
  padding: 10px 14px;
  border-radius: var(--r3);
  max-width: 70%;
  align-self: flex-start;
}
.chat-msg-own {
  background: var(--y-pale);
  border: 1px solid #FFE89D;
  align-self: flex-end;
}
.chat-msg-sys {
  align-self: center;
  background: transparent;
  font-size: 11px;
  color: var(--n400);
  font-style: italic;
}
.chat-msg-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 4px;
  font-size: 11px;
}
.chat-msg-sender { font-weight: 600; color: var(--n900); }
.chat-msg-time { color: var(--n400); }
.chat-msg-body { font-size: 13px; color: var(--n900); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.chat-msg-att { margin-top: 8px; }
.chat-att-link {
  display: inline-block;
  padding: 8px 12px;
  background: var(--n0);
  border: 1px solid var(--brl);
  border-radius: var(--r2);
  text-decoration: none;
  color: var(--n900);
  font-size: 12px;
}
.chat-att-link small { color: var(--n400); margin-left: 6px; }
.chat-input {
  display: flex; gap: 8px; align-items: flex-end;
  padding: 12px 16px;
  background: var(--n50);
  border-top: 1px solid var(--brl);
}
.chat-input textarea {
  flex: 1;
  resize: none;
  font-family: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border: 1px solid var(--br);
  border-radius: var(--r2);
  min-height: 38px;
  max-height: 120px;
}

/* ══ ALERT INFO ══════════════════════════════════════════════ */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--r3);
  font-size: 13px; line-height: 1.5;
}
.alert-icon { font-size: 18px; flex-shrink: 0; }
.alert-info {
  background: var(--bl-bg);
  color: var(--bl);
  border: 1px solid var(--bl-br);
}
.alert-err {
  background: var(--rd-bg);
  color: var(--rd);
  border: 1px solid var(--rd-br);
}

/* ══ TopBar — позиция bell-panel относительно topbar ═════════ */
.topbar { position: relative; }

/* ══ ЧАТЫ — секции/группировка ════════════════════════════════ */
.chat-section { margin-bottom: 28px; }
.chat-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--n50);
  border-radius: var(--r2);
  border: 1px solid var(--brl);
}
.chat-section-title {
  font-size: 14px; font-weight: 700; color: var(--n900);
  display: flex; align-items: center; gap: 8px;
}
.chat-section-count {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--n200); color: var(--n700);
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--rf);
  min-width: 22px;
}
.chat-section-empty {
  font-size: 13px; color: var(--n400);
  padding: 16px; background: var(--n50);
  border-radius: var(--r2); text-align: center;
  font-style: italic;
}

/* ══ ИКОНКА ЧАТОВ В TOPBAR ════════════════════════════════════ */
.chat-icon-btn {
  position: relative;
  background: var(--n50);
  border: 1px solid var(--brl);
  width: 36px; height: 36px;
  border-radius: var(--rf);
  text-decoration: none;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.chat-icon-btn:hover { background: var(--n100); border-color: var(--n200); }
.chat-icon-btn.active { background: var(--y); border-color: var(--y-dark); }
.chat-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--rd);
  color: var(--n0);
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--rf);
  min-width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--n0);
}

/* ══ ADMIN DASHBOARD — KPI карточки и секции ══════════════════ */
.kpi-card {
  background: var(--sf);
  border: 1px solid var(--br);
  border-radius: var(--r3);
  padding: 18px 20px;
  transition: border-color .12s, transform .12s;
}
.kpi-card:hover { border-color: var(--n300); }
.kpi-card .kpi-label {
  font-size: 11px; font-weight: 600;
  color: var(--n500);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi-card .kpi-val {
  font-size: 28px; font-weight: 700;
  letter-spacing: -.02em; line-height: 1;
  color: var(--n900);
}

/* Секционные заголовки между группами KPI */
.section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--n600);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 14px;
  margin-top: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--brl);
}

/* Группа KPI в обёртке-карточке для визуальной целостности */
.kpi-section {
  background: var(--n0);
  border: 1px solid var(--brl);
  border-radius: var(--r3);
  padding: 20px;
  margin-bottom: 20px;
}
.kpi-section .section-title {
  margin-top: 0;
}

/* Узкие KPI на 2 числа в строке */
.kpi-grid-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-grid-summary .kpi-card {
  padding: 22px 24px;
  background: linear-gradient(135deg, var(--n900), #2A2A2A);
  border: none;
  color: var(--n0);
}
.kpi-grid-summary .kpi-label { color: rgba(255,255,255,.5); }
.kpi-grid-summary .kpi-val { color: var(--n0); font-size: 36px; }

/* ══ ADMIN: кликабельные строки таблицы пользователей ═════════ */
.tbl-clickable tbody tr { transition: background .12s; }
.tbl-clickable tbody tr:hover { background: var(--y-pale); }

/* ══ ADMIN USER DETAIL: миниатюра заявки ══════════════════════ */
.order-mini {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: var(--n50);
  border: 1px solid var(--brl);
  border-radius: var(--r2);
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, background .12s;
}
.order-mini:hover { background: var(--y-pale); border-color: var(--y); }
.order-mini > div:first-child { flex: 1; min-width: 0; }

/* ══ STATUS PILLS — компактные ════════════════════════════════ */
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--rf);
  font-size: 11px;
  font-weight: 600;
  background: var(--n100);
  color: var(--n700);
  white-space: nowrap;
}
.status-pill.status-draft { background: var(--n100); color: var(--n600); }
.status-pill.status-submitted { background: var(--bl-bg); color: var(--bl); }
.status-pill.status-in_progress { background: var(--y-pale); color: #8B6914; }
.status-pill.status-on_review { background: #EEE8FF; color: #6B47CC; }
.status-pill.status-revision { background: #FFE4D6; color: #B85A1F; }
.status-pill.status-report_ready { background: var(--gn-bg); color: var(--gn); }
.status-pill.status-completed { background: var(--gn-bg); color: var(--gn); }
.status-pill.status-cancelled { background: var(--rd-bg); color: var(--rd); }

/* ══ Профиль check-row для чекбоксов ══════════════════════════ */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.check-row input { margin: 0; }

/* ══ Кнопки blockwidth ═══════════════════════════════════════ */
.btn-block { display: block; width: 100%; text-align: center; }

/* ══ Бейджи цвета ════════════════════════════════════════════ */
.badge-orange { background: #FFE4D6; color: #B85A1F; }
.badge-red { background: var(--rd-bg); color: var(--rd); }


/* ═════════════════════════════════════════════════════════════════════
   Report Builder (.rb-*)
   Трёхколоночник редактора отчёта оценщика.
   Левая колонка — навигация по разделам (sticky).
   Центральная — view/edit раздела с шапкой и подвалом.
   Правая — действия, прогресс (sticky).
   Эстетика: refined-minimal, бренд-акцент — жёлтая полоса слева у активной
   карточки раздела (4px). Все компоненты переиспользуют существующие токены.
   ═════════════════════════════════════════════════════════════════════ */

/* ── Производные токены ─────────────────────────────────────────── */
:root {
  --rb-col-left:  280px;
  --rb-col-right: 300px;
  --rb-gap:        20px;
  --rb-sticky-top: 84px;
  --rb-radius:    var(--r3);
  --rb-radius-lg: var(--r4);
}

/* ── Шапка страницы отчёта (над трёхколоночником) ──────────────── */
.rb-pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.rb-pagehead__crumbs {
  font-size: 13px;
  color: var(--n400);
  margin-bottom: 6px;
}
.rb-pagehead__crumbs a { color: var(--n500); }
.rb-pagehead__crumbs a:hover { color: var(--n900); }
.rb-pagehead__crumbs .sep {
  margin: 0 6px;
  color: var(--n300);
}
.rb-pagehead__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--n900);
  line-height: 1.15;
}
.rb-pagehead__sub {
  font-size: 14px;
  color: var(--n500);
  margin-top: 4px;
}
.rb-pagehead__statuses {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── Грид трёхколоночника ──────────────────────────────────────── */
.rb-grid {
  display: grid;
  grid-template-columns: var(--rb-col-left) 1fr var(--rb-col-right);
  gap: var(--rb-gap);
  align-items: start;
}
/* Без min-width:0 центральная колонка раздувается под широкую таблицу
   (баланс 5 периодов × 7 колонок в разделе 8А) и выталкивает правую
   sticky-колонку за viewport — пропадают кнопки «DOCX / Отправить на КК».
   См. bugs.zip #17. */
.rb-col-center { min-width: 0; }

/* Блок документа в карточке заявки: текст слева сжимается, кнопки справа
   нет — «не скачут» при длинных именах файлов (bugs.zip #6,7). */
.doc-row { gap: 12px; align-items: center; }
.doc-row > :first-child { min-width: 0; flex: 1; }
.doc-row > :first-child > div { overflow: hidden; text-overflow: ellipsis; }
.doc-row .doc-actions {
  display: flex; gap: 6px; flex-wrap: nowrap; flex-shrink: 0;
  align-items: center;
  /* min-width фиксирует ширину правой колонки независимо от количества кнопок
     (1 «Загрузить» / 4 кнопки «Скачать+Текст+Заменить+Удалить»). Без него
     одни карточки выглядят сдвинутыми относительно других — bugs-28-05 #6, #7. */
  justify-content: flex-end;
  min-width: 320px;
}
.doc-row .doc-actions > * { flex-shrink: 0; white-space: nowrap; }
/* На узких экранах (мобилка) min-width убираем — иначе ломается. */
@media (max-width: 768px) {
  .doc-row .doc-actions { min-width: 0; flex-wrap: wrap; }
}

.rb-col-left, .rb-col-right {
  position: sticky;
  top: var(--rb-sticky-top);
  max-height: calc(100vh - var(--rb-sticky-top) - 20px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--n200) transparent;
}
.rb-col-left::-webkit-scrollbar,
.rb-col-right::-webkit-scrollbar { width: 6px; }
.rb-col-left::-webkit-scrollbar-thumb,
.rb-col-right::-webkit-scrollbar-thumb {
  background: var(--n200);
  border-radius: 3px;
}

/* ── Левая колонка: список разделов ────────────────────────────── */
.rb-col-left {
  padding-right: 4px;  /* отступ под скроллбар */
}

/* Сегментный переключатель «Физлицо / Юрлицо» — компактнее чем
   двухкарточный выбор (bugs-29-05 #3). Используется на форме регистрации. */
.seg-toggle {
  display: inline-flex;
  border: 1px solid var(--brl);
  border-radius: var(--r2);
  background: var(--sf);
  overflow: hidden;
  width: 100%;
}
.seg-toggle label {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.seg-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.seg-toggle span {
  display: block;
  text-align: center;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--n500);
  transition: background 0.12s, color 0.12s;
}
.seg-toggle input:checked + span {
  background: var(--y);
  color: var(--n900);
  font-weight: 600;
}

.rb-col-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--n400);
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--brl);
  margin-bottom: 10px;
}
.rb-sections-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Карточка раздела — кнопка-блок */
.rb-section {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  background: var(--sf);
  border: 1px solid var(--brl);
  border-radius: var(--rb-radius);
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}
.rb-section:hover {
  border-color: var(--n200);
  background: var(--n50);
}

/* Жёлтая полоса слева у активной карточки — главный фирменный акцент */
.rb-section--active {
  border-color: var(--y);
  background: var(--y-pale);
  box-shadow: inset 4px 0 0 var(--y), 0 1px 3px rgba(255, 200, 0, 0.18);
}
.rb-section--active:hover { background: var(--y-pale); }

/* По ТЗ (БАГИ.md п.19): все плашки разделов — прозрачные (нейтральный
   фон), только активная подсвечивается жёлтым. Статус остаётся виден
   через бейдж справа (Готово / N из M / Auto), но не через фон карточки. */
.rb-section--complete,
.rb-section--partial,
.rb-section--empty,
.rb-section--readonly {
  background: var(--n0);
  border-color: var(--brl);
}
.rb-section--readonly { color: var(--n500); }
.rb-section--readonly .rb-section__title { color: var(--n600); }

.rb-section__icon {
  flex: 0 0 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 6px;
  background: var(--n0);
  border: 1px solid var(--brl);
}
.rb-section--active .rb-section__icon   { background: var(--y); border-color: var(--y-dark); }

.rb-section__body { flex: 1; min-width: 0; }
.rb-section__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--n900);
  line-height: 1.3;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.rb-section__title-text { overflow: hidden; text-overflow: ellipsis; }
.rb-section__req { color: var(--rd); font-weight: 700; }
.rb-section__meta {
  font-size: 11px;
  color: var(--n400);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rb-section__badges {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.rb-section__badges .badge {
  font-size: 10px;
  padding: 2px 6px;
  font-weight: 600;
}
.rb-section__lock {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 12px;
  color: var(--n400);
}

/* save-flash — короткая вспышка после успешного сохранения */
.rb-section--saved-flash {
  animation: rbSaveFlash 0.55s ease-out;
}
@keyframes rbSaveFlash {
  0%   { background: var(--gn-bg); box-shadow: 0 0 0 4px var(--gn-bg); }
  100% { background: var(--sf);    box-shadow: none; }
}

/* ── Центральная колонка: редактор раздела ─────────────────────── */
.rb-editor {
  background: var(--sf);
  border: 1px solid var(--brl);
  border-radius: var(--rb-radius-lg);
  overflow: hidden;
  box-shadow: var(--sh1);
}
.rb-editor__head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--brl);
  background: linear-gradient(180deg, var(--n0) 0%, var(--n50) 100%);
}
.rb-editor__icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--y);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(255, 200, 0, 0.25);
}
.rb-editor__head-text { flex: 1; min-width: 0; }
.rb-editor__title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--n900);
  line-height: 1.25;
}
.rb-editor__meta {
  font-size: 12px;
  color: var(--n500);
  margin-top: 3px;
}
.rb-editor__head-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* Подсказка под шапкой (для business_detailed / read-only режима) */
.rb-editor__hint {
  margin: 16px 22px 0;
}

/* Тело редактора */
.rb-editor__body {
  padding: 20px 22px;
  min-height: 200px;
  animation: rbFadeIn 0.2s ease-out;
}
@keyframes rbFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Группа полей внутри раздела (kind=section_header) */
.rb-fields-group {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--n500);
  border-top: 1px solid var(--brl);
  padding-top: 16px;
  margin-top: 20px;
  margin-bottom: 8px;
}
.rb-fields-group:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}

/* View-режим — read-only значения */
.rb-view-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rb-view-row {
  display: grid;
  grid-template-columns: minmax(160px, 32%) 1fr;
  gap: 16px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--brl);
}
/* Табличные поля — одна колонка: label сверху, таблица снизу на всю ширину
   центральной колонки. Иначе широкая table-preview не помещается в 1fr и
   первые столбцы уходят за пределы видимой области. */
.rb-view-row--wide {
  grid-template-columns: 1fr;
  gap: 6px;
}
.rb-view-row:last-child { border-bottom: 0; padding-bottom: 0; }
.rb-view-row__label {
  font-size: 13px;
  color: var(--n500);
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rb-view-row__req { color: var(--rd); font-weight: 700; }
.rb-view-row__hint {
  font-size: 11px;
  color: var(--n400);
  margin-top: 2px;
  width: 100%;
}
.rb-view-row__value {
  font-size: 14px;
  color: var(--n900);
  font-weight: 500;
  line-height: 1.5;
  word-break: break-word;
  /* Без min-width:0 grid-item раздвигается natural-шириной содержимого
     (таблицы на 5 периодов), и overflow:auto на .preview-table не срабатывает —
     таблица заходит под правую колонку. */
  min-width: 0;
}
.rb-view-row__value--empty { color: var(--n400); font-weight: 400; font-style: italic; }
.rb-view-row__value pre {
  font-family: var(--fb);
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.6;
}
/* Длинные narrative-поля (LLM-выводы, ручной текст-area) рендерятся как
   set из <p> с правильным абзацем и красной строкой 1.25em, как в
   готовом DOCX-отчёте. Без этого LLM-вывод смотрелся «слипшимся» в pre. */
.rb-narrative p {
  margin: 0 0 10px 0;
  text-indent: 1.25em;
  text-align: justify;
  font-size: 14px;
  line-height: 1.55;
  color: var(--n900);
}
.rb-narrative p:last-child { margin-bottom: 0; }
.rb-narrative strong { font-weight: 700; }
.rb-narrative em { font-style: italic; }
.rb-narrative code {
  font-family: var(--fb);
  background: var(--sf);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 13px;
}
/* RPT-G1: справочная формула расчёта под таблицей (банкротство, СЧА, DCF,
   мультипликаторы, согласование). Математическая типографика на CSS, без
   библиотек: дроби стопкой (.rb-frac), индексы/степени (sub/sup), мат-шрифт. */
.rb-formula {
  margin: 10px 0 4px;
  padding: 10px 14px;
  border-left: 3px solid var(--n300);
  background: var(--n50);
  border-radius: 4px;
}
.rb-formula__head {
  font-size: 11px;
  font-weight: 600;
  color: var(--n600);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 8px;
}
.rb-formula__line {
  font-family: "Cambria Math", Cambria, "STIX Two Math", Georgia, "Times New Roman", serif;
  font-size: 16px;
  color: var(--n900);
  text-align: center;
  margin: 10px 0;
  line-height: 2.1;            /* запас под дроби/индексы, чтобы строки не наезжали */
}
.rb-formula__line sub,
.rb-formula__line sup { font-size: .72em; }
/* Дробь: числитель над знаменателем, разделитель — нижняя граница числителя. */
.rb-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  margin: 0 .3em;
}
.rb-frac__n { padding: 0 .55em 1px; border-bottom: 1.4px solid currentColor; }
.rb-frac__d { padding: 1px .55em 0; }
.rb-formula__legend {
  font-size: 12px;
  font-style: italic;
  color: var(--n500);
  margin-top: 6px;
  line-height: 1.45;
  text-align: left;
}
/* Большие табличные превью (баланс/ОФР/cash-flow на 5 периодов) — отдельный
   контейнер со скроллом по обеим осям, чтобы не растягивать карточку до
   небес. ТЗ п.33: «форма слишком огромная, оптимизировать». */
.rb-view-row__value > table,
.rb-view-row__value .preview-table,
.rb-view-row__value .table-preview {
  display: block;
  max-height: 360px;
  overflow: auto;
  font-size: 12.5px;
}
.rb-view-row__value > table th,
.rb-view-row__value > table td,
.rb-view-row__value .preview-table th,
.rb-view-row__value .preview-table td {
  padding: 4px 8px;
}
.rb-view-row__value > table thead th,
.rb-view-row__value .preview-table thead th {
  position: sticky; top: 0; background: var(--n50); z-index: 1;
}

/* Edit-режим — поля формы */
.rb-edit-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.rb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rb-field__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--n700);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rb-field__req { color: var(--rd); font-weight: 700; }
.rb-field__hint {
  font-size: 11px;
  color: var(--n400);
  line-height: 1.4;
}
.rb-field__badges { display: inline-flex; gap: 4px; }
.rb-field__badges .badge { font-size: 10px; padding: 2px 6px; }
.rb-field__locked {
  background: var(--n50);
  cursor: not-allowed;
  pointer-events: none;
}
.rb-field--with-unit {
  position: relative;
}
.rb-field--with-unit .rb-field__unit {
  position: absolute;
  right: 12px;
  bottom: 9px;
  font-size: 12px;
  color: var(--n400);
  pointer-events: none;
}
.rb-field--with-unit input { padding-right: 56px; }

/* Подвал редактора */
.rb-editor__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: var(--n50);
  border-top: 1px solid var(--brl);
  flex-wrap: wrap;
}
.rb-editor__counter {
  font-size: 12px;
  color: var(--n500);
  display: flex;
  align-items: center;
  gap: 8px;
}
.rb-editor__counter strong { color: var(--n700); font-weight: 600; }
.rb-editor__actions {
  display: flex;
  gap: 8px;
}

/* ── Правая колонка: действия + прогресс ───────────────────────── */
.rb-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-left: 4px;
}
.rb-card {
  background: var(--sf);
  border: 1px solid var(--brl);
  border-radius: var(--rb-radius);
  padding: 16px;
  box-shadow: var(--sh1);
}
.rb-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--n900);
  margin-bottom: 14px;
}
.rb-card__head-icon { font-size: 14px; }

/* Действия с отчётом */
.rb-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.rb-actions-grid .btn {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 10px;
}
.rb-actions-divider {
  height: 1px;
  background: var(--brl);
  margin: 6px 0 12px;
}
.rb-actions-cta { display: flex; flex-direction: column; gap: 8px; }
.rb-actions-cta .btn {
  font-size: 13px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rb-actions-warn {
  font-size: 12px;
  color: var(--wn);
  background: var(--wn-bg);
  border: 1px solid var(--wn-br);
  border-radius: var(--r2);
  padding: 8px 10px;
  line-height: 1.4;
  display: flex;
  gap: 6px;
}

/* Прогресс */
.rb-progress__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.rb-progress__label {
  font-size: 13px;
  color: var(--n500);
}
.rb-progress__count {
  font-size: 16px;
  font-weight: 700;
  color: var(--n900);
  font-variant-numeric: tabular-nums;
}
.rb-progress__bar {
  height: 6px;
  background: var(--n100);
  border-radius: 3px;
  overflow: hidden;
}
.rb-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--y) 0%, var(--y-dark) 100%);
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.rb-progress__percent {
  font-size: 12px;
  color: var(--n500);
  margin-top: 6px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rb-progress__stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--brl);
}
.rb-progress__stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--n600);
}
.rb-progress__stat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.rb-progress__stat-dot--complete { background: var(--gn); }
.rb-progress__stat-dot--partial  { background: var(--wn); }
.rb-progress__stat-dot--empty    { background: var(--n300); }
.rb-progress__saved {
  font-size: 11px;
  color: var(--n400);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--brl);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Псевдо-раздел «Итоговая стоимость» ────────────────────────── */
.rb-final-card {
  background: linear-gradient(135deg, var(--n900) 0%, var(--n800) 100%);
  color: var(--n0);
  border-radius: var(--rb-radius-lg);
  padding: 22px;
  margin-bottom: 16px;
}
.rb-final-card__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}
.rb-final-card__value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.rb-final-card__kind {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}
.rb-final-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}

/* ── Адаптив ───────────────────────────────────────────────────── */
@media (max-width: 1279px) {
  .rb-grid {
    grid-template-columns: 260px 1fr 280px;
    gap: 16px;
  }
}

@media (max-width: 1023px) {
  /* Tablet: левая колонка → горизонтальная лента сверху */
  .rb-grid { grid-template-columns: 1fr; }
  .rb-col-left {
    position: static;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 16px;
    padding-right: 0;
  }
  .rb-col-title {
    border-bottom: 0;
    padding-bottom: 6px;
  }
  .rb-sections-list {
    flex-direction: row;
    gap: 8px;
    padding-bottom: 4px;
  }
  .rb-section {
    min-width: 240px;
    flex: 0 0 auto;
  }
  /* Правая колонка (Действия / Прогресс / О заявке) — на мобильном НЕ прячем
     (раньше был display:none + несуществующий .rb-mobile-actions, из-за чего
     блоки пропадали). Разворачиваем в обычный блок под редактором: sticky,
     ограничение высоты и внутренний скролл сбрасываем. */
  .rb-col-right {
    position: static;
    max-height: none;
    overflow: visible;
    margin-top: 16px;
    padding-right: 0;
  }
}

@media (max-width: 767px) {
  .rb-pagehead { flex-direction: column; align-items: flex-start; }
  .rb-pagehead__title { font-size: 22px; }
  .rb-editor__head { padding: 14px 16px; flex-wrap: wrap; }
  .rb-editor__head-badges { width: 100%; }
  .rb-editor__body { padding: 16px; }
  .rb-editor__foot { padding: 12px 16px; }
  .rb-view-row { grid-template-columns: 1fr; gap: 4px; }
  .rb-view-row__label { font-size: 12px; }
  .rb-actions-grid { grid-template-columns: 1fr; }
}

/* ═════════════════════════════════════════════════════════════════════
   Личный кабинет оценщика (.lk-app-*)
   Общие компоненты для dashboard / orders / orderDetail.
   ═════════════════════════════════════════════════════════════════════ */

/* KPI-плитка — крупная цифра + подпись + дельта */
.lk-app-kpi {
  background: var(--sf);
  border: 1px solid var(--brl);
  border-radius: var(--rb-radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 110px;
  position: relative;
  overflow: hidden;
  transition: all 0.15s ease;
}
.lk-app-kpi:hover {
  border-color: var(--n200);
  box-shadow: var(--sh2);
  transform: translateY(-1px);
}
.lk-app-kpi__label {
  font-size: 12px;
  color: var(--n500);
  font-weight: 500;
  letter-spacing: 0;
}
.lk-app-kpi__value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--n900);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lk-app-kpi__meta {
  font-size: 12px;
  color: var(--n400);
  margin-top: auto;
}
/* Цветные акцент-полоски KPI-плиток убраны по фидбэку (#66343561): корректная
   геометрия (content/position) была только у --accent, поэтому отрисовывалась
   одна жёлтая полоса на «В работе», а у --gn/--wn/--bl задавался лишь
   background без content — они не показывались вовсе. */

/* Саб-табы (фильтры для ordersList и табы внутри orderDetail) */
.lk-app-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--brl);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.lk-app-tabs::-webkit-scrollbar { display: none; }
.lk-app-tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--n500);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.lk-app-tab:hover { color: var(--n900); }
.lk-app-tab--active {
  color: var(--n900);
  border-bottom-color: var(--y);
  font-weight: 600;
}
.lk-app-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--n600);
  background: var(--n100);
  border-radius: 9px;
}
.lk-app-tab--active .lk-app-tab__count {
  background: var(--n900);
  color: var(--n0);
}

/* Карточка-плитка заявки в ordersList и на dashboard */
.lk-app-order {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  background: var(--sf);
  border: 1px solid var(--brl);
  border-radius: var(--rb-radius);
  cursor: pointer;
  transition: all 0.15s ease;
}
.lk-app-order:hover {
  border-color: var(--n300);
  box-shadow: var(--sh1);
}
.lk-app-order__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.lk-app-order__num {
  font-size: 12px;
  font-weight: 600;
  color: var(--n500);
  font-variant-numeric: tabular-nums;
}
.lk-app-order__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--n900);
  line-height: 1.3;
  margin-bottom: 4px;
}
.lk-app-order__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--n500);
  flex-wrap: wrap;
}
.lk-app-order__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lk-app-order__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  flex-shrink: 0;
  min-width: 140px;
  text-align: right;
}
.lk-app-order__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--n900);
  font-variant-numeric: tabular-nums;
}
.lk-app-order__cta {
  font-size: 12px;
  padding: 6px 10px;
}

/* Пустое состояние */
.lk-app-empty {
  background: var(--sf);
  border: 2px dashed var(--brl);
  border-radius: var(--rb-radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--n500);
}
.lk-app-empty__icon { font-size: 40px; opacity: 0.5; margin-bottom: 12px; }
.lk-app-empty__title { font-size: 16px; font-weight: 700; color: var(--n700); margin-bottom: 6px; }
.lk-app-empty__desc { font-size: 13px; color: var(--n500); }

/* Поисковая строка */
.lk-app-search {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.lk-app-search__input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border: 1px solid var(--br);
  border-radius: var(--r2);
  font-size: 13px;
  font-family: var(--fb);
  background: var(--sf);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lk-app-search__input:focus {
  outline: 0;
  border-color: var(--n900);
  box-shadow: 0 0 0 3px var(--n100);
}
.lk-app-search__icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--n400);
  font-size: 14px;
  pointer-events: none;
}

/* Toolbar над списком (поиск + сортировка) */
.lk-app-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.lk-app-toolbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lk-app-sort {
  font-size: 13px;
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--br);
  border-radius: var(--r2);
  background: var(--sf) url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23808693' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center / 10px;
  appearance: none;
  cursor: pointer;
  font-family: var(--fb);
}

@media (max-width: 767px) {
  .lk-app-order {
    grid-template-columns: 1fr;
  }
  .lk-app-order__side {
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    border-top: 1px solid var(--brl);
    padding-top: 10px;
  }
  .lk-app-toolbar { flex-direction: column; align-items: stretch; }
  .lk-app-search { max-width: none; }
}

/* ══ ОБЩИЕ ПРАВИЛА ВЫРАВНИВАНИЯ ════════════════════════════════════
   Превентивные фиксы, чтобы тесты не натыкались на:
     • длинные ИНН/ОГРН/URL без пробелов, разрывающие карточку;
     • flex-дети без min-width:0, выпирающие за родителя;
     • кнопки, чей label рвётся на 2 строки;
     • картинки/iframe без max-width.
================================================================== */

/* 1. Длинные «бесшовные» строки (ИНН, ОГРН, URL, e-mail) — переносим. */
.card, .card-p, .card-p-lg,
.rb-view-row__value, .rb-view-row__label,
.lk-app-order__title, .lk-app-order__meta,
.alert, .alert-body,
.bell-list, .user-menu-dropdown,
td, th {
  overflow-wrap: anywhere;
  word-wrap: break-word;
}

/* 2. Flex-дети по умолчанию имеют min-width: auto и не сжимаются —
   из-за этого row-sb разваливается, когда внутри длинный заголовок.
   Применяем только к row-sb (там обычно текст слева + кнопка справа). */
.row-sb > * { min-width: 0; }

/* 3. Кнопки и ссылки-кнопки не должны разрываться на середине слова. */
.btn { white-space: nowrap; }
.btn-block { white-space: normal; }   /* широкая кнопка может перенестись */

/* 4. Картинки/iframe/video — никогда не шире контейнера. */
img, svg, video, iframe { max-width: 100%; height: auto; }

/* 5. Топбар на узких экранах — даём навигации перейти на 2-ю строку,
   а не убегать под user-меню. */
.topbar-inner { flex-wrap: wrap; row-gap: 4px; }

/* 6. Toast / уведомления — длинный текст переносится. */
.toast, .toast-host > * { max-width: min(440px, calc(100vw - 32px)); }
.toast { word-break: break-word; }

/* 7. Колоночные сетки внутри карточек: при узком viewport — в 1 столбец. */
@media (max-width: 540px) {
  .grid-2, .grid-3, .grid-4,
  .rb-actions-grid { grid-template-columns: 1fr !important; }
}

/* 8. Стрелка кастомного select — не перекрывается длинным option-text. */
.sel { padding-right: 36px; }

/* 9. Хлебные крошки / sub-text — допускаем перенос. */
.rb-pagehead__sub, .rb-pagehead__crumbs, .page-sub, .page-crumbs,
.muted, .fl-hint, .step-subtitle {
  overflow-wrap: anywhere;
}

/* 10. Бейджи рядом с длинным label — не «выталкивают» текст. */
.rb-section__badges, .rb-field__badges, .rb-view-row__label,
.rb-pagehead__statuses {
  flex-wrap: wrap;
}

/* 11. Pre-блоки в значениях полей — переносить пробелы, не выпирать
   за карточку при многострочном тексте на ультра-широких таблицах. */
.rb-view-row__value pre,
.rb-view-row__value code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* 12. Sticky-кнопки в row-sb (например, «Назад» в правом верхнем углу
   карточки степа) — на длинных title не сжимаются и не перепрыгивают. */
.row-sb > .btn,
.row-sb > a.btn { flex-shrink: 0; }

/* ═════════════════════════════════════════════════════════════════════
   МОБИЛЬНАЯ АДАПТАЦИЯ (08-06)
   Все правила ниже либо добавляют поведение только для узких экранов
   (@media max-width), либо нейтральны для desktop. Вёрстка на ПК (≥900px)
   не меняется.
   ═════════════════════════════════════════════════════════════════════ */

/* Широкие таблицы (тарифы, списки в админке, сессии, выплаты, ЭЦП) на мобильном
   скроллятся горизонтально, а не рвут страницу. display:block + overflow-x — таблица
   образует свой контекст прокрутки; white-space:nowrap не даёт колонкам схлопнуться.
   Правило целиком в @media — desktop-рендеринг таблиц не меняется. */
@media (max-width: 720px) {
  .tbl {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    max-width: 100%;
  }
}

/* Кнопка-бургер в шапке. На desktop скрыта, на мобильном раскрывает .nav. */
.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-left: 8px;
  background: var(--n50); border: 1px solid var(--brl);
  border-radius: var(--r2); cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--n900);
}
.nav-toggle:hover { background: var(--n100); }

@media (max-width: 760px) {
  /* Высота не фиксирована: если правые кнопки (Войти/Зарегистрироваться у гостя)
     переносятся на 2-ю строку — бар растёт, а не наезжает на контент. */
  .topbar-inner {
    position: relative; gap: 8px;
    height: auto; min-height: 60px;
    padding: 8px 16px;
    flex-wrap: wrap;
  }
  /* Правый блок (кнопки входа у гостя / иконки у залогиненного) выносим на
     отдельную строку во всю ширину, выровненную вправо. margin-left:auto на
     флекс-элементе ломает перенос, поэтому сбрасываем его и задаём width:100%. */
  .top-right {
    margin-left: 0; width: 100%;
    gap: 6px; flex-wrap: wrap; justify-content: flex-end;
  }
  .top-right .btn { padding: 7px 12px; font-size: 13px; }
  .nav-toggle { display: inline-flex; }
  /* Пункты меню → выпадающая панель под шапкой (паттерн как у .user-menu-dropdown) */
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    margin-left: 0;
    flex-direction: column; gap: 2px;
    background: var(--sf); border-bottom: 1px solid var(--brl);
    box-shadow: var(--sh2);
    padding: 8px; display: none; z-index: 150;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; font-size: 14px; }
  .logo-name { font-size: 16px; }
}

/* Фиксированные колонки аудит-лога схлопываем в одну на мобильном. */
@media (max-width: 720px) {
  .audit-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Плитки демо-входа — в один столбец на узких экранах. */
@media (max-width: 540px) {
  .demo-tiles { grid-template-columns: 1fr; }
}


/* ───────────────────────── Акции (промо-кампании) ───────────────────────── */
/* Баннер действующей акции в ЛК клиента (над списком заявок / на дашборде). */
.promo-banner {
  background: linear-gradient(135deg, #2A2417 0%, #1C1A12 100%);
  border: 1px solid #6B5A1E;
  border-radius: var(--r4);
  padding: 18px 22px;
  margin-bottom: 20px;
  color: var(--n0);
}
.promo-banner__head { font-size: 16px; font-weight: 800; color: var(--y); }
.promo-banner__desc { font-size: 13px; color: #C9C4B4; margin-top: 6px; }
.promo-banner__limit { font-size: 13px; font-weight: 600; color: #EADFA8; margin-top: 6px; }
.promo-banner__row { font-size: 13px; color: #C9C4B4; margin-top: 10px; }
.promo-banner__timer {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-weight: 800; font-size: 15px; color: var(--y);
}
.promo-banner__until { color: #8F8B7C; }

/* Зачёркнутая обычная цена + выделенная цена по акции (тёмная price-panel). */
.price-val-old {
  font-size: 18px; font-weight: 600; color: var(--n400);
  text-decoration: line-through;
}
.price-val--promo { color: var(--y); }
/* В жёлтой плашке «Итого» фон — var(--y): жёлтый текст на жёлтом был бы
   невидим. Здесь акционный итог и зачёркнутый оригинал делаем тёмными. */
.price-total .price-val--promo { color: var(--n900); }
.price-total .price-val-old { color: rgba(13, 14, 18, .55); }

/* Чип «Акция …» в панели цены и в деталях заявки. */
.promo-chip {
  display: inline-block;
  background: rgba(255, 221, 45, .12);
  border: 1px solid rgba(255, 221, 45, .4);
  color: var(--y);
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  padding: 3px 10px;
  margin: 4px 0 8px;
}
.promo-free-note { font-size: 12px; color: var(--y); margin-top: 8px; }

/* Статусы акции в админ-таблице. */
.promo-st {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.promo-st--active    { background: #E8F5E9; color: #2E7D32; }
.promo-st--scheduled { background: #E3F2FD; color: #1565C0; }
.promo-st--finished  { background: var(--n100); color: var(--n500); }
.promo-st--disabled  { background: #FFEBEE; color: #C62828; }
.promo-st--exhausted { background: #FFF3E0; color: #E65100; }

/* Пикер персональных пользователей (форма акции). */
.promo-user-results { position: relative; }
.promo-user-result {
  padding: 8px 12px; cursor: pointer;
  border: 1px solid var(--n200); border-top: none;
  background: var(--n0);
  display: flex; flex-direction: column; gap: 2px;
}
.promo-user-result:first-child { border-top: 1px solid var(--n200); border-radius: 8px 8px 0 0; }
.promo-user-result:last-child  { border-radius: 0 0 8px 8px; }
.promo-user-result:hover { background: var(--n100); }
.promo-user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--n100); border: 1px solid var(--n200);
  border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 600; margin: 0 6px 6px 0;
}
.promo-chip-x {
  background: none; border: none; cursor: pointer;
  color: var(--n400); font-size: 12px; padding: 0;
}
.promo-chip-x:hover { color: #C62828; }

/* ─── Новые непринятые заявки: бейдж в навигации + плашка на дашборде (#66343561) ─── */
/* Счётчик-бейдж внутри пункта «Заявки на оценку» (ЛК оценщика). */
.nav-count {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px;
  margin-left: 6px; border-radius: 9px; background: var(--rd); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  vertical-align: middle;
}
/* Пульс — мягкое жёлтое (UI-kit --y = #FFDD2D) свечение ВНУТРИ самой кнопки
   (inset box-shadow), а не кольцом вокруг; вёрстку не сдвигает. */
.nav a.nav-pulse { animation: navPulse 1.6s ease-in-out infinite; }
@keyframes navPulse {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 221, 45, 0); }
  50%      { box-shadow: inset 0 0 10px 2px rgba(255, 221, 45, 0.85); }
}
/* Плашка «Новые непринятые» — жёлтая KPI-плитка в одном ряду со статусами; кликабельна. */
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 980px) { .grid-5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-5 { grid-template-columns: 1fr; } }
.lk-app-kpi--new {
  background: var(--y);
  border-color: var(--y-dark);
  color: var(--n900);
  text-decoration: none;
  cursor: pointer;
}
.lk-app-kpi--new:hover { border-color: var(--y-dark); }
.lk-app-kpi--new .lk-app-kpi__label { color: var(--n900); }
.lk-app-kpi--new .lk-app-kpi__meta  { color: var(--n900); opacity: .72; }
