/* Учёт доставок и продаж.
   Оформление идёт от логотипа магазина: чёрный знак на белом, прямые углы.
   Цвета ячеек взяты из исходной таблицы Excel:
   жёлтая ячейка — вводит человек, зелёная — считается сама. */

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(fonts/golos-text-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(fonts/golos-text-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #111111;
  --navy: #000000;
  --navy-deep: #2e2e2e;
  --bg: #f1f1ef;
  --surface: #ffffff;
  --line: #d6d6d2;
  --muted: #62625d;
  --in-bg: #fff2cc;
  --in-soft: #fff9e6;
  --in-line: #e3c259;
  --in-text: #1a3fc4;
  --calc-bg: #e2efda;
  --calc-soft: #f1f7ee;
  --calc-line: #b5d3a6;
  --calc-text: #1f5c35;
  --red: #c0392b;
  --s1: #2a78d6;
  --s2: #eb6834;
  --s3: #1baf7a;
  --nav-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 650; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--in-text); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- каркас ---------- */

.shell { min-height: 100vh; min-height: 100dvh; }
.main { padding: 18px 14px calc(var(--nav-h) + var(--safe-b) + 28px); max-width: 1240px; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: stretch;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); border-top: 1px solid var(--line);
}
.nav-brand, .nav-user { display: none; }
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500;
}
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--navy); font-weight: 650; }
.nav a.on svg { stroke-width: 2.2; }

.ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sub { color: var(--muted); font-size: 14px; }
.sub .link { font-size: 14px; }

