/* BidOps — рабочее место тендерного офиса.
   Визуальный язык — по дизайн-коду «Health Dashboard» (Ronas IT, Behance): светлая лавандово-серая подложка,
   белые карточки с крупным скруглением, индиго для того, на что можно нажать, тёмно-синяя «главная» карточка,
   бирюзовый — «сделано», строки списков — мягкие плашки, выбранная — залитая индиго. Цвета взяты пробой пикселей
   с макетов проекта (#4265CF, #303479, #22B49C, #F4F4F8, #24282E) и подогнаны под контраст 4,5:1.
   Правила, проверенные тестами интерфейса (ux/audit.py, ux/flows.py):
   1. Красный / янтарный — только срок (меньше суток / меньше трёх дней), бирюзовый — сделано.
   2. Индиго — то, на что можно нажать; залитый блок на экране один — «Сейчас» на странице лота.
   3. Текст не мельче 14 px, контраст не ниже 4,5:1, кнопки и поля не ниже 34 px. */
:root {
  --paper: #f6f6fa; --sheet: #fff; --ink: #24282e; --ink2: #4a4f5c; --muted: #5f6472;
  --rule: #e7e8ef; --rule2: #d3d6e2; --hover: #f7f7fb; --row: #f4f4f8;
  --accent: #4265cf; --accent-dk: #3554b8; --accent-tint: #eef1fb; --accent-line: #cbd5f4;
  --navy: #303479; --now: #3a5bc4; --teal: #22b49c;
  --ok: #0e7a68; --ok-tint: #e6f6f2; --ok-line: #b5e3d8;
  --warn: #9a5800; --warn-tint: #fff4e2; --warn-line: #f2d29a; --warn-edge: #e59a1a;
  --bad: #b8312a; --bad-tint: #fcebea; --bad-line: #f2c0bb;
  --neutral-tint: #f0f1f6;
  --font: "Manrope", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --r: 16px; --r-sm: 12px;
  --rail: 104px;
  /* старые имена — для шаблонов, которые ещё на них ссылаются */
  --bg: var(--paper); --panel: var(--sheet); --line: var(--rule); --soft: var(--row); --link: var(--accent);
  --brand: var(--accent); --accent-soft: var(--accent-tint); --ok-soft: var(--ok-tint); --warn-soft: var(--warn-tint);
  --bad-soft: var(--bad-tint); --amber: var(--warn-edge);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 72px; }   /* якорь не уходит под закреплённую шапку */
body { font: 16px/1.5 var(--font); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; margin: 0 0 6px; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 700; margin: 28px 0 12px; letter-spacing: -.005em; }
h3 { font-size: 17px; line-height: 1.35; font-weight: 700; margin: 16px 0 8px; }
small, .muted { color: var(--muted); }
.note { font-size: 14px; color: var(--ink2); }
code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; }
td.num, th.num, .num, .due, .plan, .kv, .stat b, .counts, .when, .qitem .meta, .kcard .c { font-variant-numeric: tabular-nums; }

/* ---------------- оболочка: разделы слева, поиск и пользователь сверху ---------------- */
body.shell { padding-left: var(--rail); }
.rail { position: fixed; z-index: 25; left: 0; top: 0; bottom: 0; width: var(--rail); background: var(--sheet);
  border-right: 1px solid var(--rule); display: flex; flex-direction: column; align-items: stretch; padding: 14px 8px 12px; }
.brand { display: block; text-align: center; color: var(--accent); font-weight: 800; font-size: 18px; letter-spacing: -.02em;
  margin: 2px 0 18px; line-height: 40px; }
.brand span { color: var(--ink); }
.brand:hover { text-decoration: none; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; min-height: 0; }
.nav > a, .nav > details > summary { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 9px;
  color: var(--ink2); font-size: 14px; font-weight: 600; border-radius: var(--r-sm); text-align: center; cursor: pointer;
  list-style: none; line-height: 1.2; }
.nav > details > summary::-webkit-details-marker { display: none; }
.nav .ico { width: 40px; height: 40px; padding: 9px; border-radius: 50%; flex: none; transition: background .15s, color .15s; }
.nav > a:hover, .nav > details > summary:hover { color: var(--ink); text-decoration: none; }
.nav > a:hover .ico, .nav > details > summary:hover .ico { background: var(--accent-tint); color: var(--accent); }
.nav > a.on, .nav > details.on > summary { color: var(--accent); }
.nav > a.on .ico, .nav > details.on > summary .ico { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(66,101,207,.32); }
.nav > details.more { margin-top: auto; position: relative; }
.nav details, .who { position: relative; }
.drop { position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--sheet); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r-sm); box-shadow: 0 16px 40px rgba(36,40,46,.16); padding: 6px; z-index: 30; }
.nav .drop { top: auto; bottom: 0; left: calc(100% + 10px); }
.drop a { display: block; padding: 10px 12px; border-radius: 9px; color: var(--ink); font-size: 15.5px; }
.drop a:hover { background: var(--row); text-decoration: none; }
.drop a.on { font-weight: 700; background: var(--accent-tint); color: var(--accent); }
.drop .note { padding: 6px 12px 8px; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 68px;
  padding: 0 28px; background: rgba(246,246,250,.94); backdrop-filter: blur(6px); }
