: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;
}
* { 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;
}
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>: единый «закрытый» вид Safari / Chrome (открытый список — OS) */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  color-scheme: dark;
  cursor: pointer;
  line-height: 1.3;
  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;
  padding-right: 28px !important;
}
select::-ms-expand { display: none; }
select:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.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);
}
.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: .04em;
}
.login-card h1 .brand-tail { color: var(--brand-hot); }
.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 {
  width: 100%; padding: 10px 14px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 8px; color: var(--text);
  font-size: 16px; outline: none;
  -webkit-appearance: none; appearance: none;
}
.form-group input: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: all .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-secondary {
  background: var(--surface2); color: var(--text); border: 1px solid 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; }

.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; }
.settings-hint {
  font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.4;
}
.settings-tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
}
.settings-tabs button {
  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);
}
.settings-tabs button:hover { color: var(--text); }
.settings-tabs button.active {
  color: var(--text); border-color: var(--accent, #c4f542);
  background: rgba(196, 245, 66, .1);
}
.settings-pane.hidden { display: none; }
.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; }

/* 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: 240px; 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;
}
.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);
}
.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); }
.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;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  color: var(--text-muted); font-size: 14px; margin-bottom: 2px;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(35,134,54,.15); color: var(--accent-light); }
.nav-item .icon { width: 20px; text-align: center; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  user-select: none;
}
.sidebar-user:hover { background: var(--surface2); }
.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; }
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; max-width: 52ch; }
.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;
}
.stat-label {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 8px;
}
.stat-value {
  font-size: 26px; font-weight: 700; line-height: 1.15;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.stat-value.green { color: var(--accent-light); }
.stat-value .slash, .stat-meta .slash {
  color: var(--text-muted); font-weight: 500; margin: 0 .35em;
}
.stat-value .pcs {
  font-size: .82em; font-weight: 600;
  color: var(--text-muted);
}
.stat-delta {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--text-muted); line-height: 1.35;
}
.stat-delta .row { display: flex; align-items: baseline; gap: 6px; }
.stat-delta .arrow {
  font-size: 11px; font-weight: 700; width: 12px; flex-shrink: 0;
}
.stat-delta .up { color: var(--accent-light); }
.stat-delta .down { color: #ff7b72; }
.stat-delta .flat { color: var(--text-muted); }
.stat-meta { margin-top: 12px; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.stat-meta .oz { color: #7eb0ff; }
.stat-meta .wb { color: #f0a0e0; }
.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 */ }

