:root {
  --bg: #0b0e14;
  --panel: #111621;
  --panel-2: #151b28;
  --line: #242c3a;
  --text: #f4f7fb;
  --muted: #8f9aad;
  --accent: #6d5dfc;
  --accent-2: #4f46e5;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --blue: #38bdf8;
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, "Segoe UI", Arial, sans-serif; }
body { overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; background: #0d1119; border-right: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; z-index: 50; overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; scrollbar-color:#2a3445 transparent; }
.logo { display: flex; gap: 12px; align-items: center; margin: 4px 4px 28px; }
.logo-icon { width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,.22); overflow: hidden; flex: 0 0 52px; }
.logo-icon img { display:block; width:100%; height:100%; object-fit:cover; padding:0; background:#000; }
.logo strong { display: block; font-size: 20px; }
.logo small { color: var(--muted); display: block; margin-top: 3px; }
.nav-title { color: #69758a; text-transform: uppercase; font-size: 11px; letter-spacing: .12em; margin: 8px 10px; }
.nav { display: grid; gap: 5px; }
.nav-btn { border: 0; color: #cbd3df; background: transparent; padding: 11px 12px; border-radius: 11px; text-align: left; display: flex; align-items: center; gap: 10px; transition: .18s; }
.nav-btn:hover { background: #151b27; color: white; }
.nav-btn.active { background: linear-gradient(135deg,#4f46e5,#6d5dfc); color: #fff; box-shadow: 0 8px 24px rgba(79,70,229,.25); }
.nav-ico { width: 24px; text-align: center; opacity: .95; }
.side-bottom { margin-top: auto; display: grid; gap: 10px; }
.side-card { background: #101620; border: 1px solid var(--line); border-radius: 13px; padding: 12px; color: var(--muted); font-size: 12px; }
.dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; background:var(--good); }
.main { grid-column: 2; min-width: 0; padding: 26px 30px 44px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.topbar h1 { margin:0; font-size:26px; letter-spacing:-.02em; }
.top-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.field, .select, .input { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
.input:focus, .select:focus { border-color: #635bff; box-shadow: 0 0 0 3px rgba(99,91,255,.12); }
.btn { text-decoration:none; display:inline-flex; align-items:center; justify-content:center; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 10px; padding: 10px 14px; font-weight: 600; transition:.15s; }
.btn:hover { transform: translateY(-1px); border-color: #3b4658; }
.btn.primary { background: linear-gradient(135deg,var(--accent-2),var(--accent)); border-color: transparent; }
.btn.good { background: #11391f; border-color:#1c6331; color:#c8f7d6; }
.btn.danger { background:#3b1519; border-color:#6c262e; color:#ffc9ce; }
.btn.small { padding:7px 10px; font-size:12px; }
.section { display:none; }
.section.active { display:block; }
.grid { display:grid; gap:14px; }
.metrics { grid-template-columns: repeat(5, minmax(0,1fr)); }
.metric { background: linear-gradient(180deg,#131925,#10151f); border:1px solid var(--line); border-radius:var(--radius); padding:17px 18px; min-height:108px; }
.metric .label { color:var(--muted); font-size:12px; margin-bottom:10px; }
.metric .value { font-size:25px; font-weight:750; letter-spacing:-.03em; }
.metric .sub { color:#677388; font-size:11px; margin-top:8px; }
.panels-2 { grid-template-columns: minmax(0,1.6fr) minmax(320px,.7fr); margin-top:14px; }
.panel { background: var(--panel); border:1px solid var(--line); border-radius:var(--radius); padding:18px; min-width:0; }
.panel h2, .panel h3 { margin:0 0 15px; }
.panel h2 { font-size:17px; }
.panel h3 { font-size:14px; color:#dce3ee; }
.toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.toolbar-left, .toolbar-right { display:flex; gap:9px; align-items:center; flex-wrap:wrap; }
.search { min-width:260px; }
.table-wrap { overflow:auto; border:1px solid var(--line); border-radius:12px; }
table { width:100%; border-collapse:collapse; font-size:12.5px; min-width:850px; }
th { position:sticky; top:0; z-index:1; background:#151b27; color:#aeb8c8; font-weight:600; text-align:left; padding:11px 12px; border-bottom:1px solid var(--line); white-space:nowrap; }
td { padding:10px 12px; border-bottom:1px solid #1d2430; color:#e5eaf1; vertical-align:middle; }
tr:hover td { background:#121925; }
td.num, th.num { text-align:right; font-variant-numeric: tabular-nums; }
.mini-input { width:84px; padding:6px 7px; border-radius:7px; border:1px solid #303a4a; background:#0d121b; color:white; }
.badge { display:inline-flex; align-items:center; gap:5px; border-radius:999px; padding:4px 8px; font-size:11px; background:#1b2330; color:#bac4d4; white-space:nowrap; }
.badge.good { background:#123620; color:#78e69a; }
.badge.warn { background:#3b2a0f; color:#ffd17a; }
.badge.bad { background:#3c171b; color:#ff9ba3; }
.badge.info { background:#102d3a; color:#83d9ff; }
.rec-list { display:grid; gap:9px; }
.rec { border:1px solid var(--line); border-left-width:3px; border-radius:10px; padding:10px 12px; background:#101620; }
.rec.good { border-left-color:var(--good); }
.rec.warn { border-left-color:var(--warn); }
.rec.bad { border-left-color:var(--bad); }
.rec .title { font-weight:650; margin-bottom:4px; }
.rec .text { color:var(--muted); font-size:12px; line-height:1.4; }
.empty { color:var(--muted); padding:30px 12px; text-align:center; }
.canvas-wrap { height:300px; position:relative; }
canvas { width:100%; height:100%; }
.tabs { display:flex; gap:6px; margin-bottom:12px; }
.tab { border:1px solid var(--line); color:#adb8c8; background:#111722; padding:8px 12px; border-radius:9px; }
.tab.active { background:#252054; color:white; border-color:#5146c7; }
.settings-grid { display:grid; grid-template-columns: minmax(0,1fr) minmax(360px,.7fr); gap:14px; }
.form-row { display:grid; gap:6px; margin-bottom:14px; }
.form-row label { color:#c9d1df; font-size:12px; }
.token-row { display:flex; gap:8px; }
.token-row .input { flex:1; }
.permissions { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.permission { border:1px solid var(--line); border-radius:10px; padding:10px; display:flex; justify-content:space-between; gap:8px; }
.logbox { height:270px; overflow:auto; white-space:pre-wrap; font-family:Consolas,monospace; font-size:11px; color:#aab5c4; background:#090d13; border:1px solid var(--line); border-radius:10px; padding:10px; }
.syncbar { display:none; position:sticky; top:8px; z-index:30; margin-bottom:12px; background:#121a29; border:1px solid #2c3a55; border-radius:12px; padding:10px 12px; box-shadow:0 12px 35px rgba(0,0,0,.25); }
.syncbar.show { display:block; }
.sync-top { display:flex; justify-content:space-between; gap:10px; font-size:12px; color:#c9d5e7; margin-bottom:8px; }
.progress { height:6px; background:#20293a; border-radius:999px; overflow:hidden; }
.progress > div { height:100%; width:0; background:linear-gradient(90deg,#4f46e5,#7c6cff,#38bdf8); transition:width .3s; }
.toast-area { position:fixed; right:20px; bottom:20px; z-index:100; display:grid; gap:8px; width:min(360px,calc(100vw - 40px)); }
.toast { padding:12px 14px; border-radius:11px; background:#17202d; border:1px solid #303b4a; box-shadow:0 15px 40px rgba(0,0,0,.35); font-size:13px; animation:slide .2s ease; }
.toast.good { border-color:#27633c; }
.toast.bad { border-color:#7a2930; }
.toast.warn { border-color:#8a6b21; }
@keyframes slide { from{ transform:translateY(8px); opacity:0;} to{transform:none;opacity:1;} }
.modal { display:none; position:fixed; inset:0; z-index:90; background:rgba(4,7,12,.72); align-items:center; justify-content:center; padding:20px; }
.modal.show { display:flex; }
.modal-card { width:min(540px,100%); background:#111722; border:1px solid var(--line); border-radius:16px; padding:20px; box-shadow:0 30px 90px rgba(0,0,0,.5); }
.modal-card h3 { margin-top:0; }
.help { color:var(--muted); font-size:11px; line-height:1.5; }
.kpi-positive { color:#66e08a; }
.kpi-negative { color:#ff7f89; }
.mobile-menu { display:none; }
@media (max-width: 1180px) {
  .metrics { grid-template-columns:repeat(3,1fr); }
  .panels-2, .settings-grid { grid-template-columns:1fr; }
}
@media (max-width: 820px) {
  .app { display:block; }
  .sidebar { transform:translateX(-100%); transition:.2s; width:250px; }
  .sidebar.open { transform:none; }
  .main { padding:18px 14px 40px; }
  .mobile-menu { display:inline-flex; }
  .topbar h1 { font-size:20px; }
  .metrics { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 520px) {
  .metrics { grid-template-columns:1fr; }
  .search { min-width:100%; }
  .topbar { align-items:flex-start; }
  .permissions { grid-template-columns:1fr; }
}
.token-info{margin:10px 0 12px;padding:10px 12px;border:1px solid var(--line,#263043);border-radius:10px;background:rgba(255,255,255,.02);font-size:13px;color:#aab6c8;display:none}.token-info.show{display:block}.token-info.good{border-color:rgba(34,197,94,.35);color:#b7f7c8}.token-info.warn{border-color:rgba(245,158,11,.4);color:#f7d89a}.token-info.bad{border-color:rgba(239,68,68,.4);color:#ffb3b3}.btn.danger{border-color:rgba(239,68,68,.35);color:#ff9f9f}.permission .reason{display:block;font-size:11px;color:#7f8a9c;margin-top:3px}

/* DBS order management */
.nav-count{margin-left:auto;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#ef4444;color:white;font-size:11px;font-weight:800;align-items:center;justify-content:center}
.dbs-warning{margin:0 0 12px;padding:10px 12px;border-radius:10px;background:#2b2413;border:1px solid #58491c;color:#d9bf7b}
.dbs-table-wrap table{min-width:1180px}
.row-attention td{background:rgba(239,68,68,.045)}
.modal-card.wide{width:min(1180px,96vw);max-height:92vh;overflow:auto}
.modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:16px;position:sticky;top:-20px;background:#111722;padding:20px 0 12px;z-index:5;border-bottom:1px solid var(--line)}
.modal-head h3{font-size:22px;margin:0 0 5px}
.dbs-actionbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.dbs-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.detail-block{background:#0d131d;border:1px solid var(--line);border-radius:13px;padding:14px;min-width:0}
.detail-block h4{margin:0 0 12px;font-size:14px;color:#fff}
.kv{display:grid;grid-template-columns:145px minmax(0,1fr);gap:8px 12px;align-items:start;font-size:12.5px}
.kv>span{color:var(--muted)}
.kv>b{overflow-wrap:anywhere;font-weight:650}
.mono{font-family:Consolas,monospace;font-size:11px}
.contact-link{color:#8fb4ff;text-decoration:none}.contact-link:hover{text-decoration:underline}
.inline-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.comment-box{margin-top:12px;padding:10px 12px;border-radius:10px;background:#171d29;border-left:3px solid var(--accent);font-size:12px;line-height:1.45}
.comment-box b{display:block;margin-bottom:5px}
.check-row{display:flex;align-items:center;gap:8px;margin-top:12px;color:#d5dce8;font-size:12px}
.info-card{margin-top:12px;padding:10px;border-radius:10px;background:#111a27;border:1px solid #25344a}.info-card .label{color:var(--muted);font-size:11px;margin-bottom:4px}
.inner-panel{margin-top:12px;background:#0d131d}
.meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.meta-edit{border:1px solid var(--line);border-radius:10px;padding:10px;display:grid;gap:8px}.meta-label{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px}.dbs-meta-input{width:100%;resize:vertical}
.event-list{display:grid;gap:6px}.event{display:grid;grid-template-columns:150px 170px 1fr;gap:10px;padding:8px 0;border-bottom:1px solid #1c2431;font-size:11.5px}.event span:first-child{color:var(--muted)}
.dbs-settings-grid{grid-template-columns:1.2fr .8fr;gap:16px}
@media(max-width:900px){.dbs-detail-grid,.meta-grid,.dbs-settings-grid{grid-template-columns:1fr}.kv{grid-template-columns:120px 1fr}.modal-card.wide{width:100%;max-height:96vh}.event{grid-template-columns:1fr}.event span:first-child{font-size:10px}}


/* Главная: фильтр периода и интерактивный график */
.dashboard-period-panel{margin-bottom:14px;padding:13px 16px}
.dashboard-period-controls{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.period-presets,.period-custom,.chart-controls{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.period-custom label{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:12px}
.date-input{padding:8px 10px;width:150px;color-scheme:dark}
.period-preset.active{background:#252054;border-color:#6156ef;color:#fff;box-shadow:0 0 0 2px rgba(109,93,252,.12)}
#dashboardPeriodLabel{margin-top:8px}
.interactive-chart{height:340px;user-select:none}
.interactive-chart canvas{cursor:crosshair;touch-action:none}
.interactive-chart.dragging canvas{cursor:grabbing}
.chart-tooltip{position:absolute;display:none;pointer-events:none;z-index:5;min-width:190px;padding:9px 11px;border-radius:10px;background:rgba(8,12,19,.96);border:1px solid #354157;box-shadow:0 12px 34px rgba(0,0,0,.45);font-size:12px;color:#e8edf5;line-height:1.55;white-space:nowrap}
.chart-tooltip.show{display:block}
.chart-tooltip .tt-date{font-weight:750;margin-bottom:4px;color:#fff}
.chart-tooltip .tt-row{display:flex;justify-content:space-between;gap:18px}
.chart-tooltip .tt-dot{width:7px;height:7px;border-radius:50%;display:inline-block;margin-right:6px}
@media (max-width:820px){.dashboard-period-controls{align-items:flex-start}.period-custom{width:100%}.date-input{width:135px}.interactive-chart{height:300px}}


/* Первый вариант refresh-значка */
.refresh-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:1.28em;
  height:1.28em;
  min-width:1.28em;
  margin-right:.34em;
  font-family:"Segoe UI Symbol","Arial Unicode MS",sans-serif;
  font-size:1.05em;
  font-weight:700;
  line-height:1;
  vertical-align:middle;
  overflow:visible;
  transform:rotate(45deg);
  transform-origin:50% 50%;
  position:relative;
  top:0;
}
.btn .refresh-icon{
  flex:0 0 1.28em;
}

/* DBS buyer chat */
.chat-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}
.chat-messages{background:#0a1018;border:1px solid var(--line);border-radius:14px;padding:14px;max-height:430px;min-height:140px;overflow:auto;display:flex;flex-direction:column;gap:10px}
#dbsOrderModal .chat-messages{height:min(68vh,680px);min-height:240px;max-height:82vh;resize:none}
#dbsOrderModal .chat-messages.chat-messages-expanded{height:min(82vh,900px);min-height:min(82vh,900px);max-height:82vh}
.chat-msg-row{display:flex;width:100%}
.chat-msg-row.buyer{justify-content:flex-start}.chat-msg-row.mine{justify-content:flex-end}
.chat-bubble{max-width:min(76%,720px);border-radius:16px;padding:10px 12px;background:#17202d;border:1px solid #263247;box-shadow:0 4px 18px rgba(0,0,0,.12)}
.chat-msg-row.mine .chat-bubble{background:#3d2fb5;border-color:#5a48db}
.chat-meta{display:flex;justify-content:space-between;gap:18px;font-size:11px;color:#98a9c2;margin-bottom:5px}.chat-msg-row.mine .chat-meta{color:#d8d3ff}
.chat-text{white-space:pre-wrap;word-break:break-word;line-height:1.45}
.chat-attachments{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}.chat-attachment{display:inline-flex;align-items:center;gap:6px;color:#dbe7ff;text-decoration:none;border:1px solid #334057;border-radius:10px;padding:7px 9px;background:#0d141f}.chat-attachment:hover{border-color:#6656ff}.chat-attachment.image{flex-direction:column;align-items:flex-start}.chat-attachment.image img{display:block;max-width:180px;max-height:140px;border-radius:8px;object-fit:cover}.chat-good-card{font-size:12px;color:#aab8cc;border-left:2px solid #6656ff;padding-left:8px}
.chat-compose{margin-top:12px}.chat-compose textarea{width:100%;resize:vertical;min-height:70px}.chat-compose-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px}.chat-compose-bottom>div{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.chat-file-label{cursor:pointer}.chat-link-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}.chat-link-row .select{min-width:min(520px,100%);flex:1}.chat-unlinked .comment-box{margin-bottom:0}.chat-empty{padding:30px 10px}
@media(max-width:760px){.chat-head,.chat-compose-bottom{align-items:stretch;flex-direction:column}.chat-bubble{max-width:92%}.chat-link-row{align-items:stretch;flex-direction:column}.chat-link-row .select{width:100%;min-width:0}}


/* Кликабельные карточки главной страницы */
.metric.metric-clickable{
  position:relative;
  cursor:pointer;
  transition:transform .16s ease,border-color .16s ease,background .16s ease,box-shadow .16s ease;
  padding-bottom:34px;
}
.metric.metric-clickable:hover{
  transform:translateY(-2px);
  border-color:#5f55e8;
  background:#151b28;
  box-shadow:0 10px 28px rgba(0,0,0,.18);
}
.metric.metric-clickable:focus-visible{
  outline:2px solid #7367ff;
  outline-offset:2px;
}
.metric-more{
  position:absolute;
  left:22px;
  bottom:12px;
  font-size:12px;
  color:#8f86ff;
  opacity:.9;
}
.metric.metric-clickable:hover .metric-more{color:#b3adff;}


/* Карточки показателей раздела «Продажи» используют тот же интерактивный стиль, что и главная. */
#salesMetrics .metric.metric-clickable{min-height:150px;}
.sales-operation-toolbar{align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;}


/* Сортировка DBS кликом по заголовкам таблицы */
.dbs-sortable{
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  transition:color .14s ease, background .14s ease;
}
.dbs-sortable:hover{
  color:#d8d4ff;
  background:rgba(109,94,252,.06);
}
.dbs-sortable:focus-visible{
  outline:2px solid #6d5efc;
  outline-offset:-2px;
}
.dbs-sortable.sort-active{
  color:#b6afff;
}
.dbs-sort-indicator{
  display:inline-block;
  min-width:1em;
  margin-left:.22em;
  font-size:.95em;
  font-weight:800;
  line-height:1;
  vertical-align:baseline;
}


/* Универсальная сортировка всех таблиц кликом по заголовку */
.table-sortable-header{
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  transition:color .14s ease,background .14s ease;
}
.table-sortable-header:hover{
  color:#d8d4ff;
  background:rgba(109,94,252,.06);
}
.table-sortable-header:focus-visible{
  outline:2px solid #6d5efc;
  outline-offset:-2px;
}
.table-sortable-header.table-sort-active{
  color:#b6afff;
}
.table-sort-indicator{
  display:inline-block;
  min-width:1em;
  margin-left:.22em;
  font-size:.95em;
  font-weight:800;
  line-height:1;
  vertical-align:baseline;
}


/* DBS: верхние показатели работают как фильтры */
#dbsMetrics,#dbsTestMetrics{grid-template-columns:repeat(6,minmax(0,1fr))}
#assemblyMetrics{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:1180px){#dbsMetrics,#dbsTestMetrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:820px){#dbsMetrics,#dbsTestMetrics{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){#dbsMetrics,#dbsTestMetrics{grid-template-columns:1fr}}
@media(max-width:520px){#assemblyMetrics{grid-template-columns:1fr}}
.dbs-metrics .dbs-filter-card{
  cursor:pointer;
  user-select:none;
  transition:transform .15s ease,border-color .15s ease,background .15s ease,box-shadow .15s ease;
}
.dbs-metrics .dbs-filter-card:hover{
  transform:translateY(-2px);
  border-color:#6257ee;
  background:#151b28;
  box-shadow:0 10px 26px rgba(0,0,0,.17);
}
.dbs-metrics .dbs-filter-card:focus-visible{
  outline:2px solid #7367ff;
  outline-offset:2px;
}
.dbs-metrics .dbs-filter-card.dbs-filter-active{
  border:2px solid #9a82ff;
  background:linear-gradient(135deg,rgba(124,92,255,.30),rgba(48,39,78,.96));
  box-shadow:0 0 0 3px rgba(124,92,255,.22),0 10px 28px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.08);
  transform:translateY(-1px);
}
.dbs-metrics .dbs-filter-card.dbs-filter-active .label{
  color:#fff;
}
.dbs-filter-pills{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.dbs-filter-pill.active,
.dbs-filter-pill.dbs-filter-active{
  border-color:#6d5efc;
  background:rgba(109,94,252,.16);
  color:#d7d3ff;
}
.dbs-filter-pill[hidden],
.dbs-hide-noanswer-parameter[hidden]{display:none!important}
.dbs-filter-pill--assembly{
  border-color:rgba(245,158,11,.42);
  color:#fcd34d;
}
.dbs-filter-pill--assembly.active,
.dbs-filter-pill--assembly.dbs-filter-active{
  border-color:#f59e0b;
  background:rgba(245,158,11,.18);
  color:#fff1bf;
}
.dbs-assembly-queue-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 5px;
  margin-left:3px;
  border-radius:999px;
  background:rgba(245,158,11,.18);
  font-size:11px;
  font-weight:900;
}


/* Реальный статус последней синхронизации */
#lastSyncCard{
  min-height:0;
  padding:10px 11px;
}
.sync-card-title{
  color:#8f9bb3;
  font-size:12px;
  margin-bottom:7px;
}
.sync-card-row{
  display:flex;
  align-items:center;
  gap:7px;
  min-height:20px;
  color:#e8edf7;
}
.sync-card-percent{
  margin-left:auto;
  color:#a7b0c3;
  font-size:11px;
  font-weight:700;
}
.sync-card-time{
  margin-left:auto;
  color:#c5cede;
  font-size:11px;
  font-weight:600;
  white-space:nowrap;
}
.sync-card-detail{
  margin-top:5px;
  color:#7f8ba3;
  font-size:10.5px;
  line-height:1.3;
  white-space:nowrap;
}
.sync-card-empty{
  color:#7f8ba3;
  font-size:13px;
}
.sync-status-dot,
.sync-live-dot{
  width:8px;
  height:8px;
  min-width:8px;
  border-radius:50%;
  display:inline-block;
}
.sync-status-dot.good{background:#22c55e;box-shadow:0 0 8px rgba(34,197,94,.28);}
.sync-status-dot.bad{background:#ef4444;box-shadow:0 0 8px rgba(239,68,68,.26);}
.sync-live-dot{
  background:#60a5fa;
  box-shadow:0 0 0 0 rgba(96,165,250,.45);
  animation:sync-live-pulse 1.4s infinite;
}
.sync-ok{color:#5ee58a;}
.sync-bad{color:#ff7a7a;}
.sync-card-note{
  margin-top:6px;
  padding-top:5px;
  border-top:1px solid rgba(125,138,164,.15);
  color:#8f9bb3;
  font-size:10px;
  line-height:1.3;
}
.sync-card-note.warn{color:#e7b85b;}
@keyframes sync-live-pulse{
  0%{box-shadow:0 0 0 0 rgba(96,165,250,.42);}
  70%{box-shadow:0 0 0 7px rgba(96,165,250,0);}
  100%{box-shadow:0 0 0 0 rgba(96,165,250,0);}
}


/* DBS: кликабельный адрес / геометка */
.dbs-address-link{
  color:#9eb9ff;
  text-decoration:none;
  border-bottom:1px dashed rgba(158,185,255,.45);
  line-height:1.45;
}
.dbs-address-link:hover{
  color:#c4d4ff;
  border-bottom-color:#c4d4ff;
}
.dbs-map-mark{
  display:inline-block;
  margin-left:.2em;
  font-size:.9em;
}
.dbs-map-coords{
  color:#7f8ba3;
  font-size:.9em;
  margin-left:.35em;
}
.dbs-address-missing{
  color:#7f8ba3;
  font-weight:500;
}
.dbs-table-address{
  color:#9eb9ff;
  text-decoration:none;
  font-size:12px;
  line-height:1.35;
}
.dbs-table-address:hover{
  color:#c4d4ff;
  text-decoration:underline;
}


/* DBS: регион как fallback, если полный адрес WB API недоступен */
.dbs-location-label{
  color:#7f8ba3;
  font-weight:500;
}
.dbs-region-link{
  border-bottom-style:dotted;
}
.dbs-table-region{
  color:#9aaad0;
}


/* Точный адрес DBS и отдельный регион-fallback */
.dbs-region-caption{
  color:#7f8ba3;
  font-weight:500;
}
.dbs-region-only{
  color:#9aaad0;
  text-decoration:none;
  border-bottom:1px dotted rgba(154,170,208,.45);
}
.dbs-region-only:hover{
  color:#c4d4ff;
  border-bottom-color:#c4d4ff;
}
.dbs-address-refresh{
  margin-top:10px;
}


/* Яндекс Доставка / Go для бизнеса */
.yandex-delivery-status,
.yandex-create-box{
  padding:4px 0;
}
#yandexWarehouses .btn{
  margin:3px 4px 3px 0;
  max-width:100%;
  white-space:normal;
  text-align:left;
}
.yandex-create-box .kv b{
  overflow-wrap:anywhere;
}


/* Настройки: жёсткое ограничение контента внутри рабочей области */
.main,
.section,
#page-settings,
#page-settings > *,
.yandex-settings-panel,
.yandex-settings-grid,
.yandex-settings-grid > *,
.form-row,
.token-row{
  min-width:0;
  max-width:100%;
}

#page-settings{
  width:100%;
  overflow-x:hidden;
}

.yandex-settings-panel{
  width:100%;
  overflow:hidden;
}

.yandex-settings-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px 18px;
}

.yandex-source-row{
  grid-column:1 / -1;
}

.yandex-source-actions,
.yandex-settings-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.yandex-dims{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}

.yandex-permission-box{
  width:100%;
  margin:8px 0 12px;
}

.yandex-source-results{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
  min-width:0;
  max-width:100%;
}

.yandex-source-results .btn{
  max-width:100%;
  white-space:normal;
  text-align:left;
}

#page-settings .logbox{
  max-width:100%;
  width:100%;
  overflow:auto;
}

@media (max-width:1180px){
  .yandex-settings-grid{grid-template-columns:1fr;}
  .yandex-source-row{grid-column:auto;}
}

@media (max-width:820px){
  .yandex-dims{grid-template-columns:1fr;}
  .token-row{flex-wrap:wrap;}
  .token-row .input{flex:1 1 100%;min-width:0;}
}


/* DBS search: do not allow browser number controls/autofill styling */
#dbsSearch{
  -webkit-appearance:none;
  appearance:none;
}

/* Recommendations: collapsible + clickable detail cards */
.recommendations-panel{
  align-self:start;
}
.recommendations-header{
  margin-bottom:10px;
  align-items:flex-start;
}
.recommendations-collapsed{
  padding-bottom:14px;
}
.recommendation-card{
  cursor:pointer;
  user-select:none;
  transition:border-color .15s ease,background .15s ease,transform .15s ease;
}
.recommendation-card:hover{
  transform:translateY(-1px);
  border-color:rgba(109,94,252,.62);
  background:rgba(109,94,252,.045);
}
.recommendation-card:focus-visible{
  outline:2px solid #6d5efc;
  outline-offset:2px;
}
.recommendation-main{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.recommendation-copy{
  min-width:0;
}
.recommendation-chevron{
  flex:0 0 auto;
  font-size:20px;
  line-height:1;
  color:#7f8ba3;
  transform:rotate(0deg);
  transition:transform .16s ease,color .16s ease;
}
.recommendation-card.expanded .recommendation-chevron{
  transform:rotate(180deg);
  color:#b9b3ff;
}
.recommendation-details{
  display:none;
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid rgba(125,138,164,.16);
  color:#aab4c6;
  font-size:12px;
  line-height:1.45;
}
.recommendation-card.expanded .recommendation-details{
  display:block;
}
.recommendation-explanation{
  margin:7px 0 10px;
}
.recommendation-open{
  cursor:pointer;
}


/* Прибыль: поиск + всегда видимая шапка таблицы */
.profit-search-row{
  display:flex;
  align-items:center;
  gap:9px;
  flex-wrap:wrap;
  margin:0 0 12px;
}
.profit-search-row .search{
  flex:1 1 380px;
  min-width:260px;
  max-width:620px;
}

/*
  У таблиц проекта заголовок уже position:sticky.
  Для длинной таблицы прибыли делаем собственную вертикальную область прокрутки:
  при прокрутке строк thead остаётся сверху, а горизонтальный скролл сохраняется.
*/
.profit-table-wrap{
  max-height:calc(100vh - 245px);
  min-height:300px;
  overflow:auto;
  position:relative;
  scrollbar-gutter:stable;
}

#profitTable thead th{
  position:sticky;
  top:0;
  z-index:12;
  background:#151b27;
  box-shadow:0 1px 0 var(--line),0 6px 14px rgba(7,10,16,.28);
}

#profitTable tbody tr:last-child td{
  border-bottom:0;
}

@media (max-height:720px){
  .profit-table-wrap{
    max-height:calc(100vh - 190px);
    min-height:240px;
  }
}


/* Кнопка сброса только для фильтров */
.filter-reset-round{
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  padding:0;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 44px;
}
.filter-reset-round svg{
  width:20px;
  height:20px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
  transition:transform .15s ease;
}
.filter-reset-round:hover svg{
  transform:rotate(-18deg);
}
.toolbar-left .filter-reset-round,
.profit-search-row .filter-reset-round,
.sales-operation-toolbar .filter-reset-round{
  flex:0 0 44px;
}


/* Рекомендации: надёжное сворачивание блока */
#recommendations[hidden],
.recommendations-collapsed #recommendations{
  display:none !important;
}

.recommendations-panel.recommendations-collapsed{
  padding-bottom:14px;
}

.recommendations-panel.recommendations-collapsed .recommendations-header{
  margin-bottom:0;
}


/* DBS search: contenteditable вместо input.
   Браузерное автозаполнение форм сюда не применяется. */
.dbs-search-editor{
  display:flex;
  align-items:center;
  min-height:46px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:text;
}
.dbs-search-editor:empty::before{
  content:attr(data-placeholder);
  color:var(--muted, #718096);
  pointer-events:none;
}
.dbs-search-editor:focus{
  outline:none;
}


/* === Yandex recipient card === */
.yandex-recipient-summary{
  margin-top:12px;
  border:1px solid #2b3548;
  border-left:4px solid #7657ff;
  border-radius:16px;
  background:
    radial-gradient(circle at 92% 8%,rgba(118,87,255,.18),transparent 34%),
    #121925;
  padding:18px;
  overflow:hidden;
}
.yandex-recipient-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding-bottom:14px;
  border-bottom:1px solid #263146;
}
.yandex-recipient-brand{
  color:#9cabbe;
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.yandex-recipient-title{
  margin-top:4px;
  color:#f7f9ff;
  font-size:18px;
  font-weight:750;
}
.yandex-recipient-status{
  max-width:46%;
  border:1px solid rgba(118,87,255,.42);
  border-radius:999px;
  background:rgba(118,87,255,.12);
  color:#c7bdff;
  font-size:11px;
  line-height:1.3;
  padding:7px 10px;
  text-align:center;
}
.yandex-recipient-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:14px;
}
.yandex-recipient-field{
  min-width:0;
  border:1px solid #273247;
  border-radius:12px;
  background:#161e2c;
  padding:12px 14px;
}
.yandex-recipient-field>span{
  display:block;
  margin-bottom:5px;
  color:#8291a9;
  font-size:11px;
}
.yandex-recipient-field>b{
  display:block;
  color:#f6f8fd;
  font-size:14px;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.yandex-recipient-field.yandex-recipient-code{
  border-color:rgba(118,87,255,.62);
  background:linear-gradient(135deg,rgba(94,70,245,.22),rgba(125,92,255,.10));
}
.yandex-recipient-field.yandex-recipient-code>b{
  font-size:24px;
  letter-spacing:.04em;
}
.yandex-recipient-wide{grid-column:1/-1}
.yandex-recipient-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:14px;
}

.yandex-recipient-modal-card{
  width:min(760px,96vw);
  max-height:94vh;
  overflow:auto;
}
.yandex-recipient-modal-head{
  top:-20px;
}
.yandex-recipient-preview-wrap{
  display:flex;
  justify-content:center;
  border:1px solid #273247;
  border-radius:16px;
  background:#0b111b;
  padding:14px;
}
.yandex-recipient-preview-wrap img{
  display:block;
  width:min(100%,460px);
  height:auto;
  border-radius:14px;
  box-shadow:0 16px 45px rgba(0,0,0,.35);
}
.yandex-recipient-modal-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
}
@media(max-width:700px){
  .yandex-recipient-grid{grid-template-columns:1fr}
  .yandex-recipient-wide{grid-column:auto}
  .yandex-recipient-head{flex-direction:column}
  .yandex-recipient-status{max-width:100%}
}


/* DBS: цветовая индикация этапов доставки. */
/* «На сборке» — жёлтая подсветка всей строки. */
#dbsBody tr.row-on-assembly td{
  background:rgba(245,158,11,.14);
  border-bottom-color:rgba(245,158,11,.28);
}
#dbsBody tr.row-on-assembly td:first-child{
  box-shadow:inset 4px 0 0 #f59e0b;
}
#dbsBody tr.row-on-assembly:hover td{
  background:rgba(245,158,11,.20);
}
#dbsBody tr.row-on-assembly .dbs-table-address{
  color:#fcd34d;
}

#dbsBody tr.row-in-delivery td{
  background:rgba(59,130,246,.12);
  border-bottom-color:rgba(59,130,246,.24);
}
#dbsBody tr.row-in-delivery td:first-child{
  box-shadow:inset 4px 0 0 #3b82f6;
}
#dbsBody tr.row-in-delivery:hover td{
  background:rgba(59,130,246,.18);
}
#dbsBody tr.row-in-delivery .dbs-table-address{
  color:#93c5fd;
}

/* Финально доставленный заказ — заметная ярко-зелёная подсветка. */
#dbsBody tr.row-delivered td{
  background:rgba(34,197,94,.24);
  border-bottom-color:rgba(34,197,94,.42);
}
#dbsBody tr.row-delivered td:first-child{
  box-shadow:inset 5px 0 0 #22c55e;
}
#dbsBody tr.row-delivered:hover td{
  background:rgba(34,197,94,.31);
}
#dbsBody tr.row-delivered .dbs-table-address{
  color:#bbf7d0;
}

/* DBS: Яндекс уже выдал код получения — заказ ожидает вручения покупателю. */
#dbsBody tr.row-ready-pickup td{
  background:rgba(34,197,94,.10);
  border-bottom-color:rgba(34,197,94,.22);
}
#dbsBody tr.row-ready-pickup td:first-child{
  box-shadow:inset 4px 0 0 #22c55e;
}
#dbsBody tr.row-ready-pickup:hover td{
  background:rgba(34,197,94,.15);
}
#dbsBody tr.row-ready-pickup .dbs-table-address{
  color:#9ae6b4;
}
.dbs-ready-pickup-label{
  margin-top:5px;
}


/* Поиск в разделе «Прибыль»: не является полем формы,
   поэтому браузер не может автоматически подставить сюда 5000. */
.profit-search-editor{
  display:flex;
  align-items:center;
  min-height:44px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:text;
}
.profit-search-editor:empty::before{
  content:attr(data-placeholder);
  color:var(--muted, #718096);
  pointer-events:none;
}
.profit-search-editor:focus{
  outline:none;
}


/* Все текстовые фильтры дашборда исключены из browser form autofill.
   Они выглядят как input, но технически являются contenteditable. */
.filter-search-editor{
  display:flex;
  align-items:center;
  min-height:44px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:text;
}
.filter-search-editor:empty::before{
  content:attr(data-placeholder);
  color:var(--muted, #718096);
  pointer-events:none;
}
.filter-search-editor:focus{
  outline:none;
}
.ads-search-editor{
  flex:1 1 260px;
}

/* Карта выбора ПВЗ Яндекс Доставки */
.yandex-pvz-map-panel{
  margin:12px 0;
  padding:14px;
  border:1px solid rgba(99,102,241,.35);
  border-radius:16px;
  background:rgba(18,25,40,.72);
  overflow:hidden;
}
.yandex-pvz-map-panel[hidden]{display:none!important;}
.yandex-pvz-map-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:12px;
}
.yandex-pvz-map-head>div:first-child{min-width:0;}
.yandex-pvz-distance{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
  text-align:right;
  min-width:280px;
}
.yandex-pvz-distance-value{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.yandex-pvz-distance-value span{
  color:var(--muted,#8da0c7);
  font-size:12px;
}
.yandex-pvz-distance-value b{
  font-size:16px;
  color:#fff;
}
.yandex-pvz-map{
  width:100%;
  height:300px;
  min-height:240px;
  border-radius:13px;
  overflow:hidden;
  border:1px solid rgba(148,163,184,.22);
  background:#0b1220;
  position:relative;
  z-index:0;
}
.yandex-map-note{margin-top:8px;}
.yandex-map-fallback{
  height:100%;
  min-height:240px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px;
  color:var(--muted,#8da0c7);
}
.inline-link{
  color:#8fb3ff;
  text-decoration:none;
  border-bottom:1px dotted rgba(143,179,255,.55);
}
.inline-link:hover{color:#b9ceff;}

/* Внутри блока используется нативный слой и элементы управления Яндекс Карт. */
.yandex-pvz-map ymaps[class*="-map"]{
  border-radius:13px;
}

@media (max-width:900px){
  .yandex-pvz-map-head{flex-direction:column;}
  .yandex-pvz-distance{min-width:0;width:100%;justify-content:flex-start;text-align:left;}
  .yandex-pvz-map{height:280px;min-height:230px;}
}


/* DBS: таблица всегда полностью помещается по ширине рабочей области.
   Горизонтальный скролл для списка заказов не нужен. */
.dbs-table-wrap{
  overflow-x:hidden;
}
.dbs-table-wrap table{
  width:100%;
  min-width:0;
  table-layout:fixed;
  font-size:12px;
}
.dbs-table-wrap th,
.dbs-table-wrap td{
  padding-left:8px;
  padding-right:8px;
  min-width:0;
}
.dbs-table-wrap th{
  overflow:hidden;
  text-overflow:ellipsis;
}
.dbs-table-wrap .dbs-sortable{
  white-space:nowrap;
}
.dbs-table-wrap td{
  overflow-wrap:anywhere;
  word-break:normal;
}
.dbs-table-wrap td:nth-child(1),
.dbs-table-wrap th:nth-child(1){width:9%;}
.dbs-table-wrap td:nth-child(2),
.dbs-table-wrap th:nth-child(2){width:9%;}
.dbs-table-wrap td:nth-child(3),
.dbs-table-wrap th:nth-child(3){width:11%;}
.dbs-table-wrap td:nth-child(4),
.dbs-table-wrap th:nth-child(4){width:20%;}
.dbs-table-wrap td:nth-child(5),
.dbs-table-wrap th:nth-child(5){width:9%;}
.dbs-table-wrap td:nth-child(6),
.dbs-table-wrap th:nth-child(6){width:8%;}
.dbs-table-wrap td:nth-child(7),
.dbs-table-wrap th:nth-child(7){width:23%;}
.dbs-table-wrap td:nth-child(8),
.dbs-table-wrap th:nth-child(8){width:11%;}

.dbs-table-wrap td:nth-child(1),
.dbs-table-wrap td:nth-child(2),
.dbs-table-wrap td:nth-child(3),
.dbs-table-wrap td:nth-child(5),
.dbs-table-wrap td:nth-child(6),
.dbs-table-wrap td:nth-child(8){
  white-space:normal;
}
.dbs-table-wrap td:nth-child(4) b{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
  line-height:1.32;
}
.dbs-table-wrap .dbs-table-address{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
  line-height:1.32;
}
.dbs-table-wrap .badge{
  max-width:100%;
  white-space:normal;
  justify-content:center;
  text-align:center;
  line-height:1.2;
}
#dbsBody .dbs-clickable-row{
  cursor:pointer;
}
#dbsBody .dbs-clickable-row:focus-visible td{
  outline:1px solid rgba(124,92,255,.9);
  outline-offset:-2px;
}
#dbsBody .dbs-clickable-row td{
  transition:filter .12s ease, box-shadow .12s ease;
}
#dbsBody .dbs-clickable-row:hover td{
  filter:brightness(1.08);
}

@media (max-width:1180px){
  .dbs-table-wrap table{font-size:11.5px;}
  .dbs-table-wrap th,
  .dbs-table-wrap td{padding-left:6px;padding-right:6px;}
  .dbs-table-wrap td:nth-child(1),
  .dbs-table-wrap th:nth-child(1){width:9%;}
}


/* Товары: таблица полностью помещается в рабочую область без горизонтального скролла. */
#page-products .table-wrap{
  overflow-x:hidden;
}
#productsTable{
  width:100%;
  min-width:0;
  table-layout:fixed;
  font-size:11px;
}
#productsTable th,
#productsTable td{
  min-width:0;
  padding:8px 6px;
  overflow-wrap:anywhere;
  word-break:normal;
}
#productsTable th{
  white-space:normal;
  line-height:1.15;
  vertical-align:bottom;
}
#productsTable td{
  line-height:1.25;
}
#productsTable th:nth-child(1),
#productsTable td:nth-child(1){width:6.5%;}
#productsTable th:nth-child(2),
#productsTable td:nth-child(2){width:8%;}
#productsTable th:nth-child(3),
#productsTable td:nth-child(3){width:17%;}
#productsTable th:nth-child(4),
#productsTable td:nth-child(4){width:8%;}
#productsTable th:nth-child(5),
#productsTable td:nth-child(5){width:6%;}
#productsTable th:nth-child(6),
#productsTable td:nth-child(6){width:5%;}
#productsTable th:nth-child(7),
#productsTable td:nth-child(7){width:7%;}
#productsTable th:nth-child(8),
#productsTable td:nth-child(8){width:9%;}
#productsTable th:nth-child(9),
#productsTable td:nth-child(9){width:5%;}
#productsTable th:nth-child(10),
#productsTable td:nth-child(10){width:6%;}
#productsTable th:nth-child(11),
#productsTable td:nth-child(11){width:7%;}
#productsTable th:nth-child(12),
#productsTable td:nth-child(12){width:6.5%;}
#productsTable th:nth-child(13),
#productsTable td:nth-child(13){width:9%;}

#productsTable td:nth-child(1),
#productsTable td:nth-child(2),
#productsTable td:nth-child(4){
  font-size:10.5px;
}
#productsTable td:nth-child(3){
  white-space:normal;
  overflow:hidden;
  display:table-cell;
  max-width:0;
}
#productsTable .mini-input{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  max-width:100%;
  padding:6px 4px;
  font-size:11px;
}
#productsTable .save-cost{
  box-sizing:border-box;
  width:100%;
  min-width:0;
  padding:6px 4px;
  font-size:10.5px;
  white-space:nowrap;
}

@media (max-width:1180px){
  #productsTable{
    font-size:10.3px;
  }
  #productsTable th,
  #productsTable td{
    padding:7px 4px;
  }
  #productsTable .mini-input{
    padding-left:3px;
    padding-right:3px;
    font-size:10px;
  }
  #productsTable .save-cost{
    font-size:10px;
    padding-left:3px;
    padding-right:3px;
  }
}

/* ---------------- Редактор карточек товаров WB ---------------- */
.product-select-head,
.product-select-cell{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.product-select-head input,
.product-select-cell input{
  width:15px;
  height:15px;
  flex:0 0 auto;
  accent-color:#6c4cff;
}
.product-select-cell span{
  min-width:0;
  overflow-wrap:anywhere;
}
#bulkEditProductsBtn:disabled{
  opacity:.45;
  cursor:not-allowed;
}
#productsTable th:nth-child(1),#productsTable td:nth-child(1){width:7.5%;}
#productsTable th:nth-child(3),#productsTable td:nth-child(3){width:16%;}
#productsTable th:nth-child(13),#productsTable td:nth-child(13){width:10.5%;}
.product-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:5px;
  width:100%;
}
#productsTable .product-actions .btn{
  width:100%;
  min-width:0;
  padding:6px 4px;
  font-size:10.5px;
  white-space:nowrap;
}

.product-card-edit-modal,
.product-bulk-edit-modal{
  width:min(1120px,96vw)!important;
  max-height:94vh!important;
}
.product-card-editor-top{
  display:grid;
  grid-template-columns:170px minmax(0,1fr);
  gap:18px;
  align-items:start;
}
.product-card-photo{
  min-height:210px;
  border:1px solid var(--line);
  border-radius:14px;
  background:#0d1320;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.product-card-photo img{
  display:block;
  width:100%;
  height:230px;
  object-fit:contain;
}
.product-card-main-fields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.product-local-editor{
  margin-top:14px;
  padding:13px 14px;
  border:1px solid #303a52;
  border-radius:13px;
  background:linear-gradient(180deg,#121a28,#0e1520);
}
.product-local-editor-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.product-local-editor-head>div:first-child{
  display:flex;
  align-items:baseline;
  gap:8px;
  flex-wrap:wrap;
}
.product-local-editor-head b{color:var(--text);font-size:13px;}
.product-local-editor-head span{color:var(--muted);font-size:11px;}
.product-local-editor-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  max-width:520px;
}
.product-local-editor-grid label{
  display:grid;
  gap:6px;
  color:var(--muted);
  font-size:12px;
}
.product-local-editor-grid .input{width:100%;box-sizing:border-box;}
.product-local-save-status{white-space:nowrap;}
.product-local-save-status.saving{color:#e6a23c;}
.product-local-save-status.saved{color:#37d67a;}
.product-local-save-status.error{color:#f16b6b;}
.product-card-main-fields label,
.product-card-description,
.product-dim-grid label,
.product-char-field,
.product-bulk-field{
  display:grid;
  gap:6px;
  color:var(--muted);
  font-size:12px;
}
.product-card-main-fields .product-card-title-field{
  grid-column:1/-1;
}
.product-card-main-fields .input,
.product-card-description .input,
.product-dim-grid .input,
.product-char-field .input,
.product-bulk-field .input,
.product-bulk-field .select,
.bulk-characteristic-row .input,
.bulk-characteristic-row .select{
  box-sizing:border-box;
  width:100%;
}
.product-card-description{
  margin-top:14px;
}
.product-card-description textarea,
.product-char-field textarea,
.bulk-characteristic-row textarea{
  resize:vertical;
  min-height:58px;
}
.product-card-section,
.product-bulk-details{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:13px;
  background:#0f1622;
  overflow:hidden;
}
.product-card-section summary,
.product-bulk-details summary{
  cursor:pointer;
  padding:13px 15px;
  font-weight:700;
  color:var(--text);
  user-select:none;
}
.product-card-section[open] summary,
.product-bulk-details[open] summary{
  border-bottom:1px solid var(--line);
}
.product-card-section>.product-dim-grid,
.product-card-section>.product-char-grid,
.product-card-section>.product-sizes-list,
.product-bulk-details>.product-dim-grid{
  padding:14px;
}
.product-dim-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.product-char-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.product-char-field small{
  color:#7f91ad;
  font-weight:400;
}
.product-sizes-list{
  display:grid;
  gap:7px;
}
.product-size-row{
  display:grid;
  grid-template-columns:minmax(120px,.8fr) minmax(110px,.6fr) minmax(0,1.7fr);
  gap:10px;
  align-items:center;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--muted);
}
.product-size-row b{color:var(--text);}
.product-card-editor-footer{
  position:sticky;
  bottom:-20px;
  z-index:4;
  margin:18px -20px -20px;
  padding:14px 20px 20px;
  border-top:1px solid var(--line);
  background:#111722;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.product-card-editor-footer .help{
  max-width:760px;
  line-height:1.45;
}
.product-card-editor-footer .btn{
  flex:0 0 auto;
}

.product-bulk-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.bulk-mode-value{
  display:grid;
  gap:7px;
}
.bulk-characteristic-row{
  display:grid;
  grid-template-columns:minmax(220px,.9fr) minmax(280px,1.4fr) auto;
  gap:8px;
  align-items:start;
  padding:10px 14px;
  border-bottom:1px solid var(--line);
}
#bulkAddCharacteristic{
  margin:12px 14px 14px;
}

@media(max-width:1050px){
  .product-bulk-grid{grid-template-columns:1fr;}
  .product-char-grid{grid-template-columns:1fr;}
  .product-dim-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .product-card-editor-top{grid-template-columns:135px minmax(0,1fr);}
  .product-card-photo img{height:190px;}
}
@media(max-width:760px){
  .product-card-editor-top{grid-template-columns:1fr;}
  .product-card-photo{max-width:220px;}
  .product-card-main-fields{grid-template-columns:1fr;}
  .product-card-main-fields .product-card-title-field{grid-column:auto;}
  .product-dim-grid{grid-template-columns:1fr 1fr;}
  .bulk-characteristic-row{grid-template-columns:1fr;}
  .product-size-row{grid-template-columns:1fr;}
  .product-card-editor-footer{align-items:stretch;flex-direction:column;}
  .product-card-editor-footer .btn{width:100%;}
}


/* Product card backup / rollback history */
.product-editor-actions{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
.product-backup-history-modal{max-width:980px}
.product-backup-warning{margin-bottom:12px}
.product-backup-history-list{display:grid;gap:8px;max-height:62vh;overflow:auto;padding-right:4px}
.product-backup-row{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:rgba(255,255,255,.015)
}
.product-backup-main{min-width:0}
.product-backup-title{font-weight:750;margin-bottom:4px}
.product-backup-row .btn{flex:0 0 auto}
@media(max-width:720px){
  .product-backup-row{align-items:stretch;flex-direction:column}
  .product-backup-row .btn{width:100%}
}


/* Product image editor */
.product-media-modal{max-width:1180px}
.product-media-toolbar{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:10px 0 14px;flex-wrap:wrap
}
.product-media-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap}
.product-media-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(190px,1fr));
  gap:12px;
}
.product-media-video-card{
  max-width:420px;
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  margin:0 0 14px;
  display:grid;
  gap:8px;
}
.product-media-video-card video{display:block;width:100%;max-height:320px;border-radius:10px;background:#0c111b}
.product-media-slide{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px;
  background:rgba(255,255,255,.018);
  min-width:0;
}
.product-media-slide-number{
  font-weight:750;
  margin-bottom:8px;
}
.product-media-image-wrap{
  position:relative;
  aspect-ratio:3/4;
  overflow:hidden;
  border-radius:10px;
  background:#0c111b;
  border:1px solid rgba(255,255,255,.06);
}
.product-media-image-wrap img{
  width:100%;height:100%;object-fit:cover;display:block;
}
.product-media-slide-actions{
  display:grid;
  grid-template-columns:42px 42px 1fr 1fr;
  gap:6px;
  margin-top:8px;
}
.product-media-slide-actions .btn{min-width:0;padding-left:6px;padding-right:6px}
.product-media-note{margin-top:14px}
.product-bulk-media-modal{max-width:900px}
.product-bulk-media-layout{
  display:grid;
  grid-template-columns:minmax(260px,.9fr) minmax(300px,1.1fr);
  gap:18px;
  align-items:start;
}
.product-bulk-media-drop{
  min-height:360px;
  border:1px dashed rgba(152,164,190,.42);
  border-radius:16px;
  background:rgba(255,255,255,.018);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:18px;
  cursor:pointer;
  text-align:center;
  overflow:hidden;
}
.product-bulk-media-drop:hover{border-color:rgba(142,111,255,.78)}
.product-bulk-media-drop input{display:none}
.product-bulk-media-drop-title{font-weight:800;font-size:16px}
.product-bulk-media-drop img{
  width:100%;
  max-height:420px;
  object-fit:contain;
  border-radius:12px;
  margin-top:4px;
}
.product-bulk-media-drop.has-file{
  justify-content:flex-start;
}
.product-bulk-media-settings{
  display:grid;
  gap:12px;
}
.product-bulk-media-settings>label{
  display:grid;
  gap:6px;
  font-weight:700;
}
.product-media-history-modal{max-width:980px}

@media(max-width:820px){
  .product-bulk-media-layout{grid-template-columns:1fr}
  .product-bulk-media-drop{min-height:260px}
  .product-media-slide-actions{grid-template-columns:1fr 1fr}
}

.product-bulk-media-drop.dragover{border-color:#8e6fff;box-shadow:0 0 0 3px rgba(142,111,255,.12) inset}


/* Яндекс Карты: текст в штатной строке поиска должен оставаться тёмным
   на белом фоне. Глобальная тёмная тема Dashboard не должна окрашивать
   внутренний input SearchControl в белый цвет. */
#yandexPvzMap input[type="text"],
#yandexPvzMap input:not([type]),
#yandexPvzMap [class*="searchbox-input"] input,
#yandexPvzMap [class*="searchbox-input__input"]{
  color:#202124 !important;
  -webkit-text-fill-color:#202124 !important;
  caret-color:#202124 !important;
  text-shadow:none !important;
  opacity:1 !important;
}

#yandexPvzMap input[type="text"]::placeholder,
#yandexPvzMap input:not([type])::placeholder,
#yandexPvzMap [class*="searchbox-input"] input::placeholder{
  color:#777 !important;
  -webkit-text-fill-color:#777 !important;
  opacity:1 !important;
}

#yandexPvzMap input[type="text"]::selection,
#yandexPvzMap input:not([type])::selection,
#yandexPvzMap [class*="searchbox-input"] input::selection{
  background:#5b7cfa !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

/* Buyer chat notifications */
.chat-notification-wrap{position:relative}
.chat-notification-btn{position:relative;width:44px;height:42px;padding:9px;display:grid;place-items:center}
.chat-notification-btn svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.chat-notification-count{position:absolute;right:-5px;top:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#ef4444;color:white;border:2px solid var(--bg);font-size:11px;font-weight:800;line-height:16px;text-align:center}
.chat-notification-menu{position:absolute;right:0;top:calc(100% + 9px);z-index:120;width:min(430px,calc(100vw - 28px));max-height:560px;background:#111927;border:1px solid var(--line);border-radius:15px;box-shadow:0 22px 60px rgba(0,0,0,.48);overflow:hidden}
.chat-notification-menu-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 14px 12px;border-bottom:1px solid var(--line)}
.chat-notification-list{max-height:470px;overflow:auto;padding:6px}
.chat-notification-item{width:100%;border:0;background:transparent;color:inherit;text-align:left;display:grid;grid-template-columns:42px minmax(0,1fr) auto;gap:10px;align-items:start;padding:10px;border-radius:11px;cursor:pointer}
.chat-notification-item:hover{background:rgba(255,255,255,.055)}
.chat-notification-item.unread{background:rgba(100,81,255,.105)}
.chat-notification-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#26314a;color:#dce4ff;font-weight:800}
.chat-notification-main{min-width:0}
.chat-notification-name{font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-notification-text{margin-top:3px;color:var(--text);line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.chat-notification-meta{margin-top:4px;color:var(--muted);font-size:11px}
.chat-notification-dot{width:8px;height:8px;border-radius:50%;background:#7c5cff;margin-top:7px}
.chat-live-notifications{position:fixed;right:18px;top:82px;z-index:170;display:grid;gap:10px;width:min(390px,calc(100vw - 30px));pointer-events:none}
.chat-live-card{pointer-events:auto;border:1px solid #5140b8;background:#171d31;color:var(--text);border-radius:14px;padding:13px 14px;box-shadow:0 18px 50px rgba(0,0,0,.5);cursor:pointer;animation:chatNoticeIn .18s ease-out}
.chat-live-card:hover{border-color:#7c65ff;background:#1b2340}
.chat-live-card-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:5px}
.chat-live-card .chat-live-name{font-weight:850}
.chat-live-card .chat-live-text{line-height:1.35}
@keyframes chatNoticeIn{from{transform:translateY(-8px);opacity:0}to{transform:none;opacity:1}}
.buyer-global-chat-card{width:min(920px,calc(100vw - 36px));max-height:86vh}
#buyerGlobalChatBody{min-height:240px}
.buyer-global-chat-card .chat-messages{max-height:55vh}
@media(max-width:720px){.chat-notification-menu{position:fixed;left:10px;right:10px;top:68px;width:auto}.chat-live-notifications{left:10px;right:10px;width:auto;top:70px}}


/* DBS: суточная отметка «Недозвон».
   Фиолетовый специально отличается от:
   жёлтого «На сборке», синего «В доставке» и зелёного «Доставлен». */
#dbsBody tr.row-no-answer td{
  background:rgba(168,85,247,.16);
  border-bottom-color:rgba(168,85,247,.34);
}
#dbsBody tr.row-no-answer td:first-child{
  box-shadow:inset 4px 0 0 #a855f7;
}
#dbsBody tr.row-no-answer:hover td{
  background:rgba(168,85,247,.23);
}
#dbsBody tr.row-no-answer .dbs-table-address{
  color:#d8b4fe;
}
.dbs-no-answer-badge{
  background:rgba(168,85,247,.22) !important;
  color:#e9d5ff !important;
  border:1px solid rgba(192,132,252,.46);
}
.dbs-no-answer-label{
  margin-top:5px;
}
.dbs-no-answer-control{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  transition:.15s ease;
}
.dbs-no-answer-control.active{
  border-color:rgba(168,85,247,.55);
  background:rgba(168,85,247,.10);
}
.dbs-no-answer-control.active .check-row{
  color:#e9d5ff;
}


/* Компактная карта внутри DBS-карточки */
.yandex-pvz-map-panel{padding:10px 12px}
.yandex-pvz-map-head{margin-bottom:8px}
.yandex-map-note{font-size:10.5px}


/* На главной оставлены выручка продаж и прогноз перечисления WB. */
#dashboardMetrics{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

@media(max-width:900px){
  #dashboardMetrics{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:620px){
  #dashboardMetrics{grid-template-columns:1fr;}
}


/* Прибыль: компактный фильтр периода в одну строку */
.profit-period-panel{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:14px;
  padding:12px 14px;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  scrollbar-width:thin;
}
.profit-period-presets{
  display:flex;
  align-items:center;
  gap:7px;
  flex:0 0 auto;
}
.profit-period-preset,
.analytics-period-preset{
  width:auto;
  min-height:38px;
  padding:0 14px;
  justify-content:center;
  font-size:14px;
  white-space:nowrap;
}
.profit-period-preset.active,
.analytics-period-preset.active{
  border-color:var(--accent);
  background:var(--accent);
  color:#fff;
}
.profit-period-divider{
  width:1px;
  height:32px;
  background:var(--border);
  flex:0 0 1px;
  margin:0 2px;
}
.profit-period-editor{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.profit-period-field{
  display:flex;
  align-items:center;
  gap:6px;
  color:var(--muted);
  font-size:13px;
  white-space:nowrap;
}
.profit-period-field .input{
  min-height:38px;
  height:38px;
  width:146px;
  padding:0 10px;
  font-size:14px;
}
.profit-period-reset{
  min-height:38px;
  height:38px;
  padding:0 12px;
  justify-content:center;
  white-space:nowrap;
}
.profit-period-label{
  margin-left:auto;
  min-width:max-content;
  white-space:nowrap;
  flex:0 0 auto;
}
@media (max-width:1180px){
  .profit-period-label{display:none;}
}
@media (max-width:760px){
  .profit-period-panel{
    align-items:flex-start;
    padding:10px;
  }
  .profit-period-preset,
  .analytics-period-preset{
    min-height:36px;
    padding:0 11px;
  }
  .profit-period-field .input{
    width:138px;
    min-height:36px;
    height:36px;
  }
  .profit-period-reset{
    min-height:36px;
    height:36px;
  }
}

/* ===== Товары: компактная кликабельная таблица ===== */
#page-products .panel{
  padding:18px;
}
#page-products .toolbar{
  align-items:center;
  gap:12px;
  margin-bottom:10px;
}
#page-products .toolbar-left{
  flex:1 1 420px;
  min-width:300px;
}
#page-products .toolbar-left .search{
  flex:1 1 auto;
  min-width:240px;
}
#page-products .toolbar-right{
  gap:8px;
}
#page-products .toolbar-right .btn{
  white-space:nowrap;
}
.product-table-help{
  padding:9px 12px;
  border:1px solid #263044;
  border-radius:10px;
  background:#101722;
}
#page-products .products-table-wrap{
  overflow-x:hidden;
  border:1px solid #273144;
  border-radius:12px;
  background:#0d131d;
}
#productsTable{
  width:100%;
  min-width:0;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
  font-size:12px;
}
#productsTable thead th{
  position:sticky;
  top:0;
  z-index:2;
  padding:11px 10px;
  background:#151d2a;
  color:#aebbd0;
  border-bottom:1px solid #2a3548;
  font-size:11px;
  line-height:1.2;
  white-space:normal;
}
#productsTable tbody td{
  padding:18px 12px;
  border-bottom:1px solid #202a3a;
  vertical-align:middle;
  line-height:1.35;
}
#productsTable tbody tr:last-child td{
  border-bottom:0;
}
#productsTable th:nth-child(1),#productsTable td:nth-child(1){width:4%;}
#productsTable th:nth-child(2),#productsTable td:nth-child(2){width:56%;}
#productsTable th:nth-child(3),#productsTable td:nth-child(3){width:14%;}
#productsTable th:nth-child(4),#productsTable td:nth-child(4){width:14%;}
#productsTable th:nth-child(5),#productsTable td:nth-child(5){width:12%;}

#productsTable .product-row{
  position:relative;
  cursor:pointer;
  transition:background-color .14s ease, box-shadow .14s ease;
  outline:none;
}
#productsTable .product-row:hover,
#productsTable .product-row:focus-visible{
  background:#151f30;
  box-shadow:inset 3px 0 0 #6c55ff;
}
#productsTable .product-row.is-selected{
  background:#171d38;
  box-shadow:inset 3px 0 0 #765cff;
}
#productsTable .product-row.product-row-saving{
  box-shadow:inset 3px 0 0 #e6a23c;
}
#productsTable .product-row.product-row-saved{
  box-shadow:inset 3px 0 0 #2ecc71;
}
#productsTable .product-row.product-row-save-error{
  box-shadow:inset 3px 0 0 #ef4444;
}
.product-select-column{
  text-align:center;
}
.product-select-head,
.product-select-cell{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:28px;
  cursor:pointer;
}
.product-select-head input,
.product-select-cell input{
  width:18px;
  height:18px;
  margin:0;
  accent-color:#6c55ff;
  cursor:pointer;
}
.product-main-cell{
  text-align:left;
}
.product-row-product{
  display:flex;
  align-items:center;
  gap:16px;
  min-width:0;
  min-height:108px;
}
.product-row-thumb{
  width:78px;
  height:104px;
  flex:0 0 78px;
  border:1px solid #2a3548;
  border-radius:9px;
  background:#0a1019;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}
.product-row-thumb img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.product-row-thumb-empty span{
  padding:5px;
  color:#69778d;
  font-size:9px;
  line-height:1.15;
  text-align:center;
}
.product-row-copy{
  min-width:0;
  flex:1 1 auto;
}
.product-row-title{
  color:#f2f5fb;
  font-size:14px;
  font-weight:700;
  line-height:1.38;
  margin-bottom:9px;
}
.product-row-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px 8px;
  color:#8190a8;
  font-size:11px;
}
.product-row-meta span{
  padding:2px 6px;
  border-radius:6px;
  background:#111927;
  border:1px solid #222e40;
}
.product-row-local-meta{
  margin-top:9px;
  color:#7f8ca1;
  font-size:11px;
}
.product-row-local-meta b{
  color:#b8c4d7;
  font-weight:650;
}
.product-row-open{
  margin-top:9px;
  color:#8c7cff;
  font-size:10.5px;
  font-weight:600;
  opacity:0;
  transform:translateY(2px);
  transition:opacity .14s ease, transform .14s ease;
}
.product-row:hover .product-row-open,
.product-row:focus-visible .product-row-open{
  opacity:1;
  transform:translateY(0);
}
.product-price-cell b,
.product-buyer-price b,
.product-stock-cell b{
  display:block;
  color:#f4f7fb;
  font-size:14px;
  font-weight:700;
  white-space:nowrap;
}
.product-price-meta,
.product-stock-cell span{
  display:block;
  margin-top:6px;
  color:#7f8ca1;
  font-size:11px;
  white-space:normal;
}
.product-stock-cell.product-stock-low b{color:#f5b942;}
.product-stock-cell.product-stock-zero b{color:#f16b6b;}
@media (max-width:1180px){
  #productsTable{font-size:11px;}
  #productsTable thead th{padding:10px 7px;}
  #productsTable tbody td{padding:14px 8px;}
  #productsTable th:nth-child(2),#productsTable td:nth-child(2){width:52%;}
  #productsTable th:nth-child(3),#productsTable td:nth-child(3){width:15%;}
  #productsTable th:nth-child(4),#productsTable td:nth-child(4){width:15%;}
  #productsTable th:nth-child(5),#productsTable td:nth-child(5){width:14%;}
  .product-row-title{font-size:12.5px;}
  .product-row-meta{font-size:10px;}
  .product-row-product{min-height:92px;gap:12px;}
  .product-row-thumb{width:64px;height:88px;flex-basis:64px;}
}
@media (max-width:760px){
  .product-local-editor-head{align-items:flex-start;flex-direction:column;}
  .product-local-editor-grid{grid-template-columns:1fr;}
  .product-local-save-status{white-space:normal;}
}
/* Profit: delivery is a separate confirmed expense, so seven KPI cards fit in one row. */
#profitMetrics { grid-template-columns: repeat(7, minmax(0,1fr)); }
@media (max-width: 1500px) { #profitMetrics { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 1120px) { #profitMetrics { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 820px) { #profitMetrics { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 520px) { #profitMetrics { grid-template-columns: 1fr; } }


/* Chat templates */
.chat-compose-left{display:flex!important;align-items:center!important;gap:10px!important;flex-wrap:wrap!important}
.chat-compose-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.chat-template-trigger{white-space:nowrap}
.chat-template-modal-card{width:min(760px,calc(100vw - 36px));max-height:86vh;overflow:auto}
.chat-template-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:12px}
.chat-template-list{display:flex;flex-direction:column;gap:10px}
.chat-template-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px;border:1px solid var(--line);border-radius:13px;background:#0d131d}
.chat-template-item:hover{border-color:#4f46e5;background:#101725}
.chat-template-use{appearance:none;border:0;background:transparent;color:inherit;text-align:left;padding:0;cursor:pointer;min-width:0;display:flex;flex-direction:column;gap:5px}
.chat-template-name{font-weight:700;font-size:14px;color:#f7f9ff}
.chat-template-preview{font-size:12px;color:var(--muted);line-height:1.45;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.chat-template-actions{display:flex;align-items:center;gap:7px}
.chat-template-editor{display:flex;flex-direction:column;gap:8px}
.chat-template-editor label{font-size:12px;color:#b8c4d9;margin-top:2px}
.chat-template-editor textarea{resize:vertical;min-height:180px;line-height:1.5}
.chat-template-editor-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:4px}
.chat-template-empty{padding:30px 20px;border:1px dashed var(--line);border-radius:14px;text-align:center;display:flex;flex-direction:column;align-items:center;gap:10px}
.danger-soft{border-color:#74313a!important;color:#ff9ca6!important;background:#2a1519!important}
.danger-soft:hover{background:#3a1a20!important}
@media(max-width:700px){.chat-template-item{grid-template-columns:1fr}.chat-template-actions{justify-content:flex-end}.chat-template-toolbar,.chat-template-editor-bottom{align-items:stretch;flex-direction:column}.chat-template-toolbar .btn,.chat-template-editor-bottom .btn{width:100%}}

/* === Конструктор расположения блоков === */
.layout-constructor-btn{gap:8px;white-space:nowrap}
.layout-constructor-settings-actions>[hidden]{display:none!important}
.layout-constructor-btn .layout-constructor-icon{font-size:17px;line-height:1;opacity:.9}
.layout-constructor-btn.active{background:linear-gradient(135deg,#4f46e5,#6d5dfc);border-color:transparent;box-shadow:0 8px 24px rgba(79,70,229,.22)}
body.layout-constructor-mode .layout-constructor-btn{position:relative}
body.layout-constructor-mode .layout-constructor-btn::after{content:"";position:absolute;right:8px;top:7px;width:6px;height:6px;border-radius:50%;background:#7cf29a;box-shadow:0 0 0 4px rgba(124,242,154,.12)}

.section.active.layout-custom{
  display:grid;
  grid-template-columns:repeat(12,minmax(0,1fr));
  grid-auto-rows:26px;
  gap:14px;
  align-items:stretch;
  width:100%;
  min-width:0;
}
.section.layout-custom > .layout-group-contents{display:contents}
.section.layout-custom .layout-widget{
  min-width:0;
  min-height:0;
  margin-top:0 !important;
  position:relative;
  align-self:stretch;
  justify-self:stretch;
}
.section.layout-custom .layout-widget.panel{
  height:100%;
  max-height:100%;
  overflow:auto;
  scrollbar-width:thin;
  scrollbar-color:#39455b transparent;
}
.section.layout-custom .layout-widget.metric{
  height:100%;
  min-height:0;
  overflow:hidden;
}
.section.layout-custom .layout-widget.profit-period-panel{overflow:visible}
.section.layout-custom #recommendationsPanel{overflow:auto}
.section.layout-custom .layout-widget > .table-wrap{max-height:100%}
.section.layout-custom .layout-widget .canvas-wrap{max-height:100%}

.section.layout-editor-active .layout-widget{
  outline:2px solid rgba(109,93,252,.68);
  outline-offset:-2px;
  box-shadow:0 0 0 1px rgba(109,93,252,.12),0 12px 32px rgba(0,0,0,.18);
  user-select:none;
}
.section.layout-editor-active .layout-widget.layout-collision{
  outline-color:#ef4444;
  box-shadow:0 0 0 2px rgba(239,68,68,.22),0 12px 32px rgba(0,0,0,.22);
}
.layout-drag-handle{
  position:absolute;
  z-index:35;
  top:8px;
  left:8px;
  display:flex;
  align-items:center;
  gap:6px;
  min-height:27px;
  max-width:calc(100% - 42px);
  padding:5px 8px;
  border:1px solid rgba(109,93,252,.72);
  border-radius:8px;
  background:rgba(17,22,33,.94);
  color:#dcd8ff;
  font-size:10px;
  font-weight:700;
  line-height:1;
  cursor:grab;
  box-shadow:0 5px 18px rgba(0,0,0,.28);
  backdrop-filter:blur(8px);
  white-space:nowrap;
  user-select:none;
  -webkit-user-select:none;
  overflow:hidden;
  text-overflow:ellipsis;
  touch-action:none;
}
.layout-drag-handle:active{cursor:grabbing}
.layout-drag-grip{font-size:15px;letter-spacing:-2px;opacity:.9}
.layout-drag-title{overflow:hidden;text-overflow:ellipsis}
.layout-resize-handle{
  position:absolute;
  z-index:36;
  right:5px;
  bottom:5px;
  width:22px;
  height:22px;
  border-radius:7px;
  border:1px solid rgba(109,93,252,.72);
  background:rgba(17,22,33,.94);
  cursor:nwse-resize;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
  box-shadow:0 5px 18px rgba(0,0,0,.25);
}
.layout-resize-handle::before,
.layout-resize-handle::after{
  content:"";
  position:absolute;
  right:5px;
  bottom:5px;
  width:8px;
  height:1px;
  background:#9c92ff;
  transform:rotate(-45deg);
  transform-origin:right center;
}
.layout-resize-handle::after{width:5px;right:4px;bottom:9px}
body.layout-constructor-dragging{cursor:grabbing!important}
body.layout-constructor-dragging *{cursor:grabbing!important}
body.layout-constructor-resizing{cursor:nwse-resize!important}
body.layout-constructor-resizing *{cursor:nwse-resize!important}

@media (max-width:899px){
  .section.active.layout-custom{display:block}
  .section.layout-custom > .layout-group-contents{display:grid}
  .section.layout-custom .layout-widget{
    grid-column:auto!important;
    grid-row:auto!important;
    height:auto!important;
    max-height:none!important;
    overflow:visible!important;
  }
  .layout-constructor-btn{display:none}
}

/* =========================================================
   Internal dashboard scale
   Desktop UI is rendered at 100% so the browser can stay at 100% zoom.
   Keep normal scale on compact/mobile viewports.
   ========================================================= */
@media (min-width: 901px) {
  html {
    zoom: 1;
  }
}

@media (max-width: 900px) {
  html {
    zoom: 1;
  }
}

/* Advertising management */
.ads-manage-row{cursor:pointer}
.ads-manage-row:hover td{background:#161d2a}
.ads-manage-link{font-weight:700;color:#9d94ff;white-space:nowrap}

/* Full-page campaign editor: no modal and no nested vertical scrolling. */
.ads-manager-page{padding-bottom:28px}
.ads-manager-page-header{margin-bottom:14px;padding:16px 18px}
.ads-manager-page-toolbar{margin:0}
.ads-manager-page-titleblock{display:flex;align-items:center;gap:16px;min-width:0}
.ads-manager-page-titleblock h2{margin:0 0 4px;font-size:24px;line-height:1.2}
.ads-manager-page-titleblock .help{font-size:12px;line-height:1.45}
.ads-manager-back{flex:0 0 auto}
.ads-manager-page-content{padding:18px;overflow:visible}

.ads-manager-top{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:16px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.ads-manager-status,.ads-campaign-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ads-manager-controls{display:grid;grid-template-columns:minmax(340px,1fr) minmax(470px,1.25fr);gap:14px;align-items:stretch}
.ads-control-card{padding:15px 16px;border:1px solid var(--line);border-radius:13px;background:#0e141e;min-width:0}
.ads-control-card-title{font-size:13px;font-weight:800;color:#eef2f8;margin-bottom:11px}
.ads-control-row{display:flex;align-items:flex-end;gap:10px;min-width:0}
.ads-control-row label{display:grid;gap:6px;min-width:0}
.ads-control-grow{flex:1 1 280px}
.ads-control-placement{flex:1 1 210px}
.ads-control-bid{flex:0 1 150px}
.ads-control-row .select,.ads-control-row .input{width:100%;min-width:0}
.ads-control-row .btn{flex:0 0 auto;white-space:nowrap}

.ads-manager-note{margin:14px 0;padding:10px 12px;border:1px solid #2b3445;border-radius:10px;background:#101722;color:#aeb9ca;font-size:11px;line-height:1.5}
.ads-manager-note.warn{border-color:#6b5220;color:#ffd17a}
.ads-clusters-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:20px 0 10px}
.ads-clusters-head h4{margin:0;font-size:16px}
.ads-clusters-wrap{max-height:none;overflow-x:auto;overflow-y:visible;border-radius:12px}
.ads-clusters-table{width:100%;min-width:1040px;table-layout:fixed}
.ads-clusters-table th,.ads-clusters-table td{padding:11px 10px;vertical-align:middle}
.ads-clusters-table th:nth-child(1){width:22%}
.ads-clusters-table th:nth-child(2){width:10%}
.ads-clusters-table th:nth-child(3){width:8%}
.ads-clusters-table th:nth-child(4){width:18%}
.ads-clusters-table th:nth-child(5),.ads-clusters-table th:nth-child(6),.ads-clusters-table th:nth-child(7){width:7%}
.ads-clusters-table th:nth-child(8){width:8%}
.ads-clusters-table th:nth-child(9){width:13%}
.ads-clusters-table td:first-child{white-space:normal;overflow-wrap:anywhere;line-height:1.35}
.ads-clusters-table tr.ads-cluster-disabled td{opacity:.58}
.ads-bid-inline{display:grid;grid-template-columns:minmax(72px,1fr) auto;gap:6px;align-items:center;min-width:0}
.ads-bid-inline .input{width:100%;min-width:0;padding:7px 8px}
.btn.compact{padding:7px 9px;font-size:11px;border-radius:8px}
.btn.warn{background:#3b2a0f;border-color:#6b4c17;color:#ffd17a}
.ads-bidder-last{margin-top:5px;max-width:100%;white-space:normal;line-height:1.35}
.ads-bidder-editor{margin:16px 0;padding:18px;border:1px solid #5146c7;border-radius:13px;background:#11182a;box-shadow:0 12px 30px rgba(0,0,0,.18)}
.ads-bidder-editor .ads-clusters-head{margin:0 0 14px}
.ads-bidder-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));gap:12px}
.ads-bidder-grid label{display:grid;gap:6px;color:#c8d0dc;font-size:11px}
.ads-bidder-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin:16px 0 8px}

@media(max-width:1250px){
  .ads-manager-controls{grid-template-columns:1fr}
  .ads-clusters-table{min-width:980px}
}
@media(max-width:900px){
  .ads-manager-page-titleblock{align-items:flex-start;flex-direction:column;gap:10px}
  .ads-control-row{align-items:stretch;flex-direction:column}
  .ads-control-row .btn{width:100%}
  .ads-bidder-grid{grid-template-columns:repeat(2,minmax(160px,1fr))}
}
@media(max-width:620px){
  .ads-manager-page-content,.ads-manager-page-header{padding:12px}
  .ads-bidder-grid{grid-template-columns:1fr}
  .ads-campaign-actions{width:100%}
  .ads-campaign-actions .btn{flex:1}
}


/* Центр уведомлений на Главной */
.notification-filters{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  margin:-2px 0 10px;
}
.notification-filter{
  appearance:none;
  border:1px solid var(--line);
  background:#0f151f;
  color:#aeb8ca;
  border-radius:9px;
  padding:7px 9px;
  font:inherit;
  font-size:11px;
  font-weight:650;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:6px;
  transition:border-color .15s ease,background .15s ease,color .15s ease;
}
.notification-filter span{
  min-width:19px;
  height:19px;
  padding:0 5px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#1b2432;
  color:#c9d1de;
  font-size:10px;
}
.notification-filter:hover{border-color:#47536a;color:#fff;}
.notification-filter.active{border-color:#6d5dfc;background:rgba(109,93,252,.14);color:#fff;}
.notification-filter.critical.active{border-color:rgba(239,68,68,.7);background:rgba(239,68,68,.10);}
.notification-filter.warning.active{border-color:rgba(245,158,11,.72);background:rgba(245,158,11,.10);}
.notification-filter.opportunity.active{border-color:rgba(34,197,94,.65);background:rgba(34,197,94,.09);}
.notification-filter.processed.active{border-color:#64748b;background:rgba(100,116,139,.12);color:#fff;}
.notification-closed-badge{
  display:inline-flex;
  align-items:center;
  min-height:20px;
  border-radius:999px;
  padding:2px 7px;
  font-size:10px;
  line-height:1;
  font-weight:700;
  background:rgba(100,116,139,.13);
  color:#aeb9ca;
}
.notification-card-closed{opacity:.68;border-color:rgba(100,116,139,.28);}
.notification-card-closed:hover{opacity:.88;}
.notification-card-closed .title,.notification-card-closed .text{text-decoration:none;}
.notification-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px;}
.notification-actions .recommendation-close{border-color:rgba(34,197,94,.38);color:#8ae6a8;}
.notification-actions .recommendation-close:hover{background:rgba(34,197,94,.09);border-color:rgba(34,197,94,.65);}
.notification-actions .recommendation-reopen{border-color:rgba(100,116,139,.42);color:#c5cfdd;}

.notification-card{padding:11px 12px;}
.notification-meta-line{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  margin-bottom:6px;
}
.notification-section,
.notification-severity{
  display:inline-flex;
  align-items:center;
  min-height:20px;
  border-radius:999px;
  padding:2px 7px;
  font-size:10px;
  line-height:1;
  font-weight:700;
}
.notification-section{background:#192231;color:#aeb9ca;}
.notification-severity.bad{background:rgba(239,68,68,.12);color:#ff8f8f;}
.notification-severity.warn{background:rgba(245,158,11,.12);color:#f8c45c;}
.notification-severity.good{background:rgba(34,197,94,.11);color:#76dc98;}
.notification-severity.neutral{background:#192231;color:#aeb9ca;}
.notification-card .title{font-size:13px;line-height:1.3;margin-bottom:3px;}
.notification-card .text{font-size:11px;line-height:1.38;}
.notification-detail-row{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.notification-empty{padding:18px 10px;text-align:center;}
@media (max-width:1050px){
  .notification-filter{padding:6px 8px;}
}

/* Separate product bids for search and recommendations */
.ads-placement-bids{display:grid;gap:10px}
.ads-placement-bid-row{display:grid;grid-template-columns:minmax(170px,1fr) minmax(130px,160px) auto;gap:10px;align-items:end;padding:10px 0;border-top:1px solid var(--line)}
.ads-placement-bid-row:first-child{border-top:0;padding-top:0}
.ads-placement-bid-row:last-child{padding-bottom:0}
.ads-placement-bid-name{display:grid;gap:4px;align-self:center;min-width:0}
.ads-placement-bid-name b{font-size:14px;color:#eef2f8}
.ads-placement-bid-name .help{line-height:1.35}
.ads-placement-bid-row .ads-control-bid{display:grid;gap:6px;min-width:0}
.ads-placement-bid-row .ads-control-bid .input{width:100%;min-width:0}
.ads-placement-bid-row .btn{white-space:nowrap}
@media (max-width:1100px){
  .ads-placement-bid-row{grid-template-columns:minmax(150px,1fr) minmax(120px,150px)}
  .ads-placement-bid-row .btn{grid-column:1/-1;width:100%}
}
@media (max-width:899px){
  .ads-placement-bid-row{grid-template-columns:1fr}
  .ads-placement-bid-row .btn{grid-column:auto}
}

/* Ads placement on/off controls */
.ads-placement-title-line{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ads-placement-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.ads-placement-off-note{align-self:center}
@media(max-width:980px){.ads-placement-actions{grid-column:1/-1;justify-content:flex-start}}
@media(max-width:700px){.ads-placement-actions{grid-column:auto;justify-content:stretch}.ads-placement-actions .btn{flex:1}}


#adsMetrics{grid-template-columns:repeat(6,minmax(0,1fr));}
@media (max-width:1200px){#adsMetrics{grid-template-columns:repeat(3,1fr);}}
@media (max-width:780px){#adsMetrics{grid-template-columns:repeat(2,1fr);}}
@media (max-width:540px){#adsMetrics{grid-template-columns:1fr;}}

/* DBS → создание заказа Яндекс прямо из карточки */
.yandex-create-order-placeholder{
  margin-top:12px;
  padding:18px;
  border:1px dashed var(--line);
  border-radius:14px;
  color:var(--muted);
  text-align:center;
  background:rgba(255,255,255,.015);
}
.yandex-create-order-card{
  margin-top:14px;
  padding:16px;
  border:1px solid rgba(99,102,241,.32);
  border-radius:16px;
  background:rgba(99,102,241,.045);
}
.yandex-create-order-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.yandex-create-order-head h4{margin:0 0 4px;font-size:16px;}
.yandex-create-summary{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-bottom:14px;
}
.yandex-create-summary>div{
  min-width:0;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(8,13,24,.38);
}
.yandex-create-summary span,
.yandex-create-grid label>span{
  display:block;
  margin-bottom:6px;
  color:var(--muted);
  font-size:11px;
}
.yandex-create-summary b{display:block;overflow-wrap:anywhere;font-size:12px;line-height:1.35;}
.yandex-create-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.yandex-create-grid label{min-width:0;}
.yandex-size-field{grid-column:span 2;}
.yandex-size-inputs{display:grid;grid-template-columns:1fr auto 1fr auto 1fr;align-items:center;gap:7px;}
.yandex-size-inputs span{color:var(--muted);font-weight:700;}
.yandex-create-confirm{
  margin-top:14px;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(8,13,24,.32);
}
.yandex-create-order-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}
.yandex-create-order-actions #yandexEstimateResult{min-width:0;flex:1;}
.yandex-create-order-actions .inline-actions{flex-wrap:wrap;justify-content:flex-end;}
@media(max-width:1200px){
  .yandex-create-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:760px){
  .yandex-create-summary,.yandex-create-grid{grid-template-columns:1fr;}
  .yandex-size-field{grid-column:auto;}
  .yandex-create-order-head,.yandex-create-order-actions{flex-direction:column;align-items:stretch;}
  .yandex-create-order-actions .inline-actions{justify-content:stretch;}
  .yandex-create-order-actions .btn{flex:1;}
}

/* Предустановки размера отправления Яндекс */
.yandex-size-block{
  margin-top:14px;
  padding:13px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(8,13,24,.28);
}
.yandex-size-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px;}
.yandex-size-head b{display:block;font-size:12px;margin-bottom:3px;}
.yandex-size-head .help{display:block;}
.yandex-size-options{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.yandex-size-option{
  min-height:58px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.015);
  color:var(--text);
  cursor:pointer;
  padding:9px 10px;
  text-align:center;
  transition:.15s ease;
}
.yandex-size-option:hover{border-color:rgba(99,102,241,.55);background:rgba(99,102,241,.06);}
.yandex-size-option.active{border-color:var(--accent);background:rgba(99,102,241,.14);box-shadow:inset 0 0 0 1px rgba(99,102,241,.12);}
.yandex-size-option b{display:block;font-size:15px;line-height:1.15;margin-bottom:4px;}
.yandex-size-option span{display:block;color:var(--muted);font-size:10px;line-height:1.25;}
.yandex-size-custom{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:9px;
  margin-top:10px;
}
.yandex-size-custom[hidden]{display:none!important;}
.yandex-size-custom label>span{display:block;margin-bottom:5px;color:var(--muted);font-size:10px;}
@media(max-width:1000px){
  .yandex-size-options{grid-template-columns:repeat(2,minmax(0,1fr));}
  .yandex-size-custom{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media(max-width:620px){
  .yandex-size-options,.yandex-size-custom{grid-template-columns:1fr;}
}

.yandex-cancelled-retry{margin-bottom:12px;border-color:rgba(245,158,11,.35);}
.yandex-cancelled-retry b{color:#fbbf24;}

/* Ads manager: readable product identity + Excel exports */
.ads-manager-page-toolbar{justify-content:space-between;gap:14px;flex-wrap:wrap}
.ads-manager-export-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ads-manager-export-actions .btn{white-space:nowrap}
.ads-manager-export-actions .btn.disabled{opacity:.45;pointer-events:none}
.ads-manager-period-panel{margin-bottom:14px}
.ads-selected-product-card{display:grid;grid-template-columns:64px minmax(0,1fr);gap:12px;align-items:center;margin-top:12px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:#111824}
.ads-selected-product-photo{width:64px;height:80px;border-radius:9px;overflow:hidden;background:#0a1019;border:1px solid #293244;display:flex;align-items:center;justify-content:center;color:#718098;font-size:10px}
.ads-selected-product-photo img{width:100%;height:100%;object-fit:cover;display:block}
.ads-selected-product-info{min-width:0;display:grid;gap:5px}
.ads-selected-product-info b{font-size:14px;line-height:1.35;color:#f2f5fa;white-space:normal;overflow-wrap:anywhere}
.ads-selected-product-info .help{line-height:1.45;white-space:normal}
@media(max-width:900px){.ads-manager-export-actions{width:100%}.ads-manager-export-actions .btn{flex:1}.ads-selected-product-card{grid-template-columns:54px minmax(0,1fr)}.ads-selected-product-photo{width:54px;height:72px}}

/* Центр уведомлений в верхней панели */
.notification-center-wrap{position:relative}
.notification-center-btn{position:relative;width:44px;height:42px;padding:9px;display:grid;place-items:center}
.notification-center-btn svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.notification-center-count{position:absolute;right:-5px;top:-6px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#6d5dfc;color:#fff;border:2px solid var(--bg);font-size:11px;font-weight:800;line-height:16px;text-align:center}
.notification-center-count.has-critical{background:#ef4444}
.notification-center-menu{position:absolute;right:0;top:calc(100% + 9px);z-index:125;width:min(650px,calc(100vw - 28px));max-height:min(720px,78vh);background:#111927;border:1px solid var(--line);border-radius:15px;box-shadow:0 22px 60px rgba(0,0,0,.48);overflow:hidden}
.notification-center-menu-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 14px 12px;border-bottom:1px solid var(--line)}
.notification-center-menu .notification-filters{padding:10px 12px 8px;margin:0;border-bottom:1px solid rgba(255,255,255,.05)}
.notification-center-list{max-height:min(560px,60vh);overflow:auto;padding:8px}
.notification-center-list .recommendation-card{margin-bottom:7px}
.dashboard-chart-grid{grid-template-columns:minmax(0,1fr)}

@media(max-width:720px){
  .notification-center-menu{position:fixed;left:10px;right:10px;top:68px;width:auto;max-height:calc(100vh - 86px);max-height:calc(100dvh - 86px - env(safe-area-inset-bottom,0px));overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
  .notification-center-list{max-height:none;overflow:visible}
}


/* DBS: аккуратное отображение предварительной прибыли */
.dbs-profit-empty{color:var(--muted);font-weight:600}
.dbs-profit-slot{display:block;min-width:0}
.dbs-profit-inline{margin-top:6px;display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;max-width:100%;font-size:11px;line-height:1.35}
.dbs-profit-inline__label{color:var(--muted);text-transform:lowercase}
.dbs-profit-inline__value{font-weight:800;letter-spacing:-.01em}
.dbs-profit-inline__margin{padding:2px 7px;border-radius:999px;background:#172233;border:1px solid #2a3850;color:#dce8fb;font-weight:700}
.dbs-profit-inline__hint{padding:2px 7px;border-radius:999px;background:#2a210c;border:1px solid #5f4814;color:#ffd17a}
.dbs-profit-inline--positive .dbs-profit-inline__value{color:#70e69a}
.dbs-profit-inline--negative .dbs-profit-inline__value{color:#ff99a2}
.dbs-profit-inline--draft .dbs-profit-inline__value{color:#ffffff}
.dbs-profit-card{display:grid;gap:10px;padding:12px 13px;border-radius:14px;border:1px solid #2a3447;background:linear-gradient(180deg,#121a27,#0f1622);box-shadow:inset 0 1px 0 rgba(255,255,255,.03)}
.dbs-profit-card--positive{border-color:rgba(34,197,94,.28);background:linear-gradient(180deg,rgba(19,48,31,.82),rgba(13,22,33,.96))}
.dbs-profit-card--negative{border-color:rgba(239,68,68,.28);background:linear-gradient(180deg,rgba(61,23,27,.82),rgba(17,22,34,.96))}
.dbs-profit-card--draft{border-color:rgba(245,158,11,.24)}
.dbs-profit-card__top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.dbs-profit-card__caption{font-size:10.5px;line-height:1.2;text-transform:uppercase;letter-spacing:.08em;color:#9cabc1}
.dbs-profit-card__status{display:inline-flex;align-items:center;min-height:24px;padding:4px 9px;border-radius:999px;border:1px solid #324055;background:#172233;color:#d9e7fb;font-size:11px;font-weight:700;white-space:nowrap}
.dbs-profit-card--positive .dbs-profit-card__status{background:rgba(17,57,31,.82);border-color:rgba(34,197,94,.28);color:#90f0b2}
.dbs-profit-card--negative .dbs-profit-card__status{background:rgba(59,21,25,.82);border-color:rgba(239,68,68,.28);color:#ffb0b7}
.dbs-profit-card--draft .dbs-profit-card__status{background:rgba(58,42,15,.82);border-color:rgba(245,158,11,.24);color:#ffd589}
.dbs-profit-card__main{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}
.dbs-profit-card__value{font-size:24px;line-height:1;font-weight:850;letter-spacing:-.03em;color:#fff}
.dbs-profit-card--positive .dbs-profit-card__value{color:#84efab}
.dbs-profit-card--negative .dbs-profit-card__value{color:#ff9ba3}
.dbs-profit-card__margin{display:inline-flex;align-items:center;min-height:30px;padding:4px 10px;border-radius:999px;background:#111b2a;border:1px solid #2b3850;color:#e5eefc;font-size:12px;font-weight:800}
.dbs-profit-card__meta{display:flex;flex-wrap:wrap;gap:8px}
.dbs-profit-chip{display:inline-grid;gap:2px;min-width:116px;padding:8px 10px;border-radius:11px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06)}
.dbs-profit-chip em{font-style:normal;font-size:10.5px;color:#8fa0b7}
.dbs-profit-chip strong{font-size:12px;color:#eef4ff;font-weight:750}
.dbs-profit-chip.is-muted{border-style:dashed;color:var(--muted)}
.dbs-profit-chip.is-muted strong{color:#cad4e6}
.dbs-profit-card__note{font-size:11px;line-height:1.5;color:#c4cfdf}
.dbs-profit-card__note-soft{color:#93a2b7}
@media(max-width:900px){.dbs-profit-card__main{align-items:flex-start}.dbs-profit-chip{min-width:unset;flex:1 1 150px}}

.dbs-profit-chip--income{border-color:rgba(34,197,94,.20);background:rgba(34,197,94,.07)}
.dbs-profit-chip--income strong{color:#84efab}


/* Продажи: интерактивная расшифровка «К перечислению». */
.sales-payout-link{
  appearance:none;
  border:0;
  padding:3px 7px;
  margin:-3px -7px;
  border-radius:7px;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:700;
  cursor:pointer;
  transition:background .16s ease,color .16s ease,box-shadow .16s ease;
}
.sales-payout-link:hover,
.sales-payout-link:focus-visible{
  color:#f1d7ff;
  background:rgba(205,79,255,.10);
  box-shadow:0 0 0 1px rgba(205,79,255,.22);
  outline:none;
}
.sales-payout-modal-card{
  width:min(620px,calc(100vw - 28px));
  max-height:min(780px,calc(100vh - 40px));
  overflow:auto;
}
.sales-payout-section{
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.025);
  padding:12px 14px;
  margin-top:12px;
}
.sales-payout-section-title{
  font-size:12px;
  font-weight:800;
  margin-bottom:8px;
  color:var(--text);
}
.sales-payout-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:7px 0;
  border-bottom:1px solid rgba(255,255,255,.055);
  font-size:12px;
}
.sales-payout-row:last-of-type{border-bottom:0}
.sales-payout-row span{color:var(--muted)}
.sales-payout-row b{white-space:nowrap;color:var(--text)}
.sales-payout-row.accent b{color:#7ef0ab;font-size:13px}
.sales-payout-note,
.sales-payout-footnote{
  font-size:10.5px;
  line-height:1.45;
  color:var(--muted);
  margin-top:9px;
}
.sales-payout-empty{
  padding:14px;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:10px;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}
.sales-payout-footnote{padding:4px 2px 0}
