/* Дизайн: вариант 3 «Светлый» */
/* Шрифт Golos Text хранится на нашем сервере (deploy/get-fonts.sh): Google Fonts в Китае не открываются */
@font-face { font-family: "Golos Text"; src: url("/fonts/golos-text-cyrillic-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("/fonts/golos-text-cyrillic-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("/fonts/golos-text-cyrillic-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("/fonts/golos-text-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; 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+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; src: url("/fonts/golos-text-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; 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+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; src: url("/fonts/golos-text-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; 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+20BD, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #F3F5F9; --panel: #FFFFFF; --ink: #172033; --muted: #5B6579; --line: #E3E7EF; --soft: #EEF1F6;
  --accent: #2457D6; --accent-ink: #FFFFFF; --accent-soft: #E6ECFB; --accent-dark: #163A99;
  --ok: #1E7A4C; --ok-soft: #E3F3EA; --warn: #8A5A00; --warn-soft: #FFF3DD; --bad: #B4451F; --bad-soft: #FCE9E2; --info: #2457D6; --info-soft: #E6ECFB;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23, 32, 51, .05), 0 4px 16px rgba(23, 32, 51, .04);
  --font: "Golos Text", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
h1 { font-size: 28px; margin: 0; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 18px; margin: 0 0 14px; font-weight: 700; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.debt, .pos { color: var(--bad); }
.okc, .neg { color: var(--ok); }
.grow { flex: 1; }

/* шапка */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.topbar-in { max-width: 1320px; margin: 0 auto; padding: 10px 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand .logo { width: 36px; height: 36px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 19px; font-weight: 700; flex: none; }
.pills { display: flex; flex-wrap: wrap; gap: 2px; background: var(--bg); border-radius: 999px; padding: 4px; }
.pills a { padding: 8px 14px; border-radius: 999px; color: #4A5468; font-weight: 500; white-space: nowrap; }
.pills a:hover { color: var(--ink); background: rgba(255, 255, 255, .6); }
.pills a.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 32, 51, .12); }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; }
.avatar.on { outline: 2px solid var(--accent); }
.uname { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.menu-btn { display: none; }
.avatar.gear { background: var(--bg); color: var(--muted); font-size: 18px; }
@media (max-width: 1500px) and (min-width: 901px) { .uname, .brand-name { display: none; } }

.main { max-width: 1320px; margin: 0 auto; padding: 30px 28px 64px; }
.top { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.titles { display: flex; flex-direction: column; gap: 4px; }

/* кнопки */
.btn { border: 1px solid #D5DBE6; background: var(--panel); color: var(--ink); padding: 11px 18px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; justify-content: center; min-height: 44px; }
.btn:hover { border-color: #B9C2D3; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.btn.soft:hover { background: #D7E1F9; color: var(--accent-dark); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); font-weight: 500; }
.btn.sm { padding: 6px 12px; font-size: 13.5px; min-height: 34px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }

/* карточки и показатели */
.card, .panel { background: var(--panel); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); overflow-x: auto; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-bottom: 24px; }
.kpi { background: var(--panel); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 14px; font-weight: 500; }
.kpi .value { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .sub { color: var(--muted); font-size: 14px; }
.kpi .sub.debt { color: var(--bad); }
.kpi.accent { background: var(--accent); color: #fff; }
.kpi.accent .label, .kpi.accent .sub { color: rgba(255, 255, 255, .88); }
.kpi.accent a { color: #fff; }
.two { grid-template-columns: 1.4fr 1fr; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split-main { flex: 999 1 620px; min-width: 0; }
.split-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split-side h2 { margin: 0; }

/* карточки поставщиков */
.scards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.scard { background: var(--panel); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.scard-head { display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.scard-head:hover b { color: var(--accent); }
.scard-head .zh { font-size: 13px; color: var(--muted); }
.scard-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.scard .big { font-size: 22px; font-weight: 700; }
.progress { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.two-btn > * { flex: 1; }

/* лента событий */
.event { display: flex; gap: 12px; align-items: flex-start; }
.ev-icon { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }
.ev-icon.bad { background: var(--bad-soft); color: var(--bad); } .ev-icon.ok { background: var(--ok-soft); color: var(--ok); }
.ev-icon.info { background: var(--info-soft); color: var(--info); } .ev-icon.warn { background: var(--warn-soft); color: var(--warn); }
.ev-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* метки */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); }

/* таблицы */
.tbl-wrap { overflow-x: auto; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel .tbl-wrap, .card .tbl-wrap { box-shadow: none; border-radius: 0; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #F8F9FC; }
tr.click { cursor: pointer; }
tfoot td { font-weight: 700; background: #F8F9FC; }
.bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--accent); }

/* формы */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: end; }
label.f, div.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #D5DBE6; border-radius: 10px; padding: 10px 12px; min-width: 0; min-height: 44px; }
input[type=checkbox] { min-height: 0; width: 18px; height: 18px; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 72px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form .full { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.items-table input, .items-table select { width: 100%; padding: 8px 10px; min-height: 40px; }
.items-table th, .items-table td { padding: 8px 6px; }

/* модальное окно */
.overlay { position: fixed; inset: 0; background: rgba(23, 32, 51, .45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 50; overflow-y: auto; }
.modal { background: var(--panel); border-radius: 22px; width: min(720px, 100%); padding: 24px; box-shadow: 0 24px 64px rgba(23, 32, 51, .25); }
.modal.wide { width: min(980px, 100%); }
.modal .head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.x { border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; color: var(--muted); }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; }
#toast div { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; margin-top: 8px; box-shadow: 0 8px 24px rgba(23, 32, 51, .25); }
#toast div.err { background: var(--bad); }

/* переписка */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; margin-bottom: 12px; }
.msg { padding: 10px 14px; border-radius: 16px; background: var(--bg); max-width: 85%; }
.msg.me { align-self: flex-end; background: var(--accent-soft); }
.msg .who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }

/* вход */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(400px, 100%); padding: 28px; }
.login .brand { padding: 0 0 22px; font-size: 18px; }
.login .stack { gap: 14px; }

/* печать акта сверки */
@media print {
  .no-print, .filters, .topbar { display: none !important; }
  .main { padding: 0; max-width: none; }
  .tbl-wrap, .card, .panel { box-shadow: none; } body { background: #fff; }
}

/* телефон */
@media (max-width: 900px) {
  .btn.menu-btn { display: inline-flex; margin-left: auto; }
  .pills { display: none; order: 10; flex-basis: 100%; border-radius: 16px; }
  .pills.open { display: flex; }
  .uname { display: none; }
  .topbar-in, .main { padding-left: 16px; padding-right: 16px; }
  .two, .form { grid-template-columns: 1fr; }
  .kpi .value { font-size: 26px; }
  h1 { font-size: 24px; }
}
tbody td:first-child { white-space: nowrap; }

/* двуязычные подписи: китайский сверху, русский снизу */
.bi { display: inline-flex; flex-direction: column; vertical-align: bottom; line-height: 1.15; gap: 1px; }
.bi-zh { font-size: .8em; opacity: .72; }
.btn .bi, .badge .bi, .pills .bi, .right .bi, th.right .bi { align-items: inherit; }
.btn .bi, .badge .bi, .pills .bi { align-items: center; text-align: center; }
.right .bi { align-items: flex-end; }
.pills a { padding-top: 6px; padding-bottom: 6px; }

/* ===== версия 3: доработки интерфейса ===== */
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.between { justify-content: space-between; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.dim td { opacity: .55; }
.row.between h2 { margin: 0; }
.panel > .row.between { margin-bottom: 14px; }
.panel + .panel, .panel + .grid, .grid + .panel, .onboarding + .grid, .todo + .grid { margin-top: 16px; }
.stack > .panel + .panel { margin-top: 0; }
.modal .head h2 { margin: 0; }

/* полоса загрузки */
.topbar { position: sticky; }
.loadbar { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); opacity: 0; transition: width .3s, opacity .3s; }
body.loading .loadbar { width: 70%; opacity: 1; transition: width 2s cubic-bezier(.1,.7,.3,1); }

/* кнопки */
.btn svg, .search svg, .empty-icon svg, .pw-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.sm svg { width: 15px; height: 15px; }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-fill:hover { filter: brightness(.95); color: #fff; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: rgba(255,255,255,.9) rgba(255,255,255,.9) transparent transparent; animation: spin .7s linear infinite; }
.btn:not(.primary):not(.ok):not(.danger-fill).is-busy::after { border-color: var(--accent) var(--accent) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn:focus-visible, a:focus-visible, tr:focus-visible, .chip:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.chip:hover { color: var(--ink); border-color: #B9C2D3; }

/* поиск */
.search { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid #D5DBE6; border-radius: 10px; padding: 0 12px; min-height: 44px; color: var(--muted); flex: 1 1 260px; max-width: 420px; }
.search input { border: 0; outline: none; padding: 10px 0; flex: 1; min-height: 0; background: transparent; }
.search:focus-within { border-color: var(--accent); outline: 3px solid var(--accent-soft); }
.filters label.f select { min-width: 200px; }

/* пустые состояния */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 16px; text-align: center; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty-icon svg { width: 26px; height: 26px; }
.empty-text { font-size: 15px; }

/* первые шаги */
.onboarding { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; margin-bottom: 20px; border: 1px solid var(--accent-soft); }
.onboarding h2 { margin: 0 0 4px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; flex: 999 1 600px; }
.steps li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 14px; background: var(--bg); }
.steps li.done { opacity: .6; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.steps li.done .step-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step-n svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.step-t { flex: 1 1 120px; font-weight: 600; }

/* дела поставщика */
.todo { margin-bottom: 20px; border: 1px solid #F3D9A6; background: #FFFCF5; }
.todo h2 { font-size: 16px; margin: 4px 0 10px; }
.todo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 0; border-top: 1px solid var(--line); }
.todo-row > :last-child { margin-left: auto; }

/* показатели-ссылки */
a.kpi { color: var(--ink); transition: transform .12s, box-shadow .12s; }
a.kpi:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(23,32,51,.06), 0 10px 24px rgba(23,32,51,.07); color: var(--ink); }
.kpi-text { margin-top: 6px; font-weight: 600; font-size: 17px; }
.contact { margin-top: 6px; line-height: 1.5; }

/* таблицы */
.tbl-wrap.flat { box-shadow: none; border-radius: 0; background: transparent; }
.tbl-foot { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); background: #F8F9FC; font-weight: 600; border-radius: 0 0 var(--radius) var(--radius); }
.tbl-foot > :first-child { margin-right: auto; color: var(--muted); font-weight: 500; }
tr.sub-row td { background: #F8F9FC; }
tr[tabindex]:focus { background: var(--accent-soft); }

/* ход заказа */
.progress-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; counter-reset: s; }
.progress-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 13px; color: var(--muted); }
.progress-steps li::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--line); z-index: 0; }
.progress-steps li:first-child::before { display: none; }
.progress-steps li.done::before, .progress-steps li.now::before { background: var(--accent); }
.progress-steps .dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line); display: grid; place-items: center; }
.progress-steps li.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.progress-steps li.now .dot { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.progress-steps li.now .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.progress-steps li.now { color: var(--ink); font-weight: 600; }
.progress-steps .dot svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.6; }
.cancelled-note { padding: 6px 0; }
.note { background: var(--bg); border-radius: 12px; padding: 10px 14px; margin: 12px 0 0; white-space: pre-wrap; }

/* переписка */
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; resize: none; }

/* файлы */
.files { display: flex; flex-direction: column; gap: 10px; }
.file { display: flex; align-items: center; gap: 12px; }
.thumb { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--bg); display: grid; place-items: center; flex: none; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-meta a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
label.btn input[type=file] { display: none; }

/* доступ поставщика */
.access { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.access h2 { margin: 0 0 4px; }
.access-list { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.access-row { display: flex; gap: 8px; align-items: center; }
.cred { background: var(--bg); border-radius: 12px; padding: 14px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 14px; white-space: pre-wrap; user-select: all; }
.dialog-text { font-size: 16px; margin: 0 0 6px; }

/* формы */
.items-wrap { overflow-x: auto; }
.items-table td { vertical-align: middle; }
.items-table tr.bad-row td { background: var(--bad-soft); }
.checklist { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; flex-wrap: wrap; }
.check:hover { background: var(--bg); }
.pw { position: relative; display: flex; }
.pw input { flex: 1; padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; width: 38px; height: 38px; cursor: pointer; color: var(--muted); display: grid; place-items: center; border-radius: 8px; }
.login .brand { display: flex; align-items: center; gap: 12px; }
.login .btn.primary { width: 100%; }

/* журнал */
.audit { max-height: 460px; overflow: auto; display: flex; flex-direction: column; }
.audit-row { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }

/* окна и уведомления */
body.modal-open { overflow: hidden; }
.overlay { animation: fade .15s ease-out; }
.modal { animation: pop .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
#toast div { transition: opacity .35s, transform .35s; }
#toast div.out { opacity: 0; transform: translateY(6px); }

/* печать */
.print-head, .print-sign { display: none; }
@media print {
  .print-head { display: block; margin-bottom: 12px; }
  .print-sign { display: flex; justify-content: space-between; margin-top: 40px; gap: 24px; }
  .statement .chip, .statement .filters { display: none !important; }
  #page > :not(#stmt) { display: none !important; }
  .top { display: none !important; }
  .panel { padding: 0; }
  a { color: inherit; }
}

/* телефон */
@media (max-width: 900px) {
  .progress-steps { grid-template-columns: repeat(7, minmax(64px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
  .filters label.f, .filters .search { flex: 1 1 100%; max-width: none; }
  .filters label.f select { min-width: 0; width: 100%; }
  .todo-row > :last-child { margin-left: 0; }
  .top { align-items: flex-start; }
  #page-actions { width: 100%; }
  #page-actions .btn { flex: 1 1 auto; }
  .modal { padding: 18px; border-radius: 18px; }
  .overlay { padding: 12px 8px; }
  .chat { max-height: 50vh; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.grid > *, .split > *, .stack > * { min-width: 0; }
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 16px; border-radius: 16px; }
  .kpi .value { font-size: 21px; }
  .kpi .sub { font-size: 12.5px; }
  .kpi .value { font-size: 19px; overflow-wrap: anywhere; }
  /* нечётное число карточек: последняя на всю ширину */
  .kpis:not(.kpis5) > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.grid.two { align-items: start; }
.form { align-content: start; }
.grid > .panel + .panel, .grid > .panel + section { margin-top: 0; }

.stmt-sum { display: flex; align-items: center; gap: 10px; background: var(--panel); border-radius: 12px; padding: 10px 16px; box-shadow: var(--shadow); min-height: 44px; }
.stmt-sum b { font-size: 18px; }

.neg-row td { background: var(--bad-soft); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
a.chip { display: inline-flex; text-decoration: none; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
.sale-total { font-size: 16px; }

/* панель: графики, «скоро закончится», дельта */
.kpis5 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.charts { margin-bottom: 20px; }
.chart h2 { margin: 0; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.c1 { background: #A9BDEF; } .c2 { background: var(--accent); } .c3 { background: #1E7A4C; }
.bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; height: 200px; margin-top: 18px; align-items: end; }
.bar-col { display: flex; flex-direction: column; height: 100%; gap: 6px; }
.bar-stack { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--line); }
.cbar { flex: 1; max-width: 34px; border-radius: 6px 6px 0 0; position: relative; min-height: 0; }
.bar-v { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); white-space: nowrap; padding-bottom: 3px; font-variant-numeric: tabular-nums; }
.bar-stack .cbar + .cbar .bar-v { display: none; }
.bar-col:hover .bar-stack .cbar + .cbar .bar-v { display: block; }
.bar-col:hover .bar-stack .cbar:first-child:not(:only-child) .bar-v { display: none; }
.bar-l { text-align: center; font-size: 12px; color: var(--muted); }
.split-side > .panel + .panel { margin-top: 0; }
.low h2 { margin: 0; }
.low-row { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.low-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.events { display: flex; flex-direction: column; gap: 16px; }
.events h2 { margin: 0; }
.delta { font-weight: 700; } .delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.split-main > .row.between { margin-bottom: 12px; }
.split-main > .row.between h2 { margin: 0; }
@media (max-width: 600px) { .bars { height: 160px; gap: 6px; } .bar-v { display: none !important; } .kpis5 .kpi.accent { grid-column: 1 / -1; } }
@media (max-width: 600px) { .kpis.kpis5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
