/* CRM ДИАС — «как 1С, только легче для глаз».
   Каркас «Г»: шапка во всю ширину + дерево разделов слева, рабочая область справа.
   Шрифт 15 px, цифры ровными столбцами, статус — цветом и словом. Светлая и тёмная тема. */
:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f8f9fa; --hover: #f1f3f6;
  --ink: #1b1e24; --muted: #5d6571; --faint: #8a929d; --line: #dfe2e7; --line-2: #eceef1;
  --accent: #b9561a; --accent-ink: #ffffff; --accent-weak: #fbeee5; --accent-line: #efcfb8;
  --gold: #b08a3e;
  --ok: #2b7a4b; --ok-weak: #e4f2ea; --warn: #8a5d0c; --warn-weak: #fbf0d9;
  --bad: #b42318; --bad-weak: #fdecea; --info: #2b5c8a; --info-weak: #e7f0f9;
  --sel: #fff6d6;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  --top-h: 52px; --nav-w: 232px; --radius: 8px;
  --row-h: 36px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121418; --surface: #1a1d22; --surface-2: #20242a; --hover: #252a31;
    --ink: #e6e8eb; --muted: #a0a8b3; --faint: #7d8590; --line: #30353d; --line-2: #262a31;
    --accent: #e27a3c; --accent-ink: #1b1007; --accent-weak: #3a2416; --accent-line: #5a3a24;
    --gold: #c9a55a;
    --ok: #5cbb87; --ok-weak: #163021; --warn: #e2b453; --warn-weak: #3a2d12;
    --bad: #f07362; --bad-weak: #3b1a17; --info: #7fb2e5; --info-weak: #18283a; --sel: #3a3416;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121418; --surface: #1a1d22; --surface-2: #20242a; --hover: #252a31;
  --ink: #e6e8eb; --muted: #a0a8b3; --faint: #7d8590; --line: #30353d; --line-2: #262a31;
  --accent: #e27a3c; --accent-ink: #1b1007; --accent-weak: #3a2416; --accent-line: #5a3a24;
  --gold: #c9a55a;
  --ok: #5cbb87; --ok-weak: #163021; --warn: #e2b453; --warn-weak: #3a2d12;
  --bad: #f07362; --bad-weak: #3b1a17; --info: #7fb2e5; --info-weak: #18283a; --sel: #3a3416;
  color-scheme: dark;
}
:root[data-density="compact"] { --row-h: 29px; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, .mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- шапка ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 0 14px; background: var(--surface); border-top: 3px solid var(--gold); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; letter-spacing: .08em; white-space: nowrap; width: calc(var(--nav-w) - 14px); }
.brand img { width: 24px; height: 24px; }
.brand span { font-weight: 400; letter-spacing: 0; color: var(--muted); }
.brand:hover { text-decoration: none; }
.search-btn { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); cursor: pointer; text-align: left; }
.search-btn:hover { border-color: var(--accent); }
.search-btn span { flex: 1; }
kbd { font: 500 11px var(--mono); padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--ink); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { height: 34px; min-width: 34px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius); background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.who { color: var(--muted); font-size: 14px; white-space: nowrap; }
.menu-toggle { display: none; }

/* ---------- дерево разделов ---------- */
.nav { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--nav-w); overflow-y: auto; padding: 10px 0 24px;
  background: var(--surface-2); border-right: 1px solid var(--line); z-index: 20; }
.nav-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-h .lock { color: var(--gold); font-size: 11px; letter-spacing: .04em; border: 1px solid var(--gold); border-radius: 4px; padding: 0 5px; text-transform: none; }
.nav a { display: block; padding: 6px 16px 6px 22px; color: var(--ink); border-left: 3px solid transparent; }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a.on { background: var(--accent-weak); color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.nav .later { display: block; padding: 3px 16px 6px 22px; color: var(--faint); font-size: 13px; }

/* ---------- рабочая область ---------- */
.main { margin-left: var(--nav-w); padding: calc(var(--top-h) + 18px) 22px 48px; min-width: 0; }
.page-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-h h1 { font-size: 22px; font-weight: 600; margin: 0; }
.page-h .sub { color: var(--muted); }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.crumbs a { color: var(--muted); }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.pri:hover { filter: brightness(1.06); }
.btn.ghost { border-style: dashed; }
.btn.danger { color: var(--bad); }
.btn[disabled], .btn.disabled { opacity: .5; cursor: default; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 4px); left: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px; z-index: 40; }
.dd-menu.right { left: auto; right: 0; }
.dd-menu a, .dd-menu button { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--ink); text-align: left; border-radius: 6px; cursor: pointer; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--hover); text-decoration: none; }
.dd-menu .off { color: var(--faint); cursor: default; }
.dd-menu .off:hover { background: none; }
.dd-menu .off small { color: var(--faint); }
.dd-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- метки ---------- */
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-weak); color: var(--ok); }
.chip.warn { background: var(--warn-weak); color: var(--warn); }
.chip.bad { background: var(--bad-weak); color: var(--bad); }
.chip.info { background: var(--info-weak); color: var(--info); }
.chip.muted { background: var(--line-2); color: var(--muted); }
.posted-flag { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--line); vertical-align: -3px; }
.posted-flag.on { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 2px var(--surface); }
.del { text-decoration: line-through; color: var(--faint); }

