/* Сайт «Сухарик»: общий вид. Версия 3 (22.10.2026): боковое меню, раздел «Прибыль WB».
   Версия 4 (22.10.2026): раздел «Финансы» — фильтры, строка показателей, окно периода, подсказки на графиках. */
/* Шрифт Onest (лицензия SIL OFL 1.1, fonts/OFL-Onest.txt) — свой, без обращений к внешним сайтам */
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/onest-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 500; src: url(fonts/onest-cyrillic-500-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 600; src: url(fonts/onest-cyrillic-600-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/onest-cyrillic-700-normal.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/onest-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 500; src: url(fonts/onest-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 600; src: url(fonts/onest-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/onest-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 400; src: url(fonts/onest-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 500; src: url(fonts/onest-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 600; src: url(fonts/onest-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-display: swap; font-weight: 700; src: url(fonts/onest-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+A720-A7FF; }

:root {
  --bg: #F3F5F7;
  --panel: #FFFFFF;
  --ink: #141C26;
  --ink-2: #3D4855;
  --muted: #5B6675;
  --line: #E3E8EE;
  --line-soft: #EEF1F4;
  --line-strong: #D3DAE2;
  --accent: #0F7B63;          /* прибыль, активные элементы */
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F2EC;
  --link: #0F6B57;
  --side: #121923;
  --side-2: #1F2B39;
  --side-ink: #C9D2DC;
  --side-muted: #8D9AA9;
  --c-sales: #2E6DA4;          /* продажи */
  --c-sales-soft: #B9CDE2;
  --c-wb: #9FB0C3;             /* удержания WB */
  --c-sub: #22507A;            /* перечислит WB */
  --c-own: #C9822B;            /* себестоимость товара */
  --c-ff: #E7BC7C;             /* фулфилмент */
  --warn: #8A5A0B;
  --warn-soft: #FFF3DC;
  --bad: #B4531F;
  --bad-soft: #FBEBE2;
  --ok: #0F6B57;
  --ok-soft: #E3F2EC;
  --model: #F5F7F9;
  --radius: 12px;
  --font: 'Onest', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--link); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

/* ===== Оболочка: боковое меню + страница ===== */
body.app { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; }
.side { flex: 1 1 210px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; gap: 20px; padding: 22px 16px; }
.side-brand { padding: 0 8px; }
.side-brand .b1 { font-size: 20px; font-weight: 700; color: #fff; letter-spacing: .2px; }
.side-brand .b2 { font-size: 12px; color: var(--side-muted); }
.side-client { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; font-size: 11.5px; color: var(--side-muted); text-transform: uppercase; letter-spacing: .6px; }
.side-client select { height: 36px; border-radius: 8px; border: 1px solid #2B3746; background: #1A2430; color: #fff; padding: 0 10px; font-size: 14px; text-transform: none; letter-spacing: 0; }
.side-client-ro { padding: 8px 10px; margin: 0 8px; border: 1px solid #2B3746; border-radius: 8px; color: #fff; font-size: 14px; }
.side-nav { display: flex; flex-direction: column; gap: 16px; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-h { font-size: 11.5px; color: var(--side-muted); text-transform: uppercase; letter-spacing: .6px; padding: 0 8px 6px; }
.side-nav a[data-view] { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 8px; color: var(--side-ink); text-decoration: none; font-size: 14.5px; }
.side-nav a[data-view]:hover { background: #18222E; color: #fff; }
.side-nav a[data-view].on { background: var(--side-2); color: #fff; font-weight: 600; }
/* Значки групп и панели вкладок (версия 19): на узком экране значков нет, вкладки — как раньше, списком */
.side-ico, .side-brand .b0 { display: none; }
.fly-in { display: flex; flex-direction: column; gap: 2px; }
.side-user .side-fly { flex: 1 1 auto; min-width: 0; }
.side-sub { display: flex; flex-direction: column; gap: 2px; padding-left: 38px; }
.side-sub a { min-height: 34px; display: flex; align-items: center; padding-left: 10px; color: #A9B5C2; text-decoration: none; font-size: 13.5px; border-left: 2px solid #2B3746; }
.side-sub a:hover { color: #fff; }
.side-sub a.on { color: #fff; border-left-color: var(--accent); }
.side-user { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 8px 0; border-top: 1px solid #243040; }
.side-ava { width: 34px; height: 34px; border-radius: 50%; background: #243040; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.side-who { min-width: 0; color: #fff; font-size: 13.5px; }
.side-role { color: var(--side-muted); font-size: 12px; }
.side-actions { display: flex; gap: 4px; width: 100%; }
.btn.link.side-btn { color: #A9B5C2; padding: 0 6px; height: 32px; font-size: 12.5px; }
.btn.link.side-btn:hover { color: #fff; }
.page { flex: 999 1 560px; min-width: 0; padding: 24px 28px 56px; }
.page > section { max-width: 1400px; }
.page > #viewFin { max-width: none; }          /* «Финансы» — во всю ширину: карточки до «Прибыли» в одну строку */

/* Широкий экран: меню — узкая неподвижная полоса со значками; при наведении (или фокусе) на значок — панель вкладок группы */
@media (min-width: 901px) {
  body.app { flex-wrap: nowrap; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: 64px; flex: none; box-sizing: border-box;
    padding: 14px 10px; gap: 10px; align-items: center; overflow: visible; }
  .page { margin-left: 64px; }
  .side-brand { padding: 0; margin-bottom: 6px; }
  .side-brand .b0 { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--coral); color: #fff; font-size: 20px; font-weight: 700; }
  .side-brand .b1, .side-brand .b2 { display: none; }
  .side-nav { gap: 6px; align-items: center; }
  .side-group { position: relative; align-items: center; }
  .side-ico { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 12px;
    background: transparent; color: var(--side-ink); cursor: pointer; }
  .side-group:hover > .side-ico, .side-group:focus-within > .side-ico { background: #18222E; color: #fff; }
  .side-group:has(a.on) > .side-ico { background: var(--side-2); color: #fff; }
  .side-fly { display: none; position: absolute; left: 100%; top: 0; padding-left: 12px; z-index: 61; }   /* отступ — «мостик» для мыши */
  .side-group:hover > .side-fly, .side-group:focus-within > .side-fly { display: block; }
  .fly-in { min-width: 220px; padding: 10px; border-radius: 14px; background: var(--side); box-shadow: 0 12px 32px rgba(10, 16, 24, .35); }
  .fly-in .side-h { padding: 4px 10px 8px; }
  .side-client { padding: 4px 4px 2px; }
  .side-user { margin-top: auto; padding: 10px 0 0; border-top: 1px solid #243040; flex-direction: column; flex-wrap: nowrap; }
  .side-user .side-fly { top: auto; bottom: 0; }
  .side-user .fly-in { gap: 8px; }
  .side-ava.side-ico { width: 38px; height: 38px; border-radius: 50%; background: #243040; color: #fff; font-weight: 600; font-size: 14px; }
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 14px; }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.2px; margin: 0 0 4px; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.sync { margin: 0; font-size: 13px; color: var(--muted); }
.sync .bad { color: var(--bad); }
.seg { display: flex; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 3px; }
.seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 13.5px; }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
.seg.light { background: #EEF1F4; border-color: transparent; }
.seg.light button { min-height: 32px; font-size: 13px; }
.seg.light button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(20, 28, 38, .12); }
.tool-sel { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 12px; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; }
.tool-sel select { height: 34px; border: 0; background: transparent; font-size: 14px; color: var(--ink); }
.tool-dates { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.tool-dates input { height: 40px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 10px; background: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); margin-bottom: 16px; }
.tabs a { min-height: 42px; display: flex; align-items: center; padding: 0 14px; font-size: 14.5px; color: var(--muted); text-decoration: none; }
.tabs a.on { color: var(--ink); font-weight: 600; border-bottom: 2px solid var(--accent); margin-bottom: -1px; }

/* ===== Себестоимость ===== */
.cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; text-align: left; }
.card:hover { border-color: var(--line-strong); }
.card .v { font-size: 22px; font-weight: 700; }
.card .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card.bad .v { color: var(--bad); }
.card.warn .v { color: #B7791F; }
.card.ok .v { color: var(--ok); }
.card.sel { outline: 2px solid var(--accent); outline-offset: -1px; }

.toolbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; padding: 10px 0; background: var(--bg); }
.toolbar input[type=search] { width: 320px; }
.toolbar input, .toolbar select { height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { background: #F8FAFB; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.link { border-color: transparent; background: transparent; color: var(--link); padding: 0 6px; }
.btn.link:hover { text-decoration: underline; }
.btn.danger { color: var(--bad); }
.btn[disabled], .btn.off { opacity: .45; pointer-events: none; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; min-height: 17px; }

.grid-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; }
.grid { width: 100%; border-collapse: collapse; }
#grid { table-layout: fixed; }
#grid .c-name { width: 27%; } #grid .c-key { width: 15%; } #grid .c-nm { width: 11%; } #grid .c-cost { width: 13%; }
#grid .c-from { width: 12%; } #grid .c-sold { width: 10%; } #grid .c-act { width: 12%; }
#grid.has-ff .c-name { width: 20%; } #grid.has-ff .c-key { width: 13%; } #grid.has-ff .c-nm { width: 9%; }
#grid.has-ff .c-cost, #grid.has-ff .c-ff, #grid.has-ff .c-total { width: 9%; }
#grid.has-ff .c-from { width: 10%; } #grid.has-ff .c-sold { width: 8%; } #grid.has-ff .c-act { width: 13%; }
#grid td.c-name, #grid td.c-key { overflow: hidden; text-overflow: ellipsis; }
#grid th { white-space: normal; vertical-align: bottom; }
.grid th { position: sticky; top: 56px; z-index: 3; background: #F8FAFB; text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted);
  padding: 9px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.grid td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.grid.small th { position: static; }
.grid.small td, .grid.small th { padding: 5px 8px; font-size: 12.5px; }
.c-cost, .c-ff, .c-total, .c-sold, td.num { text-align: right; }
th.c-cost, th.c-ff, th.c-total, th.c-sold { text-align: right; }
.c-total b { font-weight: 600; }
.cost-cell.quiet-ff { color: #8A94A3; }
.c-key, .c-nm { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12.5px; color: var(--ink-2); }
.c-act { width: 1%; white-space: nowrap; text-align: right; }
.c-from { white-space: nowrap; }
tr.model td { background: var(--model); font-weight: 600; border-bottom-color: var(--line); }
tr.model td .meta { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 8px; }
tr.model .sum { font-weight: 500; }
#grid.has-ff tr.model td.sum { white-space: nowrap; font-size: 12.5px; }
tr.size td.c-name { padding-left: 26px; }
tr.size:hover td { background: #FBFCFD; }
.cost-cell { cursor: pointer; border-radius: 4px; padding: 2px 6px; margin: -2px -6px; display: inline-block; min-width: 70px; }
.cost-cell:hover { background: var(--accent-soft); }
.cost-cell.none { color: var(--bad); font-weight: 500; }
.cost-cell.none.quiet { color: #8A94A3; font-weight: 400; }
.ro .cost-cell { cursor: default; }
.ro .cost-cell:hover { background: transparent; }
.next { display: block; font-size: 11.5px; color: #B7791F; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; font-weight: 500; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.sold-0 { color: #8A94A3; }

tr.size.editing td { background: var(--accent-soft); border-bottom-color: transparent; }
tr.edit td { background: var(--accent-soft); padding: 4px 10px 10px; }
.editor { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.editor label { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.editor input { height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; background: #fff; }
.editor input.cost { width: 110px; text-align: right; }
.editor input.ff { width: 100px; text-align: right; }
.editor input.date { width: 150px; }
.editor .note { font-size: 12px; color: var(--muted); margin-right: auto; padding-left: 16px; }
.editor .sum-preview { font-size: 12.5px; font-weight: 600; min-width: 110px; }
.chk { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.dlg-body .chk { margin: -2px 0 8px; }

.empty { padding: 40px; text-align: center; color: var(--muted); }

.unmatched { margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.unmatched summary { cursor: pointer; font-weight: 600; }
.unmatched summary .bad { color: var(--bad); }
.unmatched p { font-size: 12.5px; }

/* ===== Окна ===== */
.dlg { border: 0; border-radius: 12px; padding: 0; width: min(760px, 94vw); box-shadow: 0 20px 50px rgba(16, 24, 40, .25); font-family: var(--font); }
.dlg.narrow { width: min(440px, 94vw); }
.dlg.wide { width: min(1080px, 96vw); }
.dlg::backdrop { background: rgba(16, 24, 40, .45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { margin: 0; font-size: 16px; }
.dlg-body { padding: 14px 18px; max-height: 70vh; overflow: auto; }
.dlg-body h3 { font-size: 13.5px; margin: 18px 0 6px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.x { border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); min-width: 32px; min-height: 32px; }
.field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 12.5px; color: var(--ink-2); }
.field input { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font-size: 14px; color: var(--ink); }
.field select { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font-size: 14px; background: #fff; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.stat { padding: 6px 10px; border-radius: 6px; background: var(--model); font-size: 12.5px; }
.stat b { font-size: 14px; margin-right: 4px; }
.stat.new { background: var(--ok-soft); }
.stat.replace { background: var(--warn-soft); }
.stat.err { background: var(--bad-soft); }
tr.k-same td { color: #8A94A3; }
tr.k-replace td.kind { color: #B7791F; }
tr.k-new td.kind { color: var(--ok); }
.err-row td { color: var(--bad); }
.date-inline { height: 28px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: 420px; padding: 10px 14px; border-radius: 10px; background: var(--side); color: #fff;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .3); z-index: 50; }
.toast.bad { background: var(--bad); }

/* ===== Пользователи ===== */
.users-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.grid.users th { position: static; }
.grid.users td { padding: 9px 10px; }
.pass-row { display: flex; gap: 8px; align-items: center; }
.pass-row input { flex: 1; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }

/* ===== Страница входа ===== */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--side); }
.login-box { width: min(380px, 92vw); padding: 0; margin: 0; }
.login-brand { color: #E9EDF3; font-weight: 700; font-size: 22px; text-align: center; margin-bottom: 16px; letter-spacing: .2px; }
.login-card { background: var(--panel); border-radius: 12px; padding: 22px 22px 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.login-card h1 { font-size: 18px; margin: 0 0 8px; }
.login-err { color: var(--bad); background: var(--bad-soft); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
#loadErr { background: transparent; color: #FFB4AB; text-align: center; }
.btn.wide { width: 100%; justify-content: center; height: 40px; margin: 6px 0 10px; }

/* ===== Прибыль WB ===== */
.pf-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; background: #FFF7E8; border: 1px solid #F1D9A8; border-radius: 12px;
  padding: 12px 16px; font-size: 13.5px; color: #5A4310; margin-bottom: 16px; }
.pf-note .t { flex: 1 1 420px; }
.pf-note a { font-weight: 600; text-decoration: none; }
.pf-note .sub { flex-basis: 100%; font-size: 12.5px; color: #6B5320; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.kpi .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kpi .lbl { font-size: 13.5px; color: var(--muted); }
.kpi .val { display: flex; align-items: baseline; gap: 6px; }
.kpi .val b { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.kpi .val span { font-size: 13px; color: var(--muted); }
.kpi .bot { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi svg { display: block; }
.kpi.acc { background: var(--accent); border-color: var(--accent); color: #fff; }
.kpi.acc .lbl, .kpi.acc .val span, .kpi.acc .sub { color: rgba(255, 255, 255, .9); }
.kpi.loss { background: var(--bad); border-color: var(--bad); }
.chip { font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.chip.up { background: var(--ok-soft); color: var(--ok); }
.chip.down { background: var(--bad-soft); color: #A1471A; }
.chip.flat { background: #EEF1F4; color: var(--ink-2); }
.kpi.acc .chip { background: rgba(255, 255, 255, .18); color: #fff; }

.box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.box h2 { margin: 0; font-size: 18px; font-weight: 700; }
.box-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.row2 { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.row2 > .box { flex: 1 1 420px; }
.row2 > .box.wide { flex: 2 1 560px; }
.foot-note { font-size: 12.5px; color: var(--muted); }

.fall-wrap { overflow-x: auto; }
.fall { min-width: 760px; display: flex; flex-direction: column; }
.fall .fr { display: grid; grid-template-columns: 240px minmax(0, 1fr) 140px 80px 92px; gap: 16px; align-items: center; padding: 4px 0; font-size: 14px; }
.fall .fr.head { font-size: 12px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.fall .fr.sum { border-top: 1px solid var(--line); margin-top: 2px; padding-top: 8px; font-weight: 700; }
.fall .lbl.ind { padding-left: 14px; color: var(--ink-2); }
.fall .r { text-align: right; }
.fall .m { text-align: right; color: var(--muted); }
.fall svg { display: block; width: 100%; height: 26px; }
.d-bad { color: var(--bad); }
.d-good { color: var(--ok); }
.d-flat { color: var(--muted); }

.chart-wrap { overflow-x: auto; }
.chart svg { display: block; }
.chart text { font-family: var(--font); }

.struct-bar svg { display: block; width: 100%; height: 22px; border-radius: 6px; }
.struct-list .it { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 60px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.struct-list .it .dot { width: 12px; height: 12px; border-radius: 3px; }
.struct-list .it .p { text-align: right; font-weight: 600; }

.tops .it { display: grid; grid-template-columns: minmax(0, 1fr) 110px 120px 64px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.tops .nm { display: flex; flex-direction: column; min-width: 0; }
.tops .nm span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tops .nm span + span { font-size: 12px; color: var(--muted); }
.tops .bar { height: 8px; background: #F0F3F6; border-radius: 4px; overflow: hidden; }
.tops .bar svg { display: block; width: 100%; height: 8px; }
.tops .pr { text-align: right; font-weight: 600; }
.tops .mg { text-align: right; color: var(--muted); }

/* «По товарам» */
.pt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; }
.pt-tools .search { flex: 1 1 240px; max-width: 340px; height: 40px; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px; padding: 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-size: 13.5px; }
.chips button .n { font-size: 12px; padding: 1px 7px; border-radius: 10px; background: #EEF1F4; color: var(--ink-2); }
.chips button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.chips button.on .n { background: rgba(255, 255, 255, .2); color: #fff; }
.pt-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.pt { min-width: 1126px; display: flex; flex-direction: column; font-size: 13.5px; }
/* столбцы: товар | продано | выручка, комиссия, логистика, реклама, прочее, себестоимость, налоги | прибыль | маржа | на 1 шт */
.pt .pr { display: grid; grid-template-columns: minmax(200px, 2fr) minmax(56px, .7fr) repeat(7, minmax(72px, 1fr)) minmax(84px, 1fr) minmax(92px, 1.1fr) minmax(66px, .8fr);
  gap: 8px; align-items: center; padding: 9px 18px; border-bottom: 1px solid var(--line-soft); }
.pt .pr > div:not(:first-child) { text-align: right; }
.pt .pr.head { background: #F8FAFB; border-bottom-color: var(--line); font-size: 12px; color: var(--muted); align-items: end; padding: 12px 18px; }
.pt .pr.head button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 0; text-align: right; }
.pt .pr.head button.on { color: var(--ink); font-weight: 600; }
.pt .pr.total { font-weight: 700; border-bottom-color: var(--line); }
.pt .pr.company { color: var(--ink-2); background: #FBFCFD; font-size: 13.5px; }
.pt .pr.size { padding: 7px 18px; background: #FAFBFC; font-size: 13.5px; }
.pt .pr.size > div:first-child { padding-left: 40px; }
.pt .nm { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pt .nm .t { display: flex; flex-direction: column; min-width: 0; }
.pt .nm .t span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt .nm .t span + span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt .tg { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.pt .tg svg { transition: transform .12s; }
.pt .tg[aria-expanded="true"] svg { transform: rotate(90deg); }
.pt .cs { display: flex; flex-direction: column; align-items: flex-end; }
.pt .cs small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pt .mg { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.pt .mg svg { display: block; }
.pt .nocost { font-size: 12.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 10px; padding: 3px 9px; text-decoration: none; white-space: nowrap; }
.pt .neg { color: var(--bad); }
.pt .muted { color: var(--muted); }

#pfBody.busy { opacity: .55; pointer-events: none; transition: opacity .15s; }
.legend i.lg-sales { background: #2E6DA4; }
.legend i.lg-sales-soft { background: #B9CDE2; }
.legend i.lg-wb { background: #9FB0C3; }
.legend i.lg-sub { background: #22507A; }
.legend i.lg-own { background: #C9822B; }
.legend i.lg-profit { background: var(--accent); }
.pt .cs small.warn-t { color: var(--warn); }
.pt .pr.company > .all { grid-column: 1 / -1; text-align: left; }
.pt-note { margin-top: 10px; }
.tops .box-head a { text-decoration: none; font-weight: 600; font-size: 13.5px; }
.tops .pr a.tag { text-decoration: none; }
.struct-list .it span:nth-child(3) { color: var(--ink-2); }

/* ===== Финансы: шапка с фильтрами ===== */
#viewFin { position: relative; }
.fin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 6px; }
.fin-head .page-title { flex: 1 1 auto; margin: 0 8px 0 0; }
/* первая строка: заголовок, «Фильтры», период, «Обзор / По товарам»; вторая — фильтры во всю ширину */
.fin-head #finMore { order: 1; }
.fin-head #finDate { order: 2; }
.fin-head .fin-view { order: 3; }
.fin-bar { order: 4; flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 5px; background: #E9EDF1; border-radius: 14px; }
.fin-chips { display: contents; }
.fin-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; max-width: 220px; padding: 0 7px 0 9px; border: 1px solid transparent;
  border-radius: 9px; background: #fff; color: var(--ink-2); font-size: 11.5px; cursor: pointer; }
.fin-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-chip svg { flex: none; color: var(--muted); }
.fin-chip:hover { border-color: var(--line-strong); }
.fin-chip.on { background: var(--accent-soft); color: var(--accent); border-color: #BFE0D4; font-weight: 600; }
.fin-chip[disabled] { opacity: .5; cursor: default; }
.fin-reset { margin-left: auto; min-height: 32px; padding: 0 10px; border: 0; background: transparent; color: var(--ink-2); font-size: 12.5px; cursor: pointer; }
.fin-reset:hover { color: var(--ink); text-decoration: underline; }
.fin-reset[disabled] { opacity: .4; cursor: default; text-decoration: none; }
.fin-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: #fff; color: var(--ink); font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.fin-btn:hover { background: #F8FAFB; }
.fin-btn.on { border-color: var(--accent); color: var(--accent); }
.fin-btn .n { font-size: 11.5px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; text-align: center; }
.fin-view { display: flex; padding: 4px; border-radius: 12px; background: #E9EDF1; }
.fin-view button { min-height: 34px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.fin-view button.on { background: var(--accent); color: #fff; font-weight: 600; }

/* всплывающие списки фильтров */
.fin-pop { position: absolute; z-index: 30; width: 320px; max-width: calc(100vw - 24px); padding: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 14px 40px rgba(16, 24, 40, .18); display: flex; flex-direction: column; gap: 8px; }
.fin-pop.more { width: 360px; }
.fin-pop.det { width: 420px; }
.pop-title { font-weight: 700; font-size: 14px; }
.pop-sec { display: flex; flex-direction: column; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.pop-search { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; }
.pop-acts { display: flex; gap: 12px; }
.pop-acts button { border: 0; background: transparent; padding: 0; color: var(--link); font-size: 12.5px; cursor: pointer; }
.pop-list { max-height: 280px; overflow: auto; display: flex; flex-direction: column; margin: 0 -4px; }
.pop-list .opt { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 6px 4px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.pop-list .opt:hover { background: #F5F7F9; }
.pop-list .opt input { margin: 0; accent-color: var(--accent); }
.pop-list .opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-list .opt small { grid-column: 2; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.det-list { display: flex; flex-direction: column; max-height: 340px; overflow: auto; }
.det-list .det { display: grid; grid-template-columns: minmax(0, 1fr) auto 56px; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.det-list .det small { text-align: right; color: var(--muted); }

/* строка показателей одной строкой: продажи − возвраты − комиссия = к перечислению − остальные расходы = на р/с − себестоимость − налоги = прибыль */
#viewFin { max-width: none; }
.eq-cap { font-size: 11.5px; color: var(--muted); margin: 0 0 5px; }
.eq { display: flex; flex-wrap: wrap; align-items: stretch; gap: 4px; margin-bottom: 14px; }
.eq-op { flex: 0 0 10px; align-self: center; text-align: center; font-size: 16px; color: #8A94A3; }
.eqc { flex: 1 1 128px; min-width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; }
.eqc.tint { background: #F7F9FB; }
.eqc .lbl { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eqc .lbl.has-hint { text-decoration: underline dotted rgba(91, 102, 117, .6); text-underline-offset: 3px; cursor: help; }
.eqc.acc .lbl.has-hint { text-decoration-color: rgba(255, 255, 255, .6); }
.eqc .val { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 4px; white-space: nowrap; }
.eqc .val b { font-size: 19px; font-weight: 600; letter-spacing: -.3px; line-height: 1.2; }
.eqc .val span { font-size: 11px; color: var(--muted); }
.eqc .subs { font-size: 11px; line-height: 1.35; color: var(--muted); }
.eqc .subs a { font-weight: 600; text-decoration: none; }
.eqc .dl { margin-top: auto; }
.eqc.acc { background: var(--accent); border-color: var(--accent); color: #fff; }
.eqc.acc.loss { background: var(--bad); border-color: var(--bad); }
.eqc.acc .lbl, .eqc.acc .val span, .eqc.acc .subs, .eqc.acc .abs { color: rgba(255, 255, 255, .9); }
.eqc.acc .chip { background: rgba(255, 255, 255, .2); color: #fff; }
.spark { position: relative; flex: 0 0 24px; height: 24px; margin: 2px 0; cursor: crosshair; }
.spark svg { display: block; height: 100%; }
.spark .dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2px solid var(--c-sales); box-sizing: border-box; pointer-events: none; }
.eqc.acc .spark .dot { border-color: #fff; background: var(--accent); }
.dl { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.dl .chip, .eqs .chip, .eqx-head .chip { font-size: 11px; padding: 1px 6px; }
.dl .abs { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.eqx { flex: 3 1 390px; min-width: 0; background: #F7F9FB; border: 1px solid var(--line); border-radius: 12px; padding: 7px 8px 8px; display: flex; flex-direction: column; gap: 5px; }
.eqx-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 0 2px; }
.eqx-head .lbl { font-size: 12px; color: var(--muted); margin-right: auto; }
.eqx-head b { font-size: 16px; font-weight: 600; }
.eqx-head b small { font-size: 11px; font-weight: 400; color: var(--muted); }
.eqx-head .p { font-size: 10.5px; color: var(--muted); }
.eqx-grid { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.eqs { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 5px 8px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.eqs .lbl { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eqs .more-l { display: inline-flex; align-items: center; gap: 1px; max-width: 100%; align-self: flex-start; padding: 0; border: 0; background: transparent;
  text-align: left; font: inherit; font-size: 11.5px; color: var(--link); cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.eqs .more-l:hover { color: var(--accent); text-decoration-style: solid; }
.eqs .more-l svg { flex: none; }
.eqs .v { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.eqs .v b { font-size: 14px; color: var(--ink); font-weight: 600; }
.eqs .p { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.pf-note.info { background: #EEF4FA; border-color: #CFDCEA; color: #23415F; }
.fin-foot { margin-top: 14px; }

/* подсказка у курсора */
.fin-tip { position: fixed; z-index: 60; min-width: 170px; max-width: 280px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .16); pointer-events: none; font-size: 12.5px; }
.fin-tip .tt { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.fin-tip .tr { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; color: var(--muted); }
.fin-tip .tr b { color: var(--ink); font-weight: 600; white-space: nowrap; }
#pfChart g.slot.on rect.hit { fill: rgba(20, 28, 38, .05); }

/* ABC */
.abc { display: inline-block; min-width: 16px; margin-right: 6px; padding: 0 4px; border-radius: 4px; font-style: normal; font-size: 10.5px; font-weight: 700; text-align: center; }
.abc-A { background: var(--accent-soft); color: var(--accent); }
.abc-B { background: var(--warn-soft); color: var(--warn); }
.abc-C { background: #EEF1F4; color: var(--muted); }

/* окно «Период отчёта» */
.dlg.period { width: min(600px, 96vw); border-radius: 16px; }
.per-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 8px; }
.per-head h2 { margin: 0; font-size: 20px; }
.x.round { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 20px; }
.per-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; padding: 6px 20px 14px; }
.per-presets { display: flex; flex-direction: column; gap: 2px; }
.per-h { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 8px 4px; }
.per-presets button { text-align: left; min-height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13.5px; cursor: pointer; }
.per-presets button:hover { background: #F3F5F7; }
.per-presets button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cal-arr { width: 30px; height: 30px; border-radius: 50%; border: 0; background: #EEF1F4; color: var(--ink-2); font-size: 18px; cursor: pointer; }
.cal-arr[disabled] { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 11.5px; color: var(--muted); padding: 4px 0; }
.cal-d { height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13.5px; cursor: pointer; }
.cal-d:hover { background: #F3F5F7; }
.cal-d.in { background: var(--accent-soft); }
.cal-d.end { background: var(--accent); color: #fff; font-weight: 600; }
.cal-d.today { box-shadow: inset 0 0 0 1px var(--accent); }
.cal-d[disabled] { color: #B8C0CA; cursor: default; background: transparent; }
.per-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.per-err { color: var(--bad); font-size: 12.5px; margin: 4px 0 0; }
.per-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.per-cmp { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.per-foot .spacer { flex: 1 1 auto; }
.per-cmp select { height: 36px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: #fff; }
.per-cmp .q { width: 18px; height: 18px; border-radius: 50%; background: #EEF1F4; color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; cursor: help; }

/* ===== Справочник → Налоги ===== */
.tax-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 14px; }
.tax-l { font-size: 12.5px; color: var(--muted); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 8px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: #fff; color: var(--accent); cursor: pointer; }
.icon-btn:hover { background: #F8FAFB; }
.icon-btn.sm { min-width: 32px; height: 32px; border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn.sm:hover { background: #EEF1F4; color: var(--ink); }
.icon-btn.del:hover { color: var(--bad); }
.icon-btn.del.arm { color: #fff; background: var(--bad); font-size: 12px; font-weight: 600; }
.combo { position: relative; min-width: 260px; }
.combo.wide { min-width: 0; width: 100%; }
.combo-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong);
  border-radius: 10px; background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; text-align: left; }
.combo-btn[aria-expanded="true"] { border-color: var(--accent); }
.combo-btn[disabled] { background: #F5F7F9; cursor: default; }
.combo-btn .cv { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp { color: #8A94A3; font-size: .9em; }
.combo-pop { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); min-width: 240px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(16, 24, 40, .16); padding: 6px; }
.combo-search { display: flex; align-items: center; gap: 6px; padding: 0 8px; border-bottom: 1px solid var(--line-soft); color: var(--muted); }
.combo-search input { flex: 1; min-width: 0; height: 34px; border: 0; outline: none; font-size: 14px; background: transparent; }
.combo-search input::-webkit-search-cancel-button { display: none; }
.combo-x { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.combo-list { max-height: 240px; overflow: auto; padding-top: 4px; display: flex; flex-direction: column; }
.combo-list button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 7px; font-size: 14px; cursor: pointer; color: var(--ink); }
.combo-list button:hover { background: #F3F5F7; }
.combo-list button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.grid.tax-grid th { position: static; }
.grid.tax-grid td { padding: 9px 10px; }
.grid.tax-grid .num { text-align: right; }
.nowrap { white-space: nowrap; }
.tax-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.tax-note { margin-top: 12px; }
#taxMissing { margin-bottom: 12px; }

@media (max-width: 700px) {
  /* «Из продаж — в прибыль» на телефоне: статья, сумма, доля */
  .fall { min-width: 0; }
  .fall .fr { grid-template-columns: minmax(0, 1fr) auto 52px; gap: 10px; }
  .fall .fr > svg, .fall .fr > :nth-child(2), .fall .fr > :nth-child(5) { display: none; }
  .kpi .val b { font-size: 24px; }
  .eqx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .eq-op { flex-basis: 100%; height: 14px; line-height: 14px; font-size: 16px; }
  .per-body { grid-template-columns: 1fr; }
  .per-presets { flex-direction: row; flex-wrap: wrap; }
  .per-h { flex-basis: 100%; }
  .fin-bar { flex-basis: 100%; }
  .tax-3 { grid-template-columns: 1fr; }
  .combo { min-width: 0; flex: 1 1 200px; }
}
@media (max-width: 900px) {
  .grid.tax-grid { min-width: 760px; }
}
@media (max-width: 900px) {
  .page { padding: 14px 12px 40px; }
  .side { gap: 14px; padding: 14px 12px; }
  .side-user { margin-top: 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar { flex-wrap: wrap; position: static; }
  .toolbar input[type=search] { width: 100%; }
  .grid th { position: static; }
  .grid-wrap { overflow-x: auto; }
  #grid { min-width: 880px; }
  #grid.has-ff { min-width: 1060px; }
  .users-head { flex-direction: column; }
  .grid-wrap .grid.users { min-width: 820px; }
  .page-title { font-size: 22px; }
}
/* Версия 11: подтверждение вторым нажатием на кнопке (вместо окон браузера); предупреждение в предпросмотре загрузки */
.btn.link.arm { color: #fff; background: var(--bad); border-radius: 6px; padding: 2px 8px; text-decoration: none; }
.imp-warn { background: #FFF6E5; border: 1px solid #F1D39A; color: #6B4A12; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: 13px; line-height: 1.45; }
/* Версия 12: суммы полностью (без «тыс.» и «млн») — длинное число в карточке чуть мельче, чтобы «₽» оставался в строке */
.eqc .val b.l1 { font-size: 17px; letter-spacing: -.4px; }
.eqc .val b.l2 { font-size: 15px; letter-spacing: -.4px; }

/* Версия 15: кнопка «Свойства» — рядом с названием модели (артикула) */
.btn.link.props-btn { margin-left: 10px; padding: 0 2px; height: auto; font-size: 12px; vertical-align: baseline; }
tr.size .btn.link.props-btn { color: var(--muted); }
tr.size:hover .btn.link.props-btn, tr.size .btn.link.props-btn:focus-visible { color: var(--link); }

/* Версия 19: «Финансы» — верхний блок и «Динамика и структура затрат» по образцу пользователя (23.10.2026).
   Суммы — полностью, до рубля. Акцент (прибыль, выбранный шаг) — коралловый. */
:root { --coral: #E8735A; --coral-soft: #FCE7E1; }
.eq { gap: 6px; }
.eqc { border-radius: 14px; padding: 12px 12px 10px; gap: 3px; }
.eqc .lbl { font-size: 13px; }
.eqc .val b { font-size: 21px; font-weight: 500; }
.eqc .val b.l1 { font-size: 19px; }
.eqc .val b.l2 { font-size: 17px; }
.eqc .subs { font-size: 11.5px; }
.eqc .spark { flex-basis: 30px; height: 30px; margin: 6px 0 4px; }
.eqc.acc { background: var(--coral); border-color: var(--coral); }
.eqc.acc .spark .dot { background: var(--coral); }
.dl-cap { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.eqc.acc .dl-cap { color: rgba(255, 255, 255, .9); }
.eqx { background: #F4F6F8; border-radius: 14px; padding: 10px 10px 10px; gap: 8px; }
.eqx-head { align-items: center; gap: 4px 10px; padding: 0 4px; }
.eqx-head .lbl { font-size: 13px; }
.eqx-head b { font-size: 17px; }
.eqx-head .dl { flex-wrap: nowrap; }
.eqx-grid { gap: 6px; }
.eqs { border-radius: 10px; padding: 7px 9px; gap: 3px; }
.eqs-top, .eqs-mid { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.eqs-top .lbl { font-size: 12.5px; color: var(--ink-2); }
.eqs .v { font-size: 11px; }
.eqs .v b { font-size: 16px; font-weight: 500; }
.eqs .p { display: block; font-size: 10px; line-height: 1.2; text-align: right; color: var(--muted); white-space: nowrap; }
.eqs .dl { margin-top: 2px; }
/* Значок расшифровки в правом верхнем углу статьи («Штрафы», «Прочее») */
.eqs { position: relative; }
.eqs.has-more .eqs-top { padding-right: 20px; }
.more-i { position: absolute; top: 5px; right: 5px; display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%; background: #E9EEF2; color: var(--ink-2); cursor: pointer; }
.more-i:hover, .more-i:focus-visible { background: var(--coral); color: #fff; }
.eqx-grid.n7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* с «Кредитом WB» — семь статей: 4 + 3 */
.cost-box { margin-top: 14px; gap: 10px; }
.cost-box .box-head h2 { font-size: 18px; }
.seg.cost-seg { background: #EEF1F4; border-color: transparent; border-radius: 14px; }
.seg.cost-seg button { min-height: 34px; padding: 0 20px; border-radius: 11px; color: var(--ink-2); }
.seg.cost-seg button.on { background: var(--coral); color: #fff; }
.cost-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.cl-it { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent;
  color: var(--ink-2); font-size: 12.5px; font-family: inherit; cursor: pointer; }
.cl-it:hover { background: #F1F4F7; }
.cl-it.on { background: var(--coral-soft); border-color: #F2B8A8; color: var(--ink); }
.cost-row { display: flex; gap: 18px; align-items: center; }
.cost-chart { flex: 1 1 auto; min-width: 0; }
.cost-chart .chart g.slot.on rect.hit { fill: rgba(20, 28, 38, .04); }
.cost-side { flex: 0 0 auto; display: flex; align-items: center; gap: 18px; }
.cost-donut svg { display: block; }
.cost-donut .dn-seg { cursor: pointer; }
.cost-list { display: flex; flex-direction: column; gap: 2px; min-width: 210px; }
.cs-it { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; font-size: 12.5px; font-family: inherit; color: var(--ink-2); text-align: left; cursor: pointer; }
.cs-it:hover { background: #F1F4F7; }
.cs-it.on { background: var(--coral-soft); border-color: #F2B8A8; color: var(--ink); }
.cs-it b { font-weight: 600; color: var(--ink); }
/* Карточки «Финансов» до «Прибыли» — всегда одной строкой (от 1200 px): карточки и цифры сжимаются вместе с окном */
@media (min-width: 1200px) {
  .eq { flex-wrap: nowrap; gap: 3px; }
  .eq-op { flex: 0 0 10px; }
  .eqc { flex: 1 1 0; min-width: 0; padding: 12px 10px 10px; }
  .eqx { flex: 3.2 1 0; min-width: 0; }
  .eqc .val b, .eqc .val b.l1, .eqc .val b.l2 { font-size: clamp(12px, calc(1.6vw - 9px), 21px); letter-spacing: -.3px; }
  .eqs .v b { font-size: clamp(11px, calc(1.1vw - 5px), 16px); }
  .eqs { padding: 6px 7px; min-width: 0; }
  .eqx { flex-grow: 3.6; }
  .eqs-top .lbl { min-width: 0; }
  .eqs-mid { flex-wrap: wrap; row-gap: 0; }
}
@media (max-width: 1300px) {
  .cost-row { flex-direction: column; align-items: stretch; }
  .cost-side { justify-content: center; flex-wrap: wrap; }
}
/* Шапка «Финансов» по образцу: заголовок, фильтры в сером поле, «Фильтры», период, «Обзор / По товарам» — одной строкой.
   Все элементы одного формата: высота 40 px, шрифт 12.5 px, скругление 14 px, текст в одну строку.
   «Фильтры» скрывает строку фильтров (.nobar); если фильтры не помещаются целиком — строка уходит под кнопки (.wrap, finFit) */
.fin-head { flex-wrap: nowrap; gap: 6px; justify-content: flex-end; }
/* заголовок «Финансы» не показывается (место — фильтрам), но остаётся для экранных чтецов */
.fin-head .page-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fin-bar { order: 0; flex: 0 1 auto; min-width: 0; margin-right: auto; flex-wrap: nowrap; gap: 3px; min-height: 36px; padding: 3px; background: #E9EDF1; border-radius: 12px; box-sizing: border-box; }
.fin-chip { flex: 0 0 auto; max-width: none; min-height: 30px; gap: 3px; padding: 0 7px 0 9px; border: 0; border-radius: 9px; background: #fff; color: var(--ink-2);
  font-size: 11px; white-space: nowrap; box-shadow: 0 1px 2px rgba(20, 28, 38, .06); }
.fin-chip svg { width: 8px; height: 8px; }
.fin-chip:hover { background: #F8FAFB; border-color: transparent; }
.fin-chip.on { background: var(--coral-soft); color: #A4432C; font-weight: 600; }
.fin-chip[disabled] { opacity: .45; box-shadow: none; background: #F3F5F7; }
.fin-reset { flex: none; margin-left: 2px; min-height: 30px; padding: 0 8px; border-radius: 9px; font-size: 11px; white-space: nowrap; }
.fin-reset[disabled] { display: none; }                        /* нечего сбрасывать — кнопки нет, место для фильтров */
.fin-head #finMore, .fin-head #finDate { order: 1; }
.fin-head .fin-view { order: 2; }
.fin-btn { flex: none; min-height: 36px; padding: 0 11px; gap: 6px; border: 0; border-radius: 12px; font-size: 11px; white-space: nowrap; box-shadow: 0 1px 2px rgba(20, 28, 38, .08); }
.fin-btn svg { width: 12px; height: 12px; }
.fin-btn.on { color: #A4432C; background: var(--coral-soft); box-shadow: none; }
.fin-btn .n { background: var(--coral); }
.fin-view { flex: none; height: 36px; padding: 3px; border-radius: 12px; box-sizing: border-box; }
.fin-view button { min-height: 30px; padding: 0 12px; border-radius: 9px; font-size: 11px; white-space: nowrap; }
.fin-view button.on { background: var(--coral); }
.fin-head.nobar .fin-bar { display: none; }
.fin-head.wrap { flex-wrap: wrap; }
.fin-head.wrap .fin-bar { order: 3; flex: 1 1 100%; flex-wrap: wrap; }