.qsearch { flex: 0 1 520px; position: relative; }
.qsearch input { width: 100%; height: 44px; padding: 8px 18px 8px 44px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--sheet) no-repeat 17px 50% / 17px; font: inherit; font-size: 15px; color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235f6472' stroke-width='1.8'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E"); }
.qsearch input:focus { border-color: var(--accent); outline: 3px solid var(--accent-line); outline-offset: 0; }
.who { margin-left: auto; }
.who > summary { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 6px; list-style: none; cursor: pointer;
  color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap; border-radius: 999px; }
.who > summary:hover { background: var(--sheet); }
.who > summary::-webkit-details-marker { display: none; }
.who > summary::after { content: "▾"; font-size: 12px; color: var(--muted); margin-right: 6px; }
.who .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-weight: 700; }
.who .drop { left: auto; right: 0; }
.who form { margin: 0; }
button.linklike { background: none; border: 0; color: var(--accent); font: inherit; font-size: 15.5px; padding: 10px 12px;
  width: 100%; text-align: left; cursor: pointer; border-radius: 9px; min-height: 0; justify-content: flex-start; font-weight: 600; }
button.linklike:hover { background: var(--row); }
/* ход задания у пункта меню: только пока задание идёт */
.navbar { display: none; }
.navbar.on { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.navbar .pbar { width: 56px; height: 5px; background: var(--neutral-tint); }
.navbar .pbar > span { background: var(--accent); }
.navbar .nb-t { font-size: 14px; color: var(--ink2); font-weight: 600; }
.tabs .navbar.on { display: inline-flex; flex-direction: row; margin-left: 8px; }
.tabs .navbar .pbar > span { background: var(--accent); }

/* полоса идущих заданий: видна, только пока что-то идёт */
.jobstrip:empty { display: none; }
.jobstrip { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; margin: 0 28px 4px; padding: 10px 16px;
  background: var(--accent-tint); border-radius: var(--r-sm); font-size: 14px; }
.jobstrip .navh { font-weight: 650; color: var(--ink); }
.jobstrip a.sidejob { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); min-height: 24px; }
.jobstrip a.sidejob:hover { text-decoration: none; }
.jobstrip .sj-t { font-weight: 600; }
.jobstrip .sj-n { color: var(--ink2); }
.jobstrip .sj-step { color: var(--muted); }
.jobstrip .pbar { width: 90px; height: 6px; background: #fff; }
.jobstrip .pbar > span { background: var(--accent); }
.jobstrip .sj-ok { color: var(--ok); } .jobstrip .sj-bad { color: var(--bad); }
.jobstrip .sj-all { color: var(--accent); margin-left: auto; }

/* ---------------- страница ---------------- */
.page { max-width: 1520px; margin: 0 auto; padding: 8px 28px 70px; }
body.bare .page { padding-top: 24px; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.top .muted, .top .note { font-size: 15px; color: var(--ink2); }
.crumbs { font-size: 14.5px; color: var(--ink2); margin-bottom: 6px; }
.panel { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 18px 22px; margin-bottom: 16px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel.bad { border-color: var(--bad-line); background: var(--bad-tint); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(330px, 1fr); align-items: start; }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: 1fr; } }
.stat { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font-size: 24px; }
.stat span { color: var(--ink2); font-size: 14px; }
.counts { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 4px 0 18px; color: var(--ink2); font-size: 15.5px; }
.counts b { color: var(--ink); font-size: 20px; font-weight: 700; margin-right: 6px; }
.counts a { color: inherit; }
.counts a:hover b { color: var(--accent); }
.counts .hot b { color: var(--bad); }

/* ---------------- таблицы ---------------- */
table { width: 100%; border-collapse: collapse; background: var(--sheet); }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; font-size: 15px; }
th { font-size: 14px; color: var(--ink2); font-weight: 650; background: var(--sheet); white-space: nowrap; }
tr:last-child > td { border-bottom: 0; }
tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); }
.tablewrap table { border: 0; }
.tablewrap th { border-bottom: 1px solid var(--rule); color: var(--muted); font-weight: 600; }
.compact td { font-size: 15px; padding: 8px 8px; }
.compact b { font-weight: 600; }
td a, .qitem .what a { display: inline-block; min-height: 24px; min-width: 24px; }
.lothead .meta a, .crumbs a, .alerts a, .kv a { display: inline-block; line-height: 24px; }

