:root{
  --bg:#f5f6f9; --panel:#ffffff; --panel2:#f1f3f7; --line:#e3e6ee;
  --text:#1f2534; --muted:#69718a; --accent:#6558f5; --accent2:#2f6fed;
  --ok:#149a5f; --warn:#b97d0c; --bad:#d84545;
}
*{box-sizing:border-box}
body{margin:0;background:linear-gradient(155deg,#f6f8fd 0%,#eaeef8 48%,#f3edfb 100%) fixed;color:var(--text);
  font:14px/1.45 -apple-system,"Segoe UI",Roboto,Arial,sans-serif}
.hidden{display:none!important}
.muted{color:var(--muted)}
.spacer{flex:1}
.err{color:var(--bad);min-height:18px;margin-top:8px;font-size:13px}

/* login */
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center}
.login-box{background:var(--panel);padding:36px;border-radius:14px;width:340px;
  border:1px solid var(--line);display:flex;flex-direction:column;gap:10px;text-align:center}
.login-box h1{margin:0;font-size:24px}
.login-box p{margin:0 0 10px}
input,select{background:var(--panel2);border:1px solid var(--line);color:var(--text);
  border-radius:8px;padding:8px 10px;font-size:14px;outline:none}
input:focus,select:focus{border-color:var(--accent2)}

/* header + filters */
header{display:flex;align-items:center;gap:14px;padding:12px 18px;
  border-bottom:1px solid var(--line);background:var(--panel);position:sticky;top:0;z-index:5}
.brand{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1px}
.brand-full{height:46px;width:auto;display:block}
.brand-login{height:62px;width:auto;max-width:100%;display:block;margin:0 auto 4px}
.dry{background:#fdf3d9;color:#96690a;border:1px solid #efdcae;
  padding:2px 10px;border-radius:20px;font-size:12px}
.filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:12px 18px}
.f-group{display:flex;gap:6px;align-items:center}
.chip{background:var(--panel2);border:1px solid var(--line);color:var(--text);
  border-radius:20px;padding:5px 12px;cursor:pointer;font-size:13px}