.ue-summary {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px;
}
@media (max-width: 900px) {
  .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.good { color: var(--accent-light); }
.ue-kpi .val.bad { color: #ff7b72; }
.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: 240px; max-width: min(320px, 90vw); max-height: 320px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 32px 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: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ue-art-list {
  overflow-y: auto; padding: 6px 0; max-height: 260px;
}
.ue-art-opt {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px;
  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.oz.on {
  border-color: #79b8ff; background: rgba(88, 166, 255, .15); color: #79b8ff;
}
.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%;
}
.ue-lines-head .ue-g-cost { color: #f85149; }
.ue-lines-head .ue-g-wb { color: #d2a8ff; }
.ue-lines-head .ue-g-oz { color: #79b8ff; }
.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;
}
.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-oz, .ue-line-row .ue-g-oz {
  color: #79b8ff; background: rgba(88, 166, 255, .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;
}
.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 { display: grid; grid-template-columns: 1fr; gap: 0; min-height: 420px; }
.nom-layout.split { grid-template-columns: minmax(280px, 1fr) minmax(340px, 1.15fr); gap: 12px; }
.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: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1;
}
.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: none; flex-direction: column; min-height: 420px; overflow: hidden;
}
.nom-layout.split .nom-detail { display: flex; }
.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; background: rgba(0,0,0,.55); z-index: 80;
  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-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-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: flex-start;
  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: 2px;
}
.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: 11px; color: var(--text-muted); margin-top: 3px;
  display: flex; flex-direction: column; gap: 1px; line-height: 1.35;
}
.top-row .meta .oz { color: #79b8ff; }
.top-row .meta .wb { color: #f0a0e0; }
.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: .25s; z-index: 50;
  max-width: min(360px, calc(100vw - 32px));
  font-size: 13px;
}
.toast.show { opacity: 1; transform: none; }
.chart-legend {
  display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; flex-wrap: wrap;
}
.chart-legend span::before {
  content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin-right: 6px; vertical-align: -1px;
}
.lg-total::before { background: var(--accent-light); }
.lg-ozon::before { background: #388bfd; }
.lg-wb::before { background: #cb11ab; }

/* Последние заказы — карточки */
.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;
}
.orders-updated button:hover, .chart-tools .icon-btn:hover { color: var(--accent-light); }
.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%;
}
.order-card {
  display: flex; gap: 12px; align-items: stretch;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
  min-height: 120px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.order-card img, .order-card .ph {
  /* как у карточек МП: 900×1200 → 3:4 */
  width: 78px; height: 104px; border-radius: 10px; object-fit: cover;
  background: var(--bg); flex-shrink: 0;
}
.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; }
.order-card .title {
  font-size: 13px; font-weight: 600; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.order-card .meta {
  font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.order-card .row2 {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px;
  min-width: 0; max-width: 100%;
}
.order-card .price { font-size: 13px; font-weight: 700; color: var(--accent-light); flex-shrink: 0; }
.order-card .article {
  font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-muted); background: var(--bg); padding: 2px 6px; border-radius: 4px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.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; }

/* Остатки */
.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-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 {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-backdrop[hidden] { display: none !important; }
.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;
}
.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; }
  .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: var(--surface);
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar-logo {
    padding: 4px 4px 10px;
    margin-bottom: 8px;
    gap: 10px;
  }
  .sidebar-logo img { width: 34px; height: 34px; }
  .sidebar-logo h2 { font-size: 14px; }
  .sidebar-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    flex: none;
    min-height: 0;
  }
  .nav-item {
    flex: 1 0 auto;
    justify-content: center;
    padding: 10px 12px;
    margin: 0;
    font-size: 13px;
    white-space: nowrap;
  }
  .sidebar-user {
    margin-top: 8px;
    padding: 8px 10px;
  }
  .sidebar-user-sub { display: none; }
  .main {
    padding: 16px 14px calc(28px + env(safe-area-inset-bottom));
    overflow: visible;
  }
  .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;
  }
  .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;
  }
  .stat-card:active { background: var(--surface2); }
  .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-meta { font-size: 12px; margin-top: 8px; }
  .stat-delta { margin-top: 0; }

  .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;
    min-height: 0;
    gap: 10px;
    width: 100%;
  }
  .order-card img, .order-card .ph {
    width: 66px; height: 88px;
  }
  .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; }
  .nav-item .icon { display: none; }
  .order-card img, .order-card .ph {
    width: 60px; height: 80px;
  }
}

/* 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 .15s, background .15s;
}
.po-row:hover { border-color: var(--accent); background: var(--surface2); }
.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; }
.po-miss-banner {
  grid-column: 1 / -1;
  padding: 8px 12px; margin-bottom: 4px; border-radius: 8px;
  background: rgba(210, 153, 34, .1); border: 1px solid rgba(210, 153, 34, .3);
  color: #e3b341; font-size: 12px; font-weight: 600;
}
.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-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(1, 4, 9, .72);
  display: flex; align-items: stretch; justify-content: center;
  padding: 0;
  backdrop-filter: blur(4px);
}
.ue-guide-backdrop[hidden] { display: none !important; }
.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-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 {
  margin: 0 0 12px; padding: 10px 14px; border-radius: 10px;
  background: rgba(46, 160, 67, .1); border: 1px solid rgba(46, 160, 67, .25);
  font-size: 13px; color: var(--text-muted);
}
.promo-rule-bar strong { color: var(--text); }
.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 .15s, transform .15s;
  position: relative; overflow: hidden;
}
.promo-card:hover { border-color: var(--text-muted); transform: translateY(-1px); }
.promo-card.ended { opacity: .55; }
.promo-card.wb-auto {
  border-color: rgba(125,133,144,.4);
  background: rgba(110,118,129,.08);
}
.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,.55);
  backdrop-filter: blur(1px);
  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-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: 118px; }
.promo-row-actions {
  display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap;
}
.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-auto-tog.on {
  border-color: #3fb950; background: rgba(46,160,67,.18); color: #3fb950; font-weight: 700;
}
.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); }

.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-tog { display: inline-flex; gap: 4px; margin-left: auto; }
.promo-view-tog .btn.on {
  border-color: var(--accent); background: rgba(88,166,255,.15); color: var(--accent-light); font-weight: 700;
}

/* —— Лента акций (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; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2;
  background: var(--surface);
}
.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 .15s, transform .15s;
}
.promo-tape-bar:hover { filter: brightness(1.08); transform: translateY(-1px); }
.promo-tape-bar.mp-oz {
  background: rgba(88,166,255,.14); border-color: rgba(88,166,255,.35);
}
.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;
}
.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-tog { margin-left: 0; width: 100%; }
}

.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-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-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-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); }
/* —— карточка поставки (стиль 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: 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; }

/* —— Пользователи / аватары —— */
.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-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);
}