/* ---------------- метки ---------------- */
/* этап лота — нейтральная метка: этап читается словом, цвет оставлен сигналам */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; white-space: nowrap; line-height: 1.45;
  background: var(--neutral-tint); color: var(--ink2); border: 1px solid transparent; font-weight: 500; }
.st-new, .st-client_yes, .st-in_work, .st-package, .st-qc, .st-ready, .st-submitted { background: var(--neutral-tint); color: var(--ink); }
.st-offered { background: #fff; color: var(--ink2); border: 1px dashed var(--rule2); }
.st-won, .st-contract, .rv-confirmed, .cov-covered, .ok { background: var(--ok-tint); color: var(--ok); border-color: var(--ok-line); }
.st-lost, .st-client_no, .st-cancelled { background: #fff; color: var(--muted); border-color: var(--rule); }
.rv-pending, .cov-partial, .warn { background: var(--warn-tint); color: var(--warn); border-color: var(--warn-line); }
.rv-rejected, .cov-gap, .bad { background: var(--bad-tint); color: var(--bad); border-color: var(--bad-line); }
.rv-code { background: var(--neutral-tint); color: var(--ink2); }
.flag { font-size: 14px; padding: 3px 9px; border-radius: 6px; margin: 3px 0; border: 1px solid transparent; }
.flag.info { background: var(--paper); color: var(--ink2); }
.risk-overdue { color: var(--bad); font-weight: 650; }
.risk-risk { color: var(--warn); font-weight: 650; }
.pill.soft { background: transparent; border: 1px dashed var(--rule2); color: var(--ink2); }
.pill.bad { border-color: var(--bad-line); color: var(--bad); background: var(--bad-tint); }
.pill.warnpill { background: var(--warn-tint); color: var(--warn); border-color: var(--warn-line); }
a.pill:hover { text-decoration: none; border-color: currentColor; }

/* срок подачи — главный ориентир на любом экране */
.due { display: inline-block; white-space: nowrap; font-size: 14px; font-weight: 700; padding: 0 10px; border-radius: 8px;
  border: 1.5px solid currentColor; line-height: 24px; }
.due-ok { color: var(--ok); background: #fff; }
.due-warn { color: var(--warn); background: var(--warn-tint); }
.due-bad { color: #fff; background: var(--bad); border-color: var(--bad); }
.due-none { color: var(--muted); border-style: dashed; font-weight: 500; background: #fff; }
.due.big { font-size: 19px; line-height: 36px; padding: 0 14px; }
.when { display: block; color: var(--ink2); font-size: 14px; white-space: nowrap; margin-top: 2px; }

/* ---------------- формы и кнопки ---------------- */
form.inline { display: inline; }
label { display: block; font-size: 14.5px; color: var(--ink2); margin: 10px 0 4px; font-weight: 500; }
label.chk { display: flex; gap: 9px; align-items: flex-start; color: var(--ink); font-size: 15.5px; margin: 6px 0; font-weight: 400;
  min-height: 26px; cursor: pointer; }
label.chk input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
label.chk.inline { display: inline-flex; margin-right: 14px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=email],
input[type=search], select, textarea { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--rule2); border-radius: 10px;
  font: inherit; font-size: 15.5px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent-line); outline-offset: 0; }
input[type=file] { font-size: 15px; min-height: 34px; padding: 4px 0; }
input[type=file]::file-selector-button { font: inherit; font-size: 15px; padding: 6px 12px; margin-right: 10px; border-radius: 7px;
  border: 1px solid var(--rule2); background: #fff; color: var(--ink); cursor: pointer; }
textarea { min-height: 70px; }
textarea.copy { min-height: 140px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; background: var(--paper); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 170px; }
.row > .shrink { flex: 0 0 auto; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 18px;
  border-radius: 10px; border: 1px solid var(--rule2); background: #fff; color: var(--ink); font: inherit; font-size: 15.5px;
  font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.25; }
button:hover, .btn:hover { background: var(--paper); border-color: #a9b3bd; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(66,101,207,.25); }
button.primary:hover, .btn.primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); }
/* действие в строке списка: видно, что нажимается, но не спорит с содержимым */
button.tint, .btn.tint { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent); }
button.tint:hover, .btn.tint:hover { background: #e2e7f8; border-color: var(--accent-line); }
button.danger { color: var(--bad); border-color: var(--bad-line); }
button.danger:hover { background: var(--bad-tint); }
button.small, .btn.small { min-height: 34px; padding: 5px 12px; font-size: 15px; }
.btn.big, button.big { min-height: 46px; padding: 10px 22px; font-size: 17px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.busy { opacity: .6; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ok-mark { color: var(--ok); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-end; margin-bottom: 14px; }
.filters > div { flex: 0 1 240px; }
.filters > .grow { flex: 1 1 280px; }
.flash { padding: 12px 16px; border-radius: var(--r-sm); margin-bottom: 12px; border: 1px solid var(--rule); background: var(--sheet); font-size: 15.5px; }
.flash.ok { background: var(--ok-tint); border-color: var(--ok-line); color: #145a37; }
.flash.warn { background: var(--warn-tint); border-color: var(--warn-line); color: #6b3e00; }
.flash.bad { background: var(--bad-tint); border-color: var(--bad-line); color: #8f1f18; }
details > summary { cursor: pointer; color: var(--accent); min-height: 24px; }
details.panel > summary { font-weight: 650; color: var(--ink); font-size: 17px; list-style: none; display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap; min-height: 28px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "▸"; color: var(--muted); font-size: 14px; width: 12px; }
details.panel[open] > summary::before { content: "▾"; }
details.panel > summary .note { font-weight: 400; }
details.panel[open] > summary { margin-bottom: 10px; }
/* баллы 0–3: кнопки-сегменты вместо мелких кружков */
.seg { display: inline-flex; border: 1px solid var(--rule2); border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 34px; font-size: 15px;
  font-weight: 600; color: var(--ink2); cursor: pointer; border-left: 1px solid var(--rule2); background: #fff; }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--accent-line); outline-offset: -3px; }

/* ---------------- «Сегодня»: очередь действий ---------------- */
.alerts { margin-bottom: 16px; }
.alerts > div { padding: 14px 18px; border-left: 4px solid var(--warn-edge); background: var(--sheet); border-radius: var(--r-sm);
  margin-bottom: 8px; font-size: 15.5px; box-shadow: inset 0 0 0 1px var(--rule); }
.alerts > div.bad { border-left-color: var(--bad); }
.alerts .cf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 8px; }
.alerts .cf .t { flex: 1 1 100%; color: var(--ink); }
.queue { display: flex; flex-direction: column; gap: 8px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; }
.qitem { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--row);
  border-radius: var(--r-sm); padding: 12px 16px; border-left: 4px solid transparent; }
.qitem.urgent { border-left-color: var(--bad); }
.qitem.soon { border-left-color: var(--warn-edge); }
.qitem .what { font-weight: 650; font-size: 16.5px; line-height: 1.35; }
.qitem .what a { color: var(--ink); }
.qitem .meta { font-size: 14px; color: var(--ink2); display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; }
.qitem .go { text-align: right; }
@media (max-width: 760px) { .qitem { grid-template-columns: 1fr; } .qitem .go { text-align: left; } }
.section-h { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.section-h h2 { margin: 0; }
.section-h .note { margin-left: auto; }
.rows > div { padding: 8px 0; border-bottom: 1px solid var(--rule); display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.rows > div:last-child { border-bottom: 0; }

/* ---------------- лоты: доска по этапам ---------------- */
.viewswitch { display: inline-flex; border: 1px solid var(--rule2); border-radius: 8px; overflow: hidden; background: #fff; }
.viewswitch a { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; color: var(--ink2); font-size: 15px; font-weight: 600; }
.viewswitch a + a { border-left: 1px solid var(--rule2); }
.viewswitch a.on { background: var(--accent-tint); color: var(--accent); }
.viewswitch a:hover { text-decoration: none; background: var(--paper); }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(176px, 1fr)); gap: 10px; overflow-x: auto;
  padding-bottom: 8px; align-items: start; }
.kcol { background: #eceef5; border-radius: var(--r); padding: 12px 10px; min-height: 160px; }
.kcol > h3 { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; font-size: 15.5px; padding: 2px 2px 8px; }
.kcol > h3 .no { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--sheet); color: var(--accent); font-size: 14px; font-weight: 800; flex: none; }
.kcol > h3 .n { margin-left: auto; color: var(--ink2); font-size: 14px; font-weight: 600; }
.kcol .empty { color: var(--ink2); font-size: 14px; padding: 6px 4px; }
.kcard { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 12px 13px; margin-bottom: 8px; }
.kcard.urgent { box-shadow: inset 4px 0 0 var(--bad); }
.kcard.soon { box-shadow: inset 4px 0 0 var(--warn-edge); }
.kcard .t { font-weight: 650; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); }
.kcard .t:hover { text-decoration: underline; }
.kcard .c { font-size: 14px; color: var(--ink2); margin-top: 4px; }
.kcard .d { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 7px; }
.kcard .d .when { display: inline; margin: 0; }
.kcard .n2 { margin-top: 9px; }
.kcard .n2 .btn { width: 100%; white-space: normal; text-align: center; }
.kcard .flag { margin-top: 6px; }
.kcard .risk-risk { color: var(--warn); }
.nowrap { white-space: nowrap; }

/* ---------------- лот: путь, «Сейчас», справка ---------------- */
.lothead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 28px; align-items: start; margin-bottom: 14px; }
.lothead h1 { font-size: 24px; }
.lothead .meta { color: var(--ink2); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 15px; }
.lothead .side-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 760px) { .lothead { grid-template-columns: 1fr; } .lothead .side-act { align-items: flex-start; } }
.stepper { display: flex; list-style: none; margin: 0 0 14px; padding: 16px 18px; background: var(--sheet); border: 1px solid var(--rule);
  border-radius: var(--r); gap: 0; overflow-x: auto; counter-reset: st; }
.stepper li { flex: 1 1 0; min-width: 120px; position: relative; padding: 0 8px 0 36px; counter-increment: st; }
.stepper li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--rule2); background: #fff; color: var(--ink2); font-size: 14px; font-weight: 700; line-height: 23px; text-align: center; }
.stepper li::after { content: ""; position: absolute; left: 30px; right: 8px; top: 13px; height: 1.5px; background: var(--rule); z-index: 0; }
.stepper li:last-child::after { display: none; }
.stepper li b { position: relative; z-index: 1; background: var(--sheet); padding: 0 6px; margin-left: -6px; font-size: 15px;
  font-weight: 600; color: var(--ink2); }
.stepper li span { display: block; font-size: 14px; color: var(--ink2); margin-top: 2px; }
.stepper li.done::before { content: "✓"; background: var(--teal); border-color: var(--teal); color: #fff; }
.stepper li.done b, .stepper li.done span { color: var(--ink2); font-weight: 500; }
.stepper li.cur::before { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 5px var(--accent-tint); }
.stepper li.cur b { color: var(--ink); font-weight: 700; }
.stepper li.cur span { color: var(--ink); font-weight: 600; }
.stepper li.late::before { background: var(--bad); border-color: var(--bad); color: #fff; }
.stepper li.late b { color: var(--ink); font-weight: 700; }
.stepper li.late span { color: var(--bad); font-weight: 600; }
.now { background: var(--now); color: #fff; border-radius: var(--r); padding: 20px 24px 22px; margin-bottom: 16px;
  box-shadow: 0 14px 34px rgba(58,91,196,.28); }
.now > .lbl, .now .split .lbl { display: inline-block; font-size: 14px; font-weight: 700; color: #fff; background: rgba(16,24,72,.32);
  border-radius: 999px; padding: 2px 12px; margin-bottom: 8px; }
.now h2 { margin: 0 0 6px; font-size: 24px; color: #fff; font-weight: 700; }
.now .why { color: #e8ecfb; margin: 0 0 16px; max-width: 900px; }
.now label { color: #e8ecfb; }
.now .note { color: #e8ecfb; }
.now a:not(.btn) { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.now button.primary, .now .btn.primary { background: #fff; color: var(--now); border-color: #fff; box-shadow: 0 6px 16px rgba(20,30,80,.25); }
.now button.primary:hover, .now .btn.primary:hover { background: var(--accent-tint); border-color: var(--accent-tint); }
.now button:not(.primary):not(.danger), .now .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.now button:not(.primary):not(.danger):hover, .now .btn:not(.primary):hover { background: rgba(255,255,255,.12); }
.now button.danger { background: #fff; color: var(--bad); border-color: #fff; }
.now input[type=file] { color: #fff; }
.now .flash { color: var(--ink); }
.now .flash .note { color: var(--ink2); }
.now .flash a { color: var(--accent); }
.now .more { margin-top: 18px; border-top: 1px solid rgba(255,255,255,.25); padding-top: 12px; }
.now .more > summary { color: #fff; font-weight: 600; }
.now .more .note, .now .more label { color: #e8ecfb; }
.now.late { background: var(--navy); box-shadow: 0 14px 34px rgba(48,52,121,.3); }
.now.late > .lbl { background: var(--bad); }
.now .choice > details { background: #fff; color: var(--ink); border-color: transparent; }
.now .choice > details > summary { color: var(--ink); }
.now .choice label, .now .choice .note { color: var(--ink2); }
.now .choice a:not(.btn) { color: var(--accent); }
.now .choice button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.now .choice button.danger { color: var(--bad); border-color: var(--bad-line); }
.now .tgmsg { background: rgba(255,255,255,.14); }
.now .tgmsg .bubble { color: var(--ink); }
.now .flag.warn { background: var(--warn-tint); color: var(--warn); border-color: var(--warn-line); }
.now .pbar { background: rgba(255,255,255,.25); }
.now .pbar > span { background: #fff; }
.now .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: 24px; align-items: start; }
@media (max-width: 1000px) { .now .split { grid-template-columns: 1fr; } }
/* выбор «подали / не подали»: сначала решение, потом короткая форма */
.choice { display: flex; flex-direction: column; gap: 10px; }
.choice > details { border: 1px solid var(--rule2); border-radius: 9px; background: #fff; }
.choice > details > summary { list-style: none; padding: 11px 14px; font-weight: 650; color: var(--ink); display: flex; gap: 10px; align-items: center; }
.choice > details > summary::-webkit-details-marker { display: none; }
.choice > details > summary::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--rule2); flex: none; }
.choice > details[open] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-line); }
.choice > details[open] > summary::before { border: 5px solid var(--accent); }
.choice > details > form, .choice > details > .body { padding: 0 14px 14px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 14px; font-size: 15px; }
.kv > div:nth-child(odd) { color: var(--ink2); }
.next { font-weight: 650; }
.waitnote { color: var(--ink2); font-size: 14px; }
/* справка по лоту: одна панель, разделы через линию */
.side { padding: 4px 20px; }
.side > .sec { padding: 14px 0; border-top: 1px solid var(--rule); }
.side > .sec:first-child { border-top: 0; }
.side > .sec > h3 { margin: 0 0 8px; font-size: 16px; }
.side > details.sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink);
  font-weight: 650; font-size: 16px; min-height: 28px; }
.side > details.sec > summary::-webkit-details-marker { display: none; }
.side > details.sec > summary::after { content: "▾"; margin-left: auto; color: var(--muted); font-size: 13px; }
.side > details.sec[open] > summary::after { content: "▴"; }
.side > details.sec[open] > summary { margin-bottom: 10px; }
.side > details.sec > summary .note, .side > details.sec > summary .pill { font-weight: 500; }

.steps { display: flex; gap: 0; margin: 8px 0 4px; flex-wrap: wrap; }
.steps span { padding: 5px 12px; font-size: 14px; background: var(--paper); border: 1px solid var(--rule); margin-right: -1px; color: var(--ink2); }
.steps span.done { background: var(--ok-tint); color: var(--ok); }
.steps span.cur { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 650; }
.plan { list-style: none; padding: 0; margin: 0; }
.plan li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--rule); font-size: 15px; }
.plan li:last-child { border-bottom: 0; }
.plan li.done { color: var(--muted); }
.plan li.done > span:first-child::before { content: "✓ "; color: var(--ok); }
.plan li.overdue, .plan li.expired { color: var(--bad); font-weight: 650; }
.plan li.risk { color: var(--warn); font-weight: 650; }
.plan li.current { color: var(--accent); font-weight: 650; }
.plan li.after_decision { color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.board .day { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px; min-height: 100px; font-size: 14px; }
.board .day.over { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.board .day.today { border-color: var(--accent); box-shadow: inset 0 4px 0 var(--accent); }
.board .day b { display: block; margin-bottom: 4px; }
.board .it { padding: 4px 0; border-top: 1px dashed var(--rule); }
.board .chain { margin-top: 2px; line-height: 1.45; }
.board .chain .overdue, .board .expired-list .risk-overdue { color: var(--bad); font-weight: 650; }
.board .chain .risk { color: var(--warn); font-weight: 650; }
.board .chain .current { color: var(--accent); font-weight: 650; }
@media (max-width: 900px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.expired-list { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--bad-line); border-left: 4px solid var(--bad); border-radius: 8px;
  font-size: 15px; background: var(--sheet); }

/* ---------------- вкладки, фишки ---------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; padding: 10px 14px; border-bottom: 3px solid transparent; color: var(--ink2);
  margin-bottom: -1px; font-size: 15.5px; font-weight: 550; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.chips { margin-bottom: 6px; }
.chips a { display: inline-flex; align-items: center; min-height: 34px; margin: 0 6px 8px 0; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--rule2); background: #fff; font-size: 14.5px; color: var(--ink); font-weight: 500; }
.chips a:hover { border-color: var(--accent); text-decoration: none; }
.chips a.on { background: var(--accent-tint); color: var(--accent); border-color: var(--accent-line); font-weight: 650; }
.chips a .n { color: var(--ink2); margin-left: 5px; font-variant-numeric: tabular-nums; }
.chips a.on .n { color: var(--accent); }

/* ---------------- проверка карточек ---------------- */
.review { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .review { grid-template-columns: 1fr; } }
.viewer { position: sticky; top: 70px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px; }
.viewer img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); background: #fafafa; }
.viewer .pg { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.viewer .pg a { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 26px; padding: 0 8px;
  border: 1px solid var(--rule); border-radius: 5px; font-size: 14px; }
.viewer .pg a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.viewer .pg a.in { border-color: var(--accent-line); }
.viewer pre { white-space: pre-wrap; max-height: 75vh; overflow: auto; font-size: 14px; background: var(--paper); padding: 10px; }
.card { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; background: var(--sheet); }
.card .head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.fields { width: 100%; margin-top: 6px; }
.fields td { padding: 5px 8px; border-bottom: 1px solid var(--paper); font-size: 15px; }
.fields td:first-child { color: var(--ink2); width: 34%; }
.fields tr.edited td:nth-child(2) { background: #fff6dc; }
.challenge { background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 12px 14px; margin: 12px 0; }
.sticky-bar { position: sticky; bottom: 0; background: var(--sheet); border-top: 1px solid var(--rule); padding: 12px 0; margin-top: 12px; }

.log { white-space: pre-wrap; background: #16202a; color: #dbe3ea; padding: 12px 14px; border-radius: 8px; max-height: 60vh;
  overflow: auto; font: 14px/1.5 ui-monospace, Consolas, monospace; }
.login { margin: 12vh auto; width: 380px; }
.errpage { margin: 15vh auto; max-width: 560px; text-align: center; }
.lotcard { border-left: 4px solid var(--accent); }
.file { color: var(--ink2); font-size: 14px; word-break: break-word; }

/* Telegram */
.pair { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.paircode { font-size: 32px; font-weight: 700; letter-spacing: 6px; padding: 8px 16px; border: 2px dashed var(--accent-line);
  border-radius: 8px; background: var(--accent-tint); color: var(--accent); }
ol.howto { margin: 6px 0 4px; padding-left: 22px; }
ol.howto li { margin: 4px 0; }
.tgmsg { background: #e8eef2; border-radius: 12px; padding: 10px; max-width: 460px; }
.tgmsg .bubble { background: #fff; border-radius: 12px 12px 12px 3px; padding: 10px 12px; white-space: pre-wrap; font-size: 15px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.tgmsg .bubble .from { color: #1f5f9e; font-weight: 650; font-size: 14px; margin-bottom: 2px; }
.tgmsg .kb { display: grid; gap: 4px; margin-top: 4px; }
.tgmsg .kb div { display: flex; gap: 4px; }
.tgmsg .kb span { flex: 1; text-align: center; background: rgba(255,255,255,.85); border-radius: 7px; padding: 6px 8px;
  font-size: 14px; color: #1f5e9c; }
.tgmsg .kb span.gone { opacity: .45; text-decoration: line-through; }
.tgmsg .ans { margin-top: 6px; font-size: 14px; color: var(--ok); font-weight: 650; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: #c0c6d0; }
.dot.on { background: var(--ok); } .dot.wait { background: #d98a00; } .dot.off { background: #c0c6d0; } .dot.err { background: var(--bad); }
.where td:nth-child(2) { white-space: nowrap; }
code.cmd { background: var(--paper); border: 1px solid var(--rule); border-radius: 5px; padding: 1px 7px; font-weight: 600; }

/* ход заданий */
.pbar { display: block; height: 7px; background: var(--neutral-tint); border-radius: 4px; overflow: hidden; }
.pbar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .6s ease; }
.pbar.big { height: 11px; margin-top: 10px; }
.pbar.indet > span { width: 35% !important; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .pbar.indet > span { animation: none; } .pbar > span { transition: none; } }
.jobhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.jobmini { display: inline-block; min-width: 240px; vertical-align: middle; margin-left: 6px; }
.jobmini .pbar { margin: 4px 0 2px; }

/* ниши клиента */
.niche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 14px; margin: 4px 0 8px; }
.niche-grid > .niche { padding: 7px 9px; border: 1px solid var(--rule); border-radius: 8px; margin: 2px 0; }
.niche-grid > .niche:has(> label input:checked) { border-color: var(--accent-line); background: var(--accent-tint); }
.niche-roles { margin: 4px 0 2px 26px; display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: baseline; }
.niche-roles label.chk { margin: 0; font-size: 14.5px; }
.niche-roles > .note { flex-basis: 100%; }
.niche-scope { display: block; margin-top: 1px; }
details.kw { border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 14px; margin: 10px 0; background: var(--sheet); }
details.kw > summary { cursor: pointer; }
details.kw h4 { margin: 12px 0 4px; font-size: 14.5px; color: var(--ink2); }
table.kwt td { vertical-align: top; }
.kwv { margin-top: 4px; }
.kwpart { display: inline; }
pre.kwraw { white-space: pre-wrap; max-height: 420px; overflow: auto; font-size: 14px; background: var(--paper); padding: 10px; border-radius: 8px; }
table.rd td { vertical-align: top; }
td.rdm { font-weight: 700; text-align: center; font-size: 16px; }
tr.rd-ok td.rdm { color: var(--ok); }
tr.rd-warn td.rdm { color: var(--warn); }
tr.rd-missing td.rdm { color: var(--bad); }
tr.rd-manual td.rdm { color: var(--muted); }
details.fit summary { cursor: pointer; }
textarea.kwta { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; }
table.gt td { vertical-align: middle; }
ul.kwlist { font-size: 14.5px; max-height: 360px; overflow: auto; margin: 4px 0 10px; padding-left: 20px; }
ul.kwlist li { margin: 2px 0; }

@media (max-width: 1180px) { .qsearch input { width: 220px; } .nav > a, .nav > details > summary { padding: 0 9px; } }
@media (max-width: 760px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 6px 12px; }
  .nav { flex-wrap: wrap; height: auto; }
  .nav > a, .nav > details > summary { padding: 8px 10px; height: auto; }
  .qsearch { order: 5; flex: 1 1 100%; margin: 4px 0; } .qsearch input { width: 100%; }
  .page { padding: 14px 16px 40px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .panel { overflow-x: auto; }
  .jobstrip { display: none; }
}
.nav + .who { margin-left: auto; }
.dash .section-h:first-child { margin-top: 0; }
.dash > div > .section-h:first-child h2 { margin-top: 0; }
.alerts .choose { border-left-color: var(--accent); }
.alerts .choose .cf { border-top: 1px solid var(--rule); padding-top: 8px; }
.filterbar { margin-bottom: 12px; }
.filterbar .frow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.filterbar .flabel { flex: 0 0 72px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.filterbar .chips { margin-bottom: 0; flex: 1 1 400px; }

/* ---------------- «Сегодня»: приветствие и плитки ---------------- */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 2px 0 14px; }
.hello h1 { font-size: 28px; font-weight: 500; margin: 0; }
.hello .when { display: block; color: var(--muted); font-size: 15px; margin-top: 2px; }
.tiles { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--r); padding: 10px 16px; color: var(--ink);
  display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: center; min-height: 66px; }
a.tile:hover { text-decoration: none; border-color: var(--accent-line); }
.tile .big { grid-row: span 2; font-size: 30px; font-weight: 600; line-height: 1; letter-spacing: -.02em; min-width: 30px; text-align: center; }
.tile .tt { font-size: 15px; font-weight: 700; line-height: 1.25; }
.tile .sub { font-size: 14px; color: var(--muted); line-height: 1.3; }
.tile.main { background: var(--navy); border-color: var(--navy); color: #fff; }
.tile.main .sub { color: #c9d3f5; }
.tile.main .alarm { color: #ffd2cd; font-weight: 600; }
.now details > summary { color: #fff; }
.now .flag a, .now .flash a, .now .tgmsg a { color: var(--accent); }
.now .choice > details > summary { color: var(--ink); }
.now textarea.copy { background: #fff; color: var(--ink); }
.now .actions .note, .now form .note { color: #e8ecfb; }
.qitem .what a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- задачи: доска «К выполнению → В работе → Готово», форма новой задачи ---------------- */
.tboard { grid-template-columns: repeat(4, minmax(220px, 1fr)); }
.tcol { transition: background .12s, box-shadow .12s; }
.tcol.over { background: var(--accent-tint); box-shadow: inset 0 0 0 2px var(--accent-line); }
.tcol > h3 .tdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tdot-open { background: var(--muted); }
.tdot-in_progress { background: var(--navy); }
.tdot-waiting { background: var(--warn-edge); }
.tdot-done { background: var(--teal); }
.tlist { min-height: 60px; }
.tcard { cursor: grab; }
.tcard:active { cursor: grabbing; }
.tcard.dragging { opacity: .45; }
.tcard .tmove { margin-top: 9px; }
.tmsg { min-height: 22px; font-size: 14px; color: var(--ok); margin: 2px 0 8px; font-weight: 600; }
.tmsg.bad { color: var(--bad); }
.tstat { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 14px; white-space: nowrap; line-height: 1.5; }
.tstat-open { background: var(--neutral-tint); color: var(--ink2); }
.tstat-in_progress { background: #e7e8f4; color: var(--navy); }
.tstat-waiting { background: var(--warn-tint); color: var(--warn); }
.tstat-done, .tstat-accepted { background: var(--ok-tint); color: var(--ok); }
.mytasks .mt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line); }
.mytasks .mt:last-of-type { border-bottom: 0; }
.mytasks .mt .tstat { flex: none; margin-top: 2px; }
.taskform .tf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.taskform .tf-wide { grid-column: 1 / -1; }
.taskform .actions { margin-top: 12px; }
.lotchip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--neutral-tint);
  color: var(--ink); font-weight: 650; font-size: 14px; }
@media (max-width: 760px) {
  .tboard { grid-template-columns: minmax(260px, 1fr); }
  .taskform .tf-grid { grid-template-columns: 1fr; }
}
.tpltable td select { min-width: 176px; }
.tpltable td input[type=text] { min-width: 320px; }
.tpltable th[style] { min-width: 0 !important; }

.firm-other{display:inline-block;vertical-align:top}.firm-other>summary{cursor:pointer;display:inline-block}.firm-other-options{display:flex;flex-wrap:wrap;gap:6px;padding:8px 0;max-width:700px}.firm-other[open]{display:block}