.msw { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.msw span { min-width: 124px; text-align: center; font-weight: 600; }
.ico {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 6px;
  font-size: 22px; line-height: 1; color: var(--navy);
}
.ico:disabled { color: var(--line); cursor: default; }

.cols { display: grid; gap: 16px; margin-top: 14px; grid-template-columns: minmax(0, 1fr); }
.cols > *, .two > * { min-width: 0; }
.block { margin-top: 22px; }
.block > h2 { margin-bottom: 8px; }

/* ---------- кнопки, ссылки, чипы ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; font-size: 16px; text-decoration: none; color: var(--ink);
}
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:active { background: var(--navy-deep); }
.btn-danger { color: var(--red); border-color: #e3b9b4; }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn-row .btn { flex: 1; }

.link { border: 0; background: none; padding: 0; color: var(--navy); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
.link.danger { color: var(--red); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 6px; margin: 0 -14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 40px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 550; white-space: nowrap;
}
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip.add { border-style: dashed; color: var(--navy); background: none; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 0; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--navy); }

/* ---------- форма ввода: столбик ячеек ---------- */

.entry { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px 14px; align-self: start; }
.entry-date { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px 8px; }
.datebox { position: relative; flex: 1; text-align: center; padding: 8px 4px; border-radius: 6px; cursor: pointer; }
.datebox b { display: block; font-size: 17px; font-weight: 650; }
.datebox small { color: var(--muted); font-size: 13px; }
.datebox input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.cells { display: grid; gap: 8px; }
.cell-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 54%); align-items: center; gap: 10px; }
.cell-row > span { font-weight: 550; line-height: 1.25; }
.cell-row > span small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.cell {
  height: 50px; width: 100%; border-radius: 4px; border: 1px solid var(--in-line); background: var(--in-bg);
  color: var(--in-text); font-size: 20px; font-weight: 600; text-align: right; padding: 0 14px; min-width: 0;
}
.cell::placeholder { color: #a9a27e; font-weight: 500; }
.cell:focus { outline: 2px solid var(--in-text); outline-offset: 1px; background: #fff7dc; }
.cell.text { text-align: left; font-size: 17px; font-weight: 500; color: var(--ink); }
select.cell { appearance: auto; }
.stepper { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; }
.stepper .cell { text-align: center; border-radius: 0; border-left: 0; border-right: 0; padding: 0 4px; }
.stepper button {
  height: 50px; border: 1px solid var(--in-line); background: var(--in-bg); color: var(--in-text);
  font-size: 24px; font-weight: 500; line-height: 1;
}
.stepper button:first-child { border-radius: 4px 0 0 4px; }
.stepper button:last-child { border-radius: 0 4px 4px 0; }
.stepper button:active { background: #f6e3a4; }
.calc {
  height: 50px; display: flex; align-items: center; justify-content: flex-end; padding: 0 14px;
  border-radius: 4px; border: 1px solid var(--calc-line); background: var(--calc-bg);
  color: var(--calc-text); font-size: 20px; font-weight: 650;
}
.cells .btn { margin-top: 6px; }
.entry-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.legend { margin-top: 12px; color: var(--muted); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; border: 1px solid var(--in-line); background: var(--in-bg); }
.legend i.g { border-color: var(--calc-line); background: var(--calc-bg); }
.hint { color: var(--muted); font-size: 13.5px; margin-top: 10px; }

/* ---------- таблица-ведомость ---------- */

.ledger-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger th {
  background: var(--navy); color: #fff; font-weight: 600; font-size: 11.5px; line-height: 1.2;
  padding: 8px 4px; text-align: right; vertical-align: bottom; hyphens: manual;
}
.ledger th:first-child, .ledger td:first-child { text-align: left; padding-left: 8px; }
.ledger td { padding: 10px 4px; text-align: right; border-top: 1px solid #e9e9e6; white-space: nowrap; }
.ledger th:last-child, .ledger td:last-child { padding-right: 8px; }
.ledger td.in { background: var(--in-soft); color: var(--in-text); font-weight: 550; }
.ledger td.calc-c { background: var(--calc-soft); color: var(--calc-text); font-weight: 600; }
.cols .ledger tbody tr[data-day], .ledger tbody tr[data-store] { cursor: pointer; }
.ledger tbody tr.sel td { box-shadow: inset 0 2px 0 var(--navy), inset 0 -2px 0 var(--navy); }
.ledger tbody tr.sel td:first-child { box-shadow: inset 2px 2px 0 var(--navy), inset 0 -2px 0 var(--navy); }
.ledger tbody tr.sel td:last-child { box-shadow: inset -2px 2px 0 var(--navy), inset 0 -2px 0 var(--navy); }
.ledger tfoot td:first-child { white-space: normal; line-height: 1.2; }
.ledger tfoot td { font-weight: 700; border-top: 2px solid var(--navy); background: var(--surface); }
.ledger tfoot tr + tr td { border-top: 1px solid #e9e9e6; font-weight: 600; color: var(--muted); }
.ledger .d b { font-weight: 650; }
.ledger .d span { color: var(--muted); margin-left: 3px; }
.ledger .d .full { display: none; }
.ledger td.was { box-shadow: inset 0 0 0 2px var(--red); }
.ledger tr.gone td { text-decoration: line-through; text-decoration-color: var(--red); }
@media (max-width: 619px) {
  .ledger { font-size: 12.5px; }
  .ledger th, .ledger td { padding-left: 3px; padding-right: 3px; }
  .ledger th:first-child, .ledger td:first-child { padding-left: 7px; }
  .ledger th:last-child, .ledger td:last-child { padding-right: 7px; }
  .ledger .d span { margin-left: 2px; }
}
@media (max-width: 380px) {
  .ledger { font-size: 11.5px; }
  .ledger th { font-size: 10.5px; }
  .ledger th, .ledger td { padding-left: 2px; padding-right: 2px; }
  .ledger th:first-child, .ledger td:first-child { padding-left: 6px; }
  .ledger th:last-child, .ledger td:last-child { padding-right: 6px; }
}
.ledger .xw { display: none; }
.ledger .xs { display: block; font-size: 11px; font-weight: 500; color: #9a4a41; line-height: 1.2; }
.empty { padding: 26px 16px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }

/* ---------- сводка ---------- */

.sum { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sum div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 14px; border-top: 1px solid #e9e9e6; }
.sum div:first-child { border-top: 0; }
.sum div span { color: var(--muted); }
.sum div b { font-size: 17px; font-weight: 650; white-space: nowrap; }
.sum div.g { background: var(--calc-soft); }
.sum div.g b { color: var(--calc-text); }

/* ---------- журнал ---------- */

.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.filters .ctl { height: 44px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; min-width: 0; width: 100%; }
.filters .ctl.wide { grid-column: 1 / -1; }
.filters .datef { display: flex; align-items: center; gap: 8px; }
.filters .datef span { color: var(--muted); white-space: nowrap; }
.filters .datef input { flex: 1; min-width: 0; border: 0; background: none; height: 40px; }
.day-h { margin: 18px 0 6px; font-weight: 650; color: var(--muted); font-size: 13.5px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.item { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px 8px; padding: 11px 14px; border-top: 1px solid #e9e9e6; }
.item:first-child { border-top: 0; }
.item time { color: var(--muted); font-size: 13.5px; padding-top: 1px; }
.item .who { font-weight: 650; }
.item .what { color: var(--ink); }
.item .diff { color: var(--muted); font-size: 14px; }
.item .diff s { color: var(--red); text-decoration-thickness: 1px; }
.item .diff b { color: var(--calc-text); font-weight: 600; }
.item .note { font-size: 13px; color: var(--navy); font-weight: 550; }
.item.plain { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.item.plain small { color: var(--muted); display: block; }
.item.tap { cursor: pointer; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: var(--bg); color: var(--muted); margin-left: 6px; }
.tag.red { background: #f8e3e0; color: var(--red); }
.more-btn { margin-top: 12px; }
.notice { background: var(--in-soft); border: 1px solid var(--in-line); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.notice b { font-weight: 650; }
.notice .btn { margin-top: 10px; height: 44px; }

/* ---------- модальное окно и уведомление ---------- */

.modal-back { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
.modal {
  width: 100%; max-height: 90vh; max-height: 90dvh; overflow: auto; background: var(--surface);
  border-radius: 12px 12px 0 0; padding: 18px 16px calc(18px + var(--safe-b));
  animation: sheet .18s ease-out;
}
.modal h2 { font-size: 19px; margin-bottom: 12px; padding-right: 44px; }
.modal .x { position: absolute; }
.modal-head { position: relative; }
.modal-head .ico { position: absolute; right: -8px; top: -10px; color: var(--muted); }
.modal p { margin-bottom: 10px; }
.modal .list { margin: 10px 0; }
@keyframes sheet { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.toast {
  position: fixed; left: 14px; right: 14px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px); z-index: 50;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; font-weight: 500;
  animation: sheet .18s ease-out;
}
.toast.err { background: var(--red); }
.toast button { border: 0; background: none; color: #ffe48f; font-weight: 700; padding: 4px 0; }

/* ---------- вход и установка ---------- */

.auth { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card.wide { max-width: 480px; }
.auth-mark { width: 52px; height: 52px; margin-bottom: 18px; display: block; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .sub { margin-bottom: 20px; }
.auth-card .cells { gap: 12px; }
.auth-card h2 { margin: 18px 0 2px; }
.field { display: grid; gap: 5px; }
.field > span { font-weight: 550; font-size: 14px; }
.field > small { color: var(--muted); font-size: 12.5px; }
.err { background: #f8e3e0; color: #8f271c; border-radius: 6px; padding: 10px 14px; font-weight: 500; }
.ok { background: var(--calc-bg); color: var(--calc-text); border-radius: 6px; padding: 10px 14px; font-weight: 500; }
details.adv { margin-top: 4px; }
details.adv summary { cursor: pointer; color: var(--navy); font-weight: 600; padding: 6px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
pre.code { background: var(--ink); color: #e9eef5; padding: 12px; border-radius: 6px; overflow: auto; font-size: 12.5px; }

/* ---------- компьютер ---------- */

@media (min-width: 620px) {
  .ledger { font-size: 15px; }
  .ledger th { font-size: 13px; padding: 10px 9px; }
  .ledger td { padding: 11px 9px; }
  .ledger .d .full { display: inline; }
  .ledger .d .short { display: none; }
  .filters { grid-template-columns: repeat(3, minmax(0, 220px)); }
  .filters .ctl.wide { grid-column: auto; }
  .modal-back { align-items: center; padding: 24px; }
  .modal { max-width: 480px; border-radius: 10px; padding: 22px; }
  .toast { left: auto; right: 24px; bottom: 24px; max-width: 420px; }
}

@media (min-width: 980px) {
  .shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); }
  .main { padding: 28px 32px 48px; }
  .nav {
    position: sticky; top: 0; bottom: auto; height: 100vh; flex-direction: column; align-items: stretch;
    border-top: 0; border-right: 1px solid var(--line); padding: 22px 12px 16px; gap: 2px;
  }
  .nav-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; font-weight: 700; font-size: 18px; }
  .nav-brand svg { width: 30px; height: 30px; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 10px; border-radius: 6px; font-size: 15px; }
  .nav a.on { background: var(--bg); }
  .nav-user { display: block; margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
  .nav-user b { display: block; font-weight: 650; }
  .nav-user span { color: var(--muted); }
  h1 { font-size: 28px; }
  .cols .entry { max-width: 520px; }
  .chips { flex-wrap: wrap; overflow: visible; }
  .btn { height: 46px; }

  .narrow { max-width: 720px; }
}

@media (prefers-reduced-motion: reduce) {
  .modal, .toast { animation: none; }
}

/* ---------- логотип: шапка, меню, вход ---------- */

.logo { display: block; width: 100%; height: 100%; fill: currentColor; }
.top { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; background: #000; color: #fff; }
.top .mark { width: 26px; height: 26px; flex: none; }
.top b { font-size: 17px; font-weight: 650; letter-spacing: .01em; }
.top span { margin-left: auto; color: #bdbdb8; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.auth.brand { display: grid; grid-template-rows: auto 1fr; align-items: start; justify-content: stretch; padding: 0; background: var(--surface); }
.auth-hero { background: #000; color: #fff; display: flex; align-items: center; justify-content: center; padding: 44px 24px; }
.auth-hero .mark { width: 112px; height: 112px; }
.auth.brand .auth-card { margin: 0 auto; padding: 28px 20px 32px; }

@media (min-width: 980px) {
  .top { display: none; }
  .nav { background: #000; border-right: 0; }
  .nav-brand { color: #fff; }
  .nav-brand .mark { width: 30px; height: 30px; }
  .nav a { color: #b9b9b4; }
  .nav a.on { background: #fff; color: #000; }
  .nav-user { border-top-color: #333; color: #fff; }
  .nav-user span { color: #b9b9b4; }
  .auth.brand { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; }
  .auth-hero .mark { width: min(34vw, 380px); height: min(34vw, 380px); }
  .auth.brand .auth-card { align-self: center; padding: 40px; }
}

/* ---------- аналитика ---------- */

.period { display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; }
.period .ico { background: var(--surface); border: 1px solid var(--line); flex: none; }
.period label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.period label span { color: var(--muted); font-size: 13.5px; }
.period label { position: relative; cursor: pointer; }
.period label b { font-weight: 600; white-space: nowrap; }
.period input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.card + .card { margin-top: 12px; }
.card > h2 { margin-bottom: 10px; }
.lead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.lead b { font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.lead small { font-size: 16px; font-weight: 600; }
.lead-sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.dl { font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dl.up { color: var(--calc-text); }
.dl.down { color: var(--red); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.seg button { border: 0; background: var(--surface); height: 34px; padding: 0 12px; font-size: 13.5px; font-weight: 550; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: #000; color: #fff; }

.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; margin-top: 14px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; height: 170px; text-align: right; color: var(--muted); font-size: 11.5px; line-height: 1; }
.chart-y span:first-child { transform: translateY(-2px); }
.chart-y span:last-child { transform: translateY(2px); }
.chart-plot { position: relative; height: 170px; background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(#e9e9e6, #e9e9e6) 0 50% / 100% 1px no-repeat; border-bottom: 1px solid var(--ink); }
.bars { display: flex; align-items: stretch; justify-content: center; gap: 2px; height: 100%; }
.bar { flex: 1; max-width: 44px; min-width: 0; padding: 0; border: 0; background: none; display: flex; align-items: flex-end; cursor: pointer; }
.bar .stack { display: flex; flex-direction: column-reverse; gap: 2px; width: 100%; }
.bar .stack i { display: block; min-height: 1px; }
.bar .stack i:last-child { border-radius: 3px 3px 0 0; }
.bar:hover .stack, .bar.on .stack { opacity: 1; }
.bars.has-sel .bar .stack { opacity: .35; }
.bars.has-sel .bar.on .stack, .bars.has-sel .bar:hover .stack { opacity: 1; }
.bar:focus-visible { outline: 2px solid var(--in-text); outline-offset: 0; }
.s1 { background: var(--s1); }
.s2 { background: var(--s2); }
.s3 { background: var(--s3); }
.s0 { background: #000; }
.chart-x { grid-column: 2; display: flex; gap: 2px; justify-content: center; margin-top: 5px; height: 16px; color: var(--muted); font-size: 11.5px; }
.chart-x span { flex: 1; max-width: 44px; min-width: 0; display: flex; justify-content: center; white-space: nowrap; }
.chart-x span:first-child { justify-content: flex-start; }
.chart-x span:last-child { justify-content: flex-end; }
.chart-x.few span:first-child, .chart-x.few span:last-child { justify-content: center; }
.chart-hint { color: var(--muted); font-size: 13px; margin-top: 8px; }

.share { display: flex; gap: 2px; height: 10px; margin: 16px 0 4px; }
.share i { display: block; min-width: 2px; }
.share i:first-child { border-radius: 3px 0 0 3px; }
.share i:last-child { border-radius: 0 3px 3px 0; }
.rows { display: grid; }
.rw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-top: 1px solid #e9e9e6; align-items: baseline; }
.rows .rw:first-child { border-top: 0; }
.rw-n { font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rw-n i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.rw-v { font-weight: 650; font-size: 16px; white-space: nowrap; }
.rw-m { grid-column: 1 / -1; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.rw-bar { grid-column: 1 / -1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.rw-bar i { display: block; height: 100%; background: #000; border-radius: 3px; min-width: 2px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; min-width: 0; }
.tile span { display: block; color: var(--muted); font-size: 13px; line-height: 1.25; }
.tile b { display: block; font-size: 20px; font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tile.g { background: var(--calc-soft); border-color: var(--calc-line); }
.tile.g b { color: var(--calc-text); }

.an-detail { border-color: #000; border-width: 2px; }
.an-detail-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.an-detail-h b { font-size: 17px; }
.an-detail .sum { border: 0; border-radius: 0; }
.an-detail .sum div { padding: 9px 0; }
.an-detail h3 { font-size: 13.5px; color: var(--muted); font-weight: 600; margin: 12px 0 0; }
.ph .btn { height: 44px; padding: 0 14px; font-size: 15px; }

@media (min-width: 620px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-y, .chart-plot { height: 220px; }
  .period { max-width: 520px; }
}
@media (min-width: 980px) {

}
.sub .link + .link { margin-left: 14px; }

/* Отдельные колонки «Расходы» и «Зарплата» показываем только на широком экране; иначе они в подписи под остатком. */
@media (min-width: 1400px) {
  .ledger:not(.compact) .xw { display: table-cell; }
  .ledger:not(.compact) .xs { display: none; }
}

/* Две колонки (таблица и форма, пары блоков статистики) — только когда им хватает ширины. */
@media (min-width: 1200px) {
  .cols { grid-template-columns: minmax(0, 1fr) 372px; gap: 24px; align-items: start; }
  .cols .entry { order: 2; position: sticky; top: 24px; max-width: none; }
  .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .two .block { margin-top: 0; }
  .two > .stackcol { display: grid; gap: 12px; align-content: start; }
}

/* ---------- кто работал: отметки продавцов ---------- */
.cell-row.workers { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.wchips { display: flex; flex-wrap: wrap; gap: 8px; }
.wchip {
  min-height: 44px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--in-line);
  background: var(--in-soft); color: var(--ink); font-size: 16px; font-weight: 550; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.wchip.on::before { content: "✓ "; }
.wchip.more { background: none; border-style: dashed; border-color: var(--line); color: var(--muted); font-weight: 500; font-size: 15px; }
.wchip[hidden] { display: none; }
.who-s { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); white-space: normal; line-height: 1.2; }
#update-file { display: block; width: 100%; font: inherit; font-size: 15px; padding: 10px; border: 1px dashed var(--line); border-radius: 6px; background: var(--surface); }