/* ---------- журнал ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters input[type=search], .filters input[type=date], .filters select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.filters input[type=search] { width: 280px; }
.filters label.check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.grid-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
table.grid td { padding: 0 10px; height: var(--row-h); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.grid td.wide { white-space: normal; min-width: 180px; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: var(--hover); }
table.grid tbody tr.cur { background: var(--sel); }
table.grid tbody tr.stale td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.grid-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 2px; color: var(--muted); font-size: 14px; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

/* ---------- форма документа ---------- */
.doc { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.doc-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.doc-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-title h1 { font-size: 21px; font-weight: 600; margin: 0; }
.doc-title h1 .d { font-weight: 400; color: var(--muted); }
.smart { display: flex; flex-wrap: wrap; gap: 8px; }
.sb { display: flex; flex-direction: column; gap: 1px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); min-width: 120px; font-size: 14px; }
a.sb:hover, button.sb:hover { border-color: var(--accent); text-decoration: none; }
button.sb { cursor: pointer; text-align: left; }
.sb b { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sb.ok { border-color: var(--ok); } .sb.warn { border-color: var(--warn); } .sb.bad { border-color: var(--bad); color: var(--bad); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 16px; }
.f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f > span { font-size: 12.5px; color: var(--muted); }
.f > span .req { color: var(--bad); }
.f input, .f select, .f textarea, .inp { height: 34px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); width: 100%; min-width: 0; }
.f textarea { height: auto; min-height: 60px; padding: 7px 9px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, .inp:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.f.err input, .f.err select, .f.err textarea, .f.err .ac input { border-color: var(--bad); background: var(--bad-weak); }
.f .hint { font-size: 12px; color: var(--faint); }
.f.check { flex-direction: row; align-items: center; gap: 8px; padding-top: 20px; }
.f.check input { width: 18px; height: 18px; }
.ro .f input, .ro .f select, .ro .f textarea { pointer-events: none; background: transparent; }
.ac { position: relative; }
.ac-list { position: absolute; top: calc(100% + 2px); left: 0; right: 0; max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.14); z-index: 45; }
.ac-list.wide { min-width: 560px; }
.ac-item { padding: 7px 10px; cursor: pointer; display: flex; gap: 10px; justify-content: space-between; }
.ac-item .t { min-width: 0; }
.ac-item .t b { font-weight: 600; }
.ac-item .t small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ac-item .r small { display: block; color: var(--muted); }
.ac-item.cur, .ac-item:hover { background: var(--hover); }
.ac-new { color: var(--accent); }

