:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --accent: #238636;
  --accent-light: #2ea043;
  --brand: #e91e8c;
  --brand-hot: #ff2d9b;
  --danger: #da3633;
  --warning: #d29922;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --blue: #1f6feb;
  --blue-light: #388bfd;
  --ozon: #005bff;
  --wb: #cb11ab;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --press-duration: 100ms;
  --overlay-duration: 250ms;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
/* touch-action: manipulation только в кабинете — на логине ломает клавиатуру iOS */
html.authed, html.authed body {
  touch-action: manipulation;
}
html.authed input, html.authed textarea, html.authed select, html.authed [contenteditable="true"] {
  touch-action: auto;
}
html.authed button,
html.authed .nav-item,
html.authed .sidebar-logo,
html.authed .sidebar-user,
html.authed .sidebar-balances,
html.authed .hub-tile,
html.authed .mob-tab {
  -webkit-tap-highlight-color: transparent;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

/* Native <select>: закрытый вид как у полей ввода; открытый список — системный */
select:not([multiple]):not([size]) {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text);
  color-scheme: dark;
  cursor: pointer;
  background-color: var(--surface2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' viewBox='0 0 12 8'%3E%3Cpath stroke='%237d8590' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1.5 1.75 6 6.25l4.5-4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  padding: 8px 12px;
  padding-right: 32px !important;
}
select:not([multiple]):not([size]):focus {
  border-color: var(--blue-light);
}
select::-ms-expand { display: none; }
select:disabled {
  opacity: .55;
  cursor: not-allowed;
}
@media (max-width: 900px) {
  /* iOS не зумит поля, если в них 16px */
  .form-group input:not([type="checkbox"]):not([type="radio"]),
  select:not([multiple]):not([size]) {
    font-size: 16px;
  }
}

/* Десктоп: кастомный список. Мобилка — системный picker (этот блок не трогает). */
.ui-select-menu {
  position: fixed;
  z-index: 120;
  margin: 0;
  padding: 4px;
  min-width: 160px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
  color: var(--text);
  color-scheme: dark;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}
.ui-select-menu.is-up { transform: translateY(4px); }
.ui-select-menu.is-open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition:
    opacity 120ms var(--ease-out),
    transform 120ms var(--ease-out);
}
.ui-select-menu.is-instant {
  transition: none;
}
.ui-select-group {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ui-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.ui-select-option:hover,
.ui-select-option.is-active {
  background: rgba(255, 255, 255, .05);
}
.ui-select-option.is-on {
  background: rgba(35, 134, 54, .16);
  color: var(--accent-light);
  font-weight: 650;
}
.ui-select-option.is-on.is-active,
.ui-select-option.is-on:hover {
  background: rgba(35, 134, 54, .24);
}
.ui-select-option.is-disabled {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}
.ui-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-select-check {
  flex-shrink: 0;
  width: 12px;
  height: 10px;
  opacity: 0;
  background: currentColor;
  clip-path: polygon(1px 5px, 4.5px 9px, 11px 1px, 9.5px 0, 4.3px 6.4px, 2.2px 4px);
}
.ui-select-option.is-on .ui-select-check { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .ui-select-menu {
    transform: none;
  }
  .ui-select-menu.is-open {
    transition: opacity 120ms var(--ease-out);
  }
}

.hidden { display: none !important; }

/* Сессия: класс html.authed ставится в <head> до отрисовки — без мигания логина */
html.authed #login-screen { display: none !important; }
html:not(.authed) #app { display: none !important; }
html.authed #app { display: flex !important; }

/* Login — как в VPN (без 100dvh / лишних трюков) */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 20px 16px;
  background: radial-gradient(ellipse at center, #1a2332 0%, #0d1117 70%);
}
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 48px 40px; width: 100%; max-width: 360px; text-align: center;
}
.login-logo {
  width: 88px; height: 88px; margin: 0 auto 16px;
  border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 0 3px rgba(233,30,140,.35);
}
html:not(.portal-job) .login-logo {
  border-radius: 22px;
  box-shadow: none;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-card h1 {
  font-size: 22px; font-weight: 700; margin-bottom: 4px;
  letter-spacing: -0.02em; line-height: 1.15;
}
.login-card h1 .brand-tail { color: var(--brand-hot); }
html.portal-job .login-card h1 .brand-tail,
html.portal-job .sidebar-logo h2 .brand-tail {
  color: #6f6f6f;
}
.login-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
#login-error, .login-error, #setup-error {
  color: #f85149; font-size: 13px; margin-top: 12px; min-height: 1.2em;
}
#account-setup-screen {
  display: flex; align-items: center; justify-content: center;
  position: fixed; inset: 0; z-index: 2000;
  padding: 20px 16px;
  background: radial-gradient(ellipse at center, #1a2332 0%, #0d1117 70%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.account-setup-card { max-width: 400px; text-align: left; }
.account-setup-card .login-logo { margin-left: auto; margin-right: auto; }
.account-setup-card h1 { text-align: center; }
.account-setup-card > p { text-align: center; }
.account-setup-card .btn-primary { width: 100%; justify-content: center; margin-top: 8px; }
.form-group { text-align: left; margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text-muted);
}
.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select {
  width: 100%; padding: 8px 12px; background-color: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-size: 13px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.form-group input:not([type="checkbox"]):not([type="radio"]):focus,
.form-group select:focus { border-color: var(--blue-light); }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition:
    transform var(--press-duration) var(--ease-out),
    background-color var(--press-duration) ease,
    border-color var(--press-duration) ease,
    color var(--press-duration) ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-light); }
}
.btn-secondary {
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:active { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
#login-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 1.2em; }
#auth-diag {
  margin-top: 16px;
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
}
#auth-diag summary { cursor: pointer; user-select: none; }
#auth-diag p { margin: 8px 0; font-size: 12px; }
#auth-diag pre {
  margin: 0;
  padding: 8px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 180px;
  overflow: auto;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  max-width: 920px;
}
.settings-card .card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mp-tag {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 6px; text-transform: uppercase;
  display: inline-block;
}
.mp-tag.ozon { background: rgba(0,91,255,.15); color: #79b8ff; }
.mp-tag.wb { background: rgba(203,17,171,.15); color: #e87ad4; }
.mp-tag.ym { background: rgba(252,198,0,.18); color: #f0c14b; }
.settings-hint {
  font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.4;
}
/* Вкладки настроек — тот же стиль, что Цены / Номенклатура */
.settings-tabs.nom-mode-tabs {
  margin-bottom: 8px;
}
.settings-tab-lead {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  min-height: 1.2em;
}
#page-settings .page-header { margin-bottom: 16px; }
.settings-layout .guides-panel { min-height: calc(100vh - 120px); }
.settings-layout .guides-panel-body {
  display: flex;
  flex-direction: column;
  padding: 16px 20px 24px;
  overflow: auto;
}
.settings-layout .settings-pane { max-width: none; width: 100%; }
.settings-layout .form-group[hidden] { display: none !important; }
.settings-layout .settings-card {
  max-width: none;
  width: 100%;
  background: rgba(255,255,255,.03);
}
.settings-layout .settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: none;
}
.settings-layout .settings-grid .settings-card { margin: 0; }
.settings-layout .page-sync-rows {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.settings-layout .ue-g-sec {
  padding: 0 0 12px;
  border-bottom: 0;
}
.settings-layout .size-order-list { max-width: none; }
.settings-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}
.settings-promo-mps { display: block; }
.set-promo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.set-promo-grid .settings-card { margin: 0; }
.set-field[hidden] { display: none !important; }
.settings-rules-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: none;
}
.settings-rules-stack .settings-card { margin: 0; }
.settings-rules-save {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  margin: 0;
}
.set-details {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.set-details summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
  padding: 4px 0;
}
.set-details summary::-webkit-details-marker { display: none; }
@media (max-width: 900px) {
  .settings-split,
  .set-promo-grid,
  .settings-layout .settings-grid,
  .settings-layout .page-sync-rows { grid-template-columns: 1fr; }
}
.settings-pane.hidden { display: none; }
.settings-switch-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.form-group .settings-switch-row,
.settings-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
  font-weight: 650;
  color: var(--text);
  user-select: none;
}
.settings-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.settings-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.settings-switch i {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.14);
  border-radius: 999px;
  pointer-events: none;
  transition: background-color 160ms ease;
}
.settings-switch i::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 3px;
  left: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.28);
  transition: transform 160ms var(--ease-out);
}
.settings-switch input:checked + i {
  background: var(--accent);
}
.settings-switch input:checked + i::before {
  transform: translateX(18px);
}
.settings-switch input:focus-visible + i {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, .35);
}