.chip.active{background:var(--accent);border-color:var(--accent);color:#fff}
#f-search{width:230px}

.btn{background:var(--panel2);border:1px solid var(--line);color:var(--text);
  border-radius:8px;padding:7px 14px;cursor:pointer;font-size:13px}
.btn:hover{border-color:var(--accent2)}
.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn-ghost{background:transparent}
.btn-sm{padding:3px 9px;font-size:12px;border-radius:6px}
.btn-danger{border-color:#f0c4c4;color:#c33c3c}

/* table */
.table-wrap{overflow:auto;padding:0 18px 30px;max-height:calc(100vh - 130px)}
table{border-collapse:collapse;width:100%;white-space:nowrap}
th,td{padding:7px 10px;text-align:right;border-bottom:1px solid var(--line);font-size:13px}
th{position:sticky;top:0;background:var(--panel);cursor:pointer;user-select:none;
  color:var(--muted);font-weight:600;z-index:2}
th.ta-l,td.ta-l{text-align:left}
th.sorted{color:var(--accent2)}
tbody tr{cursor:pointer}
tbody tr:hover{background:#f6f8fc}
.title-cell{max-width:280px;overflow:hidden;text-overflow:ellipsis}
.pill{display:inline-block;padding:1px 8px;border-radius:12px;font-size:11.5px}
.pill-bad{background:#fdeaea;color:#c33c3c}
.pill-warn{background:#fdf3d9;color:#96690a}
.pill-ok{background:#e1f5eb;color:#12804f}
.pill-info{background:#e8f0fe;color:#2c62d6}
.v-bad{color:var(--bad);font-weight:600}
.v-warn{color:var(--warn)}
.v-ok{color:var(--ok)}

/* modal */
.modal{position:fixed;inset:0;background:rgba(31,37,52,.38);z-index:20;
  display:flex;align-items:flex-start;justify-content:center;padding:26px;overflow:auto}
.modal-box{background:var(--panel);border:1px solid var(--line);border-radius:14px;
  width:min(1240px,100%);padding:20px 24px;margin-bottom:40px}
.modal-box.narrow{width:min(760px,100%)}
.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.modal-head h2{margin:0 0 4px;font-size:19px}
.kpi-row{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0}
.kpi{background:var(--panel2);border:1px solid var(--line);border-radius:10px;
  padding:10px 16px;min-width:118px}
.kpi .v{font-size:18px;font-weight:700;margin-top:2px}
.kpi .l{font-size:11.5px;color:var(--muted)}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:14px;flex-wrap:wrap}
.tab{background:none;border:none;color:var(--muted);padding:9px 16px;cursor:pointer;
  font-size:13.5px;border-bottom:2px solid transparent}
.tab.active{color:var(--text);border-bottom-color:var(--accent)}
.tab-pane table{width:100%}
.tab-pane th{background:var(--panel2)}

.camp-card{background:var(--panel2);border:1px solid var(--line);border-radius:10px;
  padding:14px 16px;margin-bottom:12px}
.camp-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.camp-head b{font-size:14.5px}
.camp-stats{display:flex;gap:18px;flex-wrap:wrap;margin:6px 0;font-size:13px}
.camp-stats span b{font-weight:600}
.bid-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:8px}
.bid-row input{width:90px}
a.ext{color:var(--accent2);text-decoration:none}
a.ext:hover{text-decoration:underline}

.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:10px 0}
.note{background:var(--panel2);border:1px solid var(--line);border-radius:8px;
  padding:10px 12px;margin-bottom:8px}
.note .meta{font-size:12px;color:var(--muted);margin-bottom:4px}

/* Пометки: плавающая панель на карточке артикула (доступна на любой вкладке) */
.qn{position:fixed;right:22px;bottom:22px;z-index:40}
.qn-fab{background:var(--accent);border:1px solid var(--accent);color:#fff;border-radius:22px;
  padding:9px 15px;font-size:13px;cursor:pointer;box-shadow:0 3px 12px rgba(31,37,52,.20);font-weight:600}
.qn-fab:hover{background:var(--accent2);border-color:var(--accent2)}
.qn-fab.qn-has{box-shadow:0 3px 14px rgba(101,88,245,.4)}
.qn-panel{position:absolute;right:0;bottom:50px;width:min(340px,90vw);max-height:64vh;overflow:auto;
  background:var(--panel);border:1px solid var(--line);border-radius:12px;
  box-shadow:0 8px 30px rgba(31,37,52,.22);padding:12px;display:flex;flex-direction:column;gap:8px}
.qn-head{display:flex;align-items:center;gap:6px;font-weight:600;font-size:13px}
.qn-ctx{color:var(--muted);font-weight:400;font-size:12px}
.qn-x{margin-left:auto}
.qn-panel textarea{width:100%;min-height:64px;resize:vertical;font-size:13px;margin:0}
.qn-row{display:flex;gap:8px;align-items:center;margin:0}
.qn-row select{flex:1}
.qn-list{display:flex;flex-direction:column;gap:2px}
.qn-note{border-top:1px solid var(--line);padding-top:6px;font-size:13px}
.qn-meta{color:var(--muted);font-size:11px;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.qn-sec{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:0 7px;color:var(--text);font-size:11px}
.qn-del{margin-left:auto;background:transparent;border:0;color:var(--muted);cursor:pointer;font-size:12px;padding:0 2px}
.qn-del:hover{color:var(--bad)}
.qn-txt{white-space:pre-wrap;margin-top:2px}
.qn-all{align-self:flex-start;margin-top:2px}

/* Окно смены цены: сравнение ДО/ПОСЛЕ + план */
.pw-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:6px}
.pw-col h4{margin:0 0 8px;font-size:14px}
.pw-before-col{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:10px 12px}
.pw-inputs{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px;margin-bottom:10px}
.pw-inputs label{display:flex;flex-direction:column;font-size:12px;color:var(--muted);gap:3px}
.pw-inputs input{font-size:13px;width:100%}
.pw-metrics{display:flex;flex-direction:column;gap:2px}
.pw-m{display:flex;justify-content:space-between;align-items:baseline;border-bottom:1px solid var(--line);padding:5px 0}
.pw-ml{color:var(--muted);font-size:13px}
.pw-mv{font-weight:600;font-size:14px}
.pw-d{font-size:11px;font-weight:600;margin-left:6px}
.pw-d.up{color:var(--ok)}
.pw-d.down{color:var(--bad)}
.pw-comment{width:100%;margin:12px 0 4px}
.pw-actions{display:flex;gap:8px;margin-top:8px}
@media(max-width:640px){.pw-grid{grid-template-columns:1fr}.pw-inputs{grid-template-columns:1fr 1fr}}

textarea{background:var(--panel2);border:1px solid var(--line);color:var(--text);
  border-radius:8px;padding:8px 10px;width:100%;min-height:70px;font:inherit}
.audit{max-height:300px;overflow:auto;font-size:12px}
.audit div{padding:5px 0;border-bottom:1px solid var(--line)}

.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);
  background:var(--panel2);border:1px solid var(--accent2);border-radius:10px;
  padding:11px 22px;z-index:50;font-size:14px}
.toast.bad{border-color:var(--bad)}
.loading{padding:40px;text-align:center;color:var(--muted)}

/* по дням */
.daily-strip{display:flex;gap:6px;align-items:flex-end;padding:8px 18px 0;height:120px;overflow-x:auto}
.dbar{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:64px}
.dbar .cols{display:flex;gap:3px;align-items:flex-end;height:78px}
.dbar .col{width:20px;border-radius:3px 3px 0 0;background:var(--accent2);min-height:2px}
.dbar .col.sp{background:var(--warn)}
.dbar .lbl{font-size:10.5px;color:var(--muted)}
.dbar .val{font-size:10.5px}
.legend{font-size:11px;color:var(--muted);padding:0 18px}
.legend i{display:inline-block;width:10px;height:10px;border-radius:2px;margin:0 4px 0 10px}
/* чат */
.chat-box{display:flex;flex-direction:column;gap:8px;max-height:420px;overflow:auto;
  padding:6px 2px;margin-bottom:10px}
.msg{max-width:82%;padding:9px 13px;border-radius:12px;white-space:pre-wrap;font-size:13.5px}
.msg.user{align-self:flex-end;background:var(--accent);color:#fff;border-bottom-right-radius:3px}
.msg.ai{align-self:flex-start;background:var(--panel2);border:1px solid var(--line);border-bottom-left-radius:3px}
.chat-input{display:flex;gap:8px}
.chat-input input{flex:1}
.verdict{padding:10px 14px;border-radius:10px;margin:10px 0;border:1px solid var(--line);background:var(--panel2)}
.verdict.bad{border-color:#5c2626}
.verdict.good{border-color:#1e4d33}

.thumb{width:28px;height:36px;object-fit:cover;border-radius:4px;vertical-align:middle;margin-right:6px}
.thumb:hover{transform:scale(4);transition:.15s;position:relative;z-index:9}
.group-row td{background:var(--panel2);font-weight:600;cursor:pointer;border-top:2px solid var(--line)}
.group-row .arr{display:inline-block;width:14px;color:var(--accent2)}
.group-row.lvl2 td{background:#1a2135;font-weight:500;padding-left:26px}
.cols-list{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:12px 0}
.cols-list label{display:flex;gap:8px;align-items:center;font-size:13.5px;cursor:pointer}
.gallery{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0}
.gallery img{height:180px;border-radius:10px;border:1px solid var(--line);cursor:pointer}
.content-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.content-grid textarea{min-height:120px}
@media(max-width:900px){.content-grid{grid-template-columns:1fr}}
.subtabs{display:flex;gap:6px;margin-bottom:10px}
.q-missed{background:#f5f2fe;border:1px solid #ded5f8;border-radius:8px;padding:8px 12px;margin-bottom:6px;font-size:13px}
.daily-pivot td.hot{background:#ece5fd}

/* PBI-макет */
.topbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:10px 18px;border-bottom:1px solid var(--line)}
.layout{display:flex;align-items:flex-start}
.sidebar{width:228px;min-width:228px;padding:12px 10px 30px 16px;max-height:calc(100vh - 116px);overflow-y:auto;
  border-right:1px solid var(--line)}
.side-block{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:10px}
.side-block h4{margin:0 0 8px;font-size:12.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
.side-block label{display:flex;gap:7px;align-items:center;font-size:13px;padding:2.5px 0;cursor:pointer}
.side-block .lbl{display:block;font-size:11.5px;color:var(--muted);margin:7px 0 2px;cursor:default}
.side-block select{width:100%}
.mainarea{flex:1;min-width:0}
.mainarea .table-wrap{max-height:calc(100vh - 130px);padding:0 14px 30px}

/* базовая таблица */
.bt-group td{background:#e9edf6;font-weight:700;cursor:pointer;border-top:2px solid var(--line);position:sticky;left:0}
.bt-group.lvl2 td{background:#f1f4fa;padding-left:24px;font-weight:600}
.bt-sku{background:var(--panel);vertical-align:top;border-right:1px solid var(--line);min-width:170px;max-width:190px;
  position:sticky;left:0;z-index:1}
.bt-sku img{width:74px;height:98px;object-fit:cover;border-radius:8px;display:block;margin-bottom:6px}
.bt-sku .t{font-size:12px;line-height:1.3;white-space:normal;display:block}
.bt-sku .n{color:var(--accent2);font-weight:600}
.bt-metric{text-align:left;color:var(--muted);white-space:nowrap;font-size:12.5px;position:sticky;left:190px;
  background:var(--bg);border-right:1px solid var(--line)}
.bt-cell{font-size:12.5px;padding:4px 8px}
.bt-total{font-weight:700;border-left:2px solid var(--line)}
/* матрица PBI: пустые/уровневые ячейки левой части базовой таблицы (по колонке на уровень иерархии) */
.bt-lvl{border-bottom:1px solid var(--line);vertical-align:top;background:var(--panel)}
#mon-table .bt-lvl,#mon-head th.bt-lvl-h{min-width:84px;max-width:110px}
.c-good{background:#ddf3e6}
.c-mid{background:#fdf0cf}
.c-bad{background:#fbe3e3}
.c-over{background:#ece5fd}
.c-neg{color:var(--bad)}
.abc-pill{display:inline-block;padding:0 7px;border-radius:9px;font-size:11px;font-weight:700}
.abc-A{background:#e1f5eb;color:#12804f}.abc-B{background:#fdf3d9;color:#96690a}.abc-C{background:#fdeaea;color:#c33c3c}
.v-grow{color:#ba8fff}
.timing,.autofill{background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin-top:8px}
.hourbar{display:flex;gap:2px;align-items:center;flex-wrap:wrap}
.hourbar .hr{width:26px;height:22px;border-radius:4px;background:var(--panel);border:1px solid var(--line);
  font-size:10px;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.hourbar .hr.on{background:#dff3e9;color:#12804f;border-color:#b8e4cd}
.promo-card{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin-bottom:10px}
.promo-card .plush{display:inline-block;background:#152743;color:var(--accent2);border-radius:10px;
  padding:1px 8px;font-size:11px;margin:2px 3px 0 0}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.seg button{background:var(--panel2);border:none;color:var(--muted);padding:4px 10px;cursor:pointer;font-size:12px}
.seg button.active{background:var(--accent);color:#fff}
.fresh-bar{padding:3px 18px;font-size:11.5px;color:var(--muted);border-bottom:1px solid var(--line);background:var(--panel)}
.task-row{display:flex;gap:10px;align-items:center;padding:8px 10px;border-bottom:1px solid var(--line);cursor:pointer}
.task-row:hover{background:var(--panel2)}
.task-row img{width:34px;height:44px;object-fit:cover;border-radius:5px}
.task-type{min-width:96px;text-align:center}

/* дружелюбнее и компактнее */
.welcome{margin:10px 18px 0;padding:12px 16px;background:linear-gradient(120deg,#eef1ff,#f6f9ff);
  border:1px solid #d9e1fb;border-radius:12px;font-size:13.5px;line-height:1.7}
.welcome .wstep{display:block;color:var(--text)}
.bt-cell{font-size:11.5px;padding:2px 6px}
.bt-metric{font-size:11.5px;padding:2px 8px}
.bt-sku{min-width:150px;max-width:165px;padding:6px 8px}
.bt-sku img{width:56px;height:74px;margin-bottom:4px}
.bt-sku .t{font-size:11px;line-height:1.25}
.ph-days td{background:var(--bg)}
.tab{padding:8px 12px;font-size:13px}

/* иерархия строк и бейджи групп */
.row-primary .bt-cell, .row-primary .bt-metric{font-weight:700;color:#141a2a;font-size:12px}
.row-primary .bt-metric{color:var(--accent2)}
.row-dim{opacity:.62}
.gbadge{display:inline-block;background:var(--panel2);border:1px solid var(--line);border-radius:12px;
  padding:1px 9px;font-size:11px;font-weight:600;margin-left:5px;vertical-align:1px}
.b-ord{color:var(--accent2)}.b-rev{color:var(--text)}.b-prof{color:var(--ok)}.b-loss{color:var(--bad)}.b-adv{color:var(--warn)}
.qmark{color:var(--muted);border:1px solid var(--line);border-radius:50%;width:13px;height:13px;
  display:inline-flex;align-items:center;justify-content:center;font-size:9px;margin-left:auto}

/* интерактивный тур */
.tour-hl{position:relative!important;z-index:1001!important;
  box-shadow:0 0 0 3px var(--accent), 0 0 0 9999px rgba(31,37,52,.45)!important;border-radius:10px}
.tour-box{position:fixed;z-index:1002;background:var(--panel);border:1px solid var(--accent);
  border-radius:12px;padding:14px 18px;max-width:340px;font-size:13.5px;line-height:1.5;
  box-shadow:0 12px 34px rgba(31,37,52,.18)}
.tour-box b{color:var(--accent2)}


/* светлая тема: глубина и спокойствие */
body{-webkit-font-smoothing:antialiased}
.side-block,.camp-card,.promo-card,.kpi,.modal-box,.login-box{box-shadow:0 1px 3px rgba(31,37,52,.06)}
header{box-shadow:0 1px 2px rgba(31,37,52,.05)}
th{font-weight:600}
.bt-total{background:#f7f8fc}
.gbadge{background:#fff}
input,select{background:#fff}
.btn{background:#fff}
.chip{background:#fff}
.tab.active{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}
.kpi .v{color:#141a2a}
.fresh-bar{background:#fbfcfe}

/* чёткие границы между артикулами */
#mon-body tr:has(> td.bt-sku) > td{border-top:1px solid var(--line)}
.bt-sku{border-right:2px solid var(--line)}
.trend{font-size:9px;margin-left:3px;vertical-align:1px}
.t-good{color:var(--ok)}
.t-bad{color:var(--bad)}
.hscroll-top{overflow-x:auto;overflow-y:hidden;height:14px;margin-bottom:2px}
.hscroll-top>div{height:1px}
.hscroll-top::-webkit-scrollbar{height:10px}
.vis-strip{display:flex;align-items:center;gap:3px;flex-wrap:wrap;margin:4px 0 8px}
.vday{width:44px;border:1px solid var(--line);border-radius:6px;background:#f3f4f8;
  display:flex;flex-direction:column;align-items:center;padding:2px 0;font-size:10px;color:var(--muted)}
.vday.on{background:#dff3e9;border-color:#b8e4cd;color:#12804f}
.vday .vd-date{font-size:9px;opacity:.7}
.vday .vd-spend{font-weight:700}

/* карточка артикула — во весь экран (тут вся работа) */
#modal-sku{padding:0;align-items:stretch}
#modal-sku .modal-box{width:100vw;max-width:100vw;min-height:100vh;margin:0;border-radius:0;
  padding:16px 28px 60px}
#modal-sku .modal-head{position:sticky;top:0;background:var(--panel);z-index:5;padding:6px 0;
  border-bottom:1px solid var(--line)}
#modal-sku .tabs{position:sticky;top:52px;background:var(--panel);z-index:4}

/* фикс: полноэкранная карточка не должна просвечивать на фон страницы */
#modal-sku{background:var(--bg)}
#modal-sku .modal-box{background:var(--panel);position:relative;z-index:1}
#modal-sku .tab-pane{background:var(--panel)}
#modal-sku .modal-head{box-shadow:0 1px 0 var(--line)}
#modal-sku .tabs{box-shadow:0 2px 4px rgba(31,37,52,.06)}
.rp-row{display:flex;align-items:center;gap:8px;justify-content:space-between;margin:6px 0;font-size:13px}
.rp-row span{color:var(--muted)}
.rp-row input[type=number]{width:100px}
.copy-nm{cursor:pointer;color:var(--muted);font-size:11px;margin-left:4px;opacity:.6}
.copy-nm:hover{opacity:1;color:var(--accent2)}
.sarr{font-size:9px;color:var(--accent2)}
th[data-dir]{color:var(--accent2)}
.photo-cell{display:inline-flex;flex-direction:column;align-items:center;margin:4px;gap:3px}
.photo-cell img{height:150px;border-radius:8px;border:1px solid var(--line);cursor:pointer}
.photo-no{font-size:11px;color:var(--muted);font-weight:600}
.photo-cell:first-child .photo-no{color:var(--ok)}
.photo-ctrl{display:flex;gap:4px}

/* #6 Заморозка левого блока базовой таблицы (уровни иерархии + Артикул + Параметр) при
   горизонтальной прокрутке. Ширины уровней/артикула фиксированы (+ellipsis у заголовков,
   чтобы длинные подписи не растягивали колонку), `left` задаётся инлайном из JS — единый
   расчёт offset'ов для шапки и тела, чтобы они не «разъезжались». */
#mon-head th.bt-lvl-h{min-width:120px;max-width:120px;width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#mon-head th.bt-artcol{min-width:168px;max-width:168px;width:168px}
#mon-table .bt-lvl{position:sticky;z-index:3;background:var(--panel);min-width:120px;max-width:120px;width:120px}
#mon-table .bt-sku{position:sticky;z-index:5;background:var(--panel)}
#mon-table .bt-metric{position:sticky;z-index:4;background:var(--bg);min-width:150px}
#mon-head th.frz{position:sticky;top:0;z-index:8;background:var(--panel)}
/* заголовки групп и грандиозный итог — широкие colspan-ячейки: снимаем общий max-width bt-sku */
#mon-table .bt-ghead,#mon-table .bt-grand td.bt-sku{max-width:none}
/* итоговая строка */
.bt-grand td{background:#eef1f8 !important;font-weight:700}
.bt-grand:first-of-type td{border-top:2px solid var(--accent2)}
.bt-grand .bt-sku,.bt-grand .bt-metric{background:#e7ecf7 !important;color:#141a2a}

/* Джем: блок выручки (неделя/месяц) */
.jam-rev{background:#f0f4ff;border:1px solid #d5def6;border-radius:10px;padding:10px 12px;margin:8px 0 14px}
.jam-rev-h{font-weight:700;font-size:13.5px;margin-bottom:8px;color:#26314d}
.jam-rev-t{width:100%;border-collapse:collapse;font-size:12.5px}
.jam-rev-t th,.jam-rev-t td{padding:5px 8px;text-align:center;border-bottom:1px solid #e2e8f6}
.jam-rev-t th.ta-l,.jam-rev-t td.ta-l{text-align:left}
.jam-rev-t thead th{color:#68738a;font-weight:600;font-size:11.5px}
.jam-rev-base td{background:#e5ecff}

/* Универсальная сортировка таблиц по клику на заголовок */
table:not([data-nosort]) thead th{cursor:pointer;user-select:none}
table:not([data-nosort]) thead th:not([data-nosort]):hover{background:rgba(101,88,245,.08)}
.sarr{font-size:10px;color:var(--accent2,#6558f5)}

/* --- ФИКС: .btn{background:#fff} перебивал фон .btn-primary (белый текст на белом). --- */
.btn.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff}
.btn.btn-primary:hover{background:var(--accent2);border-color:var(--accent2)}
.seg button.active{background:var(--accent);color:#fff}

/* выпадающий мультивыбор (слайсеры Год/Месяц, как в Power BI) */
.msel{position:relative;display:inline-block}
.msel-pop{position:absolute;top:calc(100% + 4px);left:0;z-index:40;background:var(--panel);border:1px solid var(--line);
  border-radius:8px;box-shadow:0 6px 18px rgba(31,37,52,.16);padding:8px;min-width:180px}
.msel-pop.hidden{display:none}
.msel-search{width:100%;margin-bottom:6px}
.msel-list{max-height:240px;overflow-y:auto;display:flex;flex-direction:column;gap:1px}
.msel-pop label{display:flex;gap:6px;align-items:center;font-size:13px;padding:2px 4px;cursor:pointer;border-radius:5px}
.msel-pop label:hover{background:var(--panel2)}
.msel-all{border-bottom:1px solid var(--line);padding-bottom:5px;margin-bottom:4px;font-weight:600}

/* --- Батч A: размер картинки товара, компактность, клэмп флайаутов --- */
#mon-table.imgsz-s .bt-sku img{width:34px;height:46px}
#mon-table.imgsz-m .bt-sku img{width:52px;height:68px}
#mon-table.imgsz-l .bt-sku img{width:74px;height:98px}
#mon-table .bt-cell{padding:3px 6px}
.msel-pop{max-width:calc(100vw - 16px)}
.msel-list{max-height:min(280px, 52vh)}

/* совместное редактирование: предупреждение в карточке + бейдж в таблице */
.editlock-warn{margin:6px 0;padding:8px 12px;background:#fdecea;border:1px solid #f5c6cb;color:#a1231c;border-radius:8px;font-size:13px;font-weight:600}
.editing-badge{display:inline-block;margin:3px 0;font-size:10.5px;background:#fff3cd;color:#8a6d1a;border:1px solid #ecd9a0;border-radius:5px;padding:0 5px}

/* панель drill (как в Power BI) + компактная матрица */
.drillbar{display:inline-flex;gap:2px}
.drillbar .chip{padding:3px 7px}
#mon-table .bt-cell{padding:2px 6px;font-size:12px}
#mon-table .bt-metric{padding:2px 6px;font-size:12px;line-height:1.2}
#mon-table .bt-group td{padding:3px 6px;font-size:12px}
.bt-sku .t{font-size:11.5px;line-height:1.2}
.bt-sku{padding-top:4px;padding-bottom:4px}

/* --- КОМПАКТ-матрица (плотно как в Power BI): ужимаем фото-ячейку, она растягивала строки --- */
#mon-table .bt-cell, #mon-table .bt-metric{padding:1px 6px !important;font-size:12px !important;line-height:1.15 !important}
#mon-table .bt-group td{padding:2px 6px !important;font-size:12px !important}
#mon-table .bt-sku{padding:4px 8px !important;line-height:1.15;vertical-align:top}
#mon-table .bt-sku .t{font-size:11px;line-height:1.14;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-height:2.3em}
#mon-table .bt-sku .muted{font-size:10px;line-height:1.1}
#mon-table.imgsz-s .bt-sku img{width:26px;height:34px;margin-bottom:2px}
#mon-table.imgsz-m .bt-sku img{width:38px;height:50px;margin-bottom:3px}
#mon-table.imgsz-l .bt-sku img{width:58px;height:76px;margin-bottom:3px}

/* всплывающая панель drill над матрицей (как в Power BI, при наведении) */
.mainarea{position:relative}
.matrix-drill{position:absolute;top:2px;right:16px;z-index:8;display:inline-flex;gap:2px;
  background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:2px 3px;
  opacity:0;pointer-events:none;transition:opacity .15s;box-shadow:0 2px 10px rgba(31,37,52,.14)}
.mainarea:hover .matrix-drill{opacity:1;pointer-events:auto}
.matrix-drill .chip{padding:2px 8px;font-size:13px}

/* --- КОМПАКТ-2: низкая фото-ячейка (чтобы не растягивала строки при малом числе показателей) --- */
#mon-table.imgsz-s .bt-sku img{width:24px;height:32px;margin-bottom:2px}
#mon-table.imgsz-m .bt-sku img{width:34px;height:44px;margin-bottom:2px}
#mon-table.imgsz-l .bt-sku img{width:52px;height:68px;margin-bottom:3px}
#mon-table .bt-sku{padding:3px 8px !important}
#mon-table .bt-sku .t{font-size:10.5px;line-height:1.12;-webkit-line-clamp:2;max-height:2.2em;margin:1px 0}
#mon-table .bt-sku .n{font-size:11.5px}
#mon-table .bt-sku .muted{font-size:9.5px;line-height:1.05}
#mon-table .bt-cell, #mon-table .bt-metric{padding:0 6px !important;line-height:1.1 !important}

/* --- компактная шапка как в Power BI (плотные чипы/селекты, меньше отступов) --- */
.topbar{gap:5px !important;padding:6px 14px !important}
.topbar .chip{padding:3px 9px !important;font-size:12px !important}
.topbar select{padding:4px 7px !important;font-size:12px !important;height:28px}
.topbar input[type=date]{padding:3px 6px !important;font-size:12px !important;height:28px}
.topbar #f-search{padding:4px 8px !important;font-size:12px !important;max-width:190px;height:28px}
.topbar .btn{padding:4px 10px !important;font-size:12px !important}
.f-group{gap:3px !important}
.msel .chip{padding:3px 9px !important;font-size:12px !important}

/* --- КОМПАКТ-3: фото крупнее + строки ещё уже --- */
#mon-table.imgsz-s .bt-sku img{width:32px;height:42px}
#mon-table.imgsz-m .bt-sku img{width:46px;height:60px}
#mon-table.imgsz-l .bt-sku img{width:70px;height:92px}
#mon-table .bt-cell, #mon-table .bt-metric{padding:0 6px !important;line-height:1.0 !important;font-size:11.5px !important}
#mon-table td{height:auto}
#mon-table .bt-sku .t{font-size:10.5px;line-height:1.1;-webkit-line-clamp:2;max-height:2.1em}
#mon-table .bt-sku .muted{font-size:9.5px;line-height:1.0}
#mon-table .bt-group td{padding:2px 6px !important;font-size:11.5px !important}

/* --- КОМПАКТ-4: узкий левый столбец + drill-панель влево к «Параметр», ярче и меньше --- */
#mon-table .bt-sku{min-width:140px !important;max-width:140px !important;width:140px !important}
#mon-table .bt-metric{left:140px !important;min-width:130px !important}
#mon-head th:nth-child(1){min-width:140px;max-width:140px}
.matrix-drill{left:150px;right:auto;top:3px;background:var(--accent);border-color:var(--accent);
  padding:1px 3px;border-radius:7px;gap:1px;box-shadow:0 2px 8px rgba(101,88,245,.35)}
.matrix-drill .chip{padding:1px 6px;font-size:12px;background:transparent;color:#fff;border:none;font-weight:700}
.matrix-drill .chip:hover{background:rgba(255,255,255,.22)}

/* --- КОМПАКТ-5: горизонтальная ячейка (низкая), фикс переполнений, drill лавандовый --- */
.sku-cell{display:flex;gap:5px;align-items:flex-start}
.sku-txt{min-width:0;flex:1;display:flex;flex-direction:column;line-height:1.08;gap:0}
.sku-txt .n{font-size:11px}
.sku-txt .t{font-size:10px;line-height:1.08;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sku-txt .muted{font-size:9px;line-height:1.05;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
#mon-table .bt-sku img{float:none !important;margin:0 !important}
/* сайдбар: инпуты/селекты не вылезают за форму */
.side-block input:not([type=checkbox]), .side-block select{width:100% !important;box-sizing:border-box;max-width:100%}
.side-block label input[type=checkbox]{width:15px !important;height:15px;flex:0 0 auto;margin:0}
/* drill-панель: правее, ЛАВАНДОВАЯ ОБВОДКА (не залито) */
.matrix-drill{left:180px !important;right:auto !important;background:var(--panel) !important;
  border:1.5px solid #b7abf7 !important;box-shadow:0 2px 8px rgba(101,88,245,.18) !important;padding:1px 2px !important}
.matrix-drill .chip{background:transparent !important;color:var(--accent) !important;border:none !important;font-weight:700 !important;padding:1px 5px !important}
.matrix-drill .chip:hover{background:#efecff !important}

/* --- KOMPAKT-6: drill uzhe i pravee; svodka naverh-vpravo (2 stroki vmesto 3) --- */
.matrix-drill{left:255px !important;right:auto !important;gap:0 !important;padding:1px !important}
.matrix-drill .chip{padding:1px 4px !important}
#mon-info{margin-left:auto !important;white-space:nowrap;font-size:12px;align-self:center}
#btn-imgsz svg{color:var(--accent)}

/* --- KOMPAKT-7: drill pravee i nizhe (centrirovannee) --- */
.matrix-drill{left:300px !important;top:8px !important}

/* --- KOMPAKT-8: uzhe stolbec "Parametr" (bez lishnego mesta) --- */
#mon-table .bt-metric{min-width:92px !important;width:auto}
#mon-head th:nth-child(2){min-width:92px !important;width:auto}

/* --- KOMPAKT-9: tablica po soderzhimomu (kolonki p:rizhaty k tekstu, bez lishnego mesta) --- */
#mon-table{width:auto !important}
#mon-table .bt-metric{min-width:0 !important;padding:0 6px !important}
#mon-head th:nth-child(2){min-width:0 !important}

/* --- KOMPAKT-10: tablica 100% (zapolnyaet), levye stolbcy uzkie fiks, znacheniya zabirayut ostatok --- */
#mon-table{width:100% !important}
#mon-table .bt-metric{width:112px !important;min-width:112px !important;max-width:112px !important;padding:0 3px 0 6px !important;white-space:nowrap}
#mon-head th:nth-child(2){width:112px !important;min-width:112px !important;max-width:112px !important}
#mon-table .bt-cell{text-align:right;padding:0 6px !important}
#mon-table .bt-total{text-align:right}

/* --- KOMPAKT-11: uzhe stolbec Napravlenie (kak bylo), sticky-offset Parametra pod nego --- */
#mon-table .bt-sku{width:112px !important;min-width:112px !important;max-width:112px !important}
#mon-table .bt-metric{left:112px !important}
#mon-head th:nth-child(1){width:112px !important;min-width:112px !important;max-width:112px !important}

/* --- KOMPAKT-12: szhat stolbcy (hug), Napravlenie uzkoe (ogranich. soderzhimoe), skrol tolko esli ne vlezaet --- */
#mon-table{width:auto !important}
#mon-table .bt-sku{width:110px !important;min-width:110px !important;max-width:110px !important}
#mon-table .bt-sku .sku-cell{width:102px;max-width:102px;overflow:hidden}
#mon-table .bt-sku .sku-txt{min-width:0;max-width:100%;overflow:hidden}
#mon-table .bt-sku .t{white-space:nowrap !important;overflow:hidden;text-overflow:ellipsis;display:block !important;-webkit-line-clamp:unset !important;max-width:100%}
#mon-table .bt-sku .muted{max-width:100%;overflow:hidden;text-overflow:ellipsis}
#mon-table .bt-metric{left:110px !important;min-width:0 !important;width:auto !important;max-width:none !important}
#mon-head th:nth-child(1){width:110px !important;min-width:110px !important;max-width:110px !important}
#mon-head th:nth-child(2){width:auto !important;min-width:0 !important;max-width:none !important}

/* --- KOMPAKT-13: table-layout:fixed -> colonki ne rastyagivayutsya ot colspan-badgey, vse vlezaet bez skrola --- */
#mon-table{table-layout:fixed !important;width:100% !important}
#mon-head th:nth-child(1){width:108px !important}
#mon-head th:nth-child(2){width:104px !important}
#mon-table .bt-group td{overflow:hidden}
#mon-table .bt-group td:first-child{overflow:visible;white-space:nowrap}
#mon-table td{overflow:hidden}

/* ==== LEFT-COLS v8 (chisto, BEZ sticky-zamorozki -> kolonki v svoyom poryadke) ==== */
#mon-table{table-layout:fixed !important;width:100% !important}
#mon-table td, #mon-table th{overflow:hidden !important;text-overflow:ellipsis}
/* NE zamorazhivaem levye kolonki po gorizontali (iz-za etogo vse ezdilo). Zagolovok lipnet tolko sverhu */
#mon-table .bt-sku,#mon-table .bt-metric{position:static !important;left:auto !important}
#mon-head th:nth-child(1),#mon-head th:nth-child(2){position:sticky !important;top:0 !important;left:auto !important}
/* shirina fiks */
#mon-head th:nth-child(1),#mon-table .bt-sku{width:230px !important;min-width:230px !important;max-width:230px !important}
#mon-head th:nth-child(2),#mon-table .bt-metric{width:130px !important;min-width:130px !important;max-width:130px !important}
#mon-head th.tot{width:100px !important}
#mon-head th.sp,#mon-table td.sp{width:0 !important;padding:0 !important;border:none !important}
/* odinakovyy fon, bez granic mezhdu 1 i 2 */
#mon-table .bt-sku,#mon-table .bt-metric,#mon-head th:nth-child(1),#mon-head th:nth-child(2){
  background:var(--panel) !important;border-right:none !important;box-shadow:none !important}
/* yacheyka Napravlenie: foto float left, tekst zapolnyaet kolonku */
#mon-table .bt-sku{padding:3px 5px !important;vertical-align:top;text-align:left !important}
#mon-table .bt-sku img{float:left !important;margin:1px 6px 1px 0 !important;object-fit:cover;border-radius:4px}
#mon-table.imgsz-s .bt-sku img{width:26px !important;height:34px !important}
#mon-table.imgsz-m .bt-sku img{width:38px !important;height:50px !important}
#mon-table.imgsz-l .bt-sku img{width:56px !important;height:74px !important}
#mon-table .bt-sku .n{color:var(--accent2);font-weight:600;font-size:11px}
#mon-table .bt-sku .t{display:block !important;font-size:10.5px;line-height:1.15;white-space:normal !important;overflow:hidden;word-break:break-word}
#mon-table .bt-sku .muted{display:block !important;font-size:9.5px;line-height:1.15;white-space:normal;overflow:hidden}
#mon-table .bt-metric{padding:0 4px 0 6px !important}
#mon-table .bt-cell,#mon-table .bt-total{text-align:right !important;padding:0 8px !important}
#mon-head th{text-align:right}
#mon-head th:nth-child(1),#mon-head th:nth-child(2){text-align:left}
#mon-table .bt-grouprow{white-space:nowrap;overflow:hidden}
.mainarea .table-wrap{padding-top:0 !important}
.matrix-drill{top:6px !important;right:auto !important;left:300px !important;padding:0 1px !important;gap:0 !important}
.matrix-drill .chip{padding:0 3px !important;font-size:11px !important}

/* ==== ROW-HEIGHT: chut vyshe stroki (tekst ne podrezaetsya sverhu/snizu) ==== */
#mon-table .bt-cell,#mon-table .bt-total,#mon-table .bt-metric{padding-top:2px !important;padding-bottom:2px !important;line-height:1.3 !important}

/* бейдж маркетплейса в базовой таблице (Ozon-мерж GAB984) */
.mp-badge{font-size:9px;font-weight:700;padding:1px 4px;border-radius:4px;vertical-align:middle}
.mp-wb{background:#efeaff;color:#6558f5}
.mp-ozon{background:#e6f0ff;color:#0a5bd3}


/* --- ЯЧЕЙКА «НАПРАВЛЕНИЕ» v9: flex (фото слева, текст колонкой с зазорами) — строки не налезают --- */
#mon-table .bt-sku{padding:4px 7px !important;vertical-align:top;text-align:left !important}
#mon-table .bt-sku .skc{display:flex;gap:7px;align-items:flex-start}
#mon-table .bt-sku .skc-img{flex:0 0 auto;float:none !important;margin:0 !important;object-fit:cover;border-radius:4px}
#mon-table .bt-sku .skc-txt{min-width:0;flex:1 1 auto;display:flex;flex-direction:column;gap:3px}
#mon-table .bt-sku .skc-head{display:flex;align-items:center;gap:4px;flex-wrap:wrap;line-height:1.1}
#mon-table .bt-sku .skc-txt .t{display:block !important;font-size:10.5px;line-height:1.3;white-space:normal !important;word-break:break-word;max-height:none !important;overflow:visible !important;margin:0 !important;-webkit-line-clamp:unset !important}
#mon-table .bt-sku .skc-txt .muted{display:block !important;font-size:9.5px;line-height:1.25;white-space:normal !important;overflow:visible !important;max-width:100%;margin:0 !important}
#mon-table .bt-sku .skc-txt .editing-badge{align-self:flex-start;margin:0 !important}


/* --- ГРУППА (иерархия) как матрица показатель×день, а не только бейджи --- */
#mon-table tr.bt-grp .bt-ghead{background:#f1eeff !important;font-weight:600;cursor:pointer;vertical-align:top}
#mon-table tr.bt-grp .bt-ghead .gh{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
#mon-table tr.bt-grp .bt-ghead .gname{font-size:12px;color:var(--accent2);font-weight:700}
#mon-table tr.bt-grp .bt-ghead .arr{display:inline-flex;align-items:center;justify-content:center;width:10px;height:10px;border-radius:50%;border:1px solid var(--accent);color:var(--accent);font-size:8.5px;font-weight:700;line-height:1;flex:0 0 auto}
#mon-table tr.bt-grp .bt-ghead .gbadges{margin-top:3px;display:flex;gap:3px;flex-wrap:wrap}
/* отступы иерархии больше не нужны: имя группы теперь в своём столбце-уровне */
#mon-table tr.bt-grp .bt-ghead.lvl2{padding-left:8px !important}
#mon-table tr.bt-grp .bt-ghead.lvl3{padding-left:8px !important}
#mon-table tr.bt-grp .bt-cell,#mon-table tr.bt-grp .bt-metric,#mon-table tr.bt-grp .bt-total{background:var(--panel) !important}
#mon-table tr.bt-grp .bt-metric{font-weight:500}
#mon-table tr.bt-grp .bt-total{font-weight:700}


/* --- порядок уровней иерархии: номерок у отмеченного (как поле в PBI) --- */
.side-block label .hord{margin-left:auto;min-width:17px;height:17px;line-height:17px;text-align:center;
  font-size:10px;font-weight:700;color:#fff;background:var(--accent);border-radius:50%;flex:0 0 auto}

/* ===== вендор GA2AA4: воронки/вкладки/мультивыбор/мобилка ===== */

/* Воронки конкурентов (матрица) */
.fn-matrix{border-collapse:separate;border-spacing:3px}
.fn-matrix th{font-size:11px;color:var(--muted);white-space:nowrap;padding:2px 4px}
.fn-matrix th.fn-card,.fn-matrix td.fn-card{position:sticky;left:0;background:var(--panel);z-index:2;min-width:120px;max-width:130px;text-align:left;font-size:12px;border-right:1px solid var(--line)}
.fn-cell{width:118px;height:auto;vertical-align:top;border-radius:6px;padding:2px}
.fn-cell.fn-empty{background:repeating-linear-gradient(45deg,#f4f4f7,#f4f4f7 6px,#ececf2 6px,#ececf2 12px);min-height:40px}
.fn-thumb{width:114px;height:150px;object-fit:cover;border-radius:5px;cursor:zoom-in;display:block;border:1px solid var(--line)}
.fn-mean{width:114px;margin-top:2px;font-size:10.5px;padding:1px}
tr.fn-ours .fn-card{background:#eef0ff}
tr.fn-ours .fn-thumb{border:2px solid var(--accent2,#6558f5)}
.fn-badge-our{background:#6558f5;color:#fff;font-size:10px;font-weight:700;padding:1px 6px;border-radius:5px}
.fn-chip{padding:1px 7px;border-radius:5px;font-size:12px;color:#141a2a}
.fn-lightbox{position:fixed;inset:0;background:rgba(10,12,20,.85);display:flex;align-items:center;justify-content:center;z-index:9999;cursor:zoom-out}
.fn-lightbox img{max-width:88vw;max-height:88vh;border-radius:8px;box-shadow:0 8px 40px rgba(0,0,0,.5)}

/* Группы вкладок карточки */
.tab-groups{display:flex;gap:6px;flex-wrap:wrap;margin:6px 0 2px}
.tgroup{background:var(--panel2,#eef1f7);border:1px solid var(--line);border-radius:8px;padding:6px 12px;font-size:13px;font-weight:600;cursor:pointer;color:var(--text)}
.tgroup:hover{background:#e2e8f4}
.tgroup.active{background:var(--accent2,#6558f5);color:#fff;border-color:var(--accent2,#6558f5)}
.fltag{font-size:12px;display:inline-flex;align-items:center;gap:4px;background:var(--panel2,#eef1f7);border-radius:6px;padding:2px 7px;cursor:pointer}

/* ссылка на маркетплейс рядом с артикулом */
.mp-open{margin-left:4px;text-decoration:none;color:var(--accent2,#6558f5);font-weight:700;font-size:12px}
.mp-open:hover{color:#3b2fd0}

/* Мультивыбор фильтров (#11) */
.msel{position:relative;margin-bottom:8px}
.msel-btn{width:100%;text-align:left;background:var(--panel2,#eef1f7);border:1px solid var(--line);border-radius:7px;padding:6px 9px;font-size:12.5px;cursor:pointer;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msel-btn.on{border-color:var(--accent2,#6558f5);background:#eef0ff;font-weight:600}
/* ЕДИНЫЙ вид всех контролов левой панели: селект, мультивыбор, инпут — одинаковые */
.side-block .msel{display:block;width:100%;margin:0}
.side-block select,
.side-block .msel-btn,
.side-block input:not([type=checkbox]){
  width:100%!important;box-sizing:border-box;max-width:100%;
  background:#fff;border:1px solid var(--line);border-radius:8px;color:var(--text);
  font:inherit;font-size:13px;line-height:1.25;padding:8px 10px;margin:0;min-height:36px;
  text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.side-block select{padding-right:26px}
.side-block .msel-btn.on{background:#eef0ff;border-color:var(--accent2)}
.msel-pop{position:absolute;z-index:30;top:calc(100% + 3px);left:0;right:0;background:var(--panel,#fff);border:1px solid var(--line);border-radius:8px;box-shadow:0 6px 24px rgba(30,40,70,.18);padding:6px}
.msel-search{width:100%;border:1px solid var(--line);border-radius:6px;padding:4px 7px;font-size:12px;margin-bottom:5px;outline:none}
.msel-actions{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px}
.msel-list{max-height:230px;overflow-y:auto}
.msel-opt{display:flex;align-items:center;gap:6px;padding:3px 5px;border-radius:5px;font-size:12.5px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.msel-opt:hover{background:var(--panel2,#eef1f7)}
.msel-opt input{accent-color:var(--accent2,#6558f5);flex:none}
/* длинные имена направлений/поднаправлений — переносим, не обрезаем (иначе «не видно» полное имя) */
.msel-pop .msel-opt{white-space:normal;overflow:visible;text-overflow:clip;align-items:flex-start;line-height:1.25}

/* Диагностика РК: бейдж (таблица) + блок (карточка) */
.rk-badge{display:inline-block;font-size:11px;font-weight:700;padding:1px 7px;border-radius:6px;white-space:nowrap;line-height:1.5}
.rk-good{background:#e7f7ef;color:#1a9d63}
.rk-mid{background:#faf4cf;color:#8a7400}
.rk-warn{background:#fff0d0;color:#d98200}
.rk-bad{background:#fdecea;color:#d1443b}
.rk-line{margin:3px 0}
.rk-diag{border:1px solid var(--line);border-left-width:4px;border-radius:10px;padding:10px 13px;margin:0 0 10px}
.rk-diag.rk-good{border-left-color:#1a9d63;background:#f4fbf7}
.rk-diag.rk-mid{border-left-color:#c9a400;background:#fffdf0}
.rk-diag.rk-warn{border-left-color:#ef8f00;background:#fff9ec}
.rk-diag.rk-bad{border-left-color:#d1443b;background:#fef6f5}
.rk-btn{margin-left:8px;vertical-align:middle;background:var(--accent2,#2f6fed)!important;color:#fff!important;border-color:var(--accent2,#2f6fed)!important}
.rk-diag-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.rk-why{font-size:13.5px;color:var(--text)}
.rk-action{margin-top:6px;font-size:13.5px;font-weight:600;color:var(--text)}
.rk-metrics{margin-top:8px;display:flex;flex-wrap:wrap;gap:6px 14px}
.rk-m{font-size:12px;color:var(--muted)}
.rk-m b{color:var(--text);font-size:13px}

/* Шаг 1 (лаконичность): мельче шрифт значений/метрик базовой таблицы */
#mon-table .bt-cell,#mon-table .bt-metric,#mon-table .bt-total{font-size:11px !important;line-height:1.18 !important}

/* Шапка группы компактнее (как PBI): мельче бейджи, плотнее */
#mon-table tr.bt-grp .bt-ghead .gname{font-size:11px}
#mon-table tr.bt-grp .bt-ghead .gbadges{gap:2px;margin-top:2px}
#mon-table tr.bt-grp .bt-ghead .gbadge{font-size:9.5px;padding:0 6px;border-radius:9px;line-height:1.65}
#mon-table tr.bt-grp .bt-ghead .rk-badge{font-size:9.5px;padding:0 5px}

/* ================= Мобильная версия ================= */
.mob-only{display:none}
@media(max-width:760px){
  .mob-only{display:inline-flex}
  header{padding:8px 12px;gap:8px;flex-wrap:wrap}
  .brand{font-size:15px}
  header .btn-ghost{padding:6px 8px;font-size:12px}
  .topbar{padding:8px 10px;gap:6px}
  .topbar input#f-search{flex:1 1 100%;order:5}
  .layout{flex-direction:column}
  .sidebar{display:none;width:100%;min-width:0;max-height:none;border-right:none;border-bottom:1px solid var(--line);padding:10px 12px}
  .sidebar.open{display:block}
  .mainarea{width:100%}
  .mainarea .table-wrap{max-height:none;padding:0 6px 24px}
  /* модалки на весь экран */
  .modal{padding:0;align-items:stretch}
  .modal-box{width:100%!important;max-width:100%!important;border-radius:0;padding:12px;margin-bottom:0}
  .modal-box.narrow{width:100%!important}
  #modal-sku .modal-box{padding:8px}
  #modal-coverage .modal-box,#modal-funnel .modal-box,#modal-compare .modal-box{width:100vw!important;max-width:100vw!important;height:100vh!important;max-height:100vh!important}
  /* вкладки карточки — горизонтальный скролл вместо переносов */
  .tab-groups,#modal-sku .tabs{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
  .tgroup{flex:0 0 auto}
  #modal-sku .tab{flex:0 0 auto;white-space:nowrap}
  /* KPI по 2 в ряд, крупнее */
  .kpi{min-width:calc(50% - 8px);flex:1 1 calc(50% - 8px)}
  .kpi .v{font-size:16px}
  .modal-head h2{font-size:16px}
  /* крупнее тап-таргеты */
  .btn,.chip,.tgroup{min-height:38px}
  table{font-size:12px}
  .thumb{width:34px;height:34px}
  /* мультивыбор на всю ширину */
  .msel-pop{position:fixed;left:8px;right:8px;top:auto}
}

/* ВРЕМЕННО: отключаем липкость левых столбцов базовой таблицы (жёстко зашитые смещения 0/168px
   ломают новую многоколоночную раскладку-матрицу). Липкость вернём отдельным шагом. */
#mon-table .bt-sku,#mon-table .bt-metric,#mon-table .bt-lvl,#mon-table thead th{position:static !important;left:auto !important}

/* Многоколоночная матрица (v1): сброс старых 2-столбцовых фикс-ширин → авто-раскладка по содержимому */
#mon-table{table-layout:auto !important;width:auto !important;min-width:100% !important}
#mon-head th:nth-child(1),#mon-head th:nth-child(2){width:auto !important;min-width:0 !important;max-width:none !important}
#mon-table .bt-lvl,#mon-head th.bt-lvl-h{width:auto !important;min-width:88px !important;max-width:150px !important;text-align:left !important;white-space:nowrap;font-size:11px}
#mon-table .bt-sku{width:auto !important;min-width:150px !important;max-width:220px !important;text-align:left !important}
#mon-table .bt-metric{width:auto !important;min-width:118px !important;max-width:none !important;text-align:left !important}
/* при раскрытии группы её пустые ячейки-уровни тоже лавандовые — сплошная полоса, без белых разрывов */
#mon-table tr.bt-grp .bt-ghead,#mon-table tr.bt-grp .bt-lvl{background:#e8e3fb !important}
/* вернуть липкость ШАПКИ (верх): при вертикальной прокрутке заголовки колонок остаются */
#mon-table thead th{position:sticky !important;top:0 !important;left:auto !important;z-index:3}

/* Компактная верхняя шапка (кнопки и отступы ~в 1.5 раза меньше — меньше места по высоте) */
header{padding:5px 14px !important;gap:8px !important}
header .btn{padding:3px 9px !important;font-size:11.5px !important;border-radius:7px}
header .brand{font-size:15px !important}
header #who,header .dry{font-size:11.5px !important}

/* Единая компактная шапка (PBI-стиль): три полосы сливаются в один блок — убираем воздух и разделители */
header{box-shadow:none !important;border-bottom:none !important}
#freshness.fresh-bar{padding:0 14px !important;font-size:10.5px !important;line-height:17px;border-bottom:none !important;background:var(--panel) !important}
.topbar{padding:4px 14px !important;gap:5px !important;border-bottom:1px solid var(--line) !important;background:var(--panel)}
/* дрилл-кнопки компактнее (без слова «всё») */
.topbar .drillbar .chip{padding:2px 6px !important;font-size:11px !important}
#chip-worklist{max-width:none}
/* баннер валовой прибыли вверху карточки — хантер сразу видит свой результат */
.gp-banner{background:#e7f7ef;border:1px solid #bfe6d0;border-radius:10px;padding:8px 13px;margin:0 0 8px;font-size:14.5px;color:var(--text)}
.gp-banner b{color:#12804f;font-size:17px}
/* топбар в один ряд, ВСЕ кнопки по правому краю; серую статистику — отдельной тонкой строкой под кнопками */
.topbar{gap:2px 4px !important;justify-content:flex-end !important;padding-bottom:2px !important}
.topbar select{padding:3px 6px !important;font-size:11.5px !important}
.topbar .chip{padding:2px 8px !important;font-size:11.5px !important}
.topbar #f-search{flex:0 0 auto !important;width:170px;min-width:120px;max-width:180px !important;padding:3px 8px !important;font-size:11.5px !important}
#mon-info{flex-basis:100% !important;width:100%;order:100;font-size:10.5px !important;color:var(--muted);padding:0 !important;margin:-2px 0 0 !important;line-height:1.1;text-align:right}

/* Task A: «Свежесть данных» — компактно справа в шапке (не отдельная полоса) */
header #freshness{font-size:10.5px;color:var(--muted);white-space:nowrap;border:none;background:none;padding:0;line-height:1.1;cursor:default}

/* Task B: слайсер «Период» (PBI) — кнопка + попап у неё; даты/год/месяц идут колонкой */
.perwrap{position:relative;display:inline-block}
.period-pop{background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 26px rgba(30,40,70,.16);padding:10px 12px;display:flex;flex-direction:column;gap:8px;min-width:300px}
.period-pop.hidden{display:none}
.period-pop .f-group{flex-wrap:wrap}

/* «Зоны РК»: раскрытие вида РК → его кампании (вход в каждый вид) */
.zrow{cursor:pointer}
.zrow:hover{background:var(--panel2)}
.zcaret{display:inline-block;width:12px;color:var(--muted);font-size:11px}
.zdrill>td{background:var(--panel2);padding:6px 10px 10px 22px;border-left:2px solid var(--accent)}
.zdrill .camp-card{margin:8px 0}

/* «Войти в РК»: детализация кампании (Динамика/Зоны/Фразы) — лаконичный вид (мерж GA9840) */
.cdet-box{margin:6px 0 4px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel2)}
.cd-tabs{display:flex;gap:4px;margin-bottom:6px;flex-wrap:wrap}
.cd-tab{font-size:12px;padding:3px 10px;border:1px solid var(--line);border-radius:6px;background:var(--panel);cursor:pointer}
.cd-tab.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.cd-kpi{display:flex;flex-wrap:wrap;gap:10px;font-size:12px;margin-bottom:6px}
.cd-body{overflow:auto}
.cd-t{font-size:12px;width:100%;border-collapse:collapse}
.cd-t th,.cd-t td{padding:2px 6px;text-align:right;white-space:nowrap}
.cd-t th{color:var(--muted);font-weight:600}
.cd-t .ta-l{text-align:left}
.cd-t tbody tr:hover{background:var(--panel)}

/* Раздел Ozon (дашборд) — лаконичный вид (мерж GA9840) */
.oz-tabs{display:flex;gap:4px;margin-bottom:8px}
.oz-kpis{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:8px}
.oz-kpi{border:1px solid var(--line);border-radius:8px;padding:5px 10px;min-width:96px;background:var(--panel2)}
.oz-kpi .l{font-size:11px;color:var(--muted)}
.oz-kpi .v{font-size:15px;font-weight:700}
.oz-dynbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:8px}
.oz-dyn{font-size:11px;border:1px solid var(--line);border-radius:6px;padding:2px 6px;text-align:center}
.oz-dyn-m{display:block;color:var(--muted)}
.oz-body{overflow:auto;max-height:52vh}
.oz-t th{position:sticky;top:0;background:var(--panel);z-index:1}

/* Баннер прибыли в шапке (my-profit) + замеры товара (мерж GA9840) */
.my-profit{display:inline-flex;gap:6px;align-items:center}
.mp-metric{font-size:12.5px;font-weight:700;padding:2px 8px;border-radius:7px;white-space:nowrap}
.mp-ord{background:#e7f7ef;color:#12804f}
.mp-gross{background:#eef3ff;color:#2a4b9b}
.meas-grid{display:flex;flex-wrap:wrap;gap:10px}
.meas-card{border:1px solid var(--line);border-radius:8px;padding:6px;width:180px;background:var(--panel2)}
.meas-img{width:100%;height:140px;object-fit:cover;border-radius:6px;cursor:pointer}
.meas-noimg{height:140px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--line);border-radius:6px}
.meas-meta{font-size:12px;margin-top:4px;display:flex;flex-direction:column;gap:3px}
/* бейджи капитализации/неликвида по направлению (мерж GA9840) */
.gbadge.b-cap{background:#eef1f8;color:#3a4a75}
.gbadge.b-illiq{background:#fdeeea;color:#9a4a2a}

/* Богатая детализация РК «Войти в РК» — вкладки/подвкладки/панель столбцов/таблицы (вендор GA9840) */
.oz-table{width:100%;border-collapse:collapse;font-size:13px}
.oz-table th,.oz-table td{padding:6px 8px;border-bottom:1px solid var(--line);text-align:right}
.oz-table th:nth-child(1),.oz-table td:nth-child(1),.oz-table th:nth-child(2),.oz-table td:nth-child(2){text-align:left}
.oz-table thead th{cursor:pointer;position:sticky;top:0;background:var(--card,#fff);white-space:nowrap}
.oz-table tbody tr:hover{background:rgba(245,166,35,.06)}
.cd-tab{background:none;border:none;padding:6px 12px;cursor:pointer;font-size:13px;color:var(--muted,#888);border-bottom:2px solid transparent}
.cd-tab.active{color:var(--accent2,#6558f5);border-bottom-color:var(--accent2,#6558f5);font-weight:600}
.cdet-box tr.waste{background:rgba(224,49,49,.07)}
.cdg-tabs{display:flex;gap:6px;margin:6px 0;flex-wrap:wrap}
.cdg-tab{background:var(--panel2,#eef1f7);border:1px solid var(--line);border-radius:16px;padding:4px 12px;cursor:pointer;font-size:12.5px;color:var(--muted,#666)}
.cdg-tab.active{background:var(--accent2,#6558f5);color:#fff;border-color:var(--accent2,#6558f5)}
.cdg-n{display:inline-block;min-width:18px;text-align:center;background:rgba(0,0,0,.08);border-radius:9px;padding:0 5px;font-size:11px;margin-left:3px}
.cdg-tab.active .cdg-n{background:rgba(255,255,255,.25)}
.cdphr-wrap{display:flex;gap:10px;align-items:flex-start}
.cdphr-main{flex:1;min-width:0}
.cdphr-side{width:210px;flex:0 0 210px}
/* таблица фраз в «Войти в РК»: ограничить высоту + вертикальный скролл (тонкая КРАСНАЯ рамка), шапка липкая */
.cdphr-box{overflow:auto;max-height:62vh;border:1px solid #e03131;border-radius:8px}
/* Закрепляем слева первые две колонки — чекбокс (1) и «Кластеры (фраза)» (2), чтобы при
   горизонтальной прокрутке было видно, к какой фразе относятся цифры. Только ВНЕШНЯЯ таблица:
   вложенную таблицу «по дням» (строки .cdphd-*) не трогаем — потому селекторы через прямых потомков. */
.cdphr-box > table > thead > tr > th{z-index:4}
.cdphr-box > table > thead > tr > th:nth-child(1),
.cdphr-box > table > tbody > tr:not([class*="cdphd-"]) > td:nth-child(1){
  position:sticky;left:0;width:50px;min-width:50px;max-width:50px;background:var(--panel);z-index:2}
.cdphr-box > table > thead > tr > th:nth-child(2),
.cdphr-box > table > tbody > tr:not([class*="cdphd-"]) > td:nth-child(2){
  position:sticky;left:50px;background:var(--panel);z-index:2;box-shadow:2px 0 5px -2px rgba(0,0,0,.2);
  width:220px;min-width:220px;max-width:220px;white-space:normal;overflow-wrap:anywhere;word-break:break-word;
  padding-right:12px;vertical-align:top}
.cdphr-box > table > thead > tr > th:nth-child(1),
.cdphr-box > table > thead > tr > th:nth-child(2){z-index:6}
/* waste-строки: закреплённые ячейки в том же оттенке, чтобы слева не было белых заплаток */
.cdphr-box > table > tbody > tr.waste:not([class*="cdphd-"]) > td:nth-child(1),
.cdphr-box > table > tbody > tr.waste:not([class*="cdphd-"]) > td:nth-child(2){background:#fbeeee}
.colpanel{border:1px solid var(--line);border-radius:8px;background:var(--card,#fff);position:sticky;top:0;max-height:70vh;overflow:auto}
.colpanel-h{padding:6px 8px;border-bottom:1px solid var(--line);font-weight:600;font-size:12px;background:var(--panel2,#eef1f7)}
.colpanel-list{padding:4px 6px}
.colrow{display:flex;justify-content:space-between;align-items:center;gap:6px;padding:2px 2px;font-size:12px;border-bottom:1px dashed var(--line)}
.colrow label{display:flex;align-items:center;gap:5px;cursor:pointer;flex:1;min-width:0}
.colmv button{border:none;background:none;cursor:pointer;color:var(--muted,#888);font-size:11px;padding:0 2px}
.colmv button:hover{color:var(--accent2,#6558f5)}
@media(max-width:760px){.cdphr-wrap{flex-direction:column}.cdphr-side{width:100%;flex:none}}

/* «Доступы» — модалка назначения/заявок */
.acc-sec{margin:0 0 20px}
.acc-sec h3{margin:0 0 8px;font-size:14px}
.sm{font-size:12px}

/* «?» с расшифровкой (напр. критерии «Требуют внимания») */
.qhelp{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;
  background:var(--panel2);border:1px solid var(--line);color:var(--muted);font-size:11px;line-height:1;
  cursor:help;margin-left:4px;vertical-align:middle;user-select:none}
.qhelp:hover{color:var(--accent2);border-color:var(--accent2)}
/* попап настройки критериев «Требуют внимания» (⚙) */
.wlc-gear{padding:4px 9px}
.wlc-title{font-weight:600;font-size:13px;margin-bottom:3px}
.wlc-hint{margin-bottom:8px}
.wlc-row{display:flex;align-items:center;gap:6px;font-size:13px;padding:4px 0;flex-wrap:wrap;cursor:pointer}
.wlc-num{width:58px;padding:3px 6px;font-size:13px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--text)}
.wlc-foot{margin-top:8px;text-align:right}
/* плашка «почему в Требуют внимания» на карточке товара */
.wl-reason{font-size:11px;color:#9a3d00;background:#fff1e6;border:1px solid #ffd9bf;border-radius:6px;
  padding:1px 6px;margin:2px 0;display:inline-block;line-height:1.35;font-weight:600}

/* Инструкция (модалка) */
.guide{font-size:13.5px;line-height:1.6;color:var(--text)}
.guide h3{font-size:15px;margin:18px 0 6px;color:var(--accent2)}
.guide ul{margin:4px 0;padding-left:20px}
.guide li{margin:3px 0}
.g-lead{background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:0 0 6px}
.g-map{width:100%;border-collapse:collapse;font-size:13px;margin:4px 0}
.g-map th,.g-map td{border:1px solid var(--line);padding:6px 9px;text-align:left;vertical-align:top}
.g-map th{background:var(--panel2);font-weight:600}
.g-map td:first-child{white-space:nowrap;color:var(--muted)}
.g-foot{margin-top:16px}
.guide code{background:var(--panel2);border:1px solid var(--line);border-radius:4px;padding:0 4px;font-size:12px}
/* ссылка «❔ методика» в блоке диагноза РК */
.rk-methodhelp{margin-left:8px;font-size:11px;color:var(--muted);cursor:help;white-space:nowrap;border-bottom:1px dotted currentColor}
.rk-methodhelp:hover{color:var(--accent2)}
/* метка «статус актуален на …» над кампаниями */
.camp-asof{font-size:12px;color:var(--muted)}
.camp-asof b{color:var(--text)}
/* кнопка «Подтянуть» в состоянии «идёт обновление» */
.btn-busy{opacity:.75;cursor:progress}
/* отчёт по штрафам за габариты (вкладка «Замеры») */
.pen-table{border-collapse:collapse;width:100%;font-size:12.5px;margin-bottom:6px}
.pen-table th,.pen-table td{border:1px solid var(--line);padding:5px 8px;text-align:center;white-space:nowrap}
.pen-table th{background:var(--panel2);font-weight:600}
.pen-table td.ta-l{text-align:left}
.pen-photo{height:46px;border-radius:5px;border:1px solid var(--line);cursor:pointer;object-fit:cover;vertical-align:middle}
/* блок остатков в окне смены цены */
.pw-stock{background:var(--panel2);border:1px solid var(--line);border-radius:8px;padding:8px 12px;margin-bottom:12px}
.pw-stock-head{font-size:13px;font-weight:600}
.pw-stock-wh{font-size:12px;color:var(--muted);margin-top:4px;line-height:1.7}
.pw-wh{white-space:nowrap}
.pw-spp{margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
.pw-spp-head{font-weight:600;font-size:13px}
.pw-spp-ref{font-size:12.5px;margin:6px 0;line-height:1.9}
.pw-spp-ref input{width:78px}
.spp-now{font-size:13px;margin:6px 0;padding:6px 10px;background:var(--panel2);border-radius:6px}
.spp-tbl{font-size:12.5px;border-collapse:collapse;margin-top:4px}
.spp-tbl th,.spp-tbl td{padding:3px 12px;border-bottom:1px solid var(--line);text-align:right}
.spp-tbl th:first-child,.spp-tbl td:first-child{text-align:left}
/* архив завершённых кампаний (свёрнут) */
.camp-arch{margin-top:12px;border-top:1px dashed var(--line);padding-top:6px}
.camp-arch-head{cursor:pointer;user-select:none;color:var(--muted);font-size:13px;font-weight:600;padding:4px 2px}
.camp-arch-head:hover{color:var(--accent2)}
.camp-arch-arr{display:inline-block;transition:transform .15s}
.camp-arch-body{display:none;margin-top:6px}
.camp-arch.open .camp-arch-body{display:block}
.camp-arch.open .camp-arch-arr{transform:rotate(180deg)}
