/* Раздел «Аналитика» админки. Отдельный файл: стили раздела не лезут в общий
   styles.css и не зависят от порядка правил в нём. Цвета интерфейса — из
   общих переменных сайта, цвета рядов задаются в analytics.js. */
.analytics { display: block; }
.an-status { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); color: var(--ink-2); font-size: 14px; }
.an-status__actions { display: flex; gap: 8px; align-items: center; }
.an-status select, .an-controls select, .an-controls input, .an-toolbar input, .an-toolbar select { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; }
.an-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.an-tabs button { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font: inherit; cursor: pointer; }
.an-tabs button.is-active { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.an-controls, .an-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; color: var(--ink-2); font-size: 14px; }
.an-toolbar input[type="search"] { min-width: 260px; }
/* Длинные пункты списков не шире экрана: на телефоне поле переносится на свою строку. */
.an-toolbar label, .an-controls label { max-width: 100%; }
.an-toolbar select, .an-controls select, .an-status select { max-width: 100%; text-overflow: ellipsis; }
.an-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.an-seg button { padding: 8px 12px; border: 0; border-right: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; cursor: pointer; }
.an-seg button:last-child { border-right: 0; }
.an-seg button.is-active { background: var(--accent); color: #fff; }
.an-dates input { margin: 0 4px; }
.an-check { display: inline-flex; gap: 6px; align-items: center; }
.an-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.an-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.an-chip.is-active { border-color: var(--accent); background: var(--surface-tint); color: var(--ink); }
.an-chip input { margin: 0; }
.an-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.an-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.an-tile small { color: var(--muted); font-size: 13px; }
.an-tile strong { color: var(--ink); font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.an-change { font-size: 13px; font-variant-numeric: tabular-nums; }
.an-change--up { color: #0a7a0a; }
.an-change--down { color: #b42318; }
.an-change--flat { color: var(--muted); }
.an-card { margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.an-card--focus { border-color: var(--accent); }
.an-card header { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.an-card h3, .an-h { margin: 0; color: var(--ink); font-size: 15px; font-weight: 600; }
.an-card h4 { margin: 0 0 4px; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.an-card header strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.an-h { margin: 20px 0 10px; }
.an-multiples { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; }
.an-multiples .an-card { margin-bottom: 0; }
.an-chart { position: relative; min-height: 120px; }
.an-chart svg { display: block; max-width: 100%; }
.an-axis { fill: var(--muted-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.an-tip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 3px; min-width: 170px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); box-shadow: 0 6px 20px rgba(17, 24, 35, .12); color: var(--ink); font-size: 12px; pointer-events: none; }
.an-tip[hidden] { display: none; }
.an-tip span { display: flex; gap: 6px; align-items: center; color: var(--ink-2); }
.an-tip em { margin-left: auto; color: var(--ink); font-style: normal; font-variant-numeric: tabular-nums; }
.an-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--muted); }
.an-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; color: var(--ink-2); font-size: 13px; }
.an-legend span { display: inline-flex; gap: 6px; align-items: center; }
.an-bars { display: grid; gap: 8px; }
.an-bar-row { display: grid; grid-template-columns: 190px 1fr 120px 64px; gap: 10px; align-items: center; font-size: 14px; }
.an-bar-row b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.an-bar-row em { color: var(--muted); font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.an-bar { height: 10px; border-radius: 5px; background: var(--surface-tint); overflow: hidden; }
.an-bar i { display: block; width: 0; height: 100%; border-radius: 0 4px 4px 0; background: #2a78d6; }
.an-bar--cell { display: inline-block; width: 80px; margin-right: 8px; vertical-align: middle; }
.an-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.an-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.an-table th, .an-table td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.an-table th { position: sticky; top: 0; background: var(--surface-soft); color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.an-table th[data-sort] { cursor: pointer; }
.an-table th.is-sorted { color: var(--accent); }
.an-table tr:last-child td { border-bottom: 0; }
.an-table small { color: var(--muted); }
.an-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-align: left; cursor: pointer; }
.an-abc { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); font-weight: 600; text-align: center; }
.an-abc--A { background: var(--surface-tint); }
.an-miss { color: #b42318; }
.an-csv { margin: 0 0 4px; font-size: 12px; text-align: right; }
.an-prod { display: flex; gap: 8px; align-items: flex-start; width: 300px; max-width: 34vw; }
.an-prod__text { min-width: 0; flex: 1; }
.an-prod__name, .an-prod small { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-prod small { font-size: 12px; }
.an-pick { display: inline-flex; flex: none; }
.an-pick input { width: 16px; height: 16px; margin: 2px 0 0; }
.an-note--pick { padding: 8px 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface-tint); color: var(--ink); }
.an-advice { display: inline-block; margin: 0 4px 4px 0; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.an-advice--urgent { border-color: #b42318; color: #b42318; }
.an-advice--warn { border-color: #b26a00; color: #7a4a00; }
.an-advice--good { border-color: #0a7a0a; color: #0a6a0a; }
.an-note { margin: 10px 0; color: var(--muted); font-size: 13px; }
.an-note--warn { padding: 10px 12px; border: 1px solid #f0c36d; border-radius: 8px; background: #fff8e6; color: #6b4a00; }
.an-note--ok { padding: 10px 12px; border: 1px solid #9bd3a0; border-radius: 8px; background: #f0faf1; color: #14531a; }
.an-muted { color: var(--muted); }
.an-sub { padding: 6px 0 2px; color: var(--ink-2); font-size: 12px; }
.an-cost { width: 110px; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; text-align: right; }
.an-cost.is-saved { border-color: #0a7a0a; }
.an-cost.is-failed { border-color: #b42318; }
@media (max-width: 720px) {
  .an-multiples { grid-template-columns: 1fr; }
  .an-bar-row { grid-template-columns: 1fr 90px; }
  .an-bar-row .an-bar, .an-bar-row em { display: none; }
}
.an-reason { display: block; min-width: 280px; max-width: 420px; line-height: 1.4; }
/* Новые разделы: приёмка, отзывы, ставки, сезонность */
.an-good { color: #1b7f3b; font-weight: 600; }
.an-dim { opacity: .55; }
.an-stack { display: grid; gap: 10px; }
.an-stack label { display: grid; gap: 4px; font-size: 14px; }
.an-stack textarea, .an-stack input[type="text"], .an-stack input:not([type]) { width: 100%; padding: 8px 10px; border: 1px solid #d7dde6; border-radius: 9px; font: inherit; }
.an-coef { font-weight: 600; }
.an-coef--free { background: #e3f7e9; color: #1b7f3b; }
.an-coef--ok { background: #f3f7fb; }
.an-coef--high { color: #b42318; }
.an-coef--closed { color: #9aa3ad; }
.an-table--accept th, .an-table--accept td { white-space: nowrap; }
.an-review { margin-top: 12px; }
.an-review header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.an-review p { margin: 0 0 8px; }
.an-review textarea { width: 100%; padding: 8px 10px; border: 1px solid #d7dde6; border-radius: 9px; font: inherit; margin-bottom: 8px; }
.an-review__answer { padding: 8px 12px; border-left: 3px solid #2a78d6; background: #f3f7fb; }
details.an-card summary { cursor: pointer; list-style: none; }
details.an-card summary h3 { display: inline; margin: 0; }
/* Миниатюры и ссылки на карточки, проценты под числами */
.an-prod__img { width: 56px; height: 56px; flex: 0 0 56px; object-fit: contain; border-radius: 6px; border: 1px solid #e3e8ee; background: #fff; transition: transform .15s ease; transform-origin: left center; position: relative; }
.an-prod__img:hover { transform: scale(3.2); z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.an-prod__img--big { width: 120px; height: 120px; flex-basis: 120px; margin-right: 12px; float: left; transform-origin: left top; }
.an-prod__img--big:hover { transform: scale(2.2); }
.an-prod__link { color: #2a78d6; text-decoration: none; margin-left: 4px; }
.an-prod__link:hover { text-decoration: underline; }
.an-num .an-change { font-size: 11px; }
