/* Прайс фурнитуры: спокойная деловая вёрстка, без фото и украшений.
   Главное — плотная таблица, крупная цена и быстрый поиск. */

:root {
  --ink: #1b1d21;
  --ink-soft: #5b616b;
  --line: #e3e5ea;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --accent: #145c4a;
  --accent-soft: #e7f2ee;
  --old: #8c8f96;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, p { margin: 0; }

/* ---------- шапка ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 18px 28px;
  align-items: center;
  padding: 14px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; gap: 12px; align-items: center; margin-right: auto; }

.logo {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
  border-radius: 11px;
  font-weight: 700; font-size: 19px;
}

h1 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

.markup, .round { display: flex; flex-direction: column; gap: 5px; }
.markup > label, .round > label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft);
}

.markup-row { display: flex; align-items: center; gap: 4px; }

#markup {
  width: 74px;
  padding: 7px 6px;
  font: inherit; font-weight: 650; font-size: 17px;
  text-align: center;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
}
#markup:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.step {
  width: 30px; height: 34px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  font-size: 17px; color: var(--ink-soft); cursor: pointer;
}
.step:hover { background: var(--bg-soft); color: var(--ink); }

.quick { display: flex; gap: 4px; }
.quick button {
  flex: 1;
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  padding: 3px 0; font-size: 12px; color: var(--ink-soft); cursor: pointer;
}
.quick button:hover { background: var(--bg-soft); color: var(--ink); }

#rounding {
  padding: 8px 8px;
  font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink);
}

.actions { display: flex; gap: 8px; }

.btn {
  padding: 9px 14px;
  font: inherit; font-size: 13.5px; font-weight: 550;
  color: #fff; background: var(--accent);
  border: 1px solid var(--accent); border-radius: 9px;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-soft); }

/* ---------- каркас ---------- */
main {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - 70px);
}

.side {
  position: sticky;
  top: 71px;
  height: calc(100vh - 71px);
  overflow: auto;
  padding: 14px 12px 30px;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

#search {
  width: 100%;
  padding: 9px 11px;
  font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 9px;
  background: #fff;
}
#search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.side-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 14px 4px 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft);
}

.link {
  border: 0; background: none; padding: 0;
  font: inherit; font-size: 11px; color: var(--accent); cursor: pointer;
  text-transform: none; letter-spacing: 0;
}

.cats { display: flex; flex-direction: column; gap: 1px; }

.cat {
  display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
  width: 100%;
  padding: 6px 9px;
  border: 0; border-radius: 7px;
  background: none;
  font: inherit; font-size: 13.5px; text-align: left; color: var(--ink);
  cursor: pointer;
}
.cat:hover { background: #eceef2; }
.cat.active { background: var(--accent); color: #fff; }
.cat.active .count { color: rgba(255,255,255,.75); }

.cat .count { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.cat .mark {
  font-size: 10.5px; padding: 1px 5px; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.cat.active .mark { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- таблица ---------- */
.content { padding: 16px 22px 60px; min-width: 0; }

.crumbs { font-size: 12.5px; color: var(--ink-soft); min-height: 18px; }

.content-head {
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 12px;
}
h2 { font-size: 21px; font-weight: 650; letter-spacing: -.015em; }
.meta { font-size: 12.5px; color: var(--ink-soft); }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead th {
  position: sticky; top: 0;
  padding: 9px 12px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-soft);
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f1f4;
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfc; }

.num { text-align: right; white-space: nowrap; }
.col-art { width: 130px; color: var(--ink-soft); font-size: 12.5px; }
.col-unit { width: 62px; color: var(--ink-soft); }
.col-price { width: 118px; }

td.num.old { color: var(--old); font-size: 13px; }
td.num.new { font-weight: 650; color: var(--accent); font-size: 15px; }

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

.pager {
  display: flex; gap: 6px; align-items: center; justify-content: center;
  margin-top: 16px;
  font-size: 13px; color: var(--ink-soft);
}
.pager button {
  min-width: 30px; padding: 5px 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  font: inherit; cursor: pointer;
}
.pager button:disabled { opacity: .4; cursor: default; }
.pager button.current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* ---------- печать ---------- */
@media print {
  .top, .side, .pager { display: none !important; }
  main { display: block; }
  .content { padding: 0; }
  .table-wrap { border: 0; }
  thead th { background: #eee !important; }
  tbody tr { break-inside: avoid; }
}

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin-right: 0; }
}

/* ---------- группы разделов ---------- */
.group {
  display: flex; align-items: center; gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 5px 8px;
  border: 0; border-radius: 7px;
  background: none;
  font: inherit; font-size: 12px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft);
  text-align: left;
  cursor: pointer;
}
.group:hover { background: #eceef2; color: var(--ink); }
.group .chev { font-size: 10px; width: 10px; }
.group .count { margin-left: auto; font-weight: 500; letter-spacing: 0; }

.cat { padding-left: 20px; }

/* артикулы длинные — даём колонке больше места */
.col-art { width: 170px; font-size: 12px; overflow-wrap: anywhere; }

/* скрыть колонку закупки (для клиента) */
body.hide-cost .cost { display: none; }

.tog {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--ink-soft); cursor: pointer; user-select: none;
}
.tog input { margin: 0; }
