/* OLYMPOS CRM admin — светлая панель в стиле OLYMPOS/ecommerce (Apple: white + #f5f5f7, hairlines, Action Blue) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --bg: #f5f5f7; --card: #ffffff; --ink: #1d1d1f; --muted: #6e6e73; --muted-2: #86868b;
  --line: rgba(0, 0, 0, 0.08); --line-2: rgba(0, 0, 0, 0.15);
  --accent: #0066cc; --accent-focus: #0071e3; --accent-soft: rgba(0, 102, 204, 0.08);
  --ok: #1b7440; --ok-soft: rgba(48, 163, 90, 0.12);
  --danger: #d70015; --danger-soft: rgba(215, 0, 21, 0.08);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5;
  letter-spacing: -0.014em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--accent); color: #fff; }
b, strong { font-weight: 600; }
.mono { font-family: var(--mono); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
input, select, textarea {
  font: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--line-2);
  border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-focus); outline-offset: -1px; }
textarea { min-height: 90px; resize: vertical; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); scale: 1.15; }
input[type="color"] { padding: 2px; height: 38px; width: 54px; }

.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100svh; }
.side { background: #161617; color: #f5f5f7; display: flex; flex-direction: column; position: sticky; top: 0; height: 100svh; }
.side-logo { padding: 18px 16px; font-weight: 700; letter-spacing: .03em; display: flex; align-items: center; gap: 9px; font-size: 15px; }
.side-logo-mark { background: var(--accent); color: #fff; border-radius: 8px; padding: 3px 7px; font-size: 13px; font-family: var(--mono); }
.side-logo-sub { font-size: 10px; color: #98989d; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }
.side-nav { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; overscroll-behavior: contain; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-track { background: transparent; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 100px; }
.side-nav::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); }
.side-group { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #86868b; padding: 14px 10px 5px; }
.side-nav button {
  text-align: left; padding: 9px 12px; border-radius: 10px; color: #a1a1a6; font-size: 14px;
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
}
.side-nav button:hover { background: rgba(255, 255, 255, 0.07); color: #f5f5f7; }
.side-nav button.on { background: var(--accent-focus); color: #fff; font-weight: 500; }
.badge { background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side-nav button.on .badge { background: #fff; color: var(--accent); }
.side-store { padding: 14px 16px; border-top: 1px solid rgba(255, 255, 255, 0.10); color: #a1a1a6; font-size: 13.5px; }
.side-store:hover { color: #fff; }

.main { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 26px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16.5px; font-weight: 600; letter-spacing: -0.022em; }
.topbar-right { display: flex; gap: 14px; align-items: center; }
.hint { font-size: 12.5px; color: var(--muted); }
.content { padding: 24px 28px 60px; display: grid; gap: 18px; max-width: 1760px; margin-inline: auto; width: 100%; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.card-title { font-weight: 600; font-size: 14.5px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.chkrow { display: flex; gap: 9px; align-items: center; padding-block: 6px; font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 9999px; font-weight: 400; font-size: 13.5px; letter-spacing: -0.01em;
  border: 1.5px solid transparent; transition: background .2s, color .2s, border-color .2s, transform .15s var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-focus); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: #fff; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.savebar { display: flex; gap: 10px; align-items: center; }
.savebar .saved { color: var(--ok); font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat b { font-size: 22px; display: block; font-weight: 600; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.hot { border-color: var(--accent); background: var(--accent-soft); }

table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; }
table.list td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.tag { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; display: inline-block; }
.tag-new { background: var(--accent-soft); color: var(--accent); }
.tag-work { background: rgba(255, 149, 0, 0.14); color: #9a5b00; }
.tag-done { background: var(--ok-soft); color: var(--ok); }
.tag-cancel { background: var(--danger-soft); color: var(--danger); }
.tag-order { background: #EDF2FE; color: #3452C8; }
.tag-quick { background: #F3EDFE; color: #7A3EC8; }
.tag-callback { background: #E7F6F4; color: #0E7D6F; }
.tag-subscribe { background: #F0F0F0; color: #555; }
td .mini-select { width: auto; padding: 5px 9px; font-size: 13px; border-radius: 7px; }

.item-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: #fafafc; }
.item-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 600; }
.item-list { display: grid; gap: 10px; }
.addbtn { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 12px; color: var(--muted); font-weight: 600; width: 100%; }
.addbtn:hover { border-color: var(--accent); color: var(--accent); }

.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.swatch { border: 2px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 7px; cursor: pointer; background: #fff; }
.swatch.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.swatch-colors { display: flex; gap: 4px; }
.swatch-colors i { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); }
.swatch b { font-size: 12.5px; font-weight: 600; }

.photo-row { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-chip { position: relative; width: 74px; height: 74px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-chip img { width: 100%; height: 100%; object-fit: cover; }
.photo-chip button { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; width: 20px; height: 20px; font-size: 12px; line-height: 1; }
.upload-btn { width: 74px; height: 74px; border: 1.5px dashed var(--line-2); border-radius: 10px; color: var(--muted); font-size: 24px; }
.upload-btn:hover { border-color: var(--accent); color: var(--accent); }

.plist-head { display: flex; gap: 10px; margin-bottom: 14px; }
.plist-head input { max-width: 320px; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.editor { border-top: 3px solid var(--accent); }

/* ── Карта географии, онлайн, активность, медиа отзывов ── */
.dash-geo { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: stretch; }
.dash-geo-side { display: grid; gap: 18px; align-content: start; }
.abroad-num { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0 12px; }
.abroad-num .small { font-weight: 400; letter-spacing: 0; }
#geomap { height: 340px; }
#geomap svg { width: 100%; height: 100%; }
.jvm-tooltip { background: var(--ink); font-family: var(--font); font-size: 12.5px; border-radius: 8px; padding: 5px 10px; }
.geo-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.geo-chip {
  display: inline-flex; gap: 7px; align-items: baseline; font-size: 12.5px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 4px 11px;
}
.geo-chip b { color: var(--ink); }
.online { display: inline-flex; gap: 7px; align-items: center; margin-left: 14px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.online i { width: 8px; height: 8px; border-radius: 99px; background: var(--ok); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.act-row { display: flex; gap: 10px; align-items: flex-start; padding-block: 8px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.act-row:last-child { border-bottom: 0; }
.act-dot { width: 9px; height: 9px; border-radius: 99px; margin-top: 5px; flex: none; background: #d2d2d7; }
.act-dot.act-order, .act-dot.act-quick { background: var(--accent); }
.act-dot.act-callback { background: #0E7D6F; }
.act-dot.act-new { background: #ff9500; }
.act-dot.act-done { background: var(--ok); }
.rev-media { display: flex; gap: 6px; margin-top: 7px; }
.rev-m { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); }
span.rev-m-video { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 7px; background: #1d1d1f; color: #fff; font-size: 12px; }

/* ── Дашборд с аналитикой ── */
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { padding: 7px 14px; font-size: 13px; color: var(--muted); font-weight: 500; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }
.card-title .seg { font-weight: 400; }
.kpi-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.kpi-grid.kpi-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ret-red { color: var(--danger); }
.ret-media { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ret-ph { width: 46px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.ret-media a:hover .ret-ph { border-color: var(--accent); }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.kpi-l { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-v { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-block: 3px 5px; white-space: nowrap; }
.kpi-f { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpi-h { font-size: 11.5px; color: var(--muted); }
.dlt { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.dlt-up { background: var(--ok-soft); color: var(--ok); }
.dlt-down { background: var(--danger-soft); color: var(--danger); }
.dlt-flat { background: #f0f0f2; color: var(--muted); }
.dash-cols { align-items: stretch; }
.chart-wrap { position: relative; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-axis { font-size: 11px; fill: var(--muted); }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.ch-dot { fill: var(--accent); opacity: 0; }
.ch-hit { fill: transparent; }
.ch-hit:hover ~ .ch-dot { opacity: 0; }
.ch-hit:hover { fill: rgba(0, 102, 204, .06); }
.ch-tip {
  position: absolute; z-index: 5; pointer-events: none; translate: -50% 0;
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
}
.fn-row { margin-bottom: 4px; }
.fn-t { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.fn-bar {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
  border-radius: 7px; padding: 4px 8px; min-width: 44px;
}
.fn-conv { font-size: 11.5px; color: var(--muted); padding: 5px 0 7px 4px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut { width: 132px; height: 132px; flex: none; }
.donut-big { font-size: 22px; font-weight: 600; fill: var(--ink); font-family: var(--font); }
.donut-sub { font-size: 10.5px; fill: var(--muted); }
.legend { display: grid; gap: 8px; font-size: 13.5px; }
.legend > div { display: flex; gap: 8px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.legend b { margin-left: auto; padding-left: 12px; }
.src-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding-block: 5px; }
.src-row span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-bar { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.src-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.tp-row { display: grid; grid-template-columns: 22px 44px 1fr auto; gap: 12px; align-items: center; padding-block: 8px; border-bottom: 1px solid var(--line); }
.tp-row:last-child { border-bottom: 0; }
.tp-rank { font-weight: 600; color: var(--muted); font-size: 14px; }
.tp-row img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; }
.tp-name { font-weight: 500; font-size: 13.5px; line-height: 1.3; }
.tp-meta { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); }
.tp-rev { font-weight: 700; font-size: 13.5px; white-space: nowrap; }

/* ── Редактор главной (ILCATO-стиль) ── */
.tgl { width: 40px; height: 22px; border-radius: 99px; background: #d2d2d7; position: relative; transition: background .15s; flex: none; }
.tgl::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 99px; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tgl.on { background: #34c759; }
.tgl.on::after { left: 20px; }
.tg-cell { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.tg-cell span { font-size: 10.5px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.blk-list { display: grid; gap: 8px; }
.blk-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fafafc;
}
.blk-ord, .slide-ord { display: flex; flex-direction: column; gap: 2px; }
.blk-ord button, .slide-ord button {
  width: 26px; height: 22px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--muted); font-size: 12px; line-height: 1;
}
.blk-ord button:hover, .slide-ord button:hover { color: var(--accent); border-color: var(--accent); }
.blk-main { display: grid; gap: 1px; }
.blk-tgls { display: flex; gap: 16px; }
.slide-ed {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fafafc;
}
.slide-prevs { display: flex; gap: 10px; }
.slide-prev { display: grid; gap: 6px; justify-items: center; }
.slide-prev-ctl { display: grid; gap: 3px; justify-items: center; }
.ed-thumb { width: 128px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.ed-thumb-mob { width: 44px; height: 72px; }
.ed-ph {
  width: 128px; height: 72px; border: 1.5px dashed var(--line-2); border-radius: 8px;
  display: grid; place-items: center; color: var(--muted); font-size: 10.5px; text-align: center; line-height: 1.3;
}
.ed-ph.ed-thumb-mob { width: 44px; }
.slide-fields { display: grid; gap: 8px; }
.ed-del { color: var(--danger) !important; }

.toast {
  position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 11px; font-weight: 600;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.muted { color: var(--muted); } .small { font-size: 12.5px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-group { display: none; }
  .grid3, .grid4, .stats { grid-template-columns: 1fr 1fr; }
  .swatches { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .slide-ed { grid-template-columns: 1fr; }
  .blk-row { grid-template-columns: auto 1fr; }
  .blk-tgls { grid-column: 1 / -1; }
}

/* ── Медиа товара: сетка с перетаскиванием ── */
.media-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.m-cell {
  position: relative; width: 96px; height: 96px; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; background: var(--bg); cursor: grab;
}
.m-cell img, .m-cell video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.m-cell.dragging { opacity: .35; }
.m-cell button {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 99px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; display: grid; place-items: center;
}
.m-vid { cursor: default; }
.m-pin {
  position: absolute; left: 4px; bottom: 4px; font-size: 10px; font-weight: 600;
  background: var(--accent); color: #fff; border-radius: 99px; padding: 2px 7px;
}
.mdropz {
  width: 96px; height: 96px; border: 1.5px dashed var(--line-2); border-radius: 10px;
  display: grid; place-items: center; font-size: 12.5px; color: var(--muted); cursor: pointer; text-align: center;
}
.mdropz:hover { border-color: var(--accent); color: var(--accent); }

/* ── Превью карточки и быстрого просмотра ── */
.pv-ov { position: fixed; inset: 0; background: rgba(15, 18, 24, .5); z-index: 80; display: grid; place-items: center; padding: 20px; }
.pv-box {
  background: var(--card); border-radius: 18px; width: min(480px, 100%); max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 60px rgba(0, 0, 0, .25);
}
.pv-box.pv-wide { width: min(1000px, 100%); }
.pv-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pv-box iframe { border: 0; width: 100%; height: min(640px, 74vh); background: #fff; }

/* ── Быстрый просмотр: тумблеры; интеграции ── */
.qv-tgls { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px 26px; }
.int-badge {
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 3px 9px; margin-left: 8px;
}
.int-badge.int-on { background: var(--ok-soft); border-color: rgba(48, 163, 90, 0.35); color: var(--ok); }
.law-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.law-grid p { margin-top: 5px; font-size: 13px; line-height: 1.55; }
@media (max-width: 1100px) { .law-grid { grid-template-columns: 1fr; } }

/* ── Оплаты, доставки, возвраты ── */
.kpi-grid.kpi-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-grid.kpi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpi-grid.kpi-5, .kpi-grid.kpi-3 { grid-template-columns: repeat(2, 1fr); } }

/* ── Чаты с покупателями ── */
.chat-wrap { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.chat-list { padding: 8px; display: grid; gap: 2px; max-height: 640px; overflow-y: auto; }
.chat-item { display: grid; gap: 3px; text-align: left; padding: 11px 12px; border-radius: 10px; width: 100%; }
.chat-item:hover { background: var(--bg); }
.chat-item.on { background: var(--accent-soft); }
.chat-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pane { display: grid; grid-template-rows: auto 1fr auto; height: 640px; padding: 0; overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.chat-msgs { overflow-y: auto; padding: 18px; display: grid; gap: 8px; align-content: start; background: var(--bg); }
.chat-msgs .chatw-m { max-width: 70%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.chat-msgs .chatw-m.user { justify-self: end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msgs .chatw-m.admin { justify-self: start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msgs .chatw-ts { display: block; font-size: 10.5px; opacity: .6; margin-top: 3px; }
.chat-reply { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: end; }
.chat-reply textarea { min-height: 44px; resize: none; }
@media (max-width: 1100px) { .chat-wrap { grid-template-columns: 1fr; } .chat-pane { height: 480px; } }

/* ── Аналитика по товарам ── */
.an-row { cursor: pointer; }
.an-row:hover td { background: var(--bg); }
.an-table .dlt { margin-left: 6px; }
.an-prod-head { display: flex; align-items: center; gap: 14px; }
.an-prod-img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.an-prod-head a { color: var(--accent); }

/* ── Вложения в чатах админки ── */
.chat-reply { grid-template-columns: auto 1fr auto; }
.chat-clip { display: grid; place-items: center; width: 40px; height: 44px; border-radius: 9px; cursor: pointer; font-size: 17px; opacity: .6; align-self: end; }
.chat-clip:hover { opacity: 1; background: var(--bg); }
.chat-achips { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 0; }
.chatw-chip { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); display: grid; place-items: center; font-size: 11px; background: #fff; }
.chatw-chip img { width: 100%; height: 100%; object-fit: cover; }
.chatw-chip button { position: absolute; top: 1px; right: 1px; width: 17px; height: 17px; border-radius: 99px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; display: grid; place-items: center; }
.chat-att-media { display: block; max-width: 220px; border-radius: 10px; margin-bottom: 6px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
.gen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.promo-send { display: flex; gap: 6px; align-items: center; }
.promo-send select { max-width: 170px; }

/* ── Покупатели: CRM ── */
.linklike { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-align: left; }
.linklike.small { font-size: 12px; }
.cust-name { font-weight: 600; font-size: 14px; }
.filters-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filters-row .field { flex: 0 1 175px; }
.filters-row .field:first-child { flex: 1 1 210px; }
.bulk-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid rgba(0, 102, 204, 0.25); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.bulk-bar textarea { flex: 1 1 280px; min-height: 46px; resize: vertical; }
.filter-chip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid rgba(0, 102, 204, 0.25); border-radius: 12px; padding: 9px 14px; margin-bottom: 14px; }
.cc-chat { max-height: 250px; border-radius: 10px; margin-bottom: 10px; }
.cc-reply { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.cc-reply textarea { min-height: 46px; resize: none; }
.pt-row-a { display: flex; gap: 12px; align-items: flex-start; padding-block: 8px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pt-row-a:last-child { border-bottom: 0; }
.pt-plus { color: var(--ok); font-weight: 700; min-width: 54px; }
.pt-minus { color: var(--danger); font-weight: 700; min-width: 54px; }
.fav-mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fav-mini { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fafafc; }
.fav-mini img { width: 54px; height: 54px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); flex: none; }
.fav-mini .row-actions { display: flex; gap: 10px; margin-top: 4px; font-size: 12.5px; }

/* ── Аналитика: переключатель товара ── */
.an-picker { position: relative; margin-left: 10px; }
.an-pick-btn { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 13px; font-size: 13.5px; max-width: 320px; white-space: nowrap; overflow: hidden; }
.an-pick-btn:hover { border-color: var(--accent); }
.an-pick-btn img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; flex: none; }
.an-caret { color: var(--muted); font-size: 11px; margin-left: 2px; }
.an-pick-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 340px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(15, 17, 21, .14); overflow: hidden; }
.an-pick-q { padding: 10px; border-bottom: 1px solid var(--line); }
.an-pick-list { max-height: 320px; overflow-y: auto; padding: 6px; display: grid; gap: 2px; }
.an-pick-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; font-size: 13.5px; }
.an-pick-item:hover { background: var(--bg); }
.an-pick-item.on { background: var(--accent-soft); }
.an-pick-item img, .an-pick-all { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.an-pick-all { display: grid; place-items: center; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.an-pick-item span i { display: block; font-style: normal; }
@media (max-width: 1100px) { .filters-row .field { flex: 1 1 45%; } .an-pick-pop { width: 300px; } }

/* ── Показатели: плитки-переключатели + общий график с перекрестием ── */
.mtile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.mtile {
  position: relative; text-align: left; display: grid; gap: 3px; align-content: start;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 9px; background: var(--card);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.mtile:not(.mtile-static):hover { border-color: var(--line-2); box-shadow: 0 4px 14px rgba(0, 0, 0, .05); }
.mtile.on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 5%, #fff); }
.mtile-top { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.25; }
.mtile-chk {
  width: 15px; height: 15px; border-radius: 5px; border: 1.5px solid var(--line-2); flex: none;
  display: grid; place-items: center; font-size: 10px; line-height: 1; color: #fff; font-style: normal;
  transition: background .15s, border-color .15s;
}
.mtile.on .mtile-chk { background: var(--mc); border-color: var(--mc); }
.mtile-v { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.mtile-f { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; min-height: 20px; }
.mtile-spark { width: 100%; height: 26px; margin-top: 3px; opacity: .45; transition: opacity .15s; }
.mtile.on .mtile-spark { opacity: 1; }
.mtile-static { cursor: default; }
.mc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mc-cross { stroke: var(--line-2); stroke-width: 1; opacity: 0; }
.mc-pt { opacity: 0; stroke: #fff; stroke-width: 2; }
.mc-tip {
  position: absolute; top: 16px; z-index: 6; pointer-events: none; min-width: 190px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .14); padding: 10px 12px; font-size: 12.5px;
}
.mc-tip-d { font-weight: 600; margin-bottom: 6px; }
.mc-tip-r { display: flex; gap: 8px; align-items: center; padding-block: 2px; white-space: nowrap; }
.mc-tip-r i { width: 9px; height: 9px; border-radius: 99px; flex: none; }
.mc-tip-r b { margin-left: auto; padding-left: 16px; }
.mc-note { margin-top: 8px; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .mtile-row { grid-template-columns: repeat(2, 1fr); } }

/* ── Юнит-экономика, Остатки, Реклама ── */
.eco-in { width: 96px; padding: 6px 9px; font-size: 13px; }
.eco-neg { color: var(--danger); }
tr.eco-neg-row td { background: var(--danger-soft); }
.romi-pos { color: var(--ok); font-weight: 600; }
.romi-neg { color: var(--danger); font-weight: 600; }
.utm-chip {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
}
