:root {
  --bg: #edeff3;
  --surface: #ffffff;
  --ink: #19203a;
  --muted: #5e667d;
  --line: #d6dae3;
  --accent: #8a00e6;      /* фиолетовый из логотипа, чуть темнее для контраста */
  --gain: #16774a;
  --loss: #b42318;
  --warn-bg: #fff6e0;
  --warn-line: #e8c770;
  --radius: 6px;
  font-family: "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* скрытое скрыто, даже если у элемента свой display */
body { margin: 0; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1 { font-size: 1.75rem; font-weight: 700; margin: 0 0 1rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 0.75rem; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.neg { color: var(--loss); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.875rem; margin: 0.5rem 0 0; }
.stack .field-hint { margin-top: -0.5rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); font-weight: 700;
  text-decoration: none; font-size: 1.05rem; letter-spacing: 0.06em; }
.brand img { display: block; }
.topnav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9rem; }
.topnav a { color: var(--ink); }
.topnav .who { color: var(--muted); }
.topnav form { margin: 0; }
.topnav .link { color: var(--muted); }
@media (max-width: 560px) { .topnav .who { display: none; } }

.page { max-width: 1120px; margin: 0 auto; padding: 1.5rem; }
.crumbs { margin: 0 0 0.25rem; font-size: 0.9rem; color: var(--muted); }

.flash { padding: 0.65rem 0.9rem; border-radius: var(--radius); margin-bottom: 1rem; background: #f3e8fd; }
.flash-error { background: #fdecea; color: var(--loss); }
.warn { background: var(--warn-bg); padding: 0.5rem 0.75rem; border-radius: var(--radius); }
.error-box { background: #fdecea; color: var(--loss); padding: 0.75rem 1rem; border-radius: var(--radius); margin: 1rem 0; }
.error-box ul { margin: 0.5rem 0 0; padding-left: 1.25rem; }
.warn-box { background: var(--warn-bg); border: 1px solid var(--warn-line); padding: 0.6rem 1rem; border-radius: var(--radius); margin: 1rem 0; }
.warn-box summary { cursor: pointer; }
.warn-box ul { margin: 0.25rem 0 0.5rem; padding-left: 1.25rem; }
.warn-period { margin: 0.6rem 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.barcodes { font-variant-numeric: tabular-nums; word-break: break-word; margin: 0.5rem 0 0; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.panel.narrow { max-width: 480px; margin-top: 1.5rem; }
.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.side { display: grid; gap: 1.25rem; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }

.stack { display: grid; gap: 0.85rem; }
label { display: grid; gap: 0.3rem; font-size: 0.9rem; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=date], input:not([type]) {
  font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink);
}
input[type=file] { font: inherit; font-size: 0.9rem; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: 0.9rem; font-weight: 500; margin-bottom: 0.4rem; }
.row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn {
  font: inherit; font-weight: 600; justify-self: start; cursor: pointer;
  padding: 0.6rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--accent);
  background: var(--accent); color: #fff;
}
.btn.secondary { background: #fff; color: var(--accent); }
a.btn { display: inline-block; text-decoration: none; }
.side .panel form { margin-top: 0.75rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--loss); }
.danger-zone { margin-top: 2rem; }
.status-cell { display: inline-flex; align-items: center; gap: 0.5rem; }
.status-cell form { margin: 0; display: inline-flex; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.3rem;
  background: none; border: 0; border-radius: var(--radius); color: var(--muted); cursor: pointer; }
.icon-btn:hover, .icon-btn:focus-visible { color: var(--loss); background: #fdecea; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.4rem; }
.week { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; border: 1px solid var(--line);
  border-radius: var(--radius); font-weight: 400; font-variant-numeric: tabular-nums; cursor: pointer; }
.more summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.more[open] summary { margin-bottom: 0.6rem; }
.week:has(input:checked) { border-color: var(--accent); background: #f5ebfd; }

.auth { max-width: 380px; margin: 2rem auto 3rem; }
.auth-logo { display: block; width: 200px; height: auto; margin: 0 auto 1.5rem; }
.cab-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.cab-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.cab-name { font-weight: 600; }
.cab-state { color: var(--muted); font-size: 0.9rem; }

.history { margin-top: 2rem; }
table.plain { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.plain th, table.plain td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
table.plain th { font-weight: 500; color: var(--muted); font-size: 0.85rem; }

/* Отчёт: прибыль — главное на странице */
.pending { padding: 3rem 0; }
.progress { font-size: 1.15rem; }
.period-list { color: var(--muted); font-variant-numeric: tabular-nums; }
.headline { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.75rem 3rem; margin: 0.5rem 0 1.5rem; }
.period-name { color: var(--muted); font-variant-numeric: tabular-nums; }
.profit { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; }
.profit.gain { color: var(--gain); }
.profit.loss { color: var(--loss); }
.profit-label { color: var(--muted); margin-bottom: 0.75rem; }
.facts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.8rem; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--line); margin: 1.5rem 0 1rem; }
.tabs a { padding: 0.55rem 0.9rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current=page] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tabs .excel { margin-left: auto; color: var(--accent); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.metrics { border-collapse: collapse; width: 100%; min-width: 480px; }
table.metrics th, table.metrics td { padding: 0.42rem 0.9rem; border-bottom: 1px solid #eceef3; }
table.metrics thead th { position: sticky; top: 0; background: var(--surface); font-weight: 500; color: var(--muted); font-size: 0.85rem; text-align: left; }
table.metrics thead th.num { text-align: right; }
table.metrics tbody th { text-align: left; font-weight: 400; position: sticky; left: 0; background: var(--surface); }
table.metrics tr.key th, table.metrics tr.key td { font-weight: 600; }

.products { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.prow { display: grid; grid-template-columns: minmax(0, 3fr) repeat(5, minmax(0, 1fr)); gap: 0.75rem; align-items: center; padding: 0.6rem 1rem; }
.phead { color: var(--muted); font-size: 0.85rem; border-bottom: 1px solid var(--line); }
.product { border-bottom: 1px solid #eceef3; }
.product summary { cursor: pointer; list-style: none; }
.product summary::-webkit-details-marker { display: none; }
.product[open] summary { background: #f6f7fa; }
.pname { display: grid; min-width: 0; }
.pname strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pname small { color: var(--muted); font-variant-numeric: tabular-nums; }
/* Колонки газетного типа: строки идут сверху вниз, затем в следующую колонку */
.card { columns: 260px 3; column-gap: 2rem; margin: 0; padding: 0.5rem 1rem 1rem; }
.card div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px dotted var(--line); break-inside: avoid; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
@media (max-width: 720px) {
  .prow { grid-template-columns: minmax(0, 1fr) auto; }
  .prow > :nth-child(n+3) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.recon { display: flex; flex-wrap: wrap; gap: 0.5rem 2.5rem; margin: 0 0 0.25rem; }
.recon dt { color: var(--muted); font-size: 0.85rem; }
.recon dd { margin: 0; font-weight: 600; text-align: left; }

/* Репрайсер */
textarea { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); resize: vertical; }
code { font-size: 0.9em; background: #f1f2f6; padding: 0.05rem 0.3rem; border-radius: 4px; }
.page > .panel + .panel, .page > section.panel { margin-bottom: 1.25rem; }
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.badge.on { background: #e6f4ec; color: var(--gain); }
.badge.off { background: #eef0f4; color: var(--muted); }
.rp-state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 1.05rem; }
.rp-status form { margin-top: 0.9rem; }
.rp-fieldset { min-width: 0; }
.rp-presets { margin-bottom: 1rem; align-items: center; }
.rp-presets form { margin: 0; }
.rp-custom { display: inline-flex; align-items: center; gap: 0.4rem; }
.rp-custom input { width: 4.5rem; font: inherit; padding: 0.55rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); }
.rp-cycles { max-width: 34rem; }
.rp-cycles td { padding: 0.3rem 0.5rem; }
.rp-cycles input { width: 6rem; font: inherit; padding: 0.4rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius);
  font-variant-numeric: tabular-nums; }
.rp-del { font-size: 1.2rem; line-height: 1; }
.rp-log { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow-y: auto; font-size: 0.9rem; }
.rp-log li { padding: 0.35rem 0; border-bottom: 1px dotted var(--line); }
.rp-log time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 0.4rem; }
.rp-inline { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; }
.rp-chips { list-style: none; padding: 0; margin: 0.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.rp-chips li { padding: 0.2rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.85rem;
  font-variant-numeric: tabular-nums; }
.rp-chips b { font-weight: 600; color: var(--accent); }

/* Подписка и админка */
.sub-banner { padding: 0.55rem 0.9rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.95rem;
  background: var(--surface); border: 1px solid var(--line); }
.sub-banner.sub-warn { background: var(--warn-bg); border-color: var(--warn-line); }
.sub-banner.sub-error { background: #fdecea; border-color: #f4c3bd; color: var(--loss); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; display: grid; gap: 0.15rem; }
.stat span { color: var(--muted); font-size: 0.85rem; }
.stat b { font-size: 1.7rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat small { color: var(--muted); font-size: 0.8rem; }
.warn-stat b { color: #9a6700; }
.bad-stat b { color: var(--loss); }
.admin-filter { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.admin-filter input, .admin-filter select { font: inherit; padding: 0.5rem 0.7rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; }
.admin-table td { vertical-align: top; }
.admin-table summary { cursor: pointer; font-weight: 500; }
.admin-cabs { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; }
.admin-table tr.sub-expiring .sub-cell { color: #9a6700; font-weight: 600; }
.admin-table tr.sub-expired { background: #fdf6f5; }
.admin-actions { display: grid; gap: 0.4rem; }
.admin-actions form { margin: 0; display: flex; gap: 0.4rem; align-items: center; }
.admin-until input { font: inherit; font-size: 0.85rem; padding: 0.3rem 0.4rem; border: 1px solid var(--line); border-radius: var(--radius); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.85rem; white-space: nowrap; }

/* Переключатель модулей кабинета */
.module-nav { margin-bottom: 1.5rem; }
.module-cab { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.9rem; }
.module-cab > span { color: var(--ink); font-weight: 600; font-size: 1.35rem; display: block; margin-top: 0.15rem; }
.module-tabs { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.module-tabs .btn { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.module-tabs .btn[aria-current=page] { cursor: default; }
.module-tabs .btn.secondary:hover { background: #f5ebfd; }
.dot { width: 0.6rem; height: 0.6rem; flex: none; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--gain); }
.dot.off { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.btn:not(.secondary) .dot.on { box-shadow: 0 0 0 2px #fff; }

/* Коды на почту */
.stack input.code-input { font-size: 1.4rem; letter-spacing: 0.35em; font-variant-numeric: tabular-nums; text-align: center; }
.resend { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: baseline; }
.resend .hint { margin: 0; }
.resend .link { color: var(--accent); font-size: 0.875rem; }

/* Подтверждение через Telegram */
.tg-steps { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.tg-steps li { margin-bottom: 0.3rem; }
.tg-btn { display: inline-block; text-decoration: none; }
#tg-wait::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--accent); margin-right: 0.45rem; animation: tgpulse 1.2s infinite; vertical-align: middle; }
@keyframes tgpulse { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { #tg-wait::before { animation: none; } }
.login-steps { margin-top: 1rem; }

/* Маркетплейсы */
.mp-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; padding: 0.1rem 0.45rem;
  border-radius: 4px; vertical-align: middle; }
.mp-wb { background: #f3e8fd; color: #7b1fa2; }
.mp-ozon { background: #e5efff; color: #0050c8; }
.mp-choice { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mp-choice legend { width: 100%; }
.mp-choice .week { flex: 1; }
table.metrics tr.sub th { padding-left: 1.8rem; color: var(--muted); font-size: 0.9rem; }
table.metrics tr.sub td { color: var(--muted); font-size: 0.9rem; }

/* Реклама по товарам (Ozon) */
.ads-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1rem 0; }
.ads-box h2 { font-size: 1rem; margin-bottom: 0.5rem; }
.ads-box p { margin: 0.35rem 0; }
.inline-form { display: inline; margin: 0; }
label.check { display: flex; flex-direction: row; align-items: center; gap: 0.4rem; font-weight: 400; }

/* Фильтры и сортировка товаров */
.pfilters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem 1rem; margin: 1rem 0 0.75rem; }
.pfilters label { display: grid; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.pfilters select { font: inherit; color: var(--ink); padding: 0.45rem 0.6rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; min-width: 12rem; max-width: 22rem; }
.psum { margin: 0; font-size: 0.9rem; font-variant-numeric: tabular-nums; flex: 1 1 100%; }
.phead button.sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: right; }
.phead button.sort:hover { color: var(--accent); }
.phead button.sort[aria-sort="descending"]::after { content: " ↓"; }
.phead button.sort[aria-sort="ascending"]::after { content: " ↑"; }

/* Заголовок списка товаров закреплён при прокрутке */
.products .phead { position: sticky; top: 0; z-index: 2; background: var(--surface);
  border-top-left-radius: var(--radius); border-top-right-radius: var(--radius);
  box-shadow: 0 1px 0 var(--line), 0 4px 8px -6px rgba(25, 32, 58, 0.25); }

/* Подраздел формы (рекламное API Ozon) — отделён рамкой, чтобы не сливался с основными полями */
fieldset.subsection { display: grid; gap: 0.75rem; margin: 0.5rem 0 0.25rem; padding: 0.9rem 1rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #f7f8fb; }
fieldset.subsection legend { padding: 0 0.4rem; margin-left: -0.4rem; font-weight: 600; font-size: 0.95rem; }
fieldset.subsection legend .muted { font-weight: 400; }
fieldset.subsection .hint { margin: 0; }
fieldset.subsection input { background: #fff; }
fieldset.subsection .path-hint { margin: 0.6rem 0 0.75rem; }  /* пустая строка до и после пути к ключам */

/* Планирование поставок */
.supply-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem 1rem; align-items: end; margin-top: 0.75rem; }
.supply-form input[type=number] { width: 100%; font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; color: var(--ink); }
.supply-form label { display: grid; gap: 0.3rem; font-weight: 500; }
.supply-form label.check, .pfilters label.check { display: flex; flex-direction: row; align-items: center; gap: 0.4rem; }
.supply-form .supply-checks, .supply-form .btn-row, .supply-form .hint { grid-column: 1 / -1; }
.supply-checks { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.pfilters input[type=search] { font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); min-width: 14rem; }
.pfilters label.check { align-self: center; }
.supply-table-wrap { overflow: visible; }
.supply-rows thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
.supply-rows td { vertical-align: top; }
.supply-totals td { vertical-align: top; }
.clusters-cell { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cl-sep { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }  /* разделитель для копирования и без стилей */
.cl-chip b { font-weight: 600; }
.cl-chip { display: inline-block; padding: 0.15rem 0.5rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.supply-totals tfoot th { border-top: 2px solid var(--line); color: var(--ink); font-weight: 700; font-size: 1rem; }
.cl-chip.dim { opacity: 0.35; }

/* Дашборд прогноза прибыли */
.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.dash-head > div { flex: 1 1 32rem; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.dash-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem; display: grid; gap: 0.2rem; }
.dash-label { color: var(--muted); font-size: 0.85rem; }
.dash-orders { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.dash-orders small { color: var(--muted); }
.dash-profit { font-size: 1.6rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.dash-profit.neg, .dash-items .neg, .dash-day .neg { color: var(--loss); }
.dash-sub { color: var(--muted); font-size: 0.8rem; }
.dash-chart { width: 100%; height: auto; display: block; }
.dash-chart .axis { stroke: var(--line); stroke-width: 1; }
.dash-chart .bar-orders { fill: #d9c2f5; }
.dash-chart .bar-profit { fill: var(--accent); }
.dash-chart .bar-loss { fill: var(--loss); }
.dash-chart .xlabel { font-size: 11px; fill: var(--muted); text-anchor: middle; }
.dash-legend { display: flex; align-items: center; gap: 0.4rem 0.6rem; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.lg { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 2px; }
.lg-orders { background: #d9c2f5; } .lg-profit { background: var(--accent); margin-left: 0.8rem; }
.dash-day-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; }
.dash-day-head label { display: flex; align-items: center; gap: 0.5rem; color: var(--muted); font-size: 0.9rem; }
.dash-day-head select { font: inherit; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.dash-items tr.loss-row td { background: #fdf3f2; }
.dash-chart .ctitle { font-size: 12px; fill: var(--muted); }
.dash-chart .hit { fill: transparent; }
.dash-chart g:hover .hit { fill: rgba(138, 0, 230, 0.06); }
.dash-orders-main { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-profit-small { font-size: 0.95rem; color: var(--accent); font-variant-numeric: tabular-nums; margin-top: 0.35rem; }
.dash-profit-range { font-size: 1.1rem; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; margin-top: 0.35rem; }
.dash-profit-small.neg, .dash-profit-range.neg, .dash-two .neg { color: var(--loss); }
.dash-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.dash-two .panel { margin: 0; }
/* суммы не переносятся посреди числа */
.dash-orders-main, .dash-profit-small, .dash-profit-range, .dash-two td.num, .dash-items td.num { white-space: nowrap; }
.dash-profit-small, .dash-profit-range { white-space: normal; }
.dash-profit-small .n, .dash-profit-range .n { white-space: nowrap; }
.dash-two th, .dash-two td { white-space: nowrap; }
.dash-two td:first-child { white-space: normal; }
.dash-profit-range .pm { font-size: 0.8rem; font-weight: 500; color: var(--muted); white-space: nowrap; }

/* Кредит: уведомление и тумблер в WB-отчёте */
.credit-box { display: flex; gap: 1rem; align-items: flex-start; background: #fff8e6; border: 1px solid #f0d58a;
  border-radius: var(--radius); padding: 0.9rem 1.1rem; margin: 1rem 0; }
.credit-box.on { background: #f3f4f8; border-color: var(--line); }
.credit-box p { margin: 0; }
.credit-box .hint { display: block; margin-top: 0.3rem; }
.switch { display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .slider { width: 2.6rem; height: 1.45rem; border-radius: 999px; background: #c9ccd6; position: relative; transition: background 0.15s; flex: none; }
.switch .slider::after { content: ""; position: absolute; top: 0.18rem; left: 0.2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { transform: translateX(1.15rem); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-label { font-weight: 600; }

/* Товары за период на дашборде */
.gp-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0.25rem; }
.gp-btn { font: inherit; font-size: 0.9rem; padding: 0.35rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; }
.gp-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.gp-presets label { display: flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.9rem; }
.gp-presets input[type=date] { font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.gp-wrap { overflow: visible; }
#gp-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: 0 1px 0 var(--line); }
#gp-table button.sort { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
#gp-table th.num button.sort { text-align: right; }
#gp-table button.sort:hover { color: var(--accent); }
#gp-table button.sort[aria-sort="descending"]::after { content: " ↓"; }
#gp-table button.sort[aria-sort="ascending"]::after { content: " ↑"; }
.dash-pending { color: #9a6a00; font-size: 0.85rem; }
#gp-table { font-size: 0.86rem; }
#gp-table th, #gp-table td { padding: 0.45rem 0.4rem; }
#gp-table th button.sort { white-space: normal; line-height: 1.2; }
#gp-table td:first-child { min-width: 10.5rem; max-width: 18rem; overflow-wrap: anywhere; }
#gp-table td.num { white-space: nowrap; }
.gp-wrap.scroll { overflow-x: auto; }  /* только если таблица шире блока — иначе заголовок закреплён при прокрутке */

/* Итог «Товаров за период» — рамка с плитками */
.gp-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; padding: 0.55rem; margin: 0.25rem 0 0.9rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: #f8f8fb; }
.gp-m { display: grid; gap: 0.1rem; align-content: start; padding: 0.4rem 0.6rem; background: #fff; border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px); min-width: 0; }
.gp-l { font-size: 0.75rem; color: var(--muted); }
.gp-v { font-size: 0.92rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gp-s { font-size: 0.75rem; color: var(--muted); }
.gp-v .neg { color: var(--loss); }
.gp-m.gp-total { border-width: 2px; }
.gp-m.gp-total.is-pos { border-color: var(--accent); }
.gp-m.gp-total.is-neg { border-color: var(--loss); }
.dash-kpi { margin-top: 0.15rem; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .gp-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 761px) and (max-width: 1000px) { .gp-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.missing-cost { margin-top: 0.5rem; border: 1px solid #f0d58a; background: #fff8e6; border-radius: var(--radius); padding: 0.55rem 0.8rem; }
.missing-cost summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.missing-cost table { font-size: 0.85rem; margin-top: 0.4rem; background: #fff; }
.missing-cost td { font-variant-numeric: tabular-nums; }

/* Фильтр с несколькими значениями */
.msel-field { display: grid; gap: 0.3rem; min-width: 12rem; }
.msel-title { font-size: 0.85rem; color: var(--muted); }
.msel { position: relative; }
.msel-btn { width: 100%; text-align: left; font: inherit; padding: 0.45rem 2rem 0.45rem 0.7rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 0.7rem center;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msel-btn:disabled { opacity: 0.6; cursor: default; }
.msel-panel { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: 22rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 20px rgba(0,0,0,0.12); padding: 0.5rem; }
.msel-q { width: 100%; box-sizing: border-box; font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 0.4rem; }
.msel-list { max-height: 16rem; overflow-y: auto; display: grid; gap: 0.1rem; }
.pfilters .msel .msel-opt, .msel .msel-opt { display: flex; flex-direction: row; gap: 0.5rem; align-items: center; padding: 0.3rem 0.35rem;
  border-radius: 4px; cursor: pointer; font-size: 0.9rem; color: var(--text, inherit); margin: 0; }
.msel .msel-opt input { margin: 0; flex: none; width: auto; }
.msel .msel-opt span { white-space: nowrap; }
.msel-opt:hover { background: #f3f4f8; }
.msel-opt[hidden] { display: none; }
.msel-actions { display: flex; justify-content: space-between; gap: 0.5rem; margin-top: 0.45rem; padding-top: 0.45rem; border-top: 1px solid var(--line); }
.msel-actions button { font: inherit; font-size: 0.85rem; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0.2rem 0.3rem; }
.gp-summary.rep-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .gp-summary.rep-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Демо */
.demo-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem;
  background: #f3ecff; border: 1px solid #d7c2ff; color: #3b1a73; border-radius: var(--radius); padding: 0.6rem 0.9rem; margin: 0.6rem 0 1rem; }
.demo-banner form { margin: 0; }
.demo-banner button { font: inherit; font-weight: 600; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 0.4rem 0.9rem; cursor: pointer; }

/* ---------- подвал и юридические страницы ---------- */
body { min-height: 100vh; display: flex; flex-direction: column; }  /* подвал прижат к низу на коротких страницах */
body > main { flex: 1 0 auto; width: 100%; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.site-footer-in { max-width: 1120px; margin: 0 auto; padding: 1.25rem 1.5rem;  /* та же ширина, что у страниц */ display: flex; flex-wrap: wrap; gap: 0.75rem 2rem;
  justify-content: space-between; align-items: center; color: var(--muted); font-size: 0.9rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }
.legal { max-width: 46rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem 2rem; }
.legal-body { line-height: 1.65; }
.legal-body h2 { margin-top: 1.5rem; }
.auth-demo { margin-top: 1.25rem; font-size: 0.95rem; line-height: 1.8; }

/* ---------- главная ---------- */
.landing { background: var(--surface); }
.l-wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }
.l-top { width: 100%; box-sizing: border-box; max-width: 1120px;  /* body — flex-столбец: без width шапка сжималась в центр */ margin: 0 auto; padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.l-top .brand { text-decoration: none; }
.l-nav { display: flex; align-items: center; gap: 1.5rem; }
.l-nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.l-nav a:hover { color: var(--accent); }
.l-nav .l-login { color: var(--accent); border: 1.5px solid var(--accent); border-radius: 999px; padding: 0.35rem 1rem; }

.l-hero { background: linear-gradient(180deg, #f5efff 0%, var(--surface) 100%); padding: 3.5rem 0 4rem; }
.l-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.l-hero h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 1.25rem; max-width: 18ch; }
.l-lead { font-size: 1.15rem; line-height: 1.6; color: #333a52; max-width: 38rem; margin: 0 0 1.75rem; }
.l-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.l-btn { display: inline-block; font-weight: 600; text-decoration: none; padding: 0.8rem 1.4rem; border-radius: 999px;
  border: 1.5px solid var(--accent); color: var(--accent); background: var(--surface); }
.l-btn:hover { background: #f5efff; }
.l-btn-main { background: var(--accent); color: #fff; }
.l-btn-main:hover { background: #7300c0; }
.l-note { color: var(--muted); font-size: 0.92rem; margin: 1rem 0 0; }

/* сверка — главный образ страницы: строка «как в бухгалтерии» */
.l-check { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.5rem 1.6rem 1.25rem;
  box-shadow: 0 18px 40px -24px rgba(60, 0, 120, 0.35); }
.l-check figcaption { font-weight: 600; margin-bottom: 1rem; }
.l-check dl { margin: 0; }
.l-check dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px dashed var(--line); }
.l-check dt { color: var(--muted); }
.l-check dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.l-check .l-check-diff { border-bottom: 0; padding-top: 0.9rem; }
.l-check .l-check-diff dt { color: var(--ink); font-weight: 600; }
.l-check .l-check-diff dd { color: var(--gain); font-size: 2rem; line-height: 1; letter-spacing: -0.02em; }
.l-check p { color: var(--muted); font-size: 0.82rem; margin: 0.9rem 0 0; }

.l-section { padding: 4rem 0; }
.l-h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); letter-spacing: -0.02em; font-weight: 700; margin: 0 0 2rem; }
.l-row { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 3rem; align-items: center; margin-bottom: 3.5rem; }
.l-row-flip .l-text { order: 2; }
.l-row-small { grid-template-columns: minmax(0, 0.8fr); margin-bottom: 0; }
.l-row-small.l-row-flip .l-text { order: 0; }
.l-text h3 { font-size: 1.35rem; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
.l-text p { color: #333a52; line-height: 1.65; margin: 0; max-width: 34rem; }
.l-text p + p { margin-top: 0.75rem; }
.l-shot { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: 0 14px 34px -22px rgba(25, 32, 58, 0.45); }

.l-trust { background: var(--bg); }
.l-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.l-facts h3 { font-size: 1.1rem; margin: 0 0 0.5rem; padding-top: 0.9rem; border-top: 3px solid var(--accent); }
.l-facts p { color: #333a52; line-height: 1.6; margin: 0; }

.l-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
.l-steps li { counter-increment: step; }
.l-steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 0.8rem; }
.l-steps h3 { font-size: 1.1rem; margin: 0 0 0.4rem; }
.l-steps p { color: #333a52; margin: 0; line-height: 1.6; }

.l-price { background: var(--bg); }
.l-price-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.75rem 2rem; max-width: 40rem; }
.l-price-box > p:first-child { margin-top: 0; }
.l-price-box .l-cta { margin-top: 1.5rem; }
.l-faq { max-width: 52rem; }
.l-faq details { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.l-faq summary { font-weight: 600; cursor: pointer; font-size: 1.05rem; }
.l-faq details p { color: #333a52; line-height: 1.6; margin: 0.6rem 0 0; }
.landing .site-footer { margin-top: 0; }

@media (max-width: 860px) {
  .l-hero-grid, .l-row, .l-facts, .l-steps { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .l-row-flip .l-text { order: 0; }
  .l-nav a:not(.l-login):not([href="/demo"]) { display: none; }
  .l-hero { padding: 2rem 0 2.5rem; }
  .l-top .brand span { white-space: nowrap; font-size: 0.95rem; }
  .l-nav { gap: 0.9rem; }
}
@media (prefers-reduced-motion: no-preference) { .l-btn { transition: background-color 0.15s; } }

/* главная: блок демо и тариф */
.l-nav .l-nav-demo { color: var(--accent); }
.l-demo { background: linear-gradient(135deg, #7a00d6 0%, #9b1ff0 60%, #b44bff 100%); color: #fff; padding: 4rem 0; }
.l-demo .l-h2 { color: #fff; }
.l-demo-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.l-demo-lead { font-size: 1.1rem; line-height: 1.6; color: #f1e6ff; max-width: 40rem; margin: 0 0 1.5rem; }
.l-demo-tasks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; max-width: 42rem; }
.l-demo-tasks li { position: relative; padding-left: 2rem; line-height: 1.55; color: #f6efff; }
.l-demo-tasks li::before { content: ""; position: absolute; left: 0; top: 0.35rem; width: 1.1rem; height: 1.1rem; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%237a00d6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; }
.l-demo-tasks strong { color: #fff; }
.l-demo-card { background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 12px; padding: 2rem; display: grid; gap: 1.25rem; justify-items: start; }
.l-btn-light { background: #fff; color: #6a00bd; border-color: #fff; font-size: 1.1rem; padding: 0.95rem 1.7rem; }
.l-btn-light:hover { background: #f5efff; }
.l-demo-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; color: #f1e6ff; }
.l-demo-facts li::before { content: "✓"; margin-right: 0.5rem; font-weight: 700; color: #fff; }

.l-price-box { display: grid; gap: 1.25rem; }
.l-price-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.5rem; }
.l-price-num { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1; }
.l-price-num span { font-size: 1.1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.l-price-trial { margin: 0; font-weight: 600; color: var(--gain); background: #e8f6ee; border-radius: 999px; padding: 0.35rem 0.9rem; }
.l-price-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.45rem; color: #333a52; line-height: 1.55; }
.l-price-extra { color: #333a52; }
.l-price-box .l-cta { margin-top: 0.25rem; }
@media (max-width: 860px) { .l-demo-grid { grid-template-columns: minmax(0, 1fr); gap: 2rem; } .l-demo { padding: 2.75rem 0; } }
@media (max-width: 520px) {  /* «Открыть демо прямо сейчас» — в одну строку на телефоне */
  .l-demo-card { padding: 1.25rem; justify-items: stretch; }
  .l-btn-light { font-size: 1rem; padding: 0.9rem 1rem; text-align: center; white-space: nowrap; }
}
.l-row-wide { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }  /* текст сверху, снимок во всю ширину — чтобы цифры читались */
.l-row-wide .l-text { order: 0; }
.l-row-wide .l-text p { max-width: 46rem; }

/* юридические страницы: таблица реквизитов и длинные тексты */
.legal-body table.req { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1.5rem; }
.legal-body table.req th, .legal-body table.req td { text-align: left; vertical-align: top; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); }
.legal-body table.req th { width: 34%; font-weight: 500; color: var(--muted); }
.legal-body p { margin: 0.55rem 0; }
.legal-body ol, .legal-body ul { padding-left: 1.4rem; }
.legal-body a { overflow-wrap: anywhere; }
@media (max-width: 600px) { .legal-body table.req th, .legal-body table.req td { display: block; width: auto; padding: 0.2rem 0; border: 0; }
  .legal-body table.req tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--line); } .legal { padding: 1.25rem; } }
.l-row picture { display: block; min-width: 0; }  /* сжатые снимки (WebP) — как прежние картинки в сетке */

/* вход по коду на почту */
.auth-form { width: 100%; max-width: 22rem; margin-top: 0.5rem; }
.auth-form input { width: 100%; box-sizing: border-box; }
.code-input { font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-alt { margin: 0.75rem 0 0; }
.auth-alt .link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
