:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #6b7686;
  --border: #dde3ec;
  --primary: #ffcc00;
  --primary-text: #1c2430;
  --accent: #2f6fed;
  --danger: #d64545;
  --ok: #2e9e5b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; }
.topbar nav { display: flex; align-items: center; gap: 4px; flex: 1; flex-wrap: wrap; }
.topbar nav a {
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.topbar nav a:hover { background: var(--bg); }
.topbar nav a.active { background: var(--primary); color: var(--primary-text); font-weight: 600; }
.topbar nav a.nav-link--reference {
  background: #e7f2ff;
  color: #185c9d;
  font-weight: 600;
}
.topbar nav a.nav-link--reference:hover { background: #d6e9ff; }
.topbar nav a.nav-link--reference.active { background: var(--accent); color: #fff; }
.topbar .nav-folder {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 8px;
}
.topbar .nav-folder summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: #f1eaff;
  color: #6c3eb3;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
}
.topbar .nav-folder summary::-webkit-details-marker { display: none; }
.topbar .nav-folder summary::after { content: " ▾"; font-size: 11px; }
.topbar .nav-folder:hover summary { background: #e6d9fb; }
.topbar .nav-folder.active summary { background: #7a4bc2; color: #fff; }
.topbar .nav-folder[open] summary::after { content: " ▴"; }
.topbar .nav-folder__menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 7px);
  right: 0;
  display: flex;
  min-width: 230px;
  padding: 6px;
  flex-direction: column;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(28, 36, 48, .18);
}
.topbar .nav-folder__menu a { width: 100%; white-space: nowrap; }
.topbar .nav-folder__menu a.active { background: #eee4ff; color: #6135a4; }
.auth { display: flex; align-items: center; gap: 10px; }
.badge.admin {
  background: var(--accent); color: #fff;
  border-radius: 999px; padding: 3px 10px; font-size: 12px;
}
main { flex: 1; padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
footer {
  padding: 12px 24px; color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--border); background: var(--card);
}
h1 { font-size: 24px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.card.narrow { max-width: 420px; margin: 60px auto; }
.layout-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .layout-2col { grid-template-columns: 1fr; } }

.form-grid { display: flex; flex-direction: column; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input, select, textarea {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.hint { color: var(--muted); font-size: 12px; }
.error { color: var(--danger); }
details { border: 1px dashed var(--border); border-radius: 8px; padding: 10px 12px; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details[open] summary { margin-bottom: 10px; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.btn {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--primary); border-color: var(--primary); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.inline { display: inline; }
.hidden { display: none; }
.muted { color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.actions-col { width: 280px; }
.key-mono { font-family: Consolas, monospace; font-size: 13px; word-break: break-all; }

.result-empty { color: var(--muted); }
.result-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.result-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.result-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.result-table tr.total td { font-weight: 700; border-top: 2px solid var(--text); }
.result-good { color: var(--ok); font-weight: 700; }
.result-bad { color: var(--danger); font-weight: 700; }
.funnel-warning { color: #a35b00; font-weight: 700; }
.notice {
  background: #fff8e0; border: 1px solid #f0dd8a;
  border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px;
}

/* Комбобокс категорий */
.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  max-height: 320px; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 0 0 8px 8px; box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.combo-item { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.combo-item:hover { background: var(--bg); }

.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 900px) { .row4 { grid-template-columns: 1fr 1fr; } }
fieldset.dims { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0; }
fieldset.dims legend { font-size: 13px; color: var(--muted); padding: 0 6px; }
input.mini { width: 64px; }

/* Каскадный результат */
.cascade td { padding: 5px 8px; }
.cascade tr.group td { color: var(--muted); font-size: 13px; border-bottom: none; padding-top: 10px; }
.cascade .indent { padding-left: 16px; display: inline-block; }
.cascade tr.subtotal td { font-weight: 600; }
.cascade tr.start td { font-weight: 600; }
.cascade tr.info td { color: var(--muted); }
.cascade tr.total td { font-weight: 700; border-top: 2px solid var(--text); }

/* Каскад FBS/FBY */
.cascade th { text-align: right; color: var(--muted); font-size: 13px; padding: 4px 8px; }
.cascade th:first-child { text-align: left; }
.cascade tr.start td, .cascade tr.subtotal td { font-weight: 600; }
.result-card { overflow-x: auto; }

/* Сортируемая таблица */
.sortable th.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable th.th-sort:hover { color: var(--accent); }
.sortable td { white-space: nowrap; }

/* Широкие страницы (таблицы на всё окно) */
main.wide { max-width: none; padding: 16px 16px 24px; }
main.wide .card { padding: 14px 16px; }

/* Плотная широкая таблица: строки высокие, текст в одну строку */
.sortable th, .sortable td { padding: 12px 8px; }
.sortable td { white-space: nowrap; }
.sortable .col-hidden { display: none; }

/* Себестоимость: название в одну строку */
.name-cell {
  white-space: nowrap;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Тулбар: обновление отделено от фильтров */
.toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-sep { width: 1px; align-self: stretch; background: var(--border); min-height: 28px; }

/* Замороженные первые колонки (артикул, название, склад, модель) */
.sortable .fz { position: sticky; background: var(--card); z-index: 2; }
.sortable thead th.fz { z-index: 4; }
.sortable .fz1 { left: 0; min-width: 130px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.sortable .fz2 { left: 130px; min-width: 280px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.sortable .fz3 { left: 410px; min-width: 185px; max-width: 185px; overflow: hidden; text-overflow: ellipsis; }
.sortable .fz4 { left: 595px; min-width: 72px; max-width: 72px; box-shadow: 4px 0 6px -3px rgba(0,0,0,.15); }

/* Сверка с TrueStats: компактная таблица без растягивания */
#ts-table { width: auto; min-width: 0; }
#ts-table th, #ts-table td { padding: 8px 7px; }
#ts-table .grp { border-left: 1px solid var(--border); }
#ts-table thead th.grp[colspan] { text-align: center; }

/* Ручка ресайза колонок */
th { position: relative; }
th .rz {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 5;
}
th .rz:hover { background: var(--accent); opacity: .35; }


/* Товары: заморозка шапки (контейнер скроллится по обеим осям) */
.table-scroll { overflow: auto; max-height: calc(100vh - 240px); }
.table-scroll thead th { position: sticky; top: 0; background: var(--card); z-index: 3; box-shadow: 0 2px 0 var(--border); }
.table-scroll thead th.fz { z-index: 6; }

.funnel-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin: 8px 0 12px;
}
.funnel-summary > div {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fafbfc;
  padding: 10px 12px;
}
.funnel-summary span { display: block; color: var(--muted); font-size: 12px; }
.funnel-summary strong { display: block; margin-top: 4px; font-size: 22px; }
.funnel-chart-card {
  width: 100%;
  margin: 14px 0 16px;
  padding: 14px 16px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
}
.funnel-chart-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.funnel-chart-toolbar h2 { margin: 0 0 3px; font-size: 17px; }
.funnel-chart-toolbar select { min-width: 205px; }
.funnel-chart-toolbar input { width: 270px; }
.funnel-chart-wrap { position: relative; width: 100%; min-height: 330px; margin-top: 8px; }
#funnel-chart { display: block; width: 100%; height: 330px; overflow: visible; }
.chart-grid { stroke: #dfe5ee; stroke-width: 1; }
.chart-axis-label { fill: var(--muted); font-size: 11px; }
.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-dot { fill: #fff; stroke: var(--accent); stroke-width: 2; transition: r .12s ease; }
.chart-dot.active { r: 6; fill: var(--accent); }
.chart-hit { fill: transparent; cursor: crosshair; }
.funnel-chart-tooltip {
  position: absolute;
  z-index: 8;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid #cad4e3;
  border-radius: 8px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 6px 20px rgba(28, 36, 48, .14);
  pointer-events: none;
  font-size: 12px;
}
.funnel-chart-tooltip b, .funnel-chart-tooltip span { display: block; }
.funnel-chart-tooltip span { margin-top: 3px; color: var(--muted); }
.funnel-table-scroll { max-height: calc(100vh - 330px); min-height: 280px; }
.funnel-table-scroll th, .funnel-table-scroll td { white-space: nowrap; }
.funnel-table-scroll .fz2 { min-width: 260px; max-width: 360px; }
.cell-sub { font-size: 11px; margin-top: 2px; }
.funnel-note { margin: 12px 2px 0; max-width: 1300px; }

@media (max-width: 1100px) {
  .funnel-summary { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .funnel-chart-toolbar input { width: 220px; }
}


/* Панель параметров юнитки в товарах */
label.param { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px; }

/* Инпуты прямо в ячейках таблицы */
.cell-input { width: 92px; padding: 5px 7px; font-size: 13px; }

/* Справка по действующим ставкам площадки (Lamoda) — под таблицей */
.rates-note { margin-top: 14px; font-size: 13px; }
.rates-note ul { margin: 6px 0 8px; padding-left: 20px; }
.rates-note li { margin: 2px 0; color: var(--text); }
.rates-note .hint { margin: 0; }

/* Единый центр отзывов */
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.reviews-head { margin-bottom: 14px; }
.reviews-head h1 { margin-bottom: 5px; }
.reviews-head p { margin: 0; max-width: 980px; line-height: 1.45; }
.reviews-error { color: #9d2b2b; background: #fff1f1; border-color: #efb5b5; }
.reviews-summary {
  display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px; margin: 0 0 14px;
}
.reviews-summary > div {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card);
}
.reviews-summary span { display: block; color: var(--muted); font-size: 12px; }
.reviews-summary strong { display: block; margin-top: 4px; font-size: 23px; }
.reviews-analytics {
  display: grid; grid-template-columns: minmax(240px, .8fr) minmax(300px, 1.2fr) minmax(260px, .8fr);
  gap: 28px; align-items: start;
}
.review-bars { display: grid; gap: 6px; }
.review-bars > div { display: grid; grid-template-columns: 38px 1fr 40px; gap: 8px; align-items: center; font-size: 12px; }
.review-bars i { display: block; height: 8px; overflow: hidden; border-radius: 99px; background: #edf0f5; }
.review-bars b { display: block; height: 100%; border-radius: inherit; background: #ffc928; }
.review-bars em { font-style: normal; text-align: right; color: var(--muted); }
.review-topics { display: flex; flex-wrap: wrap; gap: 7px; }
.review-topic { padding: 5px 9px; border-radius: 999px; background: #eef3fb; color: #365b89; font-size: 12px; }
.review-topic b { margin-left: 3px; }
.review-auto-state { margin: 0 0 7px; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 999px; background: #edf0f4; color: #586474; font-size: 12px; }
.pill.ok, .status-published, .status-answered, .status-manual_answered { background: #e1f5e8; color: #217744; }
.status-pending_approval { background: #fff2c7; color: #846100; }
.status-draft, .status-manual_pending { background: #e7efff; color: #2d5fb4; }
.status-error, .status-rejected { background: #fde5e5; color: #a53030; }
.reviews-settings { padding: 0; }
.reviews-settings > summary { padding: 15px 18px; color: var(--text); }
.reviews-settings[open] > summary { border-bottom: 1px solid var(--border); margin: 0; }
.reviews-settings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px 18px 8px; }
.reviews-settings .actions { padding: 6px 18px 16px; }
.reviews-settings-grid .reviews-wide { grid-column: 1 / -1; }
.reviews-toolbar { margin-bottom: 14px; }
.reviews-toolbar input { min-width: 320px; flex: 1; }
.reviews-toolbar select { width: auto; min-width: 150px; }
.reviews-list-card { padding: 14px; }
.reviews-list { display: grid; gap: 12px; }
.review-item { border: 1px solid var(--border); border-radius: 11px; background: #fff; overflow: hidden; }
.review-item:target { outline: 3px solid var(--accent); outline-offset: 2px; }
.review-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: #fafbfc; border-bottom: 1px solid var(--border); }
.review-item-head > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.review-item-head time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.market-badge { padding: 4px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.market-badge.yandex { color: #3c3200; background: #ffdd57; }
.review-stars { color: #e6a800; letter-spacing: 1px; }
.review-product { display: flex; gap: 10px; align-items: baseline; padding: 12px 14px 2px; }
.review-product strong { font-family: Consolas, monospace; font-size: 13px; }
.review-product span { font-weight: 600; }
.review-meta { padding: 0 14px 11px; color: var(--muted); font-size: 12px; }
.review-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); border-top: 1px solid var(--border); }
.review-columns > div { padding: 14px; min-width: 0; }
.review-columns > div + div { border-left: 1px solid var(--border); background: #fcfdff; }
.review-columns h3 { margin: 0 0 9px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.review-columns p { margin: 5px 0; line-height: 1.45; white-space: pre-wrap; }
.review-analysis { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.review-analysis span { padding: 3px 7px; border-radius: 999px; background: #edf0f4; font-size: 11px; }
.review-analysis .sentiment-positive, .review-analysis .risk-low { background: #e1f5e8; color: #217744; }
.review-analysis .sentiment-negative, .review-analysis .risk-high { background: #fde5e5; color: #a53030; }
.review-analysis .sentiment-neutral, .review-analysis .risk-medium { background: #fff2c7; color: #846100; }
.review-draft-label { font-weight: 600; }
.review-draft, .manual-reply { margin-top: 7px; min-height: 112px; line-height: 1.45; resize: vertical; font-weight: 400; }
.review-existing { padding: 11px 12px; border-radius: 8px; background: #eff8f2; border: 1px solid #c9e5d1; }
.review-existing p { margin: 6px 0 0; }
.review-row-error { margin-top: 9px; padding: 8px 10px; color: #9d2b2b; background: #fff1f1; border-radius: 7px; font-size: 12px; white-space: pre-wrap; }
.review-actions { margin-top: 11px; }
.reviews-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 15px; }
.reviews-empty { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 42px; color: var(--muted); }
@media (max-width: 1150px) {
  .reviews-summary { grid-template-columns: repeat(3, 1fr); }
  .reviews-analytics { grid-template-columns: 1fr 1fr; }
  .reviews-analytics > div:last-child { grid-column: 1 / -1; }
  .reviews-settings-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .reviews-summary { grid-template-columns: 1fr 1fr; }
  .reviews-analytics, .review-columns { grid-template-columns: 1fr; }
  .review-columns > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .reviews-settings-grid { grid-template-columns: 1fr; }
  .reviews-toolbar input { min-width: 100%; }
}

/* Статус сессии сбора объявлений Авито */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  background: var(--border); color: var(--text); font-size: 12px; font-weight: 600;
}
textarea { resize: vertical; font-family: inherit; }

/* Администрирование */
.admin-head, .section-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.admin-head p, .section-head p { margin: 4px 0 0; }
.admin-create-form {
  display: grid; grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr) auto auto;
  gap: 12px; align-items: end; margin-bottom: 18px;
}
.admin-check { padding-bottom: 9px; white-space: nowrap; }
.admin-check input { width: auto; }
.admin-table-wrap { max-height: 520px; }
.admin-table td { vertical-align: middle; }

/* Админка: интеграции и API-ключи */
.integration-editor {
  margin-bottom: 18px; border-style: solid; background: #fbfcfe;
}
.integration-editor > summary { color: var(--accent); font-weight: 600; }
.integration-form {
  display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px; align-items: end;
}
.integration-fields {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px; align-items: end;
}
.integration-fields.hidden { display: none; }
.integration-enabled { padding-bottom: 9px; }
.integration-enabled input { width: auto; }
.integration-notes { grid-column: 1 / -1; }
.integration-form-actions { grid-column: 1 / -1; }
.integration-detail { min-width: 220px; }
@media (max-width: 900px) {
  .integration-form, .integration-fields { grid-template-columns: 1fr; }
}

/* Центр уведомлений и автоматизаций */
.automation-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(620px, 2fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}
.automation-channel {
  display: grid;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfcfe;
}
.automation-channel h3, .automation-channel p { margin: 0; }
.automation-time { width: 105px; }
.automation-actions { min-width: 230px; }
.automation-summary { min-width: 300px; white-space: normal; }
@media (max-width: 1050px) {
  .automation-grid { grid-template-columns: 1fr; }
}

/* Акции Ozon */
.ozon-control-card { border-left: 4px solid #1261d5; }
.ozon-monitor-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}
.ozon-monitor-metric {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  padding: 14px 16px;
}
.ozon-monitor-metric span { display: block; color: var(--muted); font-size: 12px; }
.ozon-monitor-metric strong { display: block; margin-top: 4px; font-size: 24px; }
.ozon-controls, .ozon-schedule {
  display: flex; align-items: end; gap: 12px; flex-wrap: wrap;
}
.ozon-controls label { min-width: 230px; }
.ozon-schedule {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.ozon-schedule label { flex-direction: row; align-items: center; white-space: nowrap; }
.ozon-schedule label:not(.check) input { width: 90px; margin-left: 6px; }
.ozon-schedule input[type="checkbox"] { width: auto; }
.ozon-actions-wrap { max-height: 480px; }
.ozon-products-wrap { max-height: calc(100vh - 250px); }
.ozon-runs-wrap { max-height: 420px; }
.ozon-items-wrap { max-height: 420px; margin-top: 10px; }
#ozon-actions-table td, #ozon-products-table td, #ozon-runs-table td,
#ozon-items-table td { white-space: nowrap; }
#ozon-products-table .name-cell { min-width: 260px; }
.ozon-threshold { min-width: 120px; }
#ozon-run-items { margin-top: 24px; }
@media (max-width: 900px) {
  .ozon-monitor-summary { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
}

/* Юнит-экономика Ozon */
.ozon-unit-wrap { max-height: calc(100vh - 285px); }
#ozon-unit-table td { white-space: nowrap; }
#ozon-unit-table td.fz2 { white-space: normal; }
#ozon-note { margin: 0 0 12px; padding: 9px 12px; font-size: 13px; }
.ozon-new-col.grp { border-left: 2px solid #c4cfdd; }
.ozon-price-input { width: 105px; }
.ozon-save-price { white-space: nowrap; }
.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 360px; }
.admin-filters input { max-width: 220px; }
.admin-filters select { max-width: 190px; }
.admin-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.admin-agent { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.pill-admin { background: #e7efff; color: var(--accent); }
.pill.pill-ok { background: #e4f5eb; color: var(--ok); }
.pill.pill-off { background: #eef0f3; color: var(--muted); }
.pill.pill-bad { background: #fdeaea; color: var(--danger); }
.notice.admin-error { background: #fdeaea; border-color: #f2b7b7; color: var(--danger); }
@media (max-width: 900px) {
  .admin-create-form { grid-template-columns: 1fr; }
  .admin-check { padding-bottom: 0; }
}

/* Заказываемость: недельная матрица по площадкам */
.orderability-head { margin-bottom: 12px; }
.orderability-head h1 { margin-bottom: 2px; }
.orderability-toolbar { align-items: end; }
.orderability-toolbar #product-filter { width: 250px; }
.orderability-toolbar .check { margin: 0; }
.orderability-scroll { max-height: calc(100vh - 300px); min-height: 360px; }
.orderability-table { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.orderability-table th, .orderability-table td { white-space: nowrap; }
.orderability-table thead th { position: sticky; top: 0; z-index: 5; background: #f6f8fb; }
.orderability-table thead tr:nth-child(2) th { top: 48px; }
.orderability-table .ord-week { text-align: center; border-left: 2px solid #c8d3e1; min-width: 86px; }
.orderability-table .ord-week span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.orderability-table .ord-platform { text-align: center; min-width: 70px; }
.orderability-table .ord-platform-total { background: #f2f5f9; }
.orderability-table td.ord-platform-total { border-left: 2px solid #d2dbe7; }
.orderability-table .has-orders { color: var(--text); font-weight: 600; background: #f8fbff; }
.orderability-table .ord-sticky { position: sticky; z-index: 3; background: #fff; }
.orderability-table th.ord-sticky { z-index: 8; background: #f6f8fb; }
.orderability-table .ord-sku { left: 0; min-width: 155px; max-width: 155px; }
.orderability-table .ord-name { left: 155px; min-width: 290px; max-width: 290px; overflow: hidden; text-overflow: ellipsis; }
.orderability-table .ord-total { left: 445px; min-width: 105px; box-shadow: 5px 0 8px -7px rgba(18, 31, 49, .7); }
.orderability-table .orderability-total-row td { position: sticky; top: 85px; z-index: 2; background: #eef4fc; border-bottom: 2px solid #bdcce0; }
.orderability-table .orderability-total-row .ord-sticky { z-index: 4; background: #e7effa; }
.orderability-note { margin: 12px 2px 0; max-width: 1250px; }
@media (max-width: 900px) {
  .orderability-table .ord-name { min-width: 220px; max-width: 220px; }
  .orderability-table .ord-total { left: 375px; }
}
.market-badge.wb { color: #fff; background: #a73afd; }
.reviews-templates summary { cursor: pointer; }
.rv-rules ol { margin: 8px 0 12px 18px; padding: 0; line-height: 1.5; }
.rv-templates { display: grid; gap: 12px; }
.rv-template { border: 1px solid var(--border, #e3e6ea); border-radius: 8px; padding: 10px 12px; }
.rv-template-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rv-template textarea { width: 100%; box-sizing: border-box; }