/* табличная часть */
.lines-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.lines-h h2 { font-size: 15px; font-weight: 600; margin: 0; }
.lines-wrap { border: 1px solid var(--line); border-radius: 8px; overflow: auto; }
table.lines { width: 100%; border-collapse: collapse; min-width: 760px; }
table.lines th { background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.lines th.num { text-align: right; }
table.lines td { border-bottom: 1px solid var(--line-2); padding: 2px 4px; vertical-align: middle; }
table.lines tr:last-child td { border-bottom: 0; }
table.lines tr.cur { background: var(--sel); }
table.lines td.n { width: 36px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
table.lines td.amount { text-align: right; padding-right: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; }
table.lines td.margin { text-align: right; padding-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
table.lines td.margin.neg { color: var(--bad); }
table.lines input { width: 100%; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; min-width: 0; }
table.lines input:hover { border-color: var(--line); }
table.lines input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
table.lines input.r { text-align: right; font-variant-numeric: tabular-nums; }
table.lines .namecell { min-width: 300px; }
table.lines .namecell .art { font-weight: 600; }
table.lines .namecell small { color: var(--muted); }
table.lines .tag { font-size: 11px; color: var(--warn); margin-left: 6px; }
table.lines td.x { width: 30px; }
table.lines td.x button { border: 0; background: none; color: var(--faint); cursor: pointer; width: 26px; height: 26px; border-radius: 5px; }
table.lines td.x button:hover { background: var(--bad-weak); color: var(--bad); }
.totals { display: flex; justify-content: flex-end; gap: 28px; flex-wrap: wrap; padding: 10px 4px 0; }
.totals span { color: var(--muted); }
.totals b { font-variant-numeric: tabular-nums; color: var(--ink); font-size: 16px; }
.keys { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--faint); font-size: 12.5px; padding-top: 8px; }

/* лента */
.side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: calc(var(--top-h) + 14px); max-height: calc(100vh - var(--top-h) - 30px); overflow: auto; }
.side h3 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.fe { font-size: 13.5px; display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); }
.fe:last-child { border-bottom: 0; }
.fe time { font: 500 11.5px var(--mono); color: var(--faint); }
.fe .w { font-weight: 600; }
.fe.comment { background: var(--accent-weak); border-radius: 6px; padding: 6px 8px; border: 0; }
.comment-box { display: flex; gap: 6px; }
.comment-box input { flex: 1; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); min-width: 0; }
.files a { display: block; padding: 3px 0; font-size: 14px; word-break: break-word; }
.files .drop { margin-top: 6px; border: 1px dashed var(--line); border-radius: 8px; padding: 10px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.files .drop.over { border-color: var(--accent); background: var(--accent-weak); }

/* ---------- окна ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 17, 21, .42); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.modal { width: 100%; max-width: 640px; max-height: 76vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal-b { padding: 12px 16px 16px; }
.palette input { width: 100%; height: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 17px; }
.palette input:focus { outline: none; }
.pal-group { padding: 8px 16px 2px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pal-item { display: flex; flex-direction: column; padding: 7px 16px; cursor: pointer; color: var(--ink); }
.pal-item small { color: var(--muted); }
.pal-item.cur, .pal-item:hover { background: var(--hover); text-decoration: none; }
.pal-empty { padding: 18px 16px; color: var(--muted); }
.tree ul { list-style: none; margin: 0; padding-left: 20px; border-left: 1px dashed var(--line); }
.tree > ul { padding-left: 0; border-left: 0; }
.tree li { padding: 4px 0; }
.tree .node { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tree .node.current { font-weight: 600; }
.tree .node .muted { font-weight: 400; }

/* ---------- сообщения ---------- */
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 80; max-width: 420px; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 14px; }
.toast.err { background: var(--bad); color: #fff; }
.alert { padding: 10px 14px; border-radius: 8px; background: var(--warn-weak); color: var(--warn); margin-bottom: 12px; font-size: 14px; }
.alert.info { background: var(--info-weak); color: var(--info); }

/* ---------- рабочий стол, карточки ---------- */
.blocks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.block { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.block h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.block .row { display: block; padding: 6px 0; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.block .row:last-child { border-bottom: 0; }
.block .row small { display: block; color: var(--muted); }
.block .row:hover { text-decoration: none; background: var(--hover); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }

/* ---------- вход ---------- */
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; border-top: 3px solid var(--gold); }
.login { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.login .brand { width: auto; font-size: 18px; }
.login .brand img { width: 30px; height: 30px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.login input { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 16px; color: var(--ink); }
.login .btn { height: 42px; }
.login .err { color: var(--bad); font-size: 14px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 1600px) { .doc { grid-template-columns: minmax(0, 1fr); } .side { position: static; max-height: none; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; } }
@media (max-width: 1180px) { .blocks { grid-template-columns: minmax(0, 1fr); } .side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .nav { transform: translateX(-100%); transition: transform .15s; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
  body.nav-open .nav { transform: none; }
  .main { margin-left: 0; padding-left: 14px; padding-right: 14px; }
  .menu-toggle { display: inline-flex; }
  .brand { width: auto; }
  .brand span, .who { display: none; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn::before { content: "Поиск"; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .filters input[type=search] { width: 100%; }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .top, .nav, .side, .btn-row { display: none !important; } .main { margin: 0; padding: 0; } }

/* ---------- таблица отправок ---------- */
table.ship tbody tr { cursor: default; }
table.ship td { padding: 2px 4px; vertical-align: middle; }
table.ship td:first-child { padding-left: 10px; white-space: nowrap; }
table.ship input, table.ship select { height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; min-width: 0; }
table.ship input.r { text-align: right; font-variant-numeric: tabular-nums; }
table.ship input:hover, table.ship select:hover { border-color: var(--line); }
table.ship input:focus, table.ship select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
table.ship select.st { font-weight: 600; border-radius: 999px; padding: 0 10px; width: 168px; }
table.ship select[data-f="carrier"] { width: 170px; }
table.ship select[data-f="payer"] { width: 92px; }
table.ship td:nth-child(2) { min-width: 160px; max-width: 220px; white-space: normal; }
table.ship select.st.ok { background: var(--ok-weak); color: var(--ok); }
table.ship select.st.info { background: var(--info-weak); color: var(--info); }
table.ship select.st.warn { background: var(--warn-weak); color: var(--warn); }
table.ship select.st.bad { background: var(--bad-weak); color: var(--bad); }
table.ship select.st.muted { background: var(--line-2); color: var(--muted); }
table.ship tr.del input, table.ship tr.del select { text-decoration: line-through; color: var(--faint); }
table.ship td.x { white-space: nowrap; }

/* ---------- закупки (14.10.2026) ---------- */
.tender-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--accent-line); border-radius: var(--radius); }
.tender-quick label { font-weight: 600; }
.tender-quick input { flex: 1; min-width: 260px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.tverdict { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: start; }
.tscore { border-radius: var(--radius); padding: 12px; text-align: center; display: grid; gap: 3px; background: var(--surface-2); }
.tscore .big { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tscore .word { font-weight: 600; }
.tscore.ok { background: var(--ok-weak); color: var(--ok); }
.tscore.warn { background: var(--warn-weak); color: var(--warn); }
.tscore.bad { background: var(--bad-weak); color: var(--bad); }
.taxes { display: grid; gap: 6px; }
.taxis { border: 1px solid var(--line-2); border-radius: var(--radius); }
.taxis.has-ov { border-color: var(--info); }
.taxis summary { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px; gap: 12px; align-items: center; padding: 7px 12px; cursor: pointer; list-style: none; }
.taxis summary::-webkit-details-marker { display: none; }
.taxis summary:hover { background: var(--hover); }
.taxis .t { font-weight: 600; }
.taxis .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.taxis .v small { font-weight: 400; color: var(--muted); }
.tbar { height: 9px; border-radius: 99px; background: var(--line-2); position: relative; overflow: hidden; }
.tbar i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--ok); }
.tbar i.warn { background: var(--warn); } .tbar i.bad { background: var(--bad); }
.tbar b { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .5; }
.taxis .tbody { padding: 2px 12px 10px; display: grid; gap: 8px; justify-items: start; }
.taxis ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; color: var(--muted); font-size: 14px; }
.taxis li.ov { color: var(--info); }
.ov-form { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 12px; width: 100%; padding: 10px; border-radius: var(--radius); background: var(--info-weak); }
.ov-form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ov-form input, .ov-form textarea { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ov-form .btn-row { grid-column: 1 / -1; }
.ttodo { margin-top: 14px; padding: 10px 14px; border: 1px solid var(--accent-line); background: var(--accent-weak); border-radius: var(--radius); }
.ttodo h3 { margin: 0 0 6px; font-size: 15px; }
.ttodo ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.tlines { margin-top: 14px; }
.tlines td .sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tlines select { max-width: 100%; width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.tlines .pct { font-weight: 700; } .tlines .pct.ok { color: var(--ok); } .tlines .pct.warn { color: var(--warn); } .tlines .pct.bad { color: var(--bad); }
.tdetail > td { background: var(--surface-2); }
.tdet { display: grid; gap: 6px; margin: 4px 0 10px; }
.tdet h4 { margin: 0; font-size: 14px; }
.tdet ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.tdet tr.st-fail td { color: var(--bad); } .tdet tr.st-better td, .tdet tr.st-cap td { color: var(--warn); }
.warn-t { color: var(--warn); margin: 8px 0 0; }
@media (max-width: 760px) {
  .tverdict { grid-template-columns: minmax(0, 1fr); }
  .taxis summary { grid-template-columns: 96px minmax(0, 1fr) 56px; gap: 8px; }
  .ov-form { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- сито закупок (24.10.2026) ---------- */
.sito-group { margin-top: 18px; }
.sito-h { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 16px; }
.sito-list { display: grid; gap: 8px; }
.lead { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); align-items: start; }
.lead-score { display: grid; gap: 2px; text-align: center; }
.lead-score .pct { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lead-score .pct.ok { color: var(--ok); } .lead-score .pct.warn { color: var(--warn); } .lead-score .pct.bad { color: var(--bad); }
.lead-score small { color: var(--muted); font-size: 11.5px; }
.lead-main { min-width: 0; display: grid; gap: 4px; }
.lead-title a { color: var(--ink); font-weight: 600; }
.lead-sub { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13.5px; color: var(--muted); }
.lead-sub b { color: var(--ink); }
.lead-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.lead-tags .tag { font-size: 12px; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted); }
.lead-tags .tag.ai { background: var(--info-weak); color: var(--info); border-color: transparent; }
.lead-act { display: grid; gap: 6px; justify-items: stretch; min-width: 150px; }
.no-form { display: grid; gap: 6px; }
.no-form select, .no-form input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: 13px; }
@media (max-width: 760px) { .lead { grid-template-columns: 56px minmax(0, 1fr); } .lead-act { grid-column: 1 / -1; grid-auto-flow: column; } }
