* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1d1d1f; background: #fafafa; }
a { color: #0b57d0; text-decoration: none; }
a:hover { text-decoration: underline; }
.top { display: flex; gap: 16px; align-items: center; padding: 8px 16px; background: #fff; border-bottom: 1px solid #ddd; }
.top .spacer { flex: 1; }
.top form { margin: 0; }
main { padding: 12px 16px; }
button { font: inherit; padding: 4px 12px; cursor: pointer; }
.notes p { margin: 4px 0; }
.error { color: #b3261e; font-weight: 600; }
.warn { color: #8a5300; font-weight: 600; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.controls input[type=search] { min-width: 220px; padding: 4px 6px; }
.chk { white-space: nowrap; }
table.products { border-collapse: collapse; width: 100%; background: #fff; }
.products th, .products td { border: 1px solid #e3e3e3; padding: 3px 6px; vertical-align: middle; }
.products thead th { position: sticky; top: 0; background: #f0f2f5; text-align: left; white-space: nowrap; z-index: 1; }
.products thead tr.total td { position: sticky; top: 27px; background: #fff8e1; font-weight: 600; z-index: 1; }
.products tbody tr:hover { background: #f5f9ff; }
.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.neg { color: #b3261e; font-weight: 600; }
.nodata { color: #888; }
.approx { color: #8a5300; cursor: help; }
.sku { font-weight: 600; white-space: nowrap; }
form.cell { margin: 0; }
form.cell select, form.cell input { font: inherit; padding: 1px 2px; }
.txt-owner { width: 110px; }
select.st-none { background: #fde7e7; }
select.st-in_progress { background: #fff4d6; }
select.st-done { background: #e6f4ea; }
select.st-published { background: #cdebd6; }
select.st-rework, select.st-replace_main { background: #ffe0b2; }
/* Маржа, %: пороги — settings.toml, [margin_colors] */
td.m-bad { background: #e53935; color: #fff; font-weight: 700; }
td.m-low { background: #fbd5d3; color: #8c1d18; }
td.m-mid { background: #f3f1ea; color: #6b6b6b; }
td.m-good { background: #a8dcb5; color: #0d5323; font-weight: 600; }
td.m-great { background: #1e9e4a; color: #fff; font-weight: 700; box-shadow: inset 0 0 8px #b9f6ca; text-shadow: 0 0 6px #b9f6ca; }
.comments { min-width: 200px; max-width: 320px; }
.comments summary { cursor: pointer; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comments form { display: flex; gap: 4px; align-items: flex-end; margin: 4px 0; }
.comments textarea { flex: 1; font: inherit; resize: vertical; }
.comments ul { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.comments li { border-top: 1px solid #eee; padding: 3px 0; }
.comments .when { color: #888; font-size: 12px; }
.ctext { white-space: pre-wrap; overflow-wrap: anywhere; }
.login { max-width: 320px; margin: 80px auto; display: flex; flex-direction: column; gap: 12px; background: #fff; padding: 24px; border: 1px solid #ddd; border-radius: 8px; }
.login label { display: flex; flex-direction: column; gap: 4px; }
.login input { font: inherit; padding: 6px; }
.login h1 { margin: 0 0 8px; font-size: 20px; }
/* Страница товара */
.product-head h1 { margin: 4px 0; font-size: 22px; }
.muted { color: #777; font-weight: normal; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #ccc; margin: 8px 0 12px; }
.tabs a { padding: 6px 14px; border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0; }
.tabs a.active { border-color: #ccc; background: #fff; color: #1d1d1f; font-weight: 600; margin-bottom: -1px; }
.overview h2 { font-size: 16px; margin: 16px 0 6px; }
table.kv { width: auto; }
table.kv th { text-align: left; background: #f0f2f5; }
table.days { width: auto; }
.records { display: flex; flex-direction: column; gap: 8px; max-width: 900px; }
.rec { background: #fff; border: 1px solid #e3e3e3; border-radius: 6px; padding: 8px 10px; }
.rec .meta { color: #555; font-size: 13px; margin-bottom: 4px; }
.rec .id { color: #999; font-size: 12px; }
.stars { color: #e6a700; letter-spacing: 1px; }
.stars.s1, .stars.s2, .stars.s3 { color: #d93025; }
.rec .answer { margin-top: 6px; padding: 6px 8px; background: #f3f7ff; border-left: 3px solid #0b57d0; }
.media { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.media img { height: 64px; border-radius: 4px; border: 1px solid #ddd; }