/* Ответы AI — сегменты тона + большое поле указаний */
.ai-tone-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.ai-tone-seg button {
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border: 0;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 104px;
  text-align: center;
}
.ai-tone-seg button:hover { color: var(--text); background: rgba(255,255,255,.03); }
.ai-tone-seg button.active {
  color: var(--accent-light, #3fb950);
  background: rgba(35, 134, 54, .15);
}
.ai-custom-ta {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2, var(--bg));
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}
.ai-custom-ta:focus {
  outline: none;
  border-color: rgba(63, 185, 80, .55);
}
.size-order-list {
  display: grid; gap: 6px; max-width: 520px;
}
.size-order-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg);
}
.size-order-row.with-photo {
  grid-template-columns: 36px 36px 1fr auto;
}
.sort-order-photo {
  width: 32px; height: 40px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface);
}
.sort-order-photo.ph {
  display: block; width: 32px; height: 40px; border-radius: 4px;
  background: var(--surface); border: 1px solid var(--border);
}
.size-order-pos {
  font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: center;
}
.size-order-label { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.size-order-actions { display: flex; gap: 4px; }
.size-order-actions .btn-sm { min-width: 32px; padding: 4px 8px; }
.sort-subtabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.sort-subtabs button {
  font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px;
  border-radius: 8px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}
.sort-subtabs button:hover { color: var(--text); }
.sort-subtabs button.active {
  color: var(--text); border-color: var(--accent, #c4f542);
  background: rgba(196, 245, 66, .1);
}
.settings-actions {
  margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.settings-source {
  font-size: 11px; color: var(--text-muted); margin-top: 4px;
}
.input-with-toggle {
  display: flex; gap: 8px; align-items: stretch;
}
.input-with-toggle input { flex: 1; min-width: 0; }
.input-with-toggle .btn { flex-shrink: 0; }

.page-sync-rows { display: grid; gap: 12px; }
.page-sync-row {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}
.page-sync-row-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
}
.page-sync-title {
  font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.page-sync-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-muted);
}
.page-sync-badge.live {
  color: #c47a2c;
  border-color: rgba(196, 122, 44, .35);
  background: rgba(196, 122, 44, .1);
}
.page-sync-badge.db {
  color: #5a8f6a;
  border-color: rgba(90, 143, 106, .35);
  background: rgba(90, 143, 106, .1);
}
.page-sync-interval {
  font: inherit;
  font-size: 13px;
  min-width: 150px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background-color: var(--surface2);
  color: var(--text);
}
.page-sync-tip {
  margin-top: 8px; font-size: 12px; color: var(--text-muted); line-height: 1.45;
}
.page-sync-limit + .page-sync-limit { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.page-sync-limit-title { font-size: 13px; font-weight: 650; margin-bottom: 4px; }
.page-sync-limit-text { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

/* App shell — десктоп: меню на месте, скролл только у .main */
html.authed, html.authed body {
  height: 100%;
  overflow: hidden;
}
#app { display: flex; min-height: 100vh; }
html.authed #app {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.sidebar {
  width: 253px; background: var(--surface); border-right: 1px solid var(--border);
  padding: 20px 12px; display: flex; flex-direction: column; flex-shrink: 0;
  height: 100%;
  max-height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 20;
}
.sidebar-logo {
  padding: 8px 12px 20px; border-bottom: 1px solid var(--border); margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; border-radius: 8px;
  user-select: none;
  flex-shrink: 0;
  transition: transform var(--press-duration) var(--ease-out);
}
.sidebar-logo:active { transform: scale(0.98); }
.sidebar-logo img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(233,30,140,.3);
}
html:not(.portal-job) .sidebar-logo img {
  border-radius: 11px;
  box-shadow: none;
}
.sidebar-logo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-logo h2 { font-size: 15px; font-weight: 700; letter-spacing: .03em; line-height: 1.15; margin: 0; }
.sidebar-logo h2 .brand-tail { color: var(--brand-hot); }
html.portal-job .sidebar-logo h2 .brand-tail { color: #6f6f6f; }
.sidebar-logo-sub {
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  letter-spacing: .02em; line-height: 1.2;
}
.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}
.nav-group {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 10px;
}
.nav-group:last-child { margin-bottom: 0; }
.nav-group-title {
  font-size: 10px;
  font-weight: 650;
  color: var(--text-muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 10px 4px;
  line-height: 1.2;
  user-select: none;
}
.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text-muted); font-size: 14px;
  text-decoration: none;
  transition:
    transform var(--press-duration) var(--ease-out),
    background-color var(--press-duration) ease,
    color var(--press-duration) ease;
}
@media (hover: hover) and (pointer: fine) {
  .nav-item:hover { background: var(--surface2); color: var(--text); }
}
.nav-item:active { transform: scale(0.97); }
.nav-item.active { background: rgba(35,134,54,.15); color: var(--accent-light); }
.nav-item .icon { width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  user-select: none;
  transition: transform var(--press-duration) var(--ease-out), background-color var(--press-duration) ease;
}
.sidebar-foot {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.sidebar-balances {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform var(--press-duration) var(--ease-out), background-color var(--press-duration) ease;
}
@media (hover: hover) and (pointer: fine) {
  .sidebar-balances:hover { background: var(--surface2); }
}
.sidebar-balances:active { transform: scale(0.97); }
.sidebar-balances.active { background: rgba(35,134,54,.12); }
.sidebar-bal-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
html.portal-job .sidebar-bal-total {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sidebar-bal-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar-bal-total-val {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.sidebar-bal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  line-height: 1.3;
}
.sidebar-bal-mp {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar-bal-mp.wb { color: #f0a0e0; }
.sidebar-bal-mp.oz { color: #79b8ff; }
.sidebar-bal-mp.ym { color: #f0c14b; }
.sidebar-bal-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sidebar-bal-val.bad { color: #ff7b72; font-weight: 500; }

.fin-mp-tabs { margin: 0 0 14px; }
.fin-mp-block { margin-bottom: 8px; }
.fin-mp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 10px;
}
.fin-mp-head h3 { margin: 0; font-size: 16px; }
.fin-summary-grid { margin-bottom: 18px; }
.fin-tabs { margin-bottom: 16px; }
.fin-panel[hidden] { display: none !important; }
.fin-kpi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.fin-kpi {
  flex: 1 1 160px;
  min-width: 150px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 17px;
}
.fin-kpi-label {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.fin-kpi-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 8px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.fin-kpi-val.pos { color: #3fb950; }
.fin-kpi-val.neg { color: #ff7b72; }
.fin-kpi-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.35;
}
.fin-tip {
  display: inline-flex;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  cursor: help;
  flex-shrink: 0;
}
.fin-break-card { margin: 4px 0 16px; }
.fin-break { max-width: 560px; }
.fin-week-badge {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(210, 153, 34, .5);
  color: #d29922;
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}
.fin-weeks-table th:not(:first-child),
.fin-weeks-table td:not(:first-child) { text-align: right; }
.fin-weeks-table .fin-share {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}
.finance-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 800px) {
  .finance-kpis { grid-template-columns: 1fr; }
}
.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) {
  .finance-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .finance-grid { grid-template-columns: 1fr; }
}
.finance-balance {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.finance-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.finance-note { font-size: 12px; margin-top: 6px; line-height: 1.4; }
.finance-err { color: #ff7b72; font-size: 13px; line-height: 1.4; }
.finance-hist-tabs {
  display: flex;
  gap: 4px;
}
.finance-hist-tabs button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.finance-hist-tabs button.active {
  color: var(--accent-light);
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.1);
}
.finance-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.finance-hist-table th,
.finance-hist-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.finance-hist-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  background: var(--surface2);
}
.finance-hist-table .finance-amt {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.finance-mp {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}
.finance-mp.wb { background: rgba(240,160,224,.12); color: #f0a0e0; }
.finance-mp.oz,
.finance-mp.ozon { background: rgba(121,184,255,.12); color: #79b8ff; }
.finance-mp.ym { background: rgba(252,198,0,.18); color: #f0c14b; }
.finance-hist-note {
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.finance-row-upcoming td { background: rgba(63, 185, 80, 0.04); }
.finance-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.finance-status.paid {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.12);
}
.finance-status.processing {
  color: var(--text);
  background: rgba(210, 210, 210, 0.12);
}
.finance-pnl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) {
  .finance-pnl-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .finance-pnl-grid { grid-template-columns: 1fr; }
}
.finance-pnl-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--surface2);
}
.finance-pnl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.finance-pnl-sec {
  margin: 10px 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.finance-pnl-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(125,133,144,.12);
}
.finance-pnl-row:last-child { border-bottom: none; }
.finance-pnl-row strong.pos { color: #3fb950; }
.finance-pnl-row strong.neg { color: #ff7b72; }
.finance-pnl-total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  border-bottom: none;
  font-weight: 600;
}
.finance-docs { display: flex; flex-direction: column; gap: 8px; }
.finance-doc {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  overflow: hidden;
}
.finance-doc > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}
.finance-doc > summary::-webkit-details-marker { display: none; }
.finance-doc-title { font-weight: 600; font-size: 13px; }
.finance-doc-meta { margin-left: auto; font-weight: 600; font-size: 13px; }
.finance-doc-body { padding: 0 12px 12px; }
.finance-doc-lines { margin-top: 4px; }
.finance-status.scheduled {
  color: #d29922;
  background: rgba(210, 153, 34, 0.14);
}

@media (hover: hover) and (pointer: fine) {
  .sidebar-user:hover { background: var(--surface2); }
}
.sidebar-user:active { transform: scale(0.97); }
.sidebar-user.active {
  background: rgba(35,134,54,.15);
}
.sidebar-user-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.main {
  flex: 1; min-width: 0; min-height: 0;
  padding: 28px 32px 48px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.page-header { margin-bottom: 24px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; max-width: 52ch; }
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* Справка — иконка рядом с ↻ → /guides#раздел */
.page-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform var(--press-duration) var(--ease-out), color var(--press-duration) ease, background-color var(--press-duration) ease;
}
@media (hover: hover) and (pointer: fine) {
  .page-help-btn:hover { color: var(--accent-light); background: rgba(255,255,255,.04); }
}
.page-help-btn:active { transform: scale(0.97); }
/* Primary-действия в строке фильтров — справа, отделены */
.ue-toolbar-spacer { flex: 1 1 12px; min-width: 8px; }
.ue-toolbar-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}
.ue-toolbar .btn-toolbar-primary,
.btn-toolbar-primary {
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.14);
  color: var(--accent-light, #3fb950);
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform var(--press-duration) var(--ease-out),
    background-color var(--press-duration) ease,
    border-color var(--press-duration) ease;
}
@media (hover: hover) and (pointer: fine) {
  .ue-toolbar .btn-toolbar-primary:hover,
  .btn-toolbar-primary:hover {
    background: rgba(63, 185, 80, 0.22);
    border-color: rgba(63, 185, 80, 0.65);
  }
}
.ue-toolbar .btn-toolbar-primary:active,
.btn-toolbar-primary:active {
  transform: scale(0.97);
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px;
  container-type: inline-size;
  container-name: stat-card;
  min-width: 0;
  overflow: hidden;
}
.stat-label {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 8px;
  font-weight: 600;
}
.stat-value {
  font-size: 33px; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.02em;
  word-break: break-word;
  min-width: 0;
  color: #fff;
}
.stat-value.green { color: var(--accent-light); }
.stat-sales {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.stat-sales-side {
  flex: 0 0 auto;
  text-align: right;
  padding-top: 4px;
}
.stat-pcs {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-check {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat-loss { margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.stat-loss b { color: var(--red, #ff453a); font-weight: 600; }
.stat-econ {
  display: grid;
  grid-template-columns: 1.3fr 1.05fr 0.85fr 0.85fr;
  gap: 2px;
  margin-top: 12px;
  background: var(--border);
  border-radius: 10px;
  padding: 1px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.stat-econ-cell {
  background: var(--surface2);
  padding: 9px 10px;
  min-width: 0;
}
.stat-econ-v {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-econ-v.ok { color: var(--accent-light); }
.stat-econ-v.bad { color: #ff7b72; }
.stat-econ-k {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.stat-econ.muted {
  display: block;
  background: none;
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.stat-trend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}
.stat-trend .row {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 650;
  background: var(--surface2);
}
.stat-trend .arrow {
  font-size: 10px; font-weight: 700; width: 10px; flex-shrink: 0;
}
.stat-trend .up { color: var(--accent-light); background: rgba(46, 160, 67, 0.15); }
.stat-trend .down { color: #ff7b72; background: rgba(255, 123, 114, 0.15); }
.stat-trend .flat { color: var(--text-muted); }
.stat-mp-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.stat-mp-row { display: flex; align-items: center; gap: 11px; }
.stat-mp-chip {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 750; letter-spacing: -0.02em;
}
.stat-mp-chip.oz { background: rgba(126, 176, 255, 0.16); color: #7eb0ff; }
.stat-mp-chip.wb { background: rgba(240, 160, 224, 0.16); color: #f0a0e0; }
.stat-mp-chip.ym { background: rgba(240, 193, 75, 0.16); color: #f0c14b; }
.stat-mp-body { flex: 1; min-width: 0; }
.stat-mp-line1 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px;
}
.stat-mp-name { font-weight: 650; color: var(--text); }
.stat-mp-nums {
  color: var(--text-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-mp-nums b { color: var(--text); font-weight: 600; }
.stat-mp-bar-row { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.stat-mp-bar-track { flex: 1; height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; }
.stat-mp-bar-fill { height: 100%; border-radius: 3px; }
.stat-mp-bar-fill.oz { background: #7eb0ff; }
.stat-mp-bar-fill.wb { background: #f0a0e0; }
.stat-mp-bar-fill.ym { background: #f0c14b; }
.stat-mp-net { font-size: 12px; font-weight: 650; flex-shrink: 0; white-space: nowrap; color: var(--text); }
.stat-mp-net.ok { color: var(--accent-light); }
.stat-mp-net.bad { color: #ff7b72; }
.stat-mp-margin { color: var(--text-muted); font-weight: 500; margin-left: 3px; }
.stat-mp-sub {
  margin-top: 4px; font-size: 11px; color: var(--text-muted); opacity: 0.85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stat-mp-sub b { color: var(--text-muted); font-weight: 600; }
@container stat-card (max-width: 340px) {
  .stat-econ-k { display: none; }
  .stat-mp-nums { display: block; margin-top: 1px; }
}
.stat-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.stat-label-row .stat-label { margin-bottom: 0; }
.stat-chevron {
  display: none;
  color: var(--text-muted); font-size: 12px; line-height: 1;
  transition: transform .15s ease;
}
.stat-details { /* desktop: always visible у других сеток */ }

#page-dashboard {
  --dash-gutter: 32px;
}
#dash-stats.stats-grid {
  margin-bottom: 16px;
}
#dash-stats.stats-grid.is-carousel {
  display: block;
}
.dash-stats-stack {
  min-width: 0;
  margin-inline: calc(-1 * var(--dash-gutter));
}
.dash-stats-viewport {
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
}
.dash-stats-viewport:active { cursor: grabbing; }
.dash-stats-track {
  display: flex;
  align-items: stretch;
  will-change: transform;
}
.dash-stats-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  padding: 0 var(--dash-gutter);
  box-sizing: border-box;
}
.dash-stats-track .stat-card {
  width: 100%;
  min-width: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  transition: none;
}
#dash-stats.is-carousel .dash-stats-track .stat-card:hover,
#dash-stats.is-carousel .dash-stats-track .stat-card:active,
#dash-stats.is-carousel .dash-stats-track .stat-card:focus {
  background: var(--surface);
  transform: none;
  filter: none;
}
#dash-stats.is-carousel .stat-chevron {
  display: inline-block;
  transition: transform 180ms var(--ease-out);
}
#dash-stats.is-carousel .stat-details {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
#dash-stats.is-carousel .stat-card.open .stat-details { display: block; }
#dash-stats.is-carousel .stat-card.open .stat-chevron { transform: rotate(180deg); }
#dash-stats:not(.is-carousel) .stat-chevron { display: none; }
#dash-stats:not(.is-carousel) .stat-card { cursor: default; }
#dash-stats:not(.is-carousel) .stat-details {
  display: block;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.dash-stats-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 10px 0 0;
}
.dash-stats-dot {
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dash-stats-dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  transform: translate(-50%, -50%);
  transition:
    width 180ms var(--ease-out),
    background-color 180ms ease;
}
.dash-stats-dot.is-on::after {
  width: 18px;
  background: rgba(255, 255, 255, 0.58);
}
@media (hover: hover) and (pointer: fine) {
  .dash-stats-dot:hover::after { background: rgba(255, 255, 255, 0.4); }
}
@media (prefers-reduced-motion: reduce) {
  .dash-stats-track { transition: none !important; }
  .dash-stats-dot::after,
  .dash-stats-dot.is-on::after { transition: none; }
  .hub-tile { transition: none; }
  .hub-tile:active { transform: none; }
}

.ue-summary {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 14px;
}
@media (max-width: 1100px) {
  .ue-summary { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .ue-summary { grid-template-columns: repeat(2, 1fr); }
}
.ue-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.ue-kpi .lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.ue-kpi .val { font-size: 22px; font-weight: 700; margin-top: 6px; }
.ue-kpi .val.wb { color: #f0a0e0; }
.ue-kpi .val.oz { color: #79b8ff; }
.ue-kpi .val.ym { color: #f0c14b; }
.ue-kpi .val.good { color: var(--accent-light); }
.ue-kpi .val.bad { color: #ff7b72; }

.ue-drr-banner {
  margin-bottom: 12px; padding: 10px 14px; border-radius: 10px;
  background: rgba(210, 153, 34, 0.12); border: 1px solid rgba(210, 153, 34, 0.35);
  color: #e3b341; font-size: 13px; line-height: 1.4;
}

.ue-sim { max-width: none; }
.ue-sim-toolbar select { min-width: 200px; max-width: 320px; }
.ue-sim-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
@media (max-width: 980px) {
  .ue-sim-grid { grid-template-columns: 1fr; }
}
.ue-sim-card .card-body { padding: 14px 16px; }
.ue-sim-card-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}
.ue-sim-card-sub {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.4;
}
.ue-sim-levers { display: grid; gap: 12px; }
.ue-sim-field { display: grid; gap: 4px; }
.ue-sim-field-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.ue-sim-field-hint {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}
.ue-sim-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.ue-sim-field-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}
.ue-sim-suffix {
  flex: 0 0 auto;
  min-width: 28px;
  font-size: 12px;
  color: var(--text-muted);
}
.ue-sim-opt { margin-top: 12px; font-size: 12px; line-height: 1.45; }
.ue-sim-cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.ue-sim-cmp th,
.ue-sim-cmp td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.ue-sim-cmp th { color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
.ue-sim-cmp .wh-num { text-align: right; font-variant-numeric: tabular-nums; }
.ue-sim-row-kpi td { background: rgba(63, 185, 80, 0.06); }
.ue-sim-curve-wrap { min-height: 160px; margin-top: 4px; }
.ue-sim-notes { margin: 10px 0 0; font-size: 12px; line-height: 1.45; }
.ue-sim-scroll { overflow: auto; max-height: 480px; }
.ue-sim-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ue-sim-table th,
.ue-sim-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ue-sim-table thead th {
  position: sticky; top: 0; background: var(--bg-elevated, #161b22); z-index: 1;
  font-size: 11px; text-transform: uppercase; color: var(--text-muted);
  border-bottom: none;
  box-shadow: 0 12px 14px -12px rgba(0, 0, 0, .55);
}
.ue-sim-table .good { color: #3fb950; }
.ue-sim-table .bad { color: #f85149; }

.ue-hypo { max-width: none; }
.ue-hypo-lead { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; line-height: 1.45; max-width: 920px; }
.ue-hypo-summary {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px;
}
@media (max-width: 1000px) {
  .ue-hypo-summary { grid-template-columns: repeat(2, 1fr); }
}
.ue-hypo-table-root { overflow: hidden; }
.ue-hypo-scroll {
  overflow: auto;
  max-height: calc(100vh - 320px);
  border-top: 1px solid var(--border);
}
.ue-hypo-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  min-width: 920px;
}
.ue-hypo-table th,
.ue-hypo-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}
.ue-hypo-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface2);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
}
.ue-hypo-table thead tr.ue-hypo-group th {
  top: 0;
  text-align: center;
  border-bottom: none;
  padding-bottom: 2px;
  font-size: 11px;
}
.ue-hypo-table thead tr:not(.ue-hypo-group) th {
  top: 28px;
  border-bottom: none;
  box-shadow: 0 12px 14px -12px rgba(0, 0, 0, .55);
}
.ue-hypo-th-now { color: var(--text) !important; }
.ue-hypo-th-plan {
  color: #3fb950 !important;
  background: rgba(63, 185, 80, 0.08) !important;
}
.ue-hypo-td-photo,
.ue-hypo-table th.ue-hypo-td-photo {
  text-align: center;
  width: 48px;
  padding-left: 12px;
  padding-right: 6px;
}
.ue-hypo-td-art,
.ue-hypo-table th.ue-hypo-td-art {
  text-align: left;
  min-width: 140px;
  max-width: 200px;
}
.ue-hypo-td-art strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  color: var(--text);
}
.ue-hypo-td-sz,
.ue-hypo-table th.ue-hypo-td-sz {
  text-align: center;
  width: 64px;
}
.ue-hypo-plan {
  background: rgba(63, 185, 80, 0.04);
}
.ue-hypo-plan.muted { color: var(--text-muted); font-size: 12px; }
.ue-hypo-plan-edit { min-width: 88px; }
.ue-hypo-pred {
  font-variant-numeric: tabular-nums;
  border-bottom: 1px dashed rgba(63, 185, 80, 0.45);
  cursor: help;
}
.ue-hypo-inp {
  width: 76px;
  background: var(--bg);
  border: 1px solid rgba(63, 185, 80, 0.5);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 13px;
  text-align: right;
}
.ue-hypo-inp:focus { outline: none; border-color: var(--accent); }
.ue-hypo-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.ue-hypo-table tbody tr:hover td.ue-hypo-plan { background: rgba(63, 185, 80, 0.07); }

.ue-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.ue-toolbar input, .ue-toolbar select {
  background-color: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
.ue-toolbar input { flex: 1; min-width: 160px; }
.ue-toolbar select { min-width: 140px; max-width: 200px; }

.ue-art-filter { position: relative; }
.ue-art-filter-btn {
  font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  white-space: nowrap;
}
.ue-art-filter-btn:hover { border-color: var(--text-muted); }
.ue-art-filter-btn.active {
  border-color: var(--accent, #3d8b5a);
  background: rgba(46, 160, 67, .12);
  color: var(--accent-light, #3fb950);
}
.ue-art-count { font-weight: 600; opacity: .85; }
.ue-art-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  min-width: 200px; max-width: min(260px, 90vw); max-height: 280px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35); display: flex; flex-direction: column;
  overflow: hidden;
}
.ue-art-dropdown[hidden] { display: none; }
.ue-art-dropdown-head {
  display: flex; gap: 4px; padding: 4px 6px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ue-art-dropdown-head .btn {
  padding: 4px 8px;
  font-size: 12px;
}
.ue-art-list {
  overflow-y: auto; padding: 2px 0; max-height: 240px;
}
.ue-art-opt {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  font-size: 13px; cursor: pointer; user-select: none;
}
.ue-art-opt:hover { background: rgba(255,255,255,.04); }
.ue-art-opt input { accent-color: var(--accent, #3d8b5a); }
.ue-art-opt span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ue-art-empty { padding: 12px; font-size: 12px; color: var(--text-muted); }

.wh-xlsx-filter .wh-xlsx-menu {
  min-width: 180px;
  max-width: 220px;
  padding: 4px 0;
  left: 0;
  right: auto;
}
.wh-xlsx-filter .wh-xlsx-menu.wh-xlsx-menu-end {
  left: auto;
  right: 0;
}
.wh-xlsx-filter .wh-xlsx-menu.wh-xlsx-menu-up {
  top: auto;
  bottom: calc(100% + 4px);
}
.wh-xlsx-filter .wh-xlsx-caret {
  opacity: .65;
  font-size: 11px;
  margin-left: 2px;
}
.wh-xlsx-filter .wh-xlsx-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 8px 14px;
  cursor: pointer;
}
.wh-xlsx-filter .wh-xlsx-item:hover {
  background: rgba(255,255,255,.05);
}
.wh-xlsx-filter .wh-xlsx-item[hidden] { display: none; }
.ue-art-filter-btn.on {
  border-color: var(--accent, #3d8b5a);
  background: rgba(46, 160, 67, .12);
  color: var(--accent-light, #3fb950);
}

/* Таблица как состав заказа */
.ue-lines-wrap { padding: 0 0 8px; overflow-x: auto; }
.ue-col-toggles {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px 12px 4px;
}
.ue-col-toggles-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600; margin-right: 4px;
}
.ue-col-tog {
  font: inherit; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}
.ue-col-tog:hover { color: var(--text); border-color: var(--text-muted); }
.ue-col-tog.on { color: var(--text); }
.ue-col-tog.wb.on {
  border-color: #d2a8ff; background: rgba(163, 113, 247, .15); color: #d2a8ff;
}
.ue-col-tog.fbs.on {
  border-color: #56d4dd; background: rgba(86, 212, 221, .14); color: #56d4dd;
}
.ue-col-tog.oz.on {
  border-color: #79b8ff; background: rgba(88, 166, 255, .15); color: #79b8ff;
}
.ue-col-tog.ym.on {
  border-color: #f0c14b; background: rgba(252, 198, 0, .14); color: #f0c14b;
}
.ue-col-tog.profit.on {
  border-color: #3fb950; background: rgba(46, 160, 67, .15); color: #3fb950;
}
.ue-col-tog.ads.on {
  border-color: #e3b341; background: rgba(210, 153, 34, .15); color: #e3b341;
}

.ue-lines-table { padding: 0 12px 12px; }
.ue-lines-head, .ue-line-row {
  display: grid;
  grid-template-columns: var(--ue-cols);
  gap: 6px; align-items: center;
}
.ue-lines-head {
  padding: 8px 0; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .03em; color: var(--text-muted); border-bottom: 1px solid var(--border);
  text-align: center;
  position: relative;
}
.ue-lines-head > span {
  text-align: center; justify-self: center; width: 100%;
  white-space: nowrap;
}
.ue-lines-head .ue-g-cost { color: #f85149; }
.ue-lines-head .ue-g-wb { color: #d2a8ff; }
.ue-lines-head .ue-g-fbs { color: #56d4dd; }
.ue-lines-head .ue-g-oz { color: #79b8ff; }
.ue-lines-head .ue-g-ym { color: #f0c14b; }
.ue-lines-head .ue-g-profit { color: #3fb950; }
.ue-lines-head .ue-g-net { color: #1a7f37; font-weight: 800; }
.ue-lines-head .ue-g-tax { color: #e3b341; }

.ue-line-row {
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.ue-line-row.no-cost { opacity: .72; }

/* Закреплённые колонки: фото + артикул + размер */
.ue-sticky {
  position: sticky;
  z-index: 2;
  background: var(--surface);
  box-sizing: border-box;
}
.ue-lines-head .ue-sticky {
  z-index: 4;
  background: var(--surface);
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ue-line-row .ue-sticky {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ue-sticky-photo {
  left: 12px; /* совпадает с padding таблицы */
  z-index: 3;
}
.ue-sticky-art {
  left: 62px; /* 12 + 44 + 6 */
  z-index: 3;
  justify-content: center;
  min-width: 0;
}
.ue-sticky-size {
  left: 216px; /* 12 + 44 + 6 + 148 + 6 */
  z-index: 3;
  box-shadow: 6px 0 10px -6px rgba(0, 0, 0, .45);
}
.ue-lines-head .ue-sticky-size,
.ue-line-row .ue-sticky-size {
  z-index: 5;
}
.ue-line-row.no-cost .ue-sticky {
  /* сохранить читаемость поверх скролла даже при dimmed row */
  opacity: 1;
}

.ue-line-photo {
  width: 36px; height: 48px; object-fit: cover; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--border); display: block;
  justify-self: center;
}
.ue-line-photo.ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-muted); width: 36px; height: 48px;
}
.ue-line-sku { text-align: center; min-width: 0; width: 100%; flex-direction: column; }
.ue-line-sku strong { display: block; font-size: 13px; }
.ue-line-sku small {
  display: block; font-size: 10px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
  max-width: 100%;
}
.ue-line-size {
  font-size: 13px; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums; width: 100%;
}
.ue-read {
  text-align: center; font-size: 12px; font-variant-numeric: tabular-nums;
  color: var(--text-muted); border-radius: 4px; padding: 4px 6px;
  white-space: nowrap;
}
.ue-read.muted { opacity: .45; }
.ue-read.pos { color: #3fb950; font-weight: 700; }
.ue-read.neg { color: #f85149; font-weight: 700; }
.ue-read.ue-g-cost {
  color: #f85149; background: rgba(248, 81, 73, .08);
}
.ue-read.ue-g-wb, .ue-line-row .ue-g-wb {
  color: #d2a8ff; background: rgba(163, 113, 247, .07);
}
.ue-read.ue-g-fbs, .ue-line-row .ue-g-fbs {
  color: #56d4dd; background: rgba(86, 212, 221, .08);
}
.ue-read.ue-g-oz, .ue-line-row .ue-g-oz {
  color: #79b8ff; background: rgba(88, 166, 255, .08);
}
.ue-read.ue-g-ym, .ue-line-row .ue-g-ym {
  color: #f0c14b; background: rgba(252, 198, 0, .08);
}
.ue-read.ue-g-profit {
  color: #3fb950; background: rgba(46, 160, 67, .08);
}
.ue-read.ue-g-net {
  color: #1a7f37;
  background: rgba(26, 127, 55, .16);
  font-weight: 700;
}
.ue-read.ue-g-net.pos { color: #1a7f37; font-weight: 800; }
.ue-read.ue-g-net.neg { color: #f85149; font-weight: 800; }
.ue-read.ue-g-tax {
  color: #e3b341; background: rgba(210, 153, 34, .08);
}
.ue-inp {
  width: 100%; background: var(--bg); border: 1px solid transparent; color: var(--text);
  border-radius: 6px; padding: 6px 7px; font-size: 13px; font-variant-numeric: tabular-nums;
  text-align: center; font: inherit; white-space: nowrap;
}
.ue-inp.ue-g-oz {
  color: #79b8ff; background: rgba(88, 166, 255, .08);
  border-color: rgba(88, 166, 255, .2);
}
.ue-inp:hover, .ue-inp:focus { border-color: var(--border); outline: none; background: var(--surface); }

/* Номенклатура — список слева + панель справа всегда на экране */
.nom-layout,
.nom-layout.split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.15fr);
  gap: 12px;
  min-height: 420px;
}
.nom-catalog {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.nom-catalog-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border);
  align-items: center;
}
.nom-catalog-toolbar input, .nom-catalog-toolbar select {
  background-color: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.nom-catalog-toolbar input { flex: 1; min-width: 140px; }
.nom-kind-seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.nom-kind-seg button {
  background: transparent; border: 0; color: var(--text-muted); padding: 7px 12px;
  font-size: 12px; cursor: pointer; border-right: 1px solid var(--border);
}
.nom-kind-seg button:last-child { border-right: 0; }
.nom-kind-seg button.active { background: rgba(35,134,54,.15); color: var(--accent-light); }
.nom-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nom-table th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); background: var(--surface2); border-bottom: none;
  position: sticky; top: 0; z-index: 1;
  box-shadow: 0 12px 14px -12px rgba(0, 0, 0, .55);
}
.nom-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.nom-table tbody tr { cursor: pointer; }
.nom-table tbody tr:hover { background: rgba(255,255,255,.03); }
.nom-table tbody tr.active { background: rgba(35,134,54,.12); }
.nom-table .art { font-weight: 650; }
.nom-table .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.nom-thumb {
  width: 36px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface2);
  display: block; flex-shrink: 0;
}
.nom-thumb.ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-muted);
}
.nom-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px;
  background: var(--border); vertical-align: middle;
}
.nom-dot.on { background: var(--accent-light); }
.nom-dot.off { background: #da3633; opacity: .7; }
.nom-table-wrap { max-height: calc(100vh - 280px); overflow: auto; }
.nom-detail {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  display: flex; flex-direction: column; min-height: 420px; overflow: hidden;
}
.nom-detail-placeholder {
  margin: auto; padding: 36px 24px; text-align: center; max-width: 280px;
}
.nom-detail-placeholder .nom-empty { padding: 0; }
.nom-detail-placeholder .hint {
  margin-top: 8px; font-size: 12px; color: var(--text-muted); opacity: .85; line-height: 1.4;
}
.nom-detail-head {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; gap: 12px; align-items: flex-start;
}
.nom-detail-head img, .nom-detail-head .nom-thumb.ph {
  width: 54px; height: 72px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: var(--bg);
}
.nom-detail-head h2 { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.nom-detail-head .meta { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.nom-detail-head .head-actions { margin-left: auto; display: flex; gap: 6px; flex-shrink: 0; }
.nom-detail-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border); padding: 0 8px;
  overflow-x: auto;
}
.nom-detail-tabs button {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-muted); padding: 10px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.nom-detail-tabs button.active {
  color: var(--text); border-bottom-color: var(--accent);
}
.nom-detail-body { padding: 14px 16px; overflow: auto; flex: 1; }
.nom-form { display: grid; gap: 10px; }
.nom-form label { display: grid; gap: 4px; font-size: 12px; color: var(--text-muted); }
.nom-form input, .nom-form select, .nom-form textarea {
  background-color: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
.nom-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nom-photo-block {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: var(--surface2);
}
.nom-photo-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.nom-photo-row { display: flex; gap: 12px; align-items: flex-start; }
.nom-photo-preview {
  width: 72px; height: 96px; border-radius: 8px; object-fit: cover;
  background: var(--bg); flex-shrink: 0;
}
.nom-photo-preview.ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-muted);
}
.nom-photo-actions { display: flex; flex-direction: column; gap: 6px; }
.nom-photo-cands {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.nom-photo-cand {
  border: 1px solid var(--border); background: var(--bg); border-radius: 8px;
  padding: 4px; cursor: pointer; width: 72px; color: var(--text-muted);
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.nom-photo-cand img {
  width: 64px; height: 85px; object-fit: cover; border-radius: 6px; display: block;
}
.nom-photo-cand span { font-size: 10px; line-height: 1.2; text-align: center; }
.nom-photo-cand:hover { border-color: var(--accent-light); }
.nom-photo-cand.selected { border-color: var(--accent-light); box-shadow: 0 0 0 1px var(--accent-light); }
.nom-modal-bg {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.nom-modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  width: min(480px, 100%); max-height: 90vh; overflow: auto; padding: 18px;
}
.nom-modal h3 { font-size: 16px; margin-bottom: 12px; }
.nom-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.nom-offer-table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.nom-offer-table th, .nom-offer-table td {
  text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.nom-offer-table th { color: var(--text-muted); font-weight: 500; font-size: 11px; }
.nom-offer-table th:nth-child(1),
.nom-offer-table td:nth-child(1) { width: 22%; }
.nom-offer-table th:nth-child(2),
.nom-offer-table td:nth-child(2) { width: 34%; }
.nom-offer-table th:nth-child(3),
.nom-offer-table td:nth-child(3) { width: 14%; }
.nom-offer-table th.nom-offer-actions,
.nom-offer-table td.nom-offer-actions {
  width: 30%;
  text-align: right;
  padding-right: 0;
}
/* ТП: обхват (мин–макс) + ширина — отдельные колонки без наложений */
.nom-offer-table--dims th,
.nom-offer-table--dims td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nom-offer-table--dims th:nth-child(1),
.nom-offer-table--dims td:nth-child(1) { width: 12%; }
.nom-offer-table--dims th:nth-child(2),
.nom-offer-table--dims td:nth-child(2) { width: 26%; }
.nom-offer-table--dims th:nth-child(3),
.nom-offer-table--dims td:nth-child(3) { width: 12%; }
.nom-offer-table--dims th:nth-child(4),
.nom-offer-table--dims td:nth-child(4) { width: 18%; }
.nom-offer-table--dims th:nth-child(5),
.nom-offer-table--dims td:nth-child(5) { width: 12%; }
.nom-offer-table--dims th.nom-offer-actions,
.nom-offer-table--dims td.nom-offer-actions {
  width: 20%;
  overflow: visible;
  white-space: normal;
}
.nom-offer-actions-inner {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: 100%;
}
.nom-offer-actions-inner .btn-sm {
  padding: 4px 10px;
  height: 28px;
  box-sizing: border-box;
  line-height: 1.2;
}

/* —— Себестоимость (из закупок) —— */
.nom-cost-rule { font-size: 12px; margin: 0 0 6px; line-height: 1.4; }
.nom-cost-sku {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: var(--surface2); margin-bottom: 12px;
}
.nom-cost-sku-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin-bottom: 8px;
}
.nom-cost-sku-head .muted { margin-left: 8px; font-size: 12px; }
.nom-cost-value {
  font-size: 16px; font-weight: 700; color: var(--accent-light, #c4f542);
  font-variant-numeric: tabular-nums;
}
.nom-cost-table th:nth-child(1),
.nom-cost-table td:nth-child(1) { width: 14%; }
.nom-cost-table th:nth-child(2),
.nom-cost-table td:nth-child(2) { width: 14%; }
.nom-cost-table th:nth-child(3),
.nom-cost-table td:nth-child(3) { width: 12%; }
.nom-cost-table th:nth-child(n+4),
.nom-cost-table td:nth-child(n+4) { width: auto; text-align: right; }
.nom-cost-table tr.nom-cost-selected td {
  background: rgba(210, 153, 34, .14);
  color: #e3b341;
}
.nom-cost-badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
  color: #0f1412; background: #e3b341; border-radius: 4px; padding: 2px 6px;
}

/* —— Привязка к МП (слоты по размерам) —— */
.nom-slots { display: grid; gap: 12px; }
.nom-slot-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  background: var(--surface2);
}
.nom-slot-head {
  display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px;
  font-size: 13px;
}
.nom-slot-grid { display: grid; gap: 8px; }
.nom-slot {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); font-size: 12px; text-align: left; color: var(--text); width: 100%;
}
.nom-slot.free {
  grid-template-columns: auto 1fr; cursor: pointer; border-style: dashed;
  color: var(--text-muted);
}
.nom-slot.free:hover { border-color: var(--accent-light); color: var(--text); }
.nom-slot-free-text { font-size: 12px; }
.nom-slot img, .nom-slot .nom-thumb.ph {
  width: 40px; height: 53px; border-radius: 6px; object-fit: cover; background: var(--surface2);
}
.nom-slot .info { min-width: 0; }
.nom-slot .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* —— Состав (компактные строки, отдельно от привязки МП) —— */
.nom-comp-slots { display: grid; gap: 10px; }
.nom-comp-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  background: var(--surface2);
}
.nom-comp-card.active {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent-light);
}
.nom-comp-card-head {
  display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px;
  font-size: 13px;
}
.nom-comp-list { display: grid; gap: 4px; }
.nom-comp-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  font-size: 12px;
  color: var(--text);
  min-height: 44px;
  box-sizing: border-box;
}
.nom-comp-row img,
.nom-comp-ph {
  width: 32px; height: 32px; border-radius: 5px; object-fit: cover;
  background: var(--surface2); flex-shrink: 0;
}
.nom-comp-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-muted);
}
.nom-comp-info {
  min-width: 0;
  display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline;
  line-height: 1.25;
}
.nom-comp-name {
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.nom-comp-meta {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nom-comp-controls {
  display: flex; flex-direction: row; align-items: center; gap: 4px;
  flex-shrink: 0;
  height: 28px;
}
.nom-comp-qty {
  width: 52px;
  height: 28px;
  box-sizing: border-box;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 5px;
  padding: 0 6px;
  font-size: 12px;
  text-align: center;
  line-height: 26px;
}
.nom-comp-x {
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nom-comp-x:hover {
  color: #e85d5d;
  border-color: rgba(232, 93, 93, .45);
}
.nom-comp-add {
  display: block; width: 100%;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.nom-comp-add:hover {
  border-color: var(--accent-light);
  color: var(--text);
}
.nom-bind-picker {
  margin-top: 14px; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; background: var(--surface);
}
.nom-bind-picker-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.nom-bind-pick {
  display: grid; gap: 8px; max-height: 420px; overflow: auto; margin-top: 8px;
}
.nom-bind-pick label,
.nom-bind-pick .nom-bind-pick-row {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center;
  padding: 8px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; color: var(--text);
}
.nom-bind-pick .nom-probe-pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
}
.nom-bind-pick .nom-probe-pick-row .info { min-width: 0; }
.nom-bind-pick .nom-probe-pick-row .sub { white-space: normal; word-break: break-word; }
.nom-bind-pick .nom-probe-pick-row .btn { flex-shrink: 0; white-space: nowrap; }
.nom-bind-pick label { cursor: pointer; }
.nom-bind-pick label:hover,
.nom-bind-pick .nom-bind-pick-row:hover,
.nom-bind-pick .nom-probe-pick-row:hover { border-color: var(--accent); }
.nom-bind-pick img, .nom-bind-pick .nom-thumb.ph {
  width: 40px; height: 53px; border-radius: 6px; object-fit: cover;
}
.nom-qty-input {
  width: 88px; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: 13px;
}
.nom-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
@media (max-width: 900px) {
  .nom-layout.split { grid-template-columns: 1fr; }
  .nom-layout.split .nom-catalog.hidden-mobile { display: none; }
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 16px;
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px 18px; min-width: 0; }
.chart-wrap {
  position: relative; width: 100%; height: 340px;
}
.chart-wrap canvas { width: 100% !important; height: 100% !important; }
.chart-tooltip-ext {
  position: absolute; pointer-events: none; z-index: 5;
  transform: translate(-50%, calc(-100% - 12px));
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 11px; box-shadow: 0 8px 24px rgba(0,0,0,.45);
  font-size: 11.5px; min-width: 140px; opacity: 0;
  transition: opacity .1s ease; white-space: nowrap;
}
.chart-tooltip-ext .ctt-time { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.chart-tooltip-ext .ctt-row { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
.chart-tooltip-ext .ctt-name { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.chart-tooltip-ext .ctt-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chart-tooltip-ext .ctt-dot-bar { border-radius: 2px; width: 8px; height: 7px; }
.chart-tooltip-ext b { color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tooltip-ext .ctt-net b { color: #9be9a8; }
.chart-layout {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 320px);
  gap: 16px;
  align-items: stretch;
}
.chart-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.top-articles {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* высота = колонка с графиком (легенда + 280px), без лишнего растягивания */
  align-self: stretch;
  overflow: hidden;
}
#top-articles-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  overflow: hidden;
}
#top-articles-list.top-empty {
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.top-row {
  display: flex; gap: 10px; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  flex: 1 1 0;
  min-height: 58px;
}
.top-row:last-child { border-bottom: none; padding-bottom: 0; }
.top-rank {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--bg); color: var(--text-muted);
  margin-top: 0;
}
.top-rank.gold { background: rgba(210,153,34,.2); color: #e3b341; }
.top-row img, .top-row .ph {
  width: 36px; height: 48px; border-radius: 6px; object-fit: cover;
  background: var(--bg); flex-shrink: 0;
}
.top-row .ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-muted);
}
.top-row .info { min-width: 0; flex: 1; }
.top-row .code {
  font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-row .meta {
  font-size: 10.5px; color: var(--text-muted); margin-top: 3px;
  display: flex; flex-wrap: wrap; gap: 3px 8px;
  font-variant-numeric: tabular-nums;
}
.top-row .meta span { display: inline-flex; align-items: center; gap: 3px; }
.top-row .meta .d { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.top-row .meta .oz .d { background: #79b8ff; }
.top-row .meta .wb .d { background: #f0a0e0; }
.top-row .meta .ym .d { background: #f0c14b; }
.top-row .nums { padding-top: 2px; }
.top-row .nums { text-align: right; flex-shrink: 0; }
.top-row .nums .q { font-size: 13px; font-weight: 700; color: var(--accent-light); }
.top-row .nums .r { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.top-empty { font-size: 13px; color: var(--text-muted); padding: 12px 0; }
.seg {
  display: inline-flex; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; flex-shrink: 0;
}
.seg button {
  border: none; background: transparent; color: var(--text-muted);
  padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.seg button.active { background: var(--accent); color: #fff; }

.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 12px 14px; text-align: left; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.mp {
  display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.mp-ozon { background: rgba(0,91,255,.18); color: #7eb0ff; }
.mp-wb { background: rgba(203,17,171,.18); color: #f0a0e0; }
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input, .filters select {
  background-color: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; max-width: 100%;
}
.product-row { display: flex; gap: 12px; align-items: flex-start; }
.product-row img {
  width: 36px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--surface2);
}
.muted { color: var(--text-muted); }
.toast {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: auto;
  background: var(--surface2);
  border: 1px solid var(--border); padding: 12px 16px; border-radius: 10px;
  opacity: 0; transform: translateY(8px);
  transition:
    opacity 220ms var(--ease-out),
    transform 220ms var(--ease-out);
  z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  font-size: 13px;
  pointer-events: none;
  cursor: pointer;
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.chart-legend { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-legend .lg-chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 650;
  padding: 5px 11px 5px 8px; border-radius: 100px; border: 1px solid var(--border); background: var(--surface2);
  color: var(--text-muted); cursor: pointer;
}
.chart-legend .lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.chart-legend .lg-chip.net .lg-dot { width: 9px; height: 7px; border-radius: 2px; }
.chart-legend .lg-chip.is-on {
  color: var(--text); border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface2));
}
.chart-legend .lg-chip:not(.is-on) { opacity: .45; }

/* Последние заказы — карточки */
.orders-tabs, .chart-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
  min-width: 0;
}
.orders-tabs button, .chart-tabs button {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 8px 12px; cursor: pointer; white-space: nowrap;
}
.orders-tabs button:hover, .chart-tabs button:hover { color: var(--text); }
.orders-tabs button.active, .chart-tabs button.active {
  color: var(--text); border-bottom-color: var(--accent-light);
}
.orders-updated, .chart-tools {
  font-size: 12px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-width: 0;
}
.orders-updated button, .chart-tools .icon-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 6px 8px; min-width: 36px; min-height: 36px;
  transition: transform var(--press-duration) var(--ease-out), color var(--press-duration) ease;
}
@media (hover: hover) and (pointer: fine) {
  .orders-updated button:hover, .chart-tools .icon-btn:hover { color: var(--accent-light); }
}
.orders-updated button:active, .chart-tools .icon-btn:active { transform: scale(0.97); }
.orders-updated button.is-spinning,
.orders-updated button.is-spinning:hover {
  color: var(--accent-light);
  animation: wh-spin .75s linear infinite;
  pointer-events: none;
  opacity: 1;
}
@keyframes wh-spin {
  to { transform: rotate(360deg); }
}
.chart-tools select {
  background-color: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer;
  max-width: 100%;
}
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  min-width: 0;
  width: 100%;
  padding-top: 6px;
  padding-right: 4px;
  padding-left: 0;
}
.card:has(#recent-orders) {
  overflow: visible;
}
.card:has(#recent-orders) .card-body {
  overflow: visible;
}
.order-card {
  position: relative;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
  box-sizing: border-box;
}
.order-card-media {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  /* высота выставляется из JS по .body */
  height: 96px;
  border-radius: 10px;
  background: var(--bg);
  overflow: visible;
}
.order-card .of-num-badge.order-card-num,
.order-card-num.of-num-badge {
  position: absolute; top: -8px; right: -8px; left: auto; z-index: 3;
  min-width: 34px; height: 20px; padding: 0 7px;
  font-size: 11px;
  box-shadow: 0 3px 10px rgba(35, 134, 54, .32);
}
.order-card img, .order-card .ph {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  border-radius: 10px;
  background: var(--bg);
}
.order-card .ph {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 11px;
}
.order-card .body { min-width: 0; flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 4px; }
.order-card .title {
  font-size: 12px; font-weight: 700; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.order-card .status-row {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  min-width: 0; flex-wrap: wrap;
}
.order-card .status-row .time {
  font-size: 12px; color: var(--text-muted); flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.order-card .of-chip.of-sla { padding: 2px 8px; font-size: 11px; }
.order-card .meta {
  font-size: 12px; color: var(--text-muted); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.order-card .meta.foot { margin-top: 0; }
.order-card .foot-lines {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.order-card .row2 {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  min-width: 0; max-width: 100%;
}
.order-card .price { font-size: 13px; font-weight: 700; color: var(--accent-light); flex-shrink: 0; }
.order-card .net {
  font-size: 12px; font-weight: 650; flex-shrink: 0;
}
.order-card .net.ok { color: var(--accent-light); }
.order-card .net.bad { color: #ff7b72; }
.order-card .net.muted { color: var(--text-muted); }
.badge-st {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 20px;
  background: rgba(56,139,253,.15); color: #79b8ff;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge-st.ok { background: rgba(46,160,67,.18); color: var(--accent-light); }
.badge-st.bad { background: rgba(218,54,51,.18); color: #ff7b72; }
.badge-st.warn { background: rgba(210,153,34,.18); color: #e3b341; }
.mp-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px;
}
.mp-dot.ozon { background: #388bfd; }
.mp-dot.wb { background: #cb11ab; }
.mp-dot.ym { background: #f0c14b; }
.order-mp-mark {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-right: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: 1px;
  line-height: 1.3;
}
.order-mp-mark.ozon { background: rgba(56, 139, 253, .18); color: #79b8ff; }
.order-mp-mark.wb { background: rgba(203, 17, 171, .18); color: #f778ba; }
.order-mp-mark.ym { background: rgba(240, 193, 75, .18); color: #f0c14b; }

.dash-orders-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  min-width: 0; flex: 1;
}
.dash-orders-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.dash-orders-title:hover { color: var(--accent-light); }

/* Дашборд: лента акций */
.dash-promo {
  display: flex;
  gap: 18px;
  align-items: stretch;
  min-width: 0;
  flex: 1;
  min-height: 100%;
}
.dpc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.dpc-score {
  width: 118px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}
.dpc-score-lbl {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.dpc-score-pct {
  margin-top: 4px;
  font-size: 34px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.dpc-score-pct.is-zero { color: #ff7b72; }
.dpc-score-pct.is-mid { color: #d29922; }
.dpc-score-pct.is-ok { color: var(--accent-light); }
.dpc-score-pct.is-empty { color: var(--text-muted); }
.dpc-score-sub {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.dpc-score-hint {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
  max-width: 100%;
}
.dpc-score-hint.is-warn { color: #ff7b72; }
.dpc-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dpc-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 9px;
  min-height: 28px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: transform var(--press-duration) var(--ease-out), filter 160ms var(--ease-out);
}
.dpc-bar.mp-ozon {
  background: rgba(88, 166, 255, .14);
  border-color: rgba(88, 166, 255, .32);
}
.dpc-bar.mp-wb {
  background: rgba(203, 17, 171, .14);
  border-color: rgba(232, 122, 212, .32);
}
.dpc-bar.mp-ym {
  background: rgba(252, 198, 0, .14);
  border-color: rgba(240, 193, 75, .38);
}
.dpc-bar.is-in {
  box-shadow: inset 2px 0 0 #3fb950;
}
.dpc-bar.is-out { opacity: .88; }
.dpc-bar.is-auto {
  filter: grayscale(.85);
  opacity: .7;
  background: rgba(110, 118, 129, .16) !important;
  border-color: rgba(125, 133, 144, .35) !important;
  box-shadow: none;
}
.dpc-bar:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .dpc-bar:hover { filter: brightness(1.08); }
  .dpc-bar.is-auto:hover { filter: grayscale(.85) brightness(1.06); }
}
.dpc-bar-mp {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, .28);
}
.dpc-bar-title {
  min-width: 0;
  flex: 1;
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dpc-bar-date {
  flex-shrink: 0;
  font-size: 10.5px;
  color: var(--text-muted);
}
.dpc-bar-date.is-warn { color: #d29922; font-weight: 650; }
.dpc-bar-mark {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: #3fb950;
  width: 13px;
  text-align: center;
}
.dpc-bar-mark.is-out { color: var(--text-muted); }
.dpc-empty {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px;
}
.dpc-more {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-muted);
  text-decoration: none;
}
.dpc-more:hover { color: var(--accent-light); }

@media (max-width: 700px) {
  .dash-promo {
    flex-direction: column;
    gap: 12px;
  }
  .dpc-score {
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    padding-left: 0;
    padding-top: 10px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .dpc-score-pct { margin-top: 0; font-size: 28px; }
  .dpc-score-sub { margin-top: 0; }
  .dpc-score-hint { width: 100%; margin-top: 0; }
}

/* Дашборд: акции 2/3 + оценки 1/3 */
.dash-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}
.dash-bottom-row > .card {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.dash-bottom-row > .card > .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-reviews {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 100%;
  flex: 1;
}
.drv-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.drv-kpi {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.drv-kpi-lbl {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.drv-kpi-val {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.drv-kpi-val.is-ok { color: var(--accent-light); }
.drv-kpi-val.is-mid { color: var(--warning); }
.drv-kpi-val.is-low { color: #ff7b72; }
.drv-kpi-sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.drv-new {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.drv-new-lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.drv-new-n {
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.drv-stars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drv-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) minmax(40px, auto) minmax(40px, auto);
  gap: 8px;
  align-items: center;
}
.drv-star {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--warning);
}
.drv-star-ico { flex-shrink: 0; }
.drv-bar {
  display: flex;
  align-items: stretch;
  height: 11px;
  border-radius: 99px;
  background: rgba(125, 133, 144, .18);
  overflow: hidden;
  min-width: 0;
}
.drv-bar-stack {
  display: flex;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: inherit;
  flex: 0 0 auto;
}
.drv-seg {
  height: 100%;
  min-width: 4px;
}
.drv-seg.mp-wb { background: #cb11ab; }
.drv-seg.mp-ozon { background: #005bff; }
.drv-seg.mp-ym { background: #f0c14b; }
.drv-seg.mp-other { background: rgba(125, 133, 144, .55); }
.drv-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 2px;
}
.drv-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.drv-leg i {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(125, 133, 144, .45);
}
.drv-leg.mp-wb i { background: #cb11ab; }
.drv-leg.mp-ozon i { background: #005bff; }
.drv-leg.mp-ym i { background: #f0c14b; }
.drv-count {
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
}
.drv-delta {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-muted);
}
.drv-delta.is-good { color: var(--accent-light); }
.drv-delta.is-bad { color: #ff7b72; }
.drv-foot {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
}
.drv-empty { color: var(--text-muted); font-size: 13px; }

@media (max-width: 1100px) {
  .dash-bottom-row {
    grid-template-columns: 1fr;
  }
}

/* Лента заказов — страница */
.of-toolbar-card { margin-bottom: 14px; }
.of-toolbar-header { flex-wrap: wrap; gap: 10px; }
.of-filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding-top: 4px !important;
}
.of-filters select,
.of-filters input[type="search"] {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.of-filters input[type="search"] { min-width: min(260px, 100%); flex: 1; }
.of-summary { font-size: 12px; margin-left: auto; }
.of-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  min-width: 0;
  width: 100%;
}
.of-tile {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 14px 12px;
  min-width: 0;
  box-sizing: border-box;
}
.of-num-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 28px; padding: 0 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2ea043 0%, #238636 100%);
  color: #fff; font-size: 13px; font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 4px 12px rgba(35, 134, 54, .35);
}
.of-tile-top {
  display: flex; align-items: flex-start; gap: 10px;
  padding-right: 56px; min-width: 0;
}
.of-mp {
  display: inline-flex; align-items: center; flex-shrink: 0;
  margin-top: 1px;
}
.of-mp-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  color: #fff; flex-shrink: 0;
  background: var(--text-muted);
}
.of-mp.wb .of-mp-mark { background: #cb11ab; }
.of-mp.ozon .of-mp-mark { background: #005bff; }
.of-mp.ym .of-mp-mark { background: #f0c14b; color: #1a1a1a; }
.of-head { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.of-sku {
  font-size: 13px; font-weight: 700; color: var(--text);
  line-height: 1.3; word-break: break-word;
}
.of-brandline {
  font-size: 12px; color: var(--text-muted); line-height: 1.35;
}
.of-sub-inline {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  font-size: 12px; color: var(--text-muted); min-width: 0; margin-top: 2px;
}
.of-tile-main {
  display: flex; gap: 12px; align-items: stretch;
  min-width: 0;
}
.of-tile img, .of-tile .ph {
  width: 72px; height: 96px; border-radius: 10px; object-fit: cover;
  background: var(--surface2); flex-shrink: 0;
}
.of-tile .ph {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 11px;
}
.of-tile-body { min-width: 0; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.of-money-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 0;
}
.of-money-col {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px;
  min-width: 0;
}
.of-money-val {
  font-size: 15px; font-weight: 700; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.of-money-val.price { color: var(--accent-light); }
.of-money-val.ok { color: var(--accent-light); }
.of-money-val.bad { color: #ff7b72; }
.of-money-val.muted { color: var(--text-muted); font-weight: 600; }
.of-money-lbl {
  margin-top: 2px; font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.of-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.of-stat {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 7px 10px;
  min-width: 0;
}
.of-stat-lbl {
  display: block; font-size: 10px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.of-stat-val {
  display: block; margin-top: 3px;
  font-size: 13px; font-weight: 650; color: var(--text);
}
.of-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.of-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px;
}
.of-chip b { font-weight: 700; color: var(--text); }
.of-chip.of-scheme.fbs { border-color: var(--text); }
.of-chip.of-scheme.fbo { color: var(--text-muted); }
.of-chip.of-sla.ok,
.of-chip.of-sla.shipped { color: var(--text-muted); }
.of-chip.of-sla.warn {
  color: #d29922;
  border-color: rgba(210, 153, 34, .5);
  background: rgba(210, 153, 34, .12);
}
.of-chip.of-sla.danger {
  color: #ff7b72;
  border-color: rgba(255, 123, 114, .5);
  background: rgba(255, 123, 114, .12);
}
.of-tile.of-sla-warn { box-shadow: inset 3px 0 0 #d29922; }
.of-tile.of-sla-danger { box-shadow: inset 3px 0 0 #ff7b72; }
.of-sla-filter {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.of-sla-filter.active {
  color: #d29922;
  border-color: rgba(210, 153, 34, .5);
  background: rgba(210, 153, 34, .12);
}
.of-sla-filter #of-hot-count:not([hidden]) {
  display: inline-block;
  margin-left: 4px;
  min-width: 1.2em;
  font-variant-numeric: tabular-nums;
}
.of-route {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  font-size: 12px; line-height: 1.4; color: var(--text);
  padding-top: 2px;
}
.of-route-from, .of-route-to { font-weight: 600; }
.of-route-arrow { color: var(--text-muted); flex-shrink: 0; }
.of-more { display: flex; justify-content: center; padding: 16px 0 28px; }

@media (max-width: 700px) {
  .of-list { grid-template-columns: 1fr; }
  .of-summary { margin-left: 0; width: 100%; }
  .dash-orders-head { width: 100%; }
  .of-tile-top { padding-right: 48px; }
}

/* Остатки */
.stock-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px;
}
.stock-kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.stock-kpi .lbl { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stock-kpi .val { font-size: 22px; font-weight: 700; margin-top: 6px; }
.stock-kpi .val.warn { color: var(--warning); }
.stock-kpi .val.bad { color: #ff7b72; }
.stock-kpi .val.oz { color: #79b8ff; }
.stock-kpi .val.wb { color: #f0a0e0; }
.stock-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px;
}
.stock-toolbar input, .stock-toolbar select {
  background-color: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-size: 13px;
}
.stock-toolbar input { flex: 1; min-width: 160px; }
.stock-list { display: flex; flex-direction: column; gap: 10px; }
.stock-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; display: grid;
  grid-template-columns: 64px 1fr; gap: 12px 14px;
}
.stock-card.critical { border-color: rgba(218,54,51,.45); }
.stock-card.need { border-color: rgba(210,153,34,.4); }
.stock-card img, .stock-card .ph {
  width: 64px; height: 85px; border-radius: 8px; object-fit: cover; background: var(--surface2);
}
.stock-card .ph {
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11px;
}
.stock-card .head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stock-card .title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.stock-card .code {
  font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-muted); margin-top: 2px;
}
.stock-pill {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px;
  background: rgba(46,160,67,.15); color: var(--accent-light);
}
.stock-pill.need { background: rgba(210,153,34,.18); color: #e3b341; }
.stock-pill.critical { background: rgba(218,54,51,.18); color: #ff7b72; }
.stock-pill.empty { background: var(--surface2); color: var(--text-muted); }
.stock-mp {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px;
}
.stock-mp .box {
  background: var(--surface2); border-radius: 8px; padding: 10px;
  font-size: 12px; line-height: 1.45;
}
.stock-mp .box b { font-size: 16px; display: block; margin: 2px 0 4px; }
.stock-mp .box .tag { color: var(--text-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.stock-actions, .stock-wh {
  grid-column: 1 / -1; margin-top: 2px;
}
.stock-actions h4, .stock-wh h4 {
  font-size: 11px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; margin-bottom: 6px; font-weight: 600;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; line-height: 1.3;
}
.chip strong { color: var(--accent-light); }
.chip .mp-ozon-t { color: #79b8ff; }
.chip .mp-wb-t { color: #f0a0e0; }

/* —— Тарифы производства —— */
.tf-toolbar { margin-bottom: 14px; }
.tf-toolbar input {
  width: 100%; max-width: 420px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size: 13px;
}
.tf-block { margin-bottom: 28px; }
.tf-block-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px;
  margin-bottom: 10px;
}
.tf-block-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.tf-hint { font-size: 12px; color: var(--text-muted); }
.tf-prod { border-bottom: 1px solid var(--border); }
.tf-prod:last-child { border-bottom: none; }
.tf-prod.open {
  background: var(--surface2);
  border-left: 3px solid var(--accent-light);
}
.tf-prod.open .tf-prod-head {
  background: var(--surface2);
}
.tf-prod.open .tf-sku-panel {
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding-bottom: 16px;
}
.tf-prod-head {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: transparent; border: none; color: var(--text);
  cursor: pointer; text-align: left; font: inherit;
}
.tf-prod-head:hover { background: var(--surface2); }
.tf-prod.open .tf-prod-head:hover { background: var(--surface2); }
.tf-chev { width: 14px; color: var(--text-muted); flex-shrink: 0; }
.tf-thumb {
  width: 36px; height: 48px; object-fit: cover; border-radius: 6px;
  background: var(--bg); flex-shrink: 0; border: 1px solid var(--border);
}
.tf-thumb-empty { display: inline-block; }
.tf-prod-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tf-article { font-weight: 650; font-size: 14px; }
.tf-name { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tf-prod-meta {
  font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums;
  flex-shrink: 0; white-space: nowrap;
}
.tf-head-arts {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px;
}
.tf-sku-panel {
  padding: 0 14px 14px 40px;
  overflow-x: auto;
}
.tf-sku-head, .tf-sku-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(5, minmax(72px, 90px)) minmax(88px, 100px);
  gap: 8px; align-items: start;
  min-width: 720px;
}
.tf-sku-head {
  padding: 6px 0 8px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
}
.tf-sku-head .tf-sub {
  display: block; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .75; margin-top: 2px;
}
.tf-sku-row { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.tf-sku-row:last-child { border-bottom: none; }
.tf-sku-code { font-weight: 600; font-size: 13px; }
.tf-sku-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.tf-size-tag {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
}
.tf-mp {
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  border-radius: 4px; padding: 1px 5px;
}
.tf-mp.wb { color: #f0a0e0; background: rgba(240,160,224,.12); }
.tf-mp.oz { color: #79b8ff; background: rgba(121,184,255,.12); }
.tf-mp.off { color: var(--text-muted); background: var(--bg); }
.tf-offer-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.tf-rate-cell { display: flex; flex-direction: column; gap: 3px; align-items: stretch; }
.tf-rate-cell .tf-rate-inp,
.tf-rate-cell .tf-qty { flex-shrink: 0; }
.tf-rate-inp, .tf-qty {
  width: 100%; background: var(--bg); border: 1px solid transparent; color: var(--text);
  border-radius: 6px; padding: 6px 7px; font-size: 13px; font-variant-numeric: tabular-nums;
  text-align: right;
}
.tf-rate-inp:hover, .tf-rate-inp:focus, .tf-qty:focus {
  border-color: var(--border); outline: none; background: var(--surface);
}
.tf-rate-ro {
  justify-content: center;
  min-height: 32px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text);
}
.tf-rate-ro span {
  display: block;
  padding: 6px 7px;
  font-size: 13px;
}
.tf-qty { border-color: var(--border); }
.tf-rub { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; min-height: 14px; }
.tf-op-hint {
  display: block; font-size: 10px; color: var(--text-muted); text-align: right;
  margin-top: 2px; line-height: 1.2; font-weight: 500;
}
.tf-ready, .tf-line-total {
  font-weight: 700; color: var(--accent-light); font-variant-numeric: tabular-nums;
  text-align: right; font-size: 13px;
}
.tf-ready-val {
  min-height: 30px; display: flex; align-items: center; justify-content: flex-end;
  line-height: 1.2;
}
.tf-na .tf-dash { color: var(--text-muted); text-align: center; display: block; }
.tf-empty { text-align: center; color: var(--text-muted); padding: 28px; }
.tf-grand-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-top: 1px solid var(--border);
  background: var(--surface2); font-size: 14px; color: var(--text-muted);
}
.tf-grand-bar strong {
  font-size: 18px; color: var(--accent-light); font-variant-numeric: tabular-nums;
}
.tf-calc-actions { margin-top: 10px; }
/* стопка фото группы (не путать с цветными тегами) */
.grp-stack {
  position: relative;
  width: 44px; height: 52px;
  flex-shrink: 0;
}
.grp-stack.lg { width: 56px; height: 66px; }
.grp-stack.single .grp-stack-front { left: 0; }
.grp-stack.empty {
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: 8px; background: var(--bg);
}
.grp-stack-ph { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.grp-stack-back, .grp-stack-front {
  position: absolute; top: 0; width: 34px; height: 46px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface2);
}
.grp-stack.lg .grp-stack-back, .grp-stack.lg .grp-stack-front {
  width: 42px; height: 58px;
}
.grp-stack-back { left: 10px; z-index: 1; }
.grp-stack.lg .grp-stack-back { left: 12px; }
.grp-stack-front { left: 0; z-index: 2; box-shadow: 2px 0 8px rgba(0,0,0,.25); }
.grp-stack-back img, .grp-stack-front img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.grp-stack-back::after {
  content: ""; position: absolute; inset: 0;
  background: rgba(20, 28, 40, .55);
}
.grp-stack-plus {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  letter-spacing: .02em;
}
.grp-stack.lg .grp-stack-plus { font-size: 14px; }
.nom-group-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
}
.tf-tag-products {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px;
}
.tf-mini-art {
  font-size: 11px; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px;
}
.tf-calc-section {
  padding: 10px 14px 4px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
  background: var(--surface2); border-bottom: 1px solid var(--border);
}

/* —— Режимы номенклатуры / группы —— */
.nom-mode-tabs {
  display: flex; gap: 4px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
.nom-mode-tabs button {
  background: none; border: none; color: var(--text-muted);
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 14px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.nom-mode-tabs button:hover { color: var(--text); }
.nom-mode-tabs button.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}
.nom-groups-page { margin-top: 0; }
.grp-list { display: flex; flex-direction: column; }
.grp-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left; font: inherit; color: var(--text);
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  padding: 12px 14px; cursor: pointer;
}
.grp-row:hover { background: var(--surface2); }
.grp-row.active { background: rgba(35,134,54,.12); }
.grp-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.grp-row-main strong { font-size: 14px; }
.grp-members { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.grp-member {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg);
}
.grp-member img, .grp-member .nom-thumb {
  width: 36px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0;
}
.grp-member strong { font-size: 13px; }
.grp-member .nom-comp-x { margin-left: auto; }

/* —— Теги номенклатуры —— */
.nom-tag-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.nom-tag-chip.sm {
  font-size: 11px; padding: 2px 7px; gap: 5px;
}
.nom-tag-chip.sm i { width: 7px; height: 7px; }
.nom-tags-block { margin: 4px 0 8px; }
.nom-tags-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.nom-tag-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--tag, #888) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag, #888) 45%, transparent);
}
.nom-tag-chip i {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.nom-tag-chip button {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 0 0 2px;
}
.nom-tags-add select {
  margin-top: 8px; width: 100%;
  background-color: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
.tags-mgr-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; max-height: 50vh; overflow: auto; }
.tags-mgr-row {
  display: grid; grid-template-columns: 36px 1fr auto auto; gap: 8px; align-items: center;
}
.tags-mgr-row input[type="color"] {
  width: 36px; height: 32px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: transparent; cursor: pointer;
}
.tags-mgr-name {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.tags-mgr-new {
  display: grid; grid-template-columns: 1fr 44px auto; gap: 8px; align-items: center;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.tags-mgr-new input[type="text"], .tags-mgr-new #tag-new-name {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 13px;
}
.tags-mgr-new input[type="color"] {
  width: 44px; height: 36px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; background: transparent;
}

.modal-backdrop,
.nom-modal-bg,
.ue-guide-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  padding: 16px;
  opacity: 1;
  transition:
    opacity var(--overlay-duration) var(--ease-out),
    display var(--overlay-duration) allow-discrete,
    overlay var(--overlay-duration) allow-discrete;
}
.ue-guide-backdrop {
  z-index: 90;
  background: rgba(1, 4, 9, .55);
  align-items: stretch;
  padding: 0;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.modal-backdrop[hidden],
.nom-modal-bg[hidden],
.ue-guide-backdrop[hidden] {
  display: none;
  opacity: 0;
}
.modal-backdrop .modal,
.nom-modal-bg .nom-modal {
  opacity: 1;
  transform: scale(1);
  transition:
    opacity var(--overlay-duration) var(--ease-out),
    transform var(--overlay-duration) var(--ease-out);
}
.modal-backdrop[hidden] .modal,
.nom-modal-bg[hidden] .nom-modal {
  opacity: 0;
  transform: scale(0.96);
}
@starting-style {
  .modal-backdrop:not([hidden]),
  .nom-modal-bg:not([hidden]),
  .ue-guide-backdrop:not([hidden]) {
    opacity: 0;
  }
  .modal-backdrop:not([hidden]) .modal,
  .nom-modal-bg:not([hidden]) .nom-modal {
    opacity: 0;
    transform: scale(0.96);
  }
}
.modal {
  width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.4); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: none; border: none; color: var(--text-muted); font-size: 22px;
  cursor: pointer; line-height: 1; padding: 0 4px;
  transition: transform var(--press-duration) var(--ease-out), color var(--press-duration) ease;
}
.modal-close:active { transform: scale(0.9); }
.modal-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* —— Mobile / iPhone 13 (~390×844) —— */
@media (max-width: 900px) {
  html.authed, html.authed body {
    height: auto;
    overflow: auto;
    overflow-x: hidden;
  }
  html.authed #app {
    height: auto;
    max-height: none;
    overflow: visible;
    flex-direction: column;
  }
  #app { flex-direction: column; }
  /* Горизонтальное меню — только job. Seller на мобилке скрывает .sidebar целиком. */
  html:not(.portal-seller) .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(22, 27, 34, 0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    height: auto;
    max-height: none;
    overflow: visible;
  }
  html:not(.portal-seller) .sidebar-logo {
    padding: 4px 4px 10px;
    margin-bottom: 8px;
    gap: 10px;
  }
  html:not(.portal-seller) .sidebar-logo img { width: 34px; height: 34px; }
  html:not(.portal-seller) .sidebar-logo h2 { font-size: 14px; }
  html:not(.portal-seller) .sidebar-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    flex: none;
    min-height: 0;
  }
  html:not(.portal-seller) .nav-group {
    display: contents;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
  }
  html:not(.portal-seller) .nav-group-title { display: none; }
  html:not(.portal-seller) .nav-group-items { display: contents; }
  html:not(.portal-seller) .nav-item {
    flex: 1 0 auto;
    justify-content: center;
    padding: 10px 12px;
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
  }
  html:not(.portal-seller) .sidebar-user {
    margin-top: 8px;
    padding: 8px 10px;
  }
  html:not(.portal-seller) .sidebar-user-sub { display: none; }
  .main {
    padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  html.portal-seller {
    --mob-tab-h: 56px;
    --mob-tab-pad: 28px;
    --mob-top-pad: 30px;
  }
  /* Мобильное меню seller — отдельный блок. Десктопный .sidebar здесь не живёт. */
  html.portal-seller .sidebar {
    display: none !important;
  }
  html.portal-seller.authed,
  html.portal-seller.authed body,
  html.portal-seller.authed #app,
  html.portal-seller.authed .main,
  html.portal-seller.authed .main > section,
  html.portal-seller.authed .page-header,
  html.portal-seller.authed #page-dashboard {
    background: var(--bg);
    background-image: none;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  html.portal-seller.authed .sidebar {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  html.portal-seller.authed .main {
    padding: calc(var(--mob-top-pad, 30px) + env(safe-area-inset-top, 0px)) 14px calc(20px + var(--mob-tab-h, 56px) + var(--mob-tab-pad, 28px) + env(safe-area-inset-bottom));
  }
  html.portal-seller #page-dashboard { padding-top: 0; }
  html.portal-seller #page-dashboard::before {
    content: none !important;
    display: none !important;
  }
  .page-header { margin-bottom: 14px; gap: 10px; }
  .page-header h1 { font-size: 20px; }
  .page-header p { font-size: 12px; max-width: none; line-height: 1.4; }
  .actions { width: 100%; }
  .actions .btn { flex: 1; justify-content: center; }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }
  #page-dashboard { --dash-gutter: 14px; }
  #dash-stats.stats-grid { margin-bottom: 12px; }
  .tf-sku-panel { padding-left: 14px; }
  .tf-toolbar input { max-width: none; }
  .stat-card {
    padding: 14px 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: transform var(--press-duration) var(--ease-out), background-color var(--press-duration) ease;
  }
  .stat-card:active { background: var(--surface2); transform: scale(0.985); }
  #dash-stats .dash-stats-track .stat-card:hover,
  #dash-stats .dash-stats-track .stat-card:active,
  #dash-stats .dash-stats-track .stat-card:focus {
    background: var(--surface);
    transform: none;
  }
  .stat-chevron { display: inline-block; }
  .stat-card.open .stat-chevron { transform: rotate(180deg); }
  .stat-details {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .stat-card.open .stat-details { display: block; }
  .stat-value { font-size: 22px; }
  .stat-pcs { font-size: 14px; }
  .stat-check { font-size: 12px; }
  .stat-econ { margin-top: 10px; }
  .stat-econ-v { font-size: 14px; }
  .stat-mp-list { margin-top: 8px; }

  .card {
    margin-bottom: 12px; border-radius: 10px;
    min-width: 0; max-width: 100%;
    overflow: hidden;
  }
  .card-header {
    padding: 12px 12px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    min-width: 0;
  }
  .card-body {
    padding: 12px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .chart-tabs, .orders-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
    margin: 0 -2px;
  }
  .chart-tabs::-webkit-scrollbar,
  .orders-tabs::-webkit-scrollbar { display: none; }
  .chart-tabs button, .orders-tabs button {
    padding: 10px 12px;
    font-size: 13px;
  }

  .chart-tools, .orders-updated {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .chart-tools select {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    font-size: 14px;
  }
  .chart-layout { grid-template-columns: 1fr; }
  .chart-wrap { height: 220px; }
  .top-articles {
    min-height: 0;
    overflow: visible;
  }
  #top-articles-list {
    flex: none;
    justify-content: flex-start;
    overflow: visible;
    gap: 0;
  }
  .top-row {
    flex: none;
    min-height: auto;
    padding: 10px 0;
  }
  .top-row img, .top-row .ph {
    width: 40px; height: 53px;
  }

  .orders-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
  }
  .order-card {
    padding: 10px;
    gap: 10px;
    width: 100%;
  }
  .order-card .title { font-size: 13px; }
  .order-card .meta { font-size: 11px; }
  .order-card .row2 { gap: 6px 8px; margin-top: 6px; }
  .order-card .article { max-width: 140px; }
  .order-card .badge-st { max-width: 160px; }

  .filters { flex-direction: column; gap: 8px; }
  .filters input, .filters select { width: 100%; min-width: 0 !important; }
  .filters label { width: 100%; }

  .table-scroll { margin: 0 -12px; padding: 0 12px; }
  table { min-width: 560px; }

  .toast {
    left: max(12px, env(safe-area-inset-left));
    right: max(12px, env(safe-area-inset-right));
    max-width: none;
  }
  .stock-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stock-mp { grid-template-columns: 1fr; }
  .stock-card { grid-template-columns: 56px 1fr; padding: 12px; }
  .stock-card img, .stock-card .ph { width: 56px; height: 75px; }
}

@media (max-width: 430px) {
  .login-card { padding: 32px 22px; }
  .stat-value { font-size: 22px; word-break: break-word; }
  .page-header p { display: none; }
  .chart-wrap { height: 200px; }
  .sidebar-nav .nav-item .icon { display: none; }
}

/* multi-page nav links */
a.nav-item { text-decoration: none; color: inherit; }
a.sidebar-logo { text-decoration: none; color: inherit; cursor: pointer; display: flex; }

/* ── Закупки ── */
.po-list { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.po-row {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  width: 100%; text-align: left; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); cursor: pointer; font: inherit;
  transition:
    border-color var(--press-duration) ease,
    background-color var(--press-duration) ease,
    transform var(--press-duration) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .po-row:hover { border-color: var(--accent); background: var(--surface2); }
}
.po-row:active { transform: scale(0.985); }
.po-row.incomplete { border-color: rgba(210, 153, 34, .45); }
.po-row.incomplete:hover { border-color: rgba(210, 153, 34, .75); }
.po-row.ready { border-color: rgba(46, 160, 67, .35); }
.po-row.closed { border-color: rgba(88, 166, 255, .35); }
.po-row-main { flex: 1; min-width: 160px; }
.po-row-num {
  font-weight: 700; font-size: 16px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.po-row-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 12px; color: var(--text-muted); }
.po-miss {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  margin-top: 8px;
}
.po-miss-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: rgba(210, 153, 34, .25); color: #e3b341; font-size: 11px; font-weight: 700;
}
.po-miss-chip {
  font-size: 11px; padding: 2px 7px; border-radius: 4px;
  background: rgba(210, 153, 34, .12); color: #e3b341; border: 1px solid rgba(210, 153, 34, .28);
}
.po-miss-chip.ok {
  background: rgba(46, 160, 67, .12); color: var(--accent-light);
  border-color: rgba(46, 160, 67, .28);
}
.po-miss.ok { margin-top: 8px; }
.po-stat-miss strong { color: #e3b341; }
.ads-stat-card .stat-value { font-size: 24px; }
#ads-kpis.stats-grid {
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 1200px) {
  #ads-kpis.stats-grid { grid-template-columns: 1fr 1fr; }
}
/* Проблемы — компактно, не баннер на весь экран (см. docs/ui.md) */
.ads-alerts {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.ads-alerts-head {
  font-size: 12px; font-weight: 650; margin-bottom: 6px; color: var(--text-muted);
}
.ads-alerts-list { display: grid; gap: 4px; }
.ads-alerts .ads-alert-item {
  padding: 6px 8px;
  font-size: 12px;
}
.ads-plan {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
.ads-plan-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ads-plan-title { font-size: 14px; font-weight: 650; }
.ads-plan-sub { font-size: 12px; margin-top: 2px; }
.ads-plan-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ads-plan-actions .btn.active {
  border-color: var(--accent, #c4f542);
  color: var(--accent, #c4f542);
}
.ads-plan-body { display: grid; gap: 8px; }
.ads-plan-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.ads-plan-item.is-accepted { border-color: rgba(61, 139, 90, .45); }
.ads-plan-item.is-rejected { opacity: .7; }
.ads-plan-item.is-done { border-color: rgba(61, 139, 90, .55); background: rgba(61, 139, 90, .06); }
.ads-plan-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.ads-plan-item-title { font-size: 13px; font-weight: 650; }
.ads-plan-item-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.ads-plan-item-reason { font-size: 12px; line-height: 1.4; }
.ads-plan-item-action { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.ads-plan-item-clusters {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}
.ads-plan-item-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.ads-plan-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.ads-plan-badge.proposed { color: #d29922; border-color: rgba(210,153,34,.45); }
.ads-plan-badge.accepted { color: #3d8b5a; border-color: rgba(61,139,90,.45); }
.ads-plan-badge.rejected { color: #8b949e; }
.ads-plan-badge.done { color: #58a6ff; border-color: rgba(88,166,255,.4); }
.ads-cluster-insights {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(210, 153, 34, .05);
  font-size: 12px;
  line-height: 1.4;
}
.ads-cluster-insights-actions { font-weight: 550; }
.ads-cluster-insights-block { margin-top: 6px; color: var(--text-muted); }
tr.ads-cluster-weak td { background: rgba(210, 153, 34, .06); }
tr.ads-cluster-good td { background: rgba(61, 139, 90, .05); }
.ads-alert-item {
  display: block; width: 100%; text-align: left;
  font: inherit; cursor: pointer;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.ads-alert-item:hover { border-color: var(--accent, #c4f542); }
.ads-alert-item.danger {
  border-color: rgba(248, 81, 73, .4);
  background: rgba(248, 81, 73, .08);
}
.ads-alert-item.warn {
  border-color: rgba(210, 153, 34, .4);
  background: rgba(210, 153, 34, .08);
}
.ads-alert-item.info {
  border-color: rgba(210, 190, 60, .35);
  background: rgba(210, 190, 60, .06);
}
.ads-alert-title { font-size: 13px; font-weight: 650; margin-bottom: 4px; }
.ads-alert-reason { font-size: 12px; color: var(--text); line-height: 1.4; }
.ads-alert-action { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.ads-alert-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
  background: #e3b341;
}
.ads-alert-dot.danger { background: #f85149; }
.ads-alert-dot.info { background: #d4b84a; }
.ads-row-alert td { background: rgba(210, 153, 34, .04); }
.ads-row-optimize td { background: rgba(248, 81, 73, .05); }
.ads-eval-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.ads-eval-badge.ads-eval-collecting {
  border-color: rgba(210, 190, 60, .45);
  background: rgba(210, 190, 60, .1);
  color: #d4b84a;
}
.ads-eval-badge.ads-eval-watch {
  border-color: rgba(210, 153, 34, .45);
  background: rgba(210, 153, 34, .12);
  color: #e3b341;
}
.ads-eval-badge.ads-eval-effective {
  border-color: rgba(61, 139, 90, .45);
  background: rgba(61, 139, 90, .12);
  color: #3fb950;
}
.ads-eval-badge.ads-eval-optimize {
  border-color: rgba(248, 81, 73, .45);
  background: rgba(248, 81, 73, .12);
  color: #f85149;
}
.ads-eval-card {
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.ads-eval-card.ads-eval-collecting { border-color: rgba(210, 190, 60, .35); }
.ads-eval-card.ads-eval-watch { border-color: rgba(210, 153, 34, .4); background: rgba(210, 153, 34, .06); }
.ads-eval-card.ads-eval-effective { border-color: rgba(61, 139, 90, .35); background: rgba(61, 139, 90, .05); }
.ads-eval-card.ads-eval-optimize { border-color: rgba(248, 81, 73, .4); background: rgba(248, 81, 73, .06); }
.ads-eval-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.ads-eval-hero-num { font-size: 1.75rem; font-weight: 750; line-height: 1.1; }
.ads-eval-hero-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; margin-bottom: 10px; }
.ads-eval-lines { font-size: 13px; line-height: 1.5; display: grid; gap: 4px; }
.ads-conf {
  display: inline-block;
  font-size: 11px;
  font-weight: 650;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.ads-conf-low { color: #8b949e; }
.ads-conf-medium { color: #e3b341; border-color: rgba(210, 153, 34, .4); }
.ads-conf-high { color: #3fb950; border-color: rgba(61, 139, 90, .4); }
.wh-num.warn { color: #e3b341; }
.wh-num.pos, .stat-value.pos { color: var(--accent-light, #3fb950); }
.wh-num.neg, .stat-value.neg { color: #f85149; }
.ads-unit-kpis { margin-top: 10px; }
.ads-funds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 2px;
}
.ads-fund-col { min-width: 0; }
.ads-fund-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  letter-spacing: .02em;
}
.ads-orders-sum {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.25;
}
.ads-toolbar {
  margin: 4px 0 14px;
}
.ads-toolbar #ads-period {
  min-width: 120px;
  max-width: 140px;
}
.ads-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
}
.ads-check input { accent-color: var(--accent); }
#ads-table .ads-row { cursor: pointer; }
#ads-table .ads-row:hover td { background: rgba(35, 134, 54, 0.06); }
#ads-table .ads-row-sel td { background: rgba(35, 134, 54, 0.12); }
#ads-table td {
  vertical-align: middle;
}
#ads-table .ads-camp-cell { min-width: 260px; }
.ads-camp-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ads-nm-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ads-nm-title {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
}
.ads-nm-cell .badge-st {
  margin-left: 6px;
  vertical-align: middle;
}
.ads-nm-sep td {
  padding-top: 10px;
  padding-bottom: 2px;
  border-top: 1px solid var(--border);
}
.ads-nm-sep-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.ads-nm-toggle-row td {
  padding-top: 8px;
  padding-bottom: 8px;
  border-top: 1px solid var(--border);
}
.ads-nm-total td {
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.ads-nm-orders-all {
  color: var(--accent-light, #3fb950) !important;
  background: rgba(63, 185, 80, .08);
  font-weight: 600;
}
th.ads-nm-orders-all {
  color: var(--accent-light, #3fb950) !important;
  font-weight: 600;
}
.ads-nm-assoc .ads-camp-name { font-weight: 500; }
.ads-camp-bids {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ads-camp-bid-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.ads-thumb {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: block;
  flex-shrink: 0;
}
.ads-thumb.ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
}
.ads-camp-text { min-width: 0; }
.ads-camp-name {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
}
.ads-camp-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.ads-actions-cell {
  width: 1%;
  white-space: nowrap;
  vertical-align: middle !important;
}
.ads-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.ads-actions .btn {
  flex-shrink: 0;
}
.ads-ico {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
}
.ads-btn-start:hover {
  border-color: rgba(46, 160, 67, 0.55);
  color: var(--accent-light);
  background: rgba(46, 160, 67, 0.12);
}
.ads-btn-pause:hover {
  border-color: rgba(210, 153, 34, 0.65);
  color: #e3b341;
  background: rgba(210, 153, 34, 0.14);
}
.ads-btn-stop:hover {
  border-color: rgba(218, 54, 51, 0.65);
  color: #ff7b72;
  background: rgba(218, 54, 51, 0.14);
}
.ads-detail { margin-top: 0; }
.ads-detail > .card-body { padding-top: 18px; }
.ads-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 16px;
}
.ads-detail-head h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}
.ads-detail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.ads-detail-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.ads-detail-kpi {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ads-detail-kpi strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ads-detail-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
}
.ads-bid-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}
.ads-bid-row label {
  min-width: 42px;
  color: var(--text-muted);
}
.ads-bid-row input {
  width: 76px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.ads-cq-table .ads-cq-minus-th {
  text-align: center;
  width: 56px;
}
.ads-cq-bid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 72px;
}
.ads-cq-bid input {
  width: 76px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}
.ads-cq-min {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.2;
}
.ads-bid-src { font-size: 10px; }
.ads-cq-minus-cell { text-align: center; vertical-align: middle; }
.ads-cq-minus-lab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px;
}
.ads-cq-minus-lab input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #3d8b5a);
  cursor: pointer;
}
.ads-minus-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.ads-minus-add input {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 420px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
}
tr.ads-cluster-minus td { background: rgba(125, 133, 144, .06); }
.ads-minus-list { display: flex; flex-direction: column; gap: 10px; }
.ads-minus-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.ads-minus-block textarea {
  width: 100%;
  max-width: 560px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  resize: vertical;
}
.ads-back {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 8px;
}
.ads-back:hover { color: var(--accent-light); }
.ads-detail-title-wrap {
  display: block;
  width: fit-content;
  max-width: 100%;
}
.ads-detail-title-view {
  display: inline;
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  max-width: 100%;
}
.ads-detail-title-view[hidden] { display: none !important; }
.ads-detail-title-view #ads-detail-title {
  display: inline;
}
.ads-rename-pen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35em;
  height: 1.35em;
  margin-left: 0.55em;
  padding: 0;
  vertical-align: -0.18em;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.ads-rename-pen svg {
  width: 16px;
  height: 16px;
}
.ads-rename-pen[hidden] { display: none !important; }
.ads-rename-pen:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}
.ads-detail-title-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}
.ads-detail-title-edit[hidden] { display: none !important; }
.ads-detail-title-edit input {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 520px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}
.ads-detail-sub {
  margin-top: 4px !important;
  max-width: 64ch !important;
}
.ads-detail-top {
  margin-bottom: 14px;
}
.ads-detail-top .ads-detail-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ads-detail-card { margin-bottom: 14px; }
.ads-empty-hint {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: rgba(255,255,255,0.02);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
@media (max-width: 1100px) {
  .ads-detail-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .ads-detail-kpis { grid-template-columns: 1fr 1fr; }
  .ads-toolbar .ads-create-btn { margin-left: 0; width: 100%; justify-content: center; }
}
@media (max-width: 560px) {
  .ads-funds { grid-template-columns: 1fr; gap: 10px; }
  .ads-detail-kpis { grid-template-columns: 1fr 1fr; }
  .ads-orders-sum { font-size: 15px; }
}

.dev-tag {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(210, 153, 34, .55);
  background: rgba(210, 153, 34, .14);
  color: #e3b341;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.2;
  position: relative;
  top: -2px;
}
.dev-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(210, 153, 34, .1);
  border: 1px solid rgba(210, 153, 34, .45);
  color: #e3b341;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
}
.dev-banner strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #e3b341;
}
.dev-banner span {
  font-weight: 500;
  color: #d2b46a;
  opacity: 1;
}
@media (max-width: 900px) {
  .dev-banner { padding: 9px 12px; font-size: 11px; }
  .dev-banner strong { font-size: 11px; display: block; width: 100%; }
}

.po-miss-banner.ok {
  background: rgba(46, 160, 67, .1); border-color: rgba(46, 160, 67, .3); color: var(--accent-light);
}
.po-field-miss input, .po-field-miss select {
  border-color: rgba(210, 153, 34, .55) !important;
  box-shadow: 0 0 0 1px rgba(210, 153, 34, .15);
}
.po-field-miss { color: #e3b341; }
.po-weight { color: var(--text); }
.po-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: rgba(255,255,255,.06); color: var(--text-muted);
}
.po-status.active { background: rgba(210, 153, 34, .15); color: #e3b341; }
.po-status.closed { background: rgba(88, 166, 255, .15); color: #58a6ff; }
.po-type {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  margin-left: 6px;
}
.po-type.china { background: rgba(163, 113, 247, .15); color: #d2a8ff; }
.po-type.local { background: rgba(46, 160, 67, .15); color: #3fb950; }
.po-status-bar { display: flex; align-items: center; gap: 10px; min-height: 36px; flex-wrap: wrap; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.po-stats-hint {
  margin: 0; font-size: 12px; color: var(--text-muted); font-weight: 500;
}
.po-stats-wrap { padding: 0 0 8px; overflow-x: auto; }
.po-stats-table-wrap { min-width: 760px; padding: 0 12px 12px; }
.po-stats-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.po-stats-table th {
  text-align: center; padding: 10px 8px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: none; letter-spacing: 0;
  background: var(--surface2); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.po-stats-table td {
  text-align: center; padding: 9px 8px;
  border-bottom: 1px solid rgba(255,255,255,.04); color: var(--text);
}
.po-stats-table tbody tr {
  cursor: pointer; transition: background .12s;
}
.po-stats-table tbody tr:hover { background: var(--surface2); }
.po-stats-table tbody tr.closed td:first-child { color: #58a6ff; }
.po-stats-table td.num { font-weight: 700; }
.po-stats-table tbody tr.partial-row td {
  background: rgba(128,128,128,.12) !important;
  color: var(--text-muted);
}
.po-stats-table tbody tr.partial-row:hover td {
  background: rgba(128,128,128,.18) !important;
}
.po-stats-table td.pct { font-weight: 600; color: var(--accent-light); }
.po-stats-table td.pct.partial,
.po-stats-table tbody tr.partial-row td.pct.partial {
  color: #e3b341 !important;
  /* фон остаётся серым у строки, желтеют только цифры */
}
.po-stats-table tfoot td {
  font-weight: 700; border-top: 1px solid var(--border);
  background: var(--surface2); padding-top: 12px; padding-bottom: 12px;
}
.card-header .po-stats-hint { margin-top: 4px; }
.card-header { flex-wrap: wrap; align-items: flex-start; }
.card-header h3 { margin: 0; }
.po-row-stats {
  display: flex; flex-wrap: wrap; gap: 14px 18px; font-variant-numeric: tabular-nums;
}
.po-row-stats .lbl { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.po-row-stats strong { font-size: 13px; }
.po-row-stats .accent, .po-read.accent, .po-total-chip.accent strong { color: var(--accent-light); }

.po-detail-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.po-detail-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.po-head-card { margin-bottom: 14px; padding: 16px; }
.po-head-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.po-head-grid label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; color: var(--text-muted); font-weight: 600;
}
.po-head-grid input, .po-head-grid select {
  background-color: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 8px 10px; font-size: 13px; font: inherit;
}
.po-head-grid input:focus, .po-head-grid select:focus {
  outline: none; border-color: var(--accent);
}
.po-span-2 { grid-column: span 2; }
.po-totals {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-top: 12px; border-top: 1px solid var(--border);
}
.po-total-chip {
  flex: 1; min-width: 140px; padding: 10px 12px;
  background: var(--bg); border-radius: 8px; border: 1px solid var(--border);
}
.po-total-chip span { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.po-total-chip strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.po-total-chip small { display: block; margin-top: 3px; font-size: 11px; color: var(--text-muted); }
.po-total-chip.deal-good {
  border-color: rgba(46, 160, 67, .35);
  background: rgba(46, 160, 67, .08);
}
.po-total-chip.deal-good small { color: #3fb950; }
.po-total-chip.deal-bad {
  border-color: rgba(248, 81, 73, .35);
  background: rgba(248, 81, 73, .08);
}
.po-total-chip.deal-bad small { color: #f85149; }
.po-total-chip.muted { opacity: .75; }

.po-lines-wrap { padding: 0 0 8px; overflow-x: auto; }
.po-col-toggles {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px 12px 4px;
}
.po-col-toggles-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600; margin-right: 4px;
}
.po-col-tog {
  font: inherit; font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}
.po-col-tog:hover { color: var(--text); border-color: var(--text-muted); }
.po-col-tog.on { color: var(--text); }
.po-col-tog[data-group="order"].on {
  border-color: #6cb6ff; background: rgba(88, 166, 255, .15); color: #79b8ff;
}
.po-col-tog[data-group="cargo"].on {
  border-color: #d2a8ff; background: rgba(163, 113, 247, .15); color: #d2a8ff;
}
.po-col-tog[data-group="defect"].on {
  border-color: #e3b341; background: rgba(210, 153, 34, .15); color: #e3b341;
}
.po-col-tog[data-group="pack"].on {
  border-color: #3fb950; background: rgba(46, 160, 67, .15); color: #3fb950;
}
.po-col-tog[data-group="prod"].on {
  border-color: #f778ba; background: rgba(219, 97, 162, .15); color: #f778ba;
}

/* Цвета заголовков и ячеек групп */
.po-lines-head .po-g-order { color: #79b8ff; }
.po-lines-head .po-g-cargo { color: #d2a8ff; }
.po-lines-head .po-g-defect { color: #e3b341; }
.po-lines-head .po-g-pack { color: #3fb950; }
.po-lines-head .po-g-prod { color: #f778ba; }

.po-line-row .po-g-order,
.po-read.po-g-order {
  color: #9ecbff;
  background: rgba(88, 166, 255, .06);
  border-radius: 4px; padding: 4px 6px;
}
.po-line-row .po-g-cargo,
.po-read.po-g-cargo {
  color: #d2a8ff;
  background: rgba(163, 113, 247, .07);
  border-radius: 4px; padding: 4px 6px;
}
.po-line-row .po-g-defect,
.po-read.po-g-defect {
  color: #e3b341;
  background: rgba(210, 153, 34, .08);
  border-radius: 4px; padding: 4px 6px;
}
.po-inp.po-g-pack {
  color: #3fb950;
  background: rgba(46, 160, 67, .08);
  border-color: rgba(46, 160, 67, .2);
}
.po-line-row .po-g-pack,
.po-read.po-g-pack {
  color: #3fb950;
  background: rgba(46, 160, 67, .08);
  border-radius: 4px; padding: 4px 6px;
}
.po-inp.po-g-prod {
  color: #f778ba;
  background: rgba(219, 97, 162, .08);
  border-color: rgba(219, 97, 162, .2);
}
.po-line-row .po-g-prod,
.po-read.po-g-prod {
  color: #f778ba;
  background: rgba(219, 97, 162, .08);
  border-radius: 4px; padding: 4px 6px;
}

.po-lines-table { padding: 0 12px 12px; }
.po-lines-head, .po-line-row {
  display: grid;
  grid-template-columns: var(--po-cols);
  gap: 6px; align-items: center;
}
.po-lines-head {
  padding: 8px 0; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .03em; color: var(--text-muted); border-bottom: 1px solid var(--border);
  text-align: center;
}
.po-lines-head > span {
  text-align: center;
  justify-self: center;
  width: 100%;
}
.po-line-row { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.po-line-photo {
  width: 36px; height: 48px; object-fit: cover; border-radius: 5px;
  background: var(--bg); border: 1px solid var(--border); display: block;
  justify-self: center;
}
.po-line-photo.ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-muted); width: 36px; height: 48px;
}
.po-line-sku {
  text-align: center;
}
.po-line-sku strong { display: block; font-size: 13px; text-align: center; }
.po-line-sub {
  display: block; font-size: 10px; color: var(--text-muted);
  margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.po-kind {
  display: inline-block; margin-top: 2px; font-size: 10px; font-weight: 600;
  letter-spacing: .02em; text-transform: lowercase; opacity: .85;
}
.po-kind-prod { color: #7eb8ff; }
.po-kind-mat { color: #c9a66b; }
.po-read.muted { opacity: .45; }
.po-line-size {
  font-size: 13px; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums;
}
.po-inp {
  width: 100%; background: var(--bg); border: 1px solid transparent; color: var(--text);
  border-radius: 6px; padding: 6px 7px; font-size: 13px; font-variant-numeric: tabular-nums;
  text-align: center; font: inherit;
}
.po-inp:hover, .po-inp:focus { border-color: var(--border); outline: none; background: var(--surface); }
.po-read {
  text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-muted);
}
.po-read strong { color: var(--accent-light); font-size: 13px; }
.po-line-row .icon-btn { justify-self: center; }
.icon-btn.danger { color: var(--danger); border-color: transparent; background: transparent; font-size: 18px; }

.po-add-panel {
  margin: 12px; padding: 14px; border: 1px dashed var(--border); border-radius: 10px;
  background: var(--surface2);
}
.po-add-grid {
  display: grid; grid-template-columns: 1.4fr 0.8fr 110px 110px; gap: 10px; align-items: end;
  position: relative;
}
.po-add-grid label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 11px; color: var(--text-muted); font-weight: 600;
  position: relative;
}
.po-add-grid input, .po-add-grid select {
  background-color: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 13px;
  width: 100%;
}
.po-add-nom { position: relative; }
.po-add-actions {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.po-add-picked { flex: 1; font-size: 13px; color: var(--text-muted); }
.po-sku-results {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  max-height: 240px; overflow: auto; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.po-sku-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border: none; background: transparent; color: var(--text);
  cursor: pointer; text-align: left; font: inherit;
}
.po-sku-item:hover { background: var(--surface2); }
.po-sku-item img, .po-sku-item .ph {
  width: 32px; height: 42px; object-fit: cover; border-radius: 4px; background: var(--bg); flex-shrink: 0;
}
.po-sku-item strong { display: block; font-size: 13px; }
.po-sku-item small { font-size: 11px; color: var(--text-muted); }
.po-sku-empty { padding: 12px; font-size: 13px; color: var(--text-muted); }

@media (max-width: 720px) {
  .po-add-grid { grid-template-columns: 1fr 1fr; }
  .po-span-2 { grid-column: span 2; }
  .po-row-stats { width: 100%; }
}

/* —— Справка юнит-экономики —— */
.ue-guide {
  width: min(980px, 100%);
  height: 100%;
  max-height: 100dvh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  box-shadow: 0 0 80px rgba(0,0,0,.5);
}
.ue-guide-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #161b22 0%, var(--bg) 100%);
  flex-shrink: 0;
}
.ue-guide-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-light); margin: 0 0 4px;
}
.ue-guide-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ue-guide-layout {
  display: grid;
  grid-template-columns: 168px 1fr;
  min-height: 0; flex: 1;
}
.ue-guide-nav {
  border-right: 1px solid var(--border);
  padding: 12px 8px;
  overflow-y: auto;
  background: var(--surface);
}
.ue-guide-nav button {
  display: block; width: 100%; text-align: left;
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 8px 10px; margin-bottom: 2px;
  border: none; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--text-muted);
}
.ue-guide-nav button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.ue-guide-nav button.on {
  color: var(--text);
  background: rgba(46, 160, 67, .16);
  box-shadow: inset 3px 0 0 var(--accent-light);
}
.ue-guide-body {
  overflow-y: auto;
  padding: 8px 22px 40px;
  scroll-behavior: smooth;
}
.ue-g-sec { padding: 20px 0 8px; border-bottom: 1px solid rgba(48,54,61,.7); }
.ue-g-sec:last-child { border-bottom: none; }
.ue-g-sec h3 {
  font-size: 17px; font-weight: 700; margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ue-g-sec p { font-size: 14px; line-height: 1.55; color: var(--text); margin: 0 0 10px; }
.ue-g-sec p em { color: #c9d1d9; font-style: normal; border-bottom: 1px dashed var(--border); }
.ue-g-callout {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(35, 134, 54, .12);
  border: 1px solid rgba(46, 160, 67, .28);
  font-size: 13px; line-height: 1.5; color: #aff5b4;
}
.ue-g-glossary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ue-g-glossary article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.ue-g-glossary h4 {
  margin: 0 0 6px; font-size: 13px; font-weight: 700;
  color: var(--accent-light);
}
.ue-g-glossary p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-muted); }
.ue-g-glossary p strong { color: var(--text); font-weight: 600; }

.ue-g-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ue-g-steps li {
  display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px;
}
.ue-g-steps .n {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
  background: rgba(46, 160, 67, .18); color: #3fb950;
}
.ue-g-steps strong { display: block; font-size: 14px; margin-bottom: 4px; }
.ue-g-steps code {
  display: block; font-size: 12.5px; color: #e6edf3;
  background: rgba(255,255,255,.04); border-radius: 6px;
  padding: 6px 8px; margin: 4px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ue-g-steps small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.ue-g-example {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.ue-g-ex-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.ue-g-ex-grid > div {
  background: var(--bg);
  border-radius: 10px;
  padding: 10px;
}
.ue-g-ex-grid span { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.ue-g-ex-grid b { font-size: 14px; font-weight: 700; }
.ue-g-ex-flow { display: flex; flex-direction: column; gap: 4px; }
.ue-g-ex-flow .row {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,.03);
  font-size: 13px;
}
.ue-g-ex-flow .row span { color: var(--text-muted); }
.ue-g-ex-flow .row.hi {
  background: rgba(26, 127, 55, .18);
  border: 1px solid rgba(46, 160, 67, .35);
}
.ue-g-ex-flow .row.hi b { color: #3fb950; font-size: 14px; }
.ue-g-note {
  margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-muted);
}

.ue-g-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px;
}
.ue-g-pill.wb { background: rgba(203,17,171,.18); color: #f0a0e0; }
.ue-g-pill.oz { background: rgba(0,91,255,.2); color: #79b8ff; }
.ue-g-pill.ym { background: rgba(240,193,75,.18); color: #f0c14b; }

.page-guide-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-guide-lib-link {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}
.page-guide-lib-link:hover {
  color: var(--accent-light);
  background: rgba(255,255,255,.04);
}

/* Страница /guides */
.guides-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 16px;
  min-height: calc(100vh - 120px);
  align-items: start;
}
.guides-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 12px;
}
.guides-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.guides-card:hover { border-color: rgba(255,255,255,.16); background: var(--surface2); }
.guides-card.on {
  border-color: rgba(63,185,80,.45);
  box-shadow: inset 3px 0 0 #3fb950;
}
.guides-card-icon { font-size: 18px; line-height: 1.2; flex-shrink: 0; }
.guides-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.guides-card-body strong { font-size: 14px; font-weight: 650; }
.guides-card-body span { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.guides-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  min-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.guides-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}
.guides-panel-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.guides-panel-blurb { margin: 6px 0 0; font-size: 13px; }
.guides-panel-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.guides-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.guides-toc[hidden] { display: none !important; }
.guides-toc a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}
.guides-toc a:hover { color: var(--accent-light); }
.guides-panel-body {
  padding: 8px 20px 28px;
  overflow: auto;
  max-height: calc(100vh - 220px);
}
@media (max-width: 900px) {
  .guides-layout { grid-template-columns: 1fr; }
  .guides-list { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .guides-card { min-width: 220px; }
  .guides-panel-body { max-height: none; }
}

.ue-g-formula-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ue-g-formula-card.big { padding: 16px; }
.ue-g-formula-card .lbl {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 6px;
}
.ue-g-formula-card code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px; color: #e6edf3;
}
.ue-g-formula-card small { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.ue-g-legend {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 12px; font-size: 12px; color: var(--text-muted);
}
.ue-g-legend b { color: var(--accent-light); }
.ue-g-mini-ex {
  margin-top: 10px; padding: 12px 14px; border-radius: 12px;
  background: rgba(88, 166, 255, .08); border: 1px solid rgba(88, 166, 255, .22);
}
.ue-g-mini-ex p { margin: 0 0 6px; font-size: 13px; color: #9ecbff; }
.ue-g-mini-ex code {
  display: block; margin: 8px 0; padding: 8px 10px; border-radius: 8px;
  background: rgba(0,0,0,.25); color: #e6edf3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
}

.ue-g-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  margin: 8px 0 4px;
}
.ue-g-table th, .ue-g-table td {
  text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--border);
}
.ue-g-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.ue-g-table td:last-child { color: var(--text-muted); }
.src {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-right: 6px;
  vertical-align: 1px;
}
.src.api { background: rgba(163,113,247,.2); color: #d2a8ff; }
.src.buy { background: rgba(248,81,73,.15); color: #ff7b72; }
.src.hand { background: rgba(210,153,34,.18); color: #e3b341; }
.src.const { background: rgba(125,133,144,.2); color: #c9d1d9; }

.ue-g-sources {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.ue-g-sources .box {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.ue-g-sources h4 { margin: 0 0 10px; font-size: 13px; }
.ue-g-sources ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.ue-g-sources .hint { margin: 10px 0 0; font-size: 11px; color: var(--accent-light); }

.ue-g-faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 0; margin-bottom: 8px; overflow: hidden;
}
.ue-g-faq summary {
  cursor: pointer; list-style: none; padding: 12px 14px;
  font-size: 13px; font-weight: 650; color: var(--text);
}
.ue-g-faq summary::-webkit-details-marker { display: none; }
.ue-g-faq details[open] summary { border-bottom: 1px solid var(--border); }
.ue-g-faq details p {
  margin: 0; padding: 12px 14px 14px; font-size: 13px; line-height: 1.5; color: var(--text-muted);
}

@media (max-width: 820px) {
  .ue-guide-layout { grid-template-columns: 1fr; }
  .ue-guide-nav {
    display: flex; gap: 4px; overflow-x: auto; border-right: none;
    border-bottom: 1px solid var(--border); padding: 8px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .ue-guide-nav button { width: auto; white-space: nowrap; flex-shrink: 0; }
  .ue-guide-nav button.on { box-shadow: none; }
  .ue-g-glossary, .ue-g-ex-grid, .ue-g-sources, .ue-g-legend { grid-template-columns: 1fr; }
  .ue-guide-body { padding: 8px 14px 32px; }
  .ue-guide-head { padding: 14px 14px 12px; }
  .ue-guide-head h2 { font-size: 18px; }
}

/* —— Акции —— */
.promo-rule-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(46, 160, 67, .1);
  border: 1px solid rgba(46, 160, 67, .25);
}
.promo-rule-main { min-width: 0; }
.promo-rule-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.promo-rule-hint {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}
.promo-rule-bar .btn { flex-shrink: 0; text-decoration: none; }
.promo-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px;
}
.promo-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; cursor: pointer;
  transition:
    border-color var(--press-duration) ease,
    transform var(--press-duration) var(--ease-out);
  position: relative; overflow: hidden;
}
@media (hover: hover) and (pointer: fine) {
  .promo-card:hover { border-color: var(--text-muted); transform: translateY(-1px); }
}
.promo-card:active { transform: scale(0.985); }
.promo-card.ended { opacity: .55; }
.promo-card.wb-auto {
  border-color: rgba(125,133,144,.4);
  background: rgba(110,118,129,.08);
}
@media (hover: hover) and (pointer: fine) {
  .promo-card.wb-auto:hover { transform: none; border-color: rgba(125,133,144,.55); }
}
.promo-card.wb-auto .promo-card-dim {
  filter: blur(2.2px) grayscale(.85);
  opacity: .55;
  user-select: none;
}
.promo-card-lock {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 18px; text-align: center;
  background: rgba(13,17,23,.72);
  pointer-events: none;
}
.promo-card-lock-title {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted);
  padding: 3px 10px; border-radius: 999px;
  background: rgba(125,133,144,.22); border: 1px solid rgba(125,133,144,.35);
}
.promo-card-lock-text {
  font-size: 12px; line-height: 1.4; color: var(--text);
  max-width: 240px;
}
.promo-badge.lk {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(125,133,144,.22); color: var(--text-muted);
}
.promo-badge.ended {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(125,133,144,.18); color: var(--text-muted);
}
.promo-wb-auto-lock {
  margin: 16px 0;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px dashed rgba(125,133,144,.45);
  background: rgba(110,118,129,.1);
  max-width: 560px;
}
.promo-wb-auto-lock strong {
  display: block; margin-bottom: 8px; font-size: 15px; color: var(--text);
}
.promo-wb-auto-lock p { margin: 0 0 8px; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.promo-wb-auto-lock p:last-child { margin-bottom: 0; }
.promo-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.promo-card h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
.promo-dates { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.promo-type { font-size: 11px; color: var(--text-muted); }
.promo-badge.on {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(46,160,67,.2); color: #3fb950;
}
.promo-stats { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; font-weight: 700; }
.promo-stats .st { padding: 2px 7px; border-radius: 6px; }
.promo-stats .join { background: rgba(46,160,67,.18); color: #3fb950; }
.promo-stats .leave { background: rgba(248,81,73,.15); color: #ff7b72; }
.promo-stats .keep { background: rgba(88,166,255,.12); color: #79b8ff; }
.promo-stats .skip { background: rgba(125,133,144,.15); color: var(--text-muted); }

.promo-detail-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px;
}
.promo-detail-head h2 { margin: 0; font-size: 18px; flex: 1; min-width: 160px; }
.promo-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px;
}
#sup-filter-tabs {
  align-items: stretch;
  row-gap: 8px;
}
#sup-filter-tabs .sup-tabs-main,
#sup-filter-tabs .sup-tabs-internal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
}
#sup-filter-tabs .sup-tab-sep {
  width: 1px;
  align-self: stretch;
  min-height: 32px;
  margin: 0 8px;
  background: var(--border);
  flex: 0 0 1px;
}
.promo-tab {
  font: inherit; font-size: 13px; font-weight: 650;
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); color: var(--text-muted);
}
.promo-tab:hover { color: var(--text); }
.promo-tab.active { color: var(--text); border-color: var(--text-muted); background: var(--surface2, var(--surface)); }
.promo-tab.join.active { border-color: #3fb950; color: #3fb950; background: rgba(46,160,67,.12); }
.promo-tab.leave.active { border-color: #ff7b72; color: #ff7b72; background: rgba(248,81,73,.1); }
.promo-tab.keep.active { border-color: #79b8ff; color: #79b8ff; background: rgba(88,166,255,.1); }
.promo-tab.draft {
  border-style: dashed;
  color: var(--text-muted);
}
.promo-tab.draft:hover { color: var(--text); border-color: var(--text-muted); }
.promo-tab.draft.active {
  border-style: dashed;
  border-color: #8b949e;
  color: #e6edf3;
  background: rgba(139, 148, 158, .16);
}
.promo-tab-n {
  display: inline-block; margin-left: 4px; font-size: 11px; opacity: .85;
  font-variant-numeric: tabular-nums;
}
.promo-tab-hint { margin: 0 0 8px; }
.promo-bulk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 0 8px;
}
.promo-bulk:empty { display: none; padding: 0; }
.promo-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}
.promo-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.promo-table th, .promo-table td {
  padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
  vertical-align: middle;
  background: var(--surface);
}
.promo-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.promo-table tr.dec-join td { background: rgba(46,160,67,.05); }
.promo-table tr.dec-leave td { background: rgba(248,81,73,.05); }
.promo-dec {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px;
}
.promo-dec.join { background: rgba(46,160,67,.2); color: #3fb950; }
.promo-dec.leave { background: rgba(248,81,73,.18); color: #ff7b72; }
.promo-dec.keep { background: rgba(88,166,255,.15); color: #79b8ff; }
.promo-dec.skip { background: rgba(125,133,144,.15); color: var(--text-muted); }
.promo-dec.unknown { background: rgba(210,153,34,.15); color: #e3b341; }
.promo-tariff { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.promo-tariff.warn { color: #e3b341; font-weight: 600; }
.promo-table .pos { color: #3fb950; font-weight: 700; }
.promo-table .neg { color: #f85149; font-weight: 700; }
.promo-dec-cell { min-width: 90px; }
/* Не ставить display:flex на td — ломает высоту строк таблицы */
.promo-row-act-cell {
  vertical-align: middle;
  text-align: right;
  min-width: 96px;
}
.promo-row-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  vertical-align: middle;
}
.promo-act-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--bg, #0d1117) !important;
  color: var(--text, #e6edf3) !important;
  border: 1px solid var(--border, #30363d) !important;
  box-shadow: none !important;
}
.promo-act-btn:hover {
  border-color: var(--text-muted, #8b949e) !important;
}
.promo-free-hint {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: normal;
  max-width: 220px;
  line-height: 1.25;
}
.promo-table tr:last-child td { border-bottom: none; }

.promo-history-wrap { margin-top: 4px; }
.promo-history-table { min-width: 720px; }
.promo-hist-when {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.promo-hist-src {
  font-size: 12px;
  font-weight: 600;
}
.promo-hist-src.autopilot { color: #3fb950; }
.promo-hist-src.manual { color: var(--text); }
.promo-hist-camp {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.promo-hist-ok { color: #3fb950; font-size: 12px; font-weight: 600; }
.promo-hist-err { color: #ff7b72; font-size: 12px; font-weight: 600; cursor: help; }

/* Автопилот — primary-кнопка тулбара: Вкл. зелёная / Выкл. красная */
.promo-auto-tog.off {
  border-color: rgba(248, 81, 73, 0.45);
  background: rgba(248, 81, 73, 0.14);
  color: #ff7b72;
}
.promo-auto-tog.off:hover {
  background: rgba(248, 81, 73, 0.22);
  border-color: rgba(248, 81, 73, 0.65);
}
.promo-auto-tog.on {
  border-color: rgba(63, 185, 80, 0.45);
  background: rgba(63, 185, 80, 0.14);
  color: var(--accent-light, #3fb950);
}
.promo-auto-tog.on:hover {
  background: rgba(63, 185, 80, 0.22);
  border-color: rgba(63, 185, 80, 0.65);
}
.promo-auto-on { color: #3fb950; }
.promo-howto {
  margin: 0 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.promo-howto summary {
  cursor: pointer; padding: 10px 14px; font-size: 13px; font-weight: 650; list-style: none;
}
.promo-howto summary::-webkit-details-marker { display: none; }
.promo-howto-body {
  padding: 0 14px 14px; font-size: 13px; line-height: 1.5; color: var(--text-muted);
}
.promo-howto-body p { margin: 0 0 8px; }
.promo-howto-body strong { color: var(--text); }
.promo-auto-label {
  display: flex; align-items: center; gap: 8px; font-weight: 650; cursor: pointer;
}
.promo-auto-label input {
  width: 16px; height: 16px; accent-color: var(--accent);
  -webkit-appearance: checkbox; appearance: checkbox;
  margin: 0; padding: 0; flex-shrink: 0;
}

.promo-badge.off {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 7px; border-radius: 999px;
  background: rgba(248,81,73,.15); color: #ff7b72;
}
.promo-wb-counts { font-size: 12px; color: var(--text-muted); margin: -4px 0 8px; }
/* Вид Карточки/Лента — слева от разделителя у Автопилота, стиль как ₽/шт */
.promo-view-seg { flex-shrink: 0; }
.promo-view-seg button { padding: 6px 12px; font-size: 12px; }
.ue-toolbar .promo-view-seg + .ue-toolbar-primary { margin-left: 0; }

/* —— Лента акций (Gantt) —— */
.promo-tape-wrap {
  overflow-x: auto; overflow-y: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding-bottom: 8px;
}
.promo-tape { min-width: 100%; }
.promo-tape-months {
  display: flex; position: sticky; top: 0; z-index: 2;
  background: var(--surface);
  box-shadow: 0 12px 14px -12px rgba(0, 0, 0, .55);
}
.promo-tape-month {
  flex-shrink: 0; padding: 8px 10px; font-size: 12px; font-weight: 700;
  border-right: 1px solid var(--border); color: var(--text);
  box-sizing: border-box;
}
.promo-tape-days { display: flex; border-bottom: 1px solid var(--border); }
.promo-tape-day {
  flex-shrink: 0; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 0; border-right: 1px solid rgba(255,255,255,.04);
  font-size: 10px; color: var(--text-muted); min-height: 36px;
}
.promo-tape-day .wd { opacity: .7; font-size: 9px; }
.promo-tape-day .dn { font-weight: 700; font-size: 11px; color: var(--text); }
.promo-tape-day.weekend { background: rgba(255,255,255,.02); }
.promo-tape-day.today .dn { color: #c084fc; }
.promo-tape-body { position: relative; padding: 10px 0 14px; min-height: 80px; }
.promo-tape-today {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #a855f7;
  z-index: 3; pointer-events: none; box-shadow: 0 0 8px rgba(168,85,247,.45);
}
.promo-tape-row {
  position: relative; height: 52px; margin: 0 0 8px;
}
.promo-tape-bar {
  position: absolute; top: 0; height: 48px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; border: none; cursor: pointer; text-align: left;
  border-radius: 10px; overflow: hidden;
  background: rgba(251, 146, 60, .18); border: 1px solid rgba(251, 146, 60, .35);
  color: var(--text);
  transition: filter var(--press-duration) ease, transform var(--press-duration) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .promo-tape-bar:hover { filter: brightness(1.08); transform: translateY(-1px); }
}
.promo-tape-bar:active { transform: scale(0.98); }
.promo-tape-bar.mp-oz {
  background: rgba(88,166,255,.14); border-color: rgba(88,166,255,.35);
}
.promo-tape-bar.mp-ym {
  background: rgba(252,198,0,.14); border-color: rgba(240,193,75,.4);
}
.promo-tape-bar.mp-wb.in {
  background: rgba(46,160,67,.16); border-color: rgba(46,160,67,.4);
}
.promo-tape-bar.ended { opacity: .45; }
.promo-tape-bar.wb-auto {
  background: rgba(110,118,129,.14) !important;
  border-color: rgba(125,133,144,.4) !important;
  filter: grayscale(1) blur(.7px);
  opacity: .72;
}
@media (hover: hover) and (pointer: fine) {
  .promo-tape-bar.wb-auto:hover {
    filter: grayscale(1) blur(.7px) brightness(1.06);
    transform: none;
  }
}
.promo-tape-pill.lk {
  background: rgba(125,133,144,.28); color: var(--text-muted);
}
.promo-tape-bar-mp {
  flex-shrink: 0; font-size: 10px; font-weight: 800; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px; background: rgba(0,0,0,.25);
}
.promo-tape-bar-title {
  font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 42%;
}
.promo-tape-bar-meta {
  font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.promo-tape-pill {
  flex-shrink: 0; font-size: 10px; font-weight: 800; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; letter-spacing: .03em;
}
.promo-tape-pill.on { background: rgba(46,160,67,.25); color: #3fb950; }
.promo-tape-pill.off { background: rgba(248,81,73,.2); color: #ff7b72; }

@media (max-width: 720px) {
  .promo-tape-bar-title { max-width: 55%; }
  .promo-tape-bar-meta { display: none; }
  .promo-view-seg { margin-left: 0; }
}

.promo-thumb-cell { width: 44px; }
.promo-thumb {
  width: 36px; height: 48px; object-fit: cover; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border); display: block;
}
.promo-thumb-ph {
  display: inline-flex; width: 36px; height: 48px; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 11px;
}



/* —— Цены и скидки —— */
.prices-dirty { color: #e3b341 !important; font-size: 13px; }
.prices-thumb-cell { width: 44px; vertical-align: middle; }
.prices-thumb {
  width: 36px; height: 48px; object-fit: cover; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border); display: block;
}
.prices-thumb.ph {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--text-muted); width: 36px; height: 48px;
}
.prices-inp {
  width: 88px; min-width: 72px; text-align: center;
}
.prices-tog { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.prices-tog input { width: 16px; height: 16px; accent-color: var(--accent); }
.th-with-hint {
  white-space: normal; max-width: 120px; line-height: 1.25;
  cursor: help;
}
.th-hint {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; margin-left: 2px; vertical-align: 1px;
  border-radius: 50%; border: 1px solid var(--text-muted);
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  line-height: 1;
}
.prices-sug-cell { text-align: right; white-space: nowrap; }
.prices-sug {
  font: inherit; font-weight: 700; color: var(--accent-light);
  background: none; border: none; padding: 0; cursor: default;
}
button.prices-sug { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
button.prices-sug:hover { color: #fff; }
.prices-sug.low { color: var(--warning); }
.prices-shelf-low { color: var(--warning) !important; font-weight: 600; }
.prices-flag-th { min-width: 118px; }
.prices-flag-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.prices-bulk { display: inline-flex; gap: 4px; }
.prices-bulk-btn {
  font: inherit; font-size: 11px; font-weight: 600; line-height: 1;
  padding: 3px 7px; border-radius: 5px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted);
}
.prices-bulk-btn:hover {
  color: var(--text); border-color: var(--text-muted); background: var(--surface);
}
#prices-table th, #prices-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle;
  white-space: nowrap;
}
#prices-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 650;
}
#prices-table td strong { font-size: 13px; }
#prices-table .muted { font-variant-numeric: tabular-nums; }

/* вертикальные превью и в акциях */
.promo-thumb {
  width: 36px; height: 48px; object-fit: cover; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border); display: block;
}
.promo-thumb-ph {
  display: inline-flex; width: 36px; height: 48px; align-items: center; justify-content: center;
  border-radius: 6px; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 10px;
}

/* —— Зонд Ozon —— */
.ozp-grid {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; margin-bottom: 14px;
}
@media (max-width: 900px) {
  .ozp-grid { grid-template-columns: 1fr; }
}
.ozp-card { margin-bottom: 14px; }
.ozp-hint { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.ozp-source-hint {
  font-size: 12px; color: var(--text-muted); margin: 0 0 12px; line-height: 1.45;
}
.ozp-program { margin-top: 14px; }
.ozp-program-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; font-weight: 650; }
.ozp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ozp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px 5px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border); font-size: 12px;
}
.ozp-chip button {
  font: inherit; font-size: 14px; line-height: 1; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; padding: 0 2px;
}
.ozp-chip button:hover { color: #ff7b72; }
.ozp-empty-inline { font-size: 12px; color: var(--text-muted); }
.ozp-select[multiple] { min-height: 200px; }
.ozp-offer-list {
  max-height: 280px; min-height: 160px; overflow: auto; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text);
}
.ozp-offer-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 13px;
}
.ozp-offer-row:last-child { border-bottom: none; }
.ozp-offer-row:hover { background: var(--surface2); }
.ozp-offer-row.in-prog { background: rgba(35,134,54,.10); }
.ozp-offer-row input { margin-top: 3px; }
.ozp-offer-row .ozp-offer-main { min-width: 0; flex: 1; }
.ozp-offer-row strong { display: block; font-size: 13px; }
.ozp-offer-row .ozp-offer-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.ozp-apply-check { margin-top: 12px; display: flex; }
.ozp-sch-note { font-size: 12px; color: var(--text-muted); margin: 0 0 12px; }
.ozp-prod-card {
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  padding: 14px 16px; margin-bottom: 12px;
}
.ozp-prod-card.bad { border-color: rgba(218,54,51,.45); }
.ozp-prod-head {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  align-items: flex-start; margin-bottom: 10px;
}
.ozp-prod-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ozp-prod-flags { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 12px; }
.ozp-prod-shelves {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; margin-bottom: 10px; color: var(--text-muted);
}
.ozp-prod-err {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12px;
  background: rgba(218,54,51,.12); color: #ff7b72;
}
.ozp-cmp { width: 100%; border-collapse: collapse; font-size: 13px; }
.ozp-cmp th, .ozp-cmp td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums; vertical-align: top;
}
.ozp-cmp th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); }
.ozp-cmp-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.ozp-cmp-changed td { background: rgba(35,134,54,.08); }
.ozp-delta { font-weight: 700; display: inline-block; min-width: 1.2em; text-align: center; }
.ozp-delta.up { color: var(--accent-light); }
.ozp-delta.same { color: var(--text-muted); }
.ozp-run-mini {
  display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--text-muted);
  margin-top: 6px; font-variant-numeric: tabular-nums;
}
.ozp-run-mini.bad { color: #ff7b72; }
.ozp-run-mini strong { color: var(--text); }
.ozp-run-open { margin-top: 8px; font-size: 12px; color: var(--accent-light); }
.ozp-live-head { margin-bottom: 10px; font-size: 13px; }
.ozp-live-row { margin-bottom: 6px; font-size: 13px; }
.ozp-raw { margin-top: 14px; font-size: 13px; }
.ozp-raw summary { cursor: pointer; color: var(--text-muted); margin-bottom: 8px; }
.ozp-raw-table-wrap { overflow-x: auto; }
.ozp-select {
  width: 100%; min-height: 180px; font: inherit; font-size: 13px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px;
}
.ozp-target {
  margin-top: 10px; padding: 12px 14px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border); font-size: 13px;
}
.ozp-target-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ozp-target-meta { margin-top: 6px; color: var(--text-muted); font-size: 12px; }
.ozp-target-meta code { font-size: 12px; }
.ozp-target-title { margin-top: 6px; color: var(--text-muted); font-size: 12px; }
.ozp-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.ozp-actions-row { margin-top: 14px; }
.ozp-sched {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.ozp-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.ozp-hour { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.ozp-hour input {
  width: 56px; font: inherit; padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.ozp-meta { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin: 0 0 4px; }
.ozp-warn { font-size: 12px; color: var(--text-muted); margin: 12px 0 0; line-height: 1.45; }
.ozp-live {
  margin-top: 12px; padding: 12px 14px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border); font-size: 13px; line-height: 1.5;
}
.ozp-tiers-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 600px) {
  .ozp-tiers-grid { grid-template-columns: 1fr; }
}
.ozp-tier {
  padding: 14px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg);
}
.ozp-tier-h { font-size: 12px; color: var(--text-muted); font-weight: 650; text-transform: uppercase; letter-spacing: .03em; }
.ozp-tier-v { font-size: 28px; font-weight: 700; margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.ozp-tier-s { font-size: 12px; color: var(--text-muted); }
.ozp-sch-foot { margin-top: 12px; font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ozp-runs { display: flex; flex-direction: column; }
.ozp-empty { padding: 20px 18px; color: var(--text-muted); font-size: 13px; }
.ozp-run-row {
  display: block; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  padding: 12px 16px; cursor: pointer;
}
.ozp-run-row:hover { background: var(--surface2); }
.ozp-run-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ozp-run-trig { font-size: 12px; color: var(--text-muted); }
.ozp-run-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ozp-run-time { margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.ozp-run-msg { margin-top: 4px; font-size: 12px; color: var(--text-muted); word-break: break-word; }
.ozp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ozp-table th, .ozp-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.ozp-table th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-muted); font-weight: 650;
}
.ozp-row-bad { background: rgba(218,54,51,.08); }

/* —— Склад —— */
#wh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
#wh-table .wh-col-art,
#wh-table .wh-col-size {
  width: 1%;
  white-space: nowrap;
  max-width: max-content;
}
#wh-table th.wh-col-art,
#wh-table th.wh-col-size {
  width: 1%;
}
#wh-table th, #wh-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
#wh-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  font-weight: 650;
}
#wh-table td strong { font-size: 13px; }
#wh-table .wh-cluster-th {
  text-align: center;
  white-space: normal;
  min-width: 110px;
  max-width: 160px;
  line-height: 1.35;
}
#wh-table .wh-cluster-sub {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  opacity: .85;
  line-height: 1.3;
  white-space: normal;
}
#wh-table .wh-num { text-align: center; }
#wh-table .wh-total-col {
  text-align: center;
  font-weight: 700;
  border-left: 1px solid transparent;
}
#wh-table.wh-mp-ozon .wh-total-col {
  background: rgba(56, 139, 253, .12);
  color: #79b8ff;
  border-left-color: rgba(56, 139, 253, .35);
}
#wh-table.wh-mp-ozon th.wh-total-col {
  background: rgba(56, 139, 253, .18);
  color: #79b8ff;
  text-transform: uppercase;
}
#wh-table.wh-mp-ozon .wh-totals .wh-total-col {
  background: rgba(56, 139, 253, .22);
  color: #a5d3ff;
}
#wh-table.wh-mp-wb .wh-total-col {
  background: rgba(203, 17, 171, .12);
  color: #f0a0e0;
  border-left-color: rgba(203, 17, 171, .35);
}
#wh-table.wh-mp-wb th.wh-total-col {
  background: rgba(203, 17, 171, .18);
  color: #f0a0e0;
  text-transform: uppercase;
}
#wh-table.wh-mp-wb .wh-totals .wh-total-col {
  background: rgba(203, 17, 171, .22);
  color: #f7c4ec;
}
#wh-table.wh-mp-ym .wh-total-col {
  background: rgba(252, 198, 0, .22);
  color: #ffd666;
  border-left-color: rgba(252, 198, 0, .55);
}
#wh-table.wh-mp-ym th.wh-total-col {
  background: rgba(252, 198, 0, .32);
  color: #ffd666;
  text-transform: uppercase;
}
#wh-table.wh-mp-ym .wh-totals .wh-total-col {
  background: rgba(252, 198, 0, .38);
  color: #ffe08a;
}
#wh-table.wh-mp-office .wh-total-col {
  background: rgba(63, 185, 80, .12);
  color: #7ee787;
  border-left-color: rgba(63, 185, 80, .35);
}
#wh-table.wh-mp-office th.wh-total-col {
  background: rgba(63, 185, 80, .18);
  color: #7ee787;
  text-transform: uppercase;
}
#wh-table.wh-mp-office .wh-totals .wh-total-col {
  background: rgba(63, 185, 80, .22);
  color: #a3f0ad;
}
#wh-table .wh-inbound-col {
  text-align: center;
  font-weight: 650;
  background: rgba(210, 153, 34, .10);
  color: #e3b341;
  border-left: 1px solid rgba(210, 153, 34, .28);
  min-width: 72px;
}
#wh-table th.wh-inbound-col {
  background: rgba(210, 153, 34, .16);
  color: #e3b341;
  text-transform: uppercase;
  font-size: 11px;
}
#wh-table .wh-totals .wh-inbound-col {
  background: rgba(210, 153, 34, .20);
  color: #f0c674;
}
#wh-table.wh-mp-recs .wh-recs-oz {
  text-align: center;
  background: rgba(56, 139, 253, .08);
  color: #79b8ff;
  min-width: 56px;
}
#wh-table.wh-mp-recs th.wh-recs-oz {
  background: rgba(56, 139, 253, .14);
  color: #79b8ff;
  text-transform: uppercase;
  font-size: 11px;
  border-left: 1px solid rgba(56, 139, 253, .28);
}
#wh-table.wh-mp-recs .wh-recs-wb {
  text-align: center;
  background: rgba(203, 17, 171, .08);
  color: #f0a0e0;
  min-width: 56px;
}
#wh-table.wh-mp-recs th.wh-recs-wb {
  background: rgba(203, 17, 171, .14);
  color: #f0a0e0;
  text-transform: uppercase;
  font-size: 11px;
  border-left: 1px solid rgba(203, 17, 171, .28);
}
#wh-table.wh-mp-recs .wh-recs-ym {
  text-align: center;
  background: rgba(252, 198, 0, .08);
  color: #f0c14b;
  min-width: 56px;
}
#wh-table.wh-mp-recs th.wh-recs-ym {
  background: rgba(252, 198, 0, .14);
  color: #f0c14b;
  text-transform: uppercase;
  font-size: 11px;
  border-left: 1px solid rgba(252, 198, 0, .35);
}
#wh-table.wh-mp-recs .wh-rec-col {
  font-weight: 700;
}
#wh-table.wh-mp-recs th.wh-inbound-col.wh-recs-oz,
#wh-table.wh-mp-recs td.wh-inbound-col.wh-recs-oz {
  background: rgba(210, 153, 34, .10);
  color: #e3b341;
}
#wh-table.wh-mp-recs th.wh-inbound-col.wh-recs-wb,
#wh-table.wh-mp-recs td.wh-inbound-col.wh-recs-wb {
  background: rgba(210, 153, 34, .10);
  color: #e3b341;
}
#wh-table.wh-mp-recs th.wh-inbound-col.wh-recs-ym,
#wh-table.wh-mp-recs td.wh-inbound-col.wh-recs-ym {
  background: rgba(210, 153, 34, .10);
  color: #e3b341;
}
#wh-table .wh-locked-col {
  opacity: .72;
  background: rgba(128, 128, 128, .08);
  color: var(--text-muted);
}
#wh-table th.wh-locked-col {
  opacity: .85;
  background: rgba(128, 128, 128, .12);
}
#wh-table .wh-qty-inp {
  width: 72px;
  text-align: center;
  padding: 6px 8px;
  margin: 0 auto;
  display: block;
}
#wh-table .wh-qty-inp.wh-saving {
  opacity: .55;
}
#wh-table .wh-qty-inp.wh-saved {
  border-color: rgba(63, 185, 80, .65);
  box-shadow: 0 0 0 1px rgba(63, 185, 80, .25);
}
#wh-table tr.wh-zero .wh-total-col { opacity: .85; }
#wh-table tr.wh-zero td { opacity: .72; }
#wh-table td.wh-merge {
  vertical-align: middle;
  border-bottom-color: var(--border);
}
#wh-table .wh-totals td {
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
#wh-table .wh-totals td strong { color: var(--text); }
#wh-table .prices-thumb-cell { width: 44px; }
@media (max-width: 720px) {
  .wh-scroll { margin: 0 -12px; padding: 0 12px; }
}

/* —— Юнит: порог 300 —— */
#ue300-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
#ue300-table th, #ue300-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
#ue300-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  font-weight: 650;
}
#ue300-table .wh-num { text-align: right; }
#ue300-table .pos { color: #7ee787; }
#ue300-table .neg { color: #ff7b72; }
#ue300-table .ue300-ok { color: #7ee787; font-weight: 650; }
#ue300-table .ue300-bad { color: #ff7b72; font-weight: 650; }
#ue300-table .ue300-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
#ue300-table .ue300-group-row th {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  padding-top: 8px;
  padding-bottom: 4px;
  border-bottom: none;
}
#ue300-table .ue300-group-label {
  text-align: center;
  font-weight: 700;
}
#ue300-table th.ue300-now,
#ue300-table td.ue300-now {
  background: rgba(56, 139, 253, 0.07);
}
#ue300-table th.ue300-alt,
#ue300-table td.ue300-alt {
  background: rgba(210, 153, 34, 0.08);
}
#ue300-table th.ue300-alt-start,
#ue300-table td.ue300-alt-start {
  box-shadow: inset 3px 0 0 rgba(210, 153, 34, 0.55);
}
#ue300-table .ue300-group-row th.ue300-now {
  color: #79b8ff;
}
#ue300-table .ue300-group-row th.ue300-alt {
  color: #e3b341;
}
.ue300-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(110, 118, 129, .15);
  color: var(--text-muted);
}
.ue300-badge.ue300-v-drop { background: rgba(63, 185, 80, .18); color: #7ee787; }
.ue300-badge.ue300-v-weak { background: rgba(210, 153, 34, .18); color: #e3b341; }
.ue300-badge.ue300-v-keep { background: rgba(248, 81, 73, .14); color: #ff7b72; }
.ue300-badge.ue300-v-stay { background: rgba(56, 139, 253, .14); color: #79b8ff; }
.ue300-badge.ue300-v-lift { background: rgba(163, 113, 247, .16); color: #d2a8ff; }
.ue300-badge.ue300-v-probe { background: rgba(110, 118, 129, .2); color: #c9d1d9; }
.ue-sum-card.ue300-chip-drop .ue-sum-val { color: #7ee787; }

/* —— Поставки —— */
.sup-orders-table tr.sup-row { cursor: pointer; }
.sup-orders-table tr.sup-row:hover td { background: rgba(88, 166, 255, .06); }
.sup-orders-table tr.sup-row.selected td { background: rgba(88, 166, 255, .12); }
.sup-mp {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  line-height: 1.2;
  height: 26px;
  box-sizing: border-box;
}
.sup-mp-ozon { color: #79b8ff; border-color: rgba(88,166,255,.35); background: rgba(88,166,255,.1); }
.sup-mp-wb { color: #d2a8ff; border-color: rgba(163,113,247,.35); background: rgba(163,113,247,.1); }
.sup-mp-ym { color: #f0c14b; border-color: rgba(240,193,75,.4); background: rgba(252,198,0,.12); }
/* —— карточка поставки (стиль Seller Hub) —— */
.supd { width: 100%; min-width: 0; }
.supd-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}
.supd-top-card {
  margin: 0;
  min-width: 0;
}
.supd-top-card .card-body {
  padding: 12px 14px;
  height: 100%;
  box-sizing: border-box;
}
.supd-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px 12px;
}
.supd-kpi { min-width: 0; }
.supd-kpi > span {
  display: block;
  font-size: 11px;
  margin-bottom: 2px;
}
.supd-kpi strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  white-space: nowrap;
}
.supd-stat-unit {
  display: inline;
  font-size: 11px;
  font-weight: 550;
  color: var(--text-muted);
  margin-left: 3px;
}
.supd-kpi.is-bad strong { color: #ff7b72; }
.supd-wh-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: 100%;
}
.supd-wh-label { font-size: 11px; margin-bottom: 2px; }
.supd-wh-name { font-size: 13px; font-weight: 700; }
.supd-wh-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
}
@media (max-width: 900px) {
  .supd-top-row { grid-template-columns: 1fr; }
}
.supd-goods-table th,
.supd-goods-table td {
  vertical-align: middle;
}
.supd-goods-table .art { font-weight: 650; }
.supd-goods-table .sup-item-pic {
  width: 48px;
  vertical-align: middle;
}
.supd-goods-table .wh-num {
  vertical-align: middle;
  text-align: right;
}
.supd-goods-table .nom-thumb,
.supd-goods-table .nom-thumb.ph {
  /* вертикальный кадр как везде: 36×48 */
  width: 36px;
  height: 48px;
  display: block;
}
.supd-goods-table .nom-thumb.ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.supd-row-mp td { opacity: .92; }
.supd-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
}
.supd-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: -1px;
  padding: 12px 14px;
}
.supd-tab:hover { color: var(--text); }
.supd-tab.active {
  color: var(--text);
  border-bottom-color: #a371f7;
}
.supd-panel {
  padding: 14px 16px 16px;
}
.supd-goods-toolbar {
  margin: 0 0 12px;
}
.supd-pkg-empty { padding: 20px 4px; }
.supd-pkg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.supd-pkg-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.02);
}
.supd-pkg-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
}
.supd-pkg-box-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.supd-pkg-box-toggle:hover { background: rgba(255,255,255,.03); }
.supd-pkg-chev {
  color: var(--text-muted);
  width: 1em;
  flex: 0 0 auto;
  font-size: 12px;
}
.supd-pkg-code {
  font-weight: 600;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.supd-pkg-body {
  border-top: 1px solid var(--border);
  padding: 0 4px 8px;
}
.supd-pkg-body .supd-goods-table { margin: 0; }

.supd-pkg-toolbar { margin: 12px 0; }
.supd-pkg-actions {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.supd-ico { font-size: 14px; line-height: 1; opacity: .9; }
.supd-caret { font-size: 10px; opacity: .7; margin-left: 2px; }
.supd-split { position: relative; display: inline-flex; }
.supd-split-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 28px rgba(0,0,0,.35);
  display: flex; flex-direction: column; gap: 2px;
}
.supd-split-menu[hidden] { display: none !important; }
.supd-split-menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border: none; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 13px; cursor: pointer;
}
.supd-split-menu button:hover { background: rgba(255,255,255,.06); }

.sup-stickers-modal { width: min(560px, 100%); }
.sup-stickers-modal .modal-body { gap: 16px; max-height: min(70vh, 640px); overflow: auto; }
.sup-sticker-section { display: flex; flex-direction: column; gap: 8px; }
.sup-sticker-label {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.sup-sticker-cards {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.sup-sticker-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 10px; text-align: left;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sup-sticker-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.sup-sticker-card.is-active {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface2));
  border-color: var(--accent);
}
.sup-sticker-card-ico { font-size: 18px; opacity: .85; }
.sup-sticker-card-title { font-size: 13px; font-weight: 650; }
.sup-sticker-card-sub { font-size: 11px; color: var(--text-muted); line-height: 1.35; }
.sup-sticker-checks {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px;
}
.sup-sticker-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text); white-space: nowrap;
}
.sup-sticker-check input { accent-color: var(--accent); }
.sup-sticker-check.is-disabled { opacity: .45; }
.sup-sticker-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.sup-sticker-pill {
  min-width: 96px; padding: 10px 14px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text);
  font-size: 13px; font-weight: 550; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.sup-sticker-pill::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border); box-sizing: border-box; flex-shrink: 0;
}
.sup-sticker-pill.is-active {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface2));
}
.sup-sticker-pill.is-active::before {
  border-color: var(--accent);
  background: radial-gradient(circle at center, var(--accent) 0 45%, transparent 48%);
}
@media (max-width: 640px) {
  .sup-sticker-cards { grid-template-columns: 1fr; }
  .sup-sticker-pill { flex: 1; justify-content: center; }
}
.supd-ozon-supplies {
  margin: 0 0 12px;
}
.supd-ozon-supplies .card-body {
  padding: 12px 14px;
}
.sup-supply-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sup-supply-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0;
}
.sup-supply-main {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}
.sup-supply-wh {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}
.sup-supply-addr {
  font-size: 12px;
  line-height: 1.35;
}
.sup-items-table { width: 100%; border-collapse: collapse; }
.sup-items-table th, .sup-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.sup-items-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
}
.sup-item-pic img.nom-thumb {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface2, #161b22);
}
.sup-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.2;
  height: 26px;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: rgba(110, 118, 129, .15);
  color: var(--text-muted);
  vertical-align: middle;
}
.sup-badge.sup-st-done {
  background: rgba(63, 185, 80, .18);
  color: #7ee787;
  border-color: rgba(63, 185, 80, .28);
}
.sup-badge.sup-st-bad {
  background: rgba(248, 81, 73, .14);
  color: #ff7b72;
  border-color: rgba(248, 81, 73, .28);
}
.sup-badge.sup-st-ready {
  background: rgba(56, 139, 253, .14);
  color: #79b8ff;
  border-color: rgba(56, 139, 253, .28);
}
.sup-badge.sup-st-go {
  background: rgba(210, 153, 34, .18);
  color: #e3b341;
  border-color: rgba(210, 153, 34, .3);
}
.sup-status-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.sup-badge.sup-st-virt {
  background: rgba(210, 153, 34, .14);
  color: #e3b341;
  border-color: rgba(210, 153, 34, .28);
}
#sup-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  line-height: 1.45;
}
#sup-subtitle .sup-status-row { gap: 8px; }
.supd-title-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  line-height: 1.25;
}
.supd-title-badges {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.page-header h1 .sup-mp,
.page-header h1 .sup-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 6px;
  line-height: 1.2;
  height: 26px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  margin: 0;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.supd-meta-dates {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  font-size: 13px;
  color: var(--text-muted);
}
.supd-meta-sep {
  margin: 0 8px;
  opacity: .45;
}
.supd-meta-date strong {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.supd-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 12px;
  border-bottom: 1px solid var(--border);
  padding: 0 8px 0 0;
}
.supd-tabs-bar .supd-tabs {
  border-bottom: none;
  padding-right: 0;
  flex: 1 1 auto;
}
.supd-tabs-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 0;
}
.supd-qty-input {
  width: 72px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.supd-qty-input:focus {
  outline: none;
  border-color: var(--accent, #a371f7);
}

/* —— Пропуск —— */
.sup-pass { display: flex; flex-direction: column; gap: 12px; }
.sup-pass-lead { margin: 0; font-size: 13px; }
.sup-pass-note { margin: 0; }
.sup-pass-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sup-pass-ctx {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2, rgba(110,118,129,.06));
}
.sup-pass-ctx-wh {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
.sup-pass-ctx-addr { font-size: 12px; margin-top: 2px; }
.sup-pass-ctx-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  font-size: 12px;
}
.sup-pass-ctx-meta strong {
  color: var(--text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.sup-pass-list { display: flex; flex-direction: column; gap: 10px; }
.sup-pass-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface, transparent);
}
.sup-pass-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sup-pass-card-title {
  font-size: 13px;
  font-weight: 700;
}
.sup-pass-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 14px;
}
.sup-pass-grid > div span {
  display: block;
  font-size: 11px;
  margin-bottom: 2px;
}
.sup-pass-grid > div strong {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}
.sup-pass-span2 { grid-column: 1 / -1; }
.sup-pass-plate { letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.sup-pass-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.sup-pass-empty {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.sup-pass-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 12px;
}
.sup-pass-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.sup-pass-form-grid input,
.sup-pass-form-grid select {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.sup-pass-form-grid .sup-pass-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  margin-top: 18px;
}
.sup-pass-plate-input { text-transform: uppercase; letter-spacing: .04em; }
.sup-pass-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
#sup-orders-table.sup-hide-accepted .sup-col-accepted { display: none !important; }
#sup-cap-table .sup-cap-ok { color: #7ee787; }
#sup-cap-table .sup-cap-low { color: #e3b341; }
#sup-cap-table .sup-cap-zero { color: #ff7b72; }

/* —— Мастер создания поставки —— */
.supc { margin-top: 8px; }
.supc-lead {
  margin: 8px 0 18px;
  font-size: 15px;
  color: var(--text-muted);
}
.supc-mp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 720px) {
  .supc-mp-grid { grid-template-columns: 1fr; }
}
.supc-mp-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 22px 22px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,.04), transparent 55%),
    linear-gradient(165deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.supc-mp-card:hover {
  border-color: rgba(255,255,255,.18);
  transform: translateY(-2px);
}
.supc-mp-card strong {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.supc-mp-card > span:last-child {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}
.supc-mp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.supc-mp-wb .supc-mp-badge {
  background: rgba(163,113,247,.12);
  color: #d2a8ff;
}
.supc-mp-ozon .supc-mp-badge {
  background: rgba(88,166,255,.12);
  color: #79b8ff;
}
.supc-mp-ym .supc-mp-badge {
  background: rgba(252,198,0,.14);
  color: #f0c14b;
}
.supc-mp-ym {
  cursor: default;
  opacity: 0.92;
}
.supc-mp-wb:hover { border-color: rgba(163,113,247,.4); }
.supc-mp-ozon:hover { border-color: rgba(88,166,255,.4); }

.supc-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}
.supc-step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.supc-step span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
}
.supc-step.is-active { color: var(--text); font-weight: 600; }
.supc-step.is-active span {
  background: #e8edf5;
  color: #0d1117;
  border-color: transparent;
}
.supc-step.is-done { color: #7ee787; }
.supc-step.is-done span {
  background: rgba(126, 231, 135, .15);
  border-color: rgba(126, 231, 135, .35);
  color: #7ee787;
}
.supc-step-line {
  width: 28px;
  height: 1px;
  margin: 0 10px;
  background: rgba(255,255,255,.12);
}

.supc-panel { display: flex; flex-direction: column; gap: 12px; }
.supc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.supc-horizon { display: inline-flex; gap: 6px; }
.supc-search {
  min-width: 200px;
  flex: 1;
  max-width: 280px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.25);
  color: var(--text);
}
.supc-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  user-select: none;
}
.supc-warn { color: #e3b341; margin-left: 6px; }
.supc-miss { color: #ff7b72; font-size: 12px; }
.supc-goods-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.supc-goods-table th,
.supc-goods-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: middle;
}
.supc-goods-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  font-weight: 600;
}
.supc-goods-table tr.is-on { background: rgba(126, 231, 135, .04); }
.supc-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  background: rgba(255,255,255,.04);
}
.supc-thumb.ph { border: 1px solid rgba(255,255,255,.06); }
.supc-qty {
  width: 72px;
  height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.3);
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.supc-code-input {
  width: 120px;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(227, 179, 65, .45);
  background: rgba(0,0,0,.3);
  color: var(--text);
  font-size: 12px;
}
.supc-rec-btn {
  background: transparent;
  border: none;
  color: #7dd3fc;
  cursor: pointer;
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.supc-rec-btn:hover { text-decoration: underline; }
.supc-chip {
  display: inline-flex;
  padding: 2px 7px;
  margin: 1px 3px 1px 0;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255,255,255,.06);
  color: var(--text-muted);
}
.supc-clusters { max-width: 220px; }
.supc-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 4px;
}
.supc-tips {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  font-size: 13px;
  line-height: 1.45;
}
.supc-cluster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  align-items: stretch;
}
.supc-cluster-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-align: left;
  padding: 16px 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.04), transparent 50%),
    rgba(255,255,255,.025);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.supc-cluster-card:hover {
  border-color: rgba(255,255,255,.2);
  transform: translateY(-1px);
}
.supc-cluster-card.is-lim {
  border-color: rgba(227, 179, 65, .28);
}
.supc-cluster-card.is-no-supply {
  border-color: rgba(255, 123, 114, .35);
  opacity: .92;
}
.supc-cluster-supply {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  min-height: 2.7em;
}
.supc-cluster-supply strong { color: var(--text); font-weight: 700; }
.supc-cluster-supply em {
  font-style: normal;
  font-size: 11px;
  opacity: .9;
}
.supc-cluster-supply.is-bad,
.supc-cluster-supply.is-bad strong {
  color: #ff7b72;
}
.supc-cluster-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 12px;
  min-height: 44px;
}
.supc-cluster-top strong {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  line-height: 1.25;
  letter-spacing: -.02em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.supc-lim-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #e3b341;
  background: rgba(227, 179, 65, .12);
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
  margin-top: 2px;
}
.supc-lim-badge.is-spacer {
  visibility: hidden;
  background: transparent;
  color: transparent;
}
.supc-cluster-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.supc-cluster-kpis > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.supc-cluster-kpis span {
  font-size: 11px;
  color: var(--text-muted);
}
.supc-cluster-kpis strong {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.supc-cluster-kpis strong.ok { color: #7ee787; }
.supc-cluster-kpis em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-muted);
}
.supc-cluster-tops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 88px;
}
.supc-cluster-tops li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 18px;
}
.supc-cluster-tops li.is-pad { visibility: hidden; }
.supc-cl-art {
  flex: 1;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.supc-cl-art em {
  font-style: normal;
  color: var(--text-muted);
  margin-left: 4px;
}
.supc-cl-need { font-variant-numeric: tabular-nums; white-space: nowrap; }
.supc-cl-ship {
  font-variant-numeric: tabular-nums;
  color: #7ee787;
  white-space: nowrap;
  font-weight: 600;
}
.supc-cl-ship.is-lim { color: #e3b341; }
.supc-cluster-more {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  min-height: 16px;
}
.supc-cluster-more.is-empty { visibility: hidden; }
.supc-seed {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #79b8ff;
  background: rgba(88,166,255,.12);
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
}
.wh-seed {
  display: inline-block;
  margin-left: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: #79b8ff;
  background: rgba(88,166,255,.12);
  padding: 0 4px;
  border-radius: 3px;
  vertical-align: middle;
}
.wh-seed-cell strong { color: #9ecbff; }
.supc-goods-table tr.is-lim td { /* soft mark when office limits */ }

.supc-wh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.supc-wh-card {
  text-align: left;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.025);
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.supc-wh-card:hover { border-color: rgba(255,255,255,.18); }
.supc-wh-card.is-selected {
  border-color: rgba(126, 231, 135, .55);
  background: rgba(126, 231, 135, .07);
}
.supc-wh-card.is-dim { opacity: .55; }
.supc-wh-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.supc-wh-top strong { font-size: 14px; line-height: 1.3; }
.supc-wh-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.supc-wh-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #c9d1d9;
}
.supc-cap {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.supc-cap.ok { color: #7ee787; }
.supc-cap.zero { color: #ff7b72; }
.supc-cap.kind-sc {
  color: #79c0ff;
  border: 1px solid rgba(121, 192, 255, .35);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
}
.supc-cap.kind-sk {
  color: #d2a8ff;
  border: 1px solid rgba(210, 168, 255, .35);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 11px;
}
.supc-selected-wh {
  font-size: 13px;
  padding: 8px 0 0;
}
.supc-book-h {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 600;
}
/* Ozon экран 1 — товары и логистика */
.supc-oz-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.supc-oz-title {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.02em;
}
.supc-oz-bulk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed rgba(56, 189, 248, .35);
  background: rgba(56, 189, 248, .06);
}
.supc-oz-bulk-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.supc-oz-bulk-text strong { font-size: 14px; }
.supc-oz-bulk-text span { color: var(--text-muted); font-size: 12px; }
.supc-oz-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.supc-oz-table th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}
.supc-oz-table td {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  vertical-align: middle;
}
.supc-oz-table tr.is-on {
  background: rgba(56, 189, 248, .07);
}
.supc-oz-table tr.is-empty td { opacity: .72; }
.supc-oz-name strong { font-size: 14px; }
.supc-oz-rec strong { color: #7dd3fc; }
.supc-oz-rec-our strong { color: #86efac; }
.supc-oz-draft-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.supc-oz-check { width: 36px; }
.supc-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}
.supc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.supc-switch span {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  transition: background-color 150ms ease;
}
.supc-switch span::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 150ms var(--ease-out);
}
.supc-switch input:checked + span {
  background: rgba(56, 189, 248, .55);
}
.supc-switch input:checked + span::before {
  transform: translateX(18px);
}
.supc-switch input:disabled + span { opacity: .4; cursor: not-allowed; }

/* Ozon screen1 modals */
.sup-oz-modal-root { z-index: 90; }
.sup-oz-modal {
  width: min(720px, 100%);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
}
.sup-oz-modal.is-wide { width: min(1100px, 100%); }
.sup-oz-modal .modal-body {
  overflow: auto;
  max-height: min(70vh, 640px);
}
.sup-oz-steps {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.sup-oz-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: none;
  border: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 0;
  opacity: .55;
}
.sup-oz-step.is-on, .sup-oz-step.is-done { opacity: 1; }
.sup-oz-step-n {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); font-size: 12px; font-weight: 700; flex: 0 0 auto;
}
.sup-oz-step.is-on .sup-oz-step-n { background: #38bdf8; color: #0b1220; }
.sup-oz-step.is-done .sup-oz-step-n { background: rgba(56,189,248,.35); }
.sup-oz-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.sup-oz-method-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.03);
  color: inherit;
  cursor: pointer;
}
.sup-oz-method-card.is-on {
  border-color: rgba(56,189,248,.55);
  background: rgba(56,189,248,.08);
}
.sup-oz-radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35);
  margin-top: 2px; flex: 0 0 auto;
  position: relative;
}
.sup-oz-method-card.is-on .sup-oz-radio {
  border-color: #38bdf8;
}
.sup-oz-method-card.is-on .sup-oz-radio::after {
  content: '';
  position: absolute; inset: 3px; border-radius: 50%; background: #38bdf8;
}
.sup-oz-point-toolbar {
  display: flex; gap: 8px; margin-bottom: 10px;
}
.sup-oz-point-toolbar .input { flex: 1; }
.sup-oz-selected {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px; font-size: 13px;
}
.sup-oz-point-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: min(42vh, 420px); overflow: auto;
}
.sup-oz-point {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03); color: inherit; cursor: pointer;
}
.sup-oz-point.is-on {
  border-color: rgba(56,189,248,.5);
  background: rgba(56,189,248,.08);
}
.sup-oz-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 10px;
}
.sup-oz-tabs button {
  background: none; border: none; color: var(--text-muted);
  padding: 10px 14px; cursor: pointer; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.sup-oz-tabs button.is-on {
  color: var(--text); border-bottom-color: #38bdf8; font-weight: 600;
}
.sup-oz-goods-row { display: flex; gap: 10px; align-items: center; }
.sup-oz-thumb {
  width: 40px; height: 40px; border-radius: 8px; object-fit: cover;
  background: rgba(255,255,255,.06); flex: 0 0 auto;
}
.sup-oz-thumb.is-empty { display: inline-block; }
.sup-oz-badge {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  font-size: 11px; background: rgba(251,191,36,.15); color: #fbbf24;
}
.sup-oz-badge.is-urgent {
  background: rgba(248,113,113,.18); color: #fca5a5;
}
@media (max-width: 900px) {
  .supc-oz-hero { flex-direction: column; }
  .supc-oz-bulk { flex-direction: column; align-items: stretch; }
  .sup-oz-method-grid { grid-template-columns: 1fr; }
}
.supc-day {
  margin-bottom: 12px;
}
.supc-day-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.supc-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.supc-slot {
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: inherit;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.supc-slot:hover { border-color: rgba(56, 189, 248, .45); }
.supc-slot.is-selected {
  border-color: rgba(56, 189, 248, .7);
  background: rgba(56, 189, 248, .12);
}
.supc-done-card {
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(168, 85, 247, .12), transparent 50%),
    rgba(255,255,255,.025);
}
.supc-done-card.ozon {
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(56, 189, 248, .12), transparent 50%),
    rgba(255,255,255,.025);
}
.supc-done-kicker {
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.supc-done-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: -.02em;
}
.supc-done-card p {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
}
.supc-next {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}
.supc-next li { margin: 4px 0; }
.supc-errs {
  margin: 0 0 12px;
  padding-left: 18px;
  color: #ff7b72;
  font-size: 13px;
}

/* —— Пользователи / аватары —— */
.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
  flex-shrink: 0;
  vertical-align: middle;
}
.user-avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.user-avatar.ph { background: #484f58; }
.user-avatar-wrap { display: inline-flex; }
.user-avatar-edit {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
}
.user-avatar-edit .user-avatar-wrap,
.user-avatar-edit .user-avatar {
  width: 64px;
  height: 64px;
}
.user-avatar-action {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  color: #fff;
  background: rgba(1, 4, 9, .55);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms var(--ease-out), background-color 120ms var(--ease-out);
}
.user-avatar-action:active { transform: scale(0.97); }
.user-avatar-edit[data-has-photo="0"] .user-avatar-upload { opacity: .72; }
.user-avatar-edit[data-has-photo="1"] .user-avatar-upload { display: none; }
.user-avatar-edit[data-has-photo="0"] .user-avatar-remove { display: none; }
@media (hover: hover) and (pointer: fine) {
  .user-avatar-edit[data-has-photo="1"] .user-avatar-remove { opacity: 0; }
  .user-avatar-edit[data-has-photo="1"]:hover .user-avatar-remove,
  .user-avatar-edit[data-has-photo="1"]:focus-within .user-avatar-remove { opacity: 1; }
  .user-avatar-edit[data-has-photo="0"]:hover .user-avatar-upload,
  .user-avatar-edit[data-has-photo="0"]:focus-within .user-avatar-upload { opacity: 1; }
}
@media (hover: none) {
  .user-avatar-edit[data-has-photo="1"] .user-avatar-remove { opacity: 1; }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.settings-account-split {
  align-items: stretch;
}
.settings-account-split .settings-card {
  display: flex;
  flex-direction: column;
  margin: 0;
}
.settings-account-split .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.settings-account-split .settings-card-foot {
  margin-top: auto;
  padding-top: 8px;
  border: 0;
}
.user-profile-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.user-profile-fields { flex: 1; min-width: 0; }
.avatar-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.avatar-color-swatch.on {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent, #3d8b5a);
}
.badge-temp-pass {
  display: inline-block;
  font-size: 12px;
  color: #d29922;
  background: rgba(210, 153, 34, .12);
  border: 1px solid rgba(210, 153, 34, .35);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.badge-own-pass {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
#users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#users-table th, #users-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
#users-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
}

/* WB cluster demand — same card/table language as warehouse */
.wh-demand-panel {
  margin-bottom: 16px;
}
.wh-demand-panel.is-inline {
  margin: 0 0 14px;
}
.wh-demand-panel[hidden] { display: none !important; }
.wh-demand-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wh-demand-table th,
.wh-demand-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.wh-demand-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--surface2, rgba(255,255,255,.02));
}
.wh-demand-table .wh-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wh-demand-table tbody tr:last-child td {
  border-bottom: none;
}
.wh-demand-share-cell {
  display: grid;
  grid-template-columns: minmax(120px, 2fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}
.wh-demand-bar-wrap {
  height: 6px;
  background: rgba(203, 17, 171, .12);
  border: 1px solid rgba(203, 17, 171, .28);
  overflow: hidden;
}
.wh-demand-bar {
  display: block;
  height: 100%;
  background: var(--wb, #cb11ab);
  min-width: 2px;
}
.wh-demand-note {
  margin: 0;
  padding: 12px 18px 14px;
}

/* Recommendations sub-views */
.wh-recs-subtabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}
.wh-recs-subtabs[hidden] { display: none !important; }
.wh-recs-subtabs > button[data-view] {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.wh-recs-subtabs > button[data-view]:hover { color: var(--text); }
.wh-recs-subtabs > button[data-view].active {
  color: var(--text);
  border-color: var(--accent, #c4f542);
  background: rgba(196, 245, 66, .1);
}
.wh-recs-hz {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}
.wh-recs-hz[hidden] { display: none !important; }

/* KPI оборачиваемости (Ozon / WB) */
.wh-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
}
.wh-kpi-bar[hidden] { display: none !important; }
.wh-kpi-cell {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.wh-kpi-cell:last-child { border-right: none; }
.wh-kpi-lbl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}
.wh-kpi-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  cursor: help;
}
.wh-kpi-val {
  margin-top: 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.wh-kpi-miss {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.wh-kpi-miss-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.wh-kpi-miss-row .wh-kpi-val { margin-top: 0; font-size: 20px; }
.wh-kpi-val-muted {
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  letter-spacing: 0;
}
.wh-kpi-miss-qty .wh-kpi-badge {
  font-size: 11px;
  padding: 1px 7px;
  opacity: .9;
}
.wh-kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.wh-kpi-miss-row .wh-kpi-badge { margin-top: 0; }
.wh-kpi-badge .arr { font-size: 11px; }
.wh-kpi-badge.bad {
  background: rgba(248, 81, 73, .14);
  color: #ff7b72;
}
.wh-kpi-badge.good {
  background: rgba(63, 185, 80, .14);
  color: #3fb950;
}
.wh-kpi-badge.flat {
  background: rgba(139, 148, 158, .12);
  color: var(--text-muted);
}
@media (max-width: 980px) {
  .wh-kpi-bar { grid-template-columns: 1fr 1fr; }
  .wh-kpi-cell:nth-child(2) { border-right: none; }
  .wh-kpi-cell:nth-child(1),
  .wh-kpi-cell:nth-child(2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .wh-kpi-bar { grid-template-columns: 1fr; }
  .wh-kpi-cell { border-right: none; border-bottom: 1px solid var(--border); }
  .wh-kpi-cell:last-child { border-bottom: none; }
  .wh-kpi-cell:nth-child(1),
  .wh-kpi-cell:nth-child(2) { border-bottom: 1px solid var(--border); }
}

.wh-recs-cluster-cell {
  min-width: 118px;
  vertical-align: top !important;
  text-align: right;
}
.wh-recs-cluster-line {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}
.wh-recs-cluster-line span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  font-weight: 600;
}
.wh-recs-cluster-line strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  min-width: 2ch;
}
.wh-recs-cluster-stock {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}
#wh-table.wh-mp-recs-wb .wh-cluster-th {
  min-width: 124px;
  max-width: 170px;
  white-space: normal;
  line-height: 1.25;
}
#wh-table.wh-mp-recs-wb .wh-cluster-th .wh-cluster-sub {
  display: block;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
#wh-table.wh-mp-recs-oz .wh-cluster-th {
  min-width: 124px;
  max-width: 180px;
  white-space: normal;
  line-height: 1.25;
}
#wh-table.wh-mp-recs-oz .wh-cluster-th .wh-cluster-sub {
  display: block;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
#wh-table.wh-mp-recs-oz .wh-recs-cluster-cell {
  vertical-align: top;
}

/* ABC / XYZ */
.ax-toolbar { margin-bottom: 14px; }
.ax-matrix-panel {
  margin-bottom: 14px;
}
.ax-matrix-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}
.ax-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.ax-summary-gap { width: 12px; }
.ax-summary-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: rgba(13, 17, 23, .35);
  border-radius: 8px;
  font-size: 13px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.ax-summary-item:hover { border-color: var(--text-muted); }
.ax-summary-item.is-on {
  border-color: var(--accent, #c4f542);
  box-shadow: 0 0 0 1px rgba(196, 245, 66, .35);
}
.ax-summary-item span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}
.ax-matrix-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.ax-matrix-cell {
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  display: grid;
  gap: 4px;
  transition:
    border-color var(--press-duration) ease,
    transform var(--press-duration) var(--ease-out),
    box-shadow var(--press-duration) ease;
}
@media (hover: hover) and (pointer: fine) {
  .ax-matrix-cell:hover { transform: translateY(-1px); }
}
.ax-matrix-cell:active { transform: scale(0.985); }
.ax-matrix-cell.is-on {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.18);
}
.ax-matrix-cell em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  opacity: .85;
}
.ax-matrix-cell strong {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.ax-matrix-cell span {
  font-size: 11px;
  line-height: 1.35;
  opacity: .8;
}
/* зелёный → жёлтый → красный */
.ax-cell-ax { background: linear-gradient(160deg, rgba(63,185,80,.42), rgba(63,185,80,.16)); border-color: rgba(63,185,80,.35); }
.ax-cell-ay { background: linear-gradient(160deg, rgba(126, 185, 60, .40), rgba(210,153,34,.14)); border-color: rgba(163,185,50,.35); }
.ax-cell-az { background: linear-gradient(160deg, rgba(210,153,34,.38), rgba(210,153,34,.14)); border-color: rgba(210,153,34,.4); }
.ax-cell-bx { background: linear-gradient(160deg, rgba(110, 170, 70, .32), rgba(110,170,70,.12)); border-color: rgba(110,170,70,.3); }
.ax-cell-by { background: linear-gradient(160deg, rgba(210,153,34,.34), rgba(227,140,50,.12)); border-color: rgba(210,153,34,.35); }
.ax-cell-bz { background: linear-gradient(160deg, rgba(227,120,50,.36), rgba(248,81,73,.12)); border-color: rgba(227,120,50,.35); }
.ax-cell-cx { background: linear-gradient(160deg, rgba(160, 160, 70, .28), rgba(160,160,70,.1)); border-color: rgba(160,160,70,.28); }
.ax-cell-cy { background: linear-gradient(160deg, rgba(230,100,60,.34), rgba(248,81,73,.14)); border-color: rgba(230,100,60,.35); }
.ax-cell-cz { background: linear-gradient(160deg, rgba(248,81,73,.42), rgba(248,81,73,.16)); border-color: rgba(248,81,73,.4); }
.ax-badge {
  display: inline-block;
  min-width: 1.6em;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 7px;
  border-radius: 6px;
}
.ax-badge.ax-class {
  background: rgba(255,255,255,.06);
  color: var(--text);
}
.ax-group-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(56,139,253,.16);
  color: #79b8ff;
  vertical-align: middle;
}
.ax-abc-a { background: rgba(196, 245, 66, .18); color: #c4f542; }
.ax-abc-b { background: rgba(210, 153, 34, .18); color: #e3b341; }
.ax-abc-c { background: rgba(139, 148, 158, .18); color: #8b949e; }
.ax-xyz-x { background: rgba(56, 139, 253, .18); color: #79b8ff; }
.ax-xyz-y { background: rgba(163, 113, 247, .18); color: #d2a8ff; }
.ax-xyz-z { background: rgba(248, 81, 73, .16); color: #f85149; }
@media (max-width: 720px) {
  .ax-matrix-grid { grid-template-columns: 1fr; }
}

/* —— Отзывы и вопросы —— */
.nav-item-label { flex: 1 1 auto; min-width: 0; }
.nav-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 4px;
}
.nav-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 7px;
  background: rgba(248, 81, 73, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.nav-badge.danger { background: rgba(248, 81, 73, 0.9); color: #fff; }
.nav-badge.warn { background: rgba(68, 68, 68, 0.95); color: #fff; }
.nav-badge.ok { background: rgba(0, 150, 21, 0.95); color: rgb(255, 255, 255); }

/* —— Мобильное нижнее меню (только seller, ≤900px) —— */
.mob-tabbar,
.mob-sheet-bg { display: none; }

@media (max-width: 900px) {
  html.portal-seller.authed .mob-tabbar {
    --mob-tab-h: 56px;
    --mob-tab-pad: 28px;
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    height: calc(var(--mob-tab-h) + var(--mob-tab-pad) + env(safe-area-inset-bottom));
    padding: 0 8px calc(var(--mob-tab-pad) + env(safe-area-inset-bottom));
    align-items: flex-start;
    justify-content: space-around;
    background: rgba(22, 27, 34, 0.92);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
  }
  html.portal-seller.authed .mob-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: var(--mob-tab-h);
    background: none;
    border: 0;
    color: #8b949e;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    transition: transform var(--press-duration) var(--ease-out), color 160ms ease;
  }
  html.portal-seller.authed .mob-tab svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  html.portal-seller.authed .mob-tab[data-tab="more"] svg {
    fill: currentColor;
    stroke: none;
  }
  html.portal-seller.authed .mob-tab.is-on { color: var(--brand-hot); }
  html.portal-seller.authed .mob-tab:active { transform: scale(0.9); }
  html.portal-seller.authed .mob-tab-pip {
    position: absolute;
    top: 10px;
    right: calc(50% - 16px);
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f85149;
    box-shadow: 0 0 0 2px rgba(22, 27, 34, 0.92);
  }
  html.portal-seller .mob-sheet-bg {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    pointer-events: none;
  }
  html.portal-seller .mob-sheet-bg[hidden] { display: none; }
  html.portal-seller .mob-sheet-bg.is-open { pointer-events: auto; }
  html.portal-seller .mob-sheet-dismiss {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(1, 4, 9, 0);
    transition: background 200ms ease;
  }
  html.portal-seller .mob-sheet-bg.is-open .mob-sheet-dismiss {
    background: rgba(1, 4, 9, 0.46);
  }
  html.portal-seller .mob-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--mob-tab-h, 56px) + var(--mob-tab-pad, 28px) + env(safe-area-inset-bottom));
    max-height: min(72vh, 520px);
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    padding: 8px 10px 12px;
    transform: translateY(110%);
    transition: transform 280ms var(--ease-out);
  }
  html.portal-seller .mob-sheet-bg.is-open .mob-sheet { transform: translateY(0); }
  html.portal-seller .mob-sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
    margin: 4px auto 10px;
  }
  html.portal-seller .mob-sheet-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 2px 10px 8px;
  }
  html.portal-seller .mob-sheet-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  html.portal-seller .mob-sheet-list .nav-item {
    flex: none;
    justify-content: flex-start;
    white-space: normal;
    padding: 12px 12px;
    font-size: 15px;
  }
  html.portal-seller .mob-sheet-list .nav-item .icon { display: inline-block; }
  body.mob-sheet-open { overflow: hidden; }

}
.rq-toolbar { margin-bottom: 12px; }
.rq-seg-n {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.85;
}
.rq-errors {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(210, 153, 34, 0.35);
  background: rgba(210, 153, 34, 0.08);
  color: #e3b341;
  font-size: 12px;
  line-height: 1.4;
}
.rq-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 14px;
  align-items: start;
  min-height: 480px;
}
.rq-list-card, .rq-detail-card { margin: 0; min-height: 480px; }
.rq-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 10px !important;
}
.rq-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.rq-item:hover { background: rgba(255,255,255,0.03); }
.rq-item.active {
  border-color: rgba(56,139,253,0.45);
  background: rgba(56,139,253,0.08);
}
.rq-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.rq-item-date { margin-left: auto; font-size: 11px; }
.rq-item-art { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.rq-item-text { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.rq-mp {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  letter-spacing: 0.03em;
}
.rq-mp.wb { background: rgba(203, 17, 171, 0.18); color: #e879c9; }
.rq-mp.oz { background: rgba(56, 139, 253, 0.18); color: #79b8ff; }
.rq-mp.ym { background: rgba(252, 198, 0, 0.18); color: #f0c14b; }
.rq-stars {
  display: inline-flex;
  gap: 1px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
}
.rq-stars .on { color: #e3b341; }
.rq-stars .off { color: #484f58; }
.rq-item-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.rq-item-thumb {
  width: 40px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.rq-item-thumb.ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
}
.rq-item-body { min-width: 0; flex: 1; }
.rq-item-user { font-size: 11px; margin: 1px 0 2px; }
.rq-empty { padding: 24px 8px; text-align: center; }
.rq-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.rq-detail-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.rq-detail-product {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex: 0 1 240px;
  min-width: 180px;
}
.rq-detail-thumb {
  width: 56px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.rq-detail-meta {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.rq-stock-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 6px;
  font-size: 12px;
}
.rq-stock-row strong { color: var(--text); font-weight: 600; }
.rq-detail-user {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text);
}
.rq-offers-block {
  flex: 1 1 0;
  min-width: 220px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.02);
}
.rq-offers-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.rq-sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.rq-sku-table th,
.rq-sku-table td {
  text-align: left;
  padding: 3px 6px;
  border-bottom: 1px solid var(--border);
}
.rq-sku-table th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
}
.rq-sku-table tr.rq-sku-current td {
  background: rgba(63, 185, 80, .08);
}
.rq-sku-table tr:last-child td { border-bottom: 0; }
@media (max-width: 720px) {
  .rq-detail-top { flex-direction: column; }
  .rq-detail-product { flex: 1 1 auto; width: 100%; }
  .rq-offers-block { width: 100%; }
}
.rq-detail-rating { margin-bottom: 8px; }
.rq-detail-text {
  white-space: pre-wrap;
  line-height: 1.45;
  margin-bottom: 10px;
  font-size: 14px;
}
.rq-pros, .rq-cons { font-size: 13px; margin-bottom: 6px; }
.rq-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.rq-photo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.rq-answer-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.rq-answer-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.rq-answer-block label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}
.rq-ai-btns { display: flex; gap: 6px; flex-shrink: 0; }
.rq-answer-block textarea {
  width: 100%;
  resize: vertical;
  min-height: 120px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  line-height: 1.4;
}
.rq-tpl-row { margin-top: 10px; }
.rq-tpl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.rq-tpl-chip {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}
.rq-tpl-chip:hover { border-color: rgba(56,139,253,0.45); }
.rq-tpl-modal-card { width: min(640px, 100%); }
.rq-tpl-edit-row {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.rq-tpl-edit-row input,
.rq-tpl-edit-row textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
@media (max-width: 900px) {
  .rq-layout { grid-template-columns: 1fr; }
  .rq-list { max-height: 280px; }
}

/* ── Чаты с покупателями ─────────────────────────────────────── */
.ch-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.ch-filter-check input { accent-color: var(--accent, #58a6ff); }
.ch-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(248, 81, 73, 0.22);
  color: #ff7b72;
  font-size: 11px;
  font-weight: 700;
}
.ch-thread-card .card-body.ch-thread {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
  min-height: 480px;
  max-height: calc(100vh - 220px);
}
.ch-thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.ch-thread-title { margin-left: 8px; font-size: 15px; }
.ch-thread-sub { margin-top: 4px; font-size: 12px; }
.ch-product {
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.015);
}
.ch-product-top { margin-bottom: 0; }
.ch-product-name {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text);
}
.ch-messages {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
}
.ch-bubble {
  max-width: min(520px, 88%);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.ch-bubble.in {
  align-self: flex-start;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
}
.ch-bubble.out {
  align-self: flex-end;
  background: rgba(56, 139, 253, 0.16);
  border: 1px solid rgba(56, 139, 253, 0.35);
}
.ch-bubble.sys {
  align-self: center;
  max-width: 90%;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}
.ch-bubble-text { white-space: pre-wrap; word-break: break-word; }
.ch-bubble-atts { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.ch-att {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}
.ch-bubble-meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}
.ch-compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.ch-compose-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ch-ai-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.ch-ozon-note {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}
.ch-compose textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}
.ch-compose .btn { flex-shrink: 0; }


/* ─── Аналитика ─── */
.an-tabs { margin-bottom: 14px; flex-wrap: wrap; }
.an-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  align-items: center;
}
.an-toolbar select {
  background-color: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}
.an-summary-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.an-card-wide { grid-column: 1 / -1; }
.an-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.an-card-title {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.an-card-title:hover { color: var(--accent-light); }
.an-card-controls { font-size: 12px; max-width: 420px; line-height: 1.4; }
.an-funnel-body {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 16px;
  align-items: stretch;
}
.an-funnel-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.an-leg-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.an-leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
  background: currentColor;
}
.an-c-order { color: #79b8ff; }
.an-c-buy { color: #3fb950; }
.an-c-refuse { color: #f85149; }
.an-c-ret { color: #d2a8ff; }
.an-leg-label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.an-leg-item strong { display: block; color: var(--text); font-size: 15px; }
.an-leg-item span.muted, .an-leg-item small { display: block; font-size: 12px; }
.an-chart-wrap { height: 260px; position: relative; }
.an-chart-lg { height: 360px; }
.an-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}
.an-kpi-row > div { min-width: 120px; }
.an-kpi-row span.muted { display: block; font-size: 12px; margin-bottom: 4px; }
.an-kpi-row strong { font-size: 15px; }
.an-geo-list { display: flex; flex-direction: column; gap: 10px; }
.an-geo-list-full { max-width: 720px; }
.an-geo-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr auto;
  gap: 10px;
  align-items: center;
}
.an-geo-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-geo-bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,.06);
  overflow: hidden;
}
.an-geo-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a371f7, #39c5cf);
}
.an-geo-meta { text-align: right; font-size: 12px; white-space: nowrap; }
.an-geo-meta strong { display: block; font-size: 13px; }
.an-placeholder-card h3 { margin: 0 0 8px; }
.an-placeholder-card p { margin: 0 0 10px; line-height: 1.5; }
.an-placeholder-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
@media (max-width: 980px) {
  .an-summary-grid { grid-template-columns: 1fr; }
  .an-funnel-body { grid-template-columns: 1fr; }
  .an-funnel-legend { flex-direction: row; flex-wrap: wrap; }
  .an-leg-item { min-width: 140px; }
}


/* Воронка продаж (Analytics) */
.an-section-title { margin: 0; font-size: 16px; font-weight: 700; }
.an-funnel-sub { margin: 4px 0 0; font-size: 12px; }
.an-funnel-toolbar .an-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}
.an-funnel-stages {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 16px;
  align-items: stretch;
}
.an-metric-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow: auto;
}
.an-metric-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.an-metric-btn:hover { background: rgba(255,255,255,.04); }
.an-metric-btn.on {
  background: rgba(63,185,80,.1);
  border-color: rgba(63,185,80,.35);
}
.an-metric-label { font-size: 12px; color: var(--text-muted); }
.an-metric-btn strong { font-size: 15px; font-weight: 700; }
.an-funnel-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.an-funnel-table th, .an-funnel-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.an-funnel-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.an-funnel-table th:hover { color: var(--accent-light); }
.an-funnel-total td { background: rgba(255,255,255,.02); }
.an-funnel-prod { display: flex; gap: 10px; align-items: flex-start; min-width: 200px; }
.an-funnel-thumb {
  width: 40px; height: 40px; border-radius: 6px; object-fit: cover;
  background: var(--surface2); flex-shrink: 0;
}
.an-funnel-thumb.ph {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-muted);
}
.an-funnel-art { font-weight: 650; font-size: 13px; }
.an-funnel-title {
  font-size: 12px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.an-cell-val { font-weight: 600; }
.an-delta { font-size: 11px; margin-top: 2px; }
.an-delta.up { color: #3fb950; }
.an-delta.down { color: #f85149; }
.an-delta.flat { color: var(--text-muted); }
@media (max-width: 980px) {
  .an-funnel-stages { grid-template-columns: 1fr; }
  .an-metric-rail { flex-direction: row; flex-wrap: wrap; max-height: none; }
  .an-metric-btn { width: auto; min-width: 140px; }
}

/* Apple-feel: reduced motion / transparency / contrast */
@media (prefers-reduced-motion: reduce) {
  .btn:active,
  .nav-item:active,
  .sidebar-logo:active,
  .sidebar-user:active,
  .sidebar-balances:active,
  .page-help-btn:active,
  .icon-btn:active,
  .btn-toolbar-primary:active,
  .ue-toolbar .btn-toolbar-primary:active,
  .promo-card:active,
  .promo-tape-bar:active,
  .dpc-bar:active,
  .ax-matrix-cell:active,
  .stat-card:active,
  .orders-updated button:active,
  .chart-tools .icon-btn:active,
  .modal-close:active,
  .guides-card:active,
  .po-row:active {
    transform: none;
  }
  .promo-card:hover,
  .promo-tape-bar:hover,
  .dpc-bar:hover,
  .ax-matrix-cell:hover {
    transform: none;
  }
  .toast,
  .toast.show {
    transform: none;
    transition: opacity 200ms ease;
  }
  .modal-backdrop .modal,
  .nom-modal-bg .nom-modal,
  .modal-backdrop[hidden] .modal,
  .nom-modal-bg[hidden] .nom-modal {
    transform: none;
  }
  .orders-updated button.is-spinning,
  .orders-updated button.is-spinning:hover {
    animation: none;
    opacity: .7;
  }
  .supc-switch span::before { transition: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .sidebar {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .ue-guide-backdrop {
    background: rgba(1, 4, 9, .88);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .modal-backdrop,
  .nom-modal-bg {
    background: rgba(0, 0, 0, .78);
  }
  .sidebar {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Seller: десктопное меню и мобильный таббар — два разных блока, без общих display */
@media (min-width: 901px) {
  html.portal-seller .sidebar {
    display: flex !important;
    flex-direction: column;
    width: 253px;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    position: relative;
    top: auto;
  }
  html.portal-seller .sidebar-nav {
    display: block !important;
    flex: 1 1 auto;
    min-height: 120px;
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
  }
  html.portal-seller .nav-group {
    display: block;
  }
  html.portal-seller .nav-group-title { display: block; }
  html.portal-seller .nav-group-items {
    display: flex;
    flex-direction: column;
  }
  html.portal-seller .nav-item { display: flex !important; }
  html.portal-seller .mob-tabbar,
  html.portal-seller .mob-sheet-bg,
  html.portal-seller .ptr-ind {
    display: none !important;
  }
}

/* Pull-to-refresh: индикатор в зазоре над контентом (только мобилка seller) */
.ptr-ind {
  display: none;
}
@media (max-width: 900px) {
  html.portal-seller.authed .ptr-ind {
    display: flex;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    left: 0;
    right: 0;
    height: 28px;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 45;
    opacity: 0;
  }
  html.portal-seller.authed .ptr-spin {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-top-color: #fff;
    border-radius: 50%;
  }
  html.portal-seller.authed .ptr-ind.is-spin .ptr-spin {
    animation: ptr-spin 700ms linear infinite;
  }
  html.portal-seller.authed .main.is-ptr {
    will-change: transform;
  }
}
@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  html.portal-seller.authed .ptr-ind.is-spin .ptr-spin {
    animation: none;
    border-top-color: var(--brand-hot);
  }
}

/* Переключатель стилей (Настройки → Дизайн, только супер-админ) */
.ui-theme-picks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ui-theme-pick {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  padding: 12px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition:
    transform var(--press-duration) var(--ease-out),
    border-color var(--press-duration) ease,
    background-color var(--press-duration) ease;
}
.ui-theme-pick:active { transform: scale(0.98); }
.ui-theme-pick.on {
  border-color: var(--accent-light);
  background: rgba(35, 134, 54, 0.12);
}
.ui-theme-pick-preview {
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.ui-theme-pick-preview::before,
.ui-theme-pick-preview::after {
  content: "";
  position: absolute;
  inset: 10px 10px 10px auto;
  width: 42%;
  border-radius: 6px;
}
.ui-theme-pick-preview-classic {
  background: #0d1117;
}
.ui-theme-pick-preview-classic::before {
  left: 8px;
  right: auto;
  width: 22px;
  background: #161b22;
  border: 1px solid #30363d;
}
.ui-theme-pick-preview-classic::after {
  background: #161b22;
  border: 1px solid #30363d;
}
.ui-theme-pick-preview-apple {
  background: #000;
}
.ui-theme-pick-preview-apple::before {
  left: 8px;
  right: auto;
  width: 22px;
  background: rgba(28, 28, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.ui-theme-pick-preview-apple::after {
  background: rgba(28, 28, 30, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
.ui-theme-pick strong { font-size: 14px; font-weight: 650; }
.ui-theme-pick span { font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.ui-theme-status {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}
@media (max-width: 520px) {
  .ui-theme-picks { grid-template-columns: 1fr; }
}
.ai-provider-picks .ui-theme-pick {
  justify-content: center;
  min-height: 96px;
  gap: 6px;
}

/* Мобильные хабы: две колонки, все плитки одного размера (без aspect-ratio — Safari ломает сетку) */
@media (max-width: 900px) {
  html.portal-seller .hub-page { width: 100%; }
  html.portal-seller .hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 120px;
    gap: 10px;
    width: 100%;
  }
  html.portal-seller .hub-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    height: 120px;
    min-height: 120px;
    max-height: 120px;
    min-width: 0;
    padding: 14px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    box-sizing: border-box;
    transition: transform var(--press-duration) var(--ease-out);
  }
  html.portal-seller .hub-tile:active { transform: scale(0.97); }
  html.portal-seller .hub-tile-ico {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--surface2);
    color: var(--text-muted);
  }
  html.portal-seller .hub-tile-ico svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  html.portal-seller .hub-tile-title {
    height: 35px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  html.portal-seller .hub-tile-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
  }
}


