/* Бюджеты
   Рабочая часть спокойная (белый, графит, тонкие линии), бренд живёт в меню, заголовках, значке и акцентах.
   Кислотно-зелёный только для действия и итога. */
:root {
  --bg: #f6f6f3;
  --panel: #ffffff;
  --ink: #141414;
  --ink-2: #3a3a38;
  --muted: #7a7a74;
  --line: #e6e6e0;
  --soft: #f3f3ef;
  --acid: #39ff14;
  --acid-soft: #efffe9;
  --acid-ink: #178a00;
  --blue: #2b35ff;
  --pink: #ff4fb3;
  --yellow: #fff033;
  --warn: #c2410c;
  --warn-bg: #fff5ed;
  --plus: #178a00;
  --minus: #d6245a;
  --radius: 14px;
  --display: "Inter Tight", "Arial Black", sans-serif;
  --shadow: 0 1px 0 rgba(0,0,0,.03), 0 10px 30px -18px rgba(0,0,0,.18);
  --side: 232px;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); font: 14px/1.45 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { background: var(--bg); min-height: 100vh; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- боковое меню ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--ink); color: #fff; z-index: 30;
  display: flex; flex-direction: column; padding: 22px 16px; overflow: hidden; }
.side::after { content: ""; position: absolute; left: -40px; bottom: 70px; width: 330px; height: 110px; opacity: .22;
  background: url(/static/brand/scribble-acid.svg) center / contain no-repeat; transform: rotate(-12deg); pointer-events: none; }
.side-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; margin: 0 4px 26px; }
.side-brand img { width: 50px; height: 50px; flex: none; transition: transform .25s; }
.side-brand:hover img { transform: rotate(-12deg) scale(1.05); }
.side-brand b { display: block; font-family: var(--display); font-weight: 900; font-size: 20px; text-transform: uppercase; line-height: 1; }
.side-brand small { color: rgba(255,255,255,.55); font-size: 12px; }
.side-new { width: 100%; margin-bottom: 18px; }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.7); text-decoration: none;
  padding: 9px 12px; border-radius: 10px; font-weight: 500; }
.side nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.side nav a.on { color: #fff; background: rgba(255,255,255,.1); }
.side nav a.on .ico { background: var(--acid); }
.ico { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.3); flex: none; }
.side-foot { margin-top: auto; position: relative; z-index: 1; }
.side .who { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: rgba(255,255,255,.8);
  font-size: 13px; padding: 10px 4px; border-top: 1px solid rgba(255,255,255,.1); }
.side .who .btn { color: rgba(255,255,255,.55); }
.side .who .btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.side .tagline { font-size: 11px; color: rgba(255,255,255,.35); padding: 4px; line-height: 1.3; }

main { margin-left: var(--side); padding: 32px 36px; max-width: calc(1500px + var(--side)); }

/* ---------- типографика ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
h1 { font-family: var(--display); font-weight: 900; font-size: 36px; line-height: .95; text-transform: uppercase;
  margin: 0; letter-spacing: -.01em; position: relative; }
h1 .mark { background: linear-gradient(transparent 62%, var(--acid) 62%, var(--acid) 92%, transparent 92%); padding: 0 2px; }
h2 { font-family: var(--display); font-weight: 800; font-size: 17px; margin: 0; text-transform: uppercase; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.back { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 10px; }
.back:hover { color: var(--ink); }

/* ---------- кнопки и поля ---------- */
.btn { border: 1px solid var(--line); background: var(--panel); padding: 8px 16px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; font-weight: 600; transition: background .15s, color .15s, border-color .15s, transform .08s; }
a.btn { text-decoration: none; color: var(--ink); display: inline-block; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--acid); border-color: var(--acid); color: var(--ink); }
.btn.primary:hover { background: #fff; border-color: #fff; box-shadow: 0 0 0 2px var(--acid) inset; }
main .btn.primary:hover { background: var(--ink); color: var(--acid); border-color: var(--ink); box-shadow: none; }
.btn.primary:disabled { opacity: .5; cursor: default; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); font-weight: 500; }
.btn.ghost:hover { color: var(--ink); background: var(--soft); border-color: transparent; }
.btn.danger { color: var(--minus); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.icon { padding: 4px 7px; border-radius: 8px; }
input[type=text], input[type=password], input[type=date], input[type=search], select, textarea {
  border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: var(--panel); width: 100%; min-width: 0; }
input:hover, select:hover, textarea:hover { border-color: #d3d3cc; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(57,255,20,.35); border-color: var(--acid-ink); }
textarea { resize: vertical; min-height: 36px; }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
input.need { border-color: var(--warn); background: var(--warn-bg); }
input[type=checkbox] { accent-color: var(--acid-ink); width: 15px; height: 15px; margin: 0; }
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
label.f > span { font-weight: 600; }
label.f input, label.f select, label.f textarea, .block-opts input, .block-opts select { color: var(--ink); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 20px 24px; }

/* ---------- список бюджетов ---------- */
.search { max-width: 320px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 14px 20px;
  border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .05em; }
table.list td { padding: 14px 20px; border-bottom: 1px solid var(--line); }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--acid-soft); }
table.list .title { font-weight: 700; font-size: 15px; }
table.list .sum { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
table.list .acts { text-align: right; white-space: nowrap; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); }
.tag.prelim { background: #fff8b8; color: #5c5200; }
.tag.agreed { background: #e3e5ff; color: #1b24c9; }
.tag.final { background: var(--acid); color: var(--ink); }
.empty { padding: 60px 24px; text-align: center; color: var(--muted); }
.empty img { width: 72px; height: 72px; display: block; margin: 0 auto 14px; }

/* ---------- редактор: шапка ---------- */
.editor-head { display: grid; grid-template-columns: 2fr 1.2fr 1.2fr 1fr; gap: 14px 16px; }
.editor-head .title-in { font-family: var(--display); font-weight: 800; font-size: 20px; padding: 8px 12px; }
.editor-head .more { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 16px;
  padding-top: 14px; border-top: 1px dashed var(--line); }
.rates-line { margin-top: 12px; font-size: 12px; color: var(--muted); }
.rates-line b { color: var(--ink-2); font-weight: 600; }
.rates-line .err { color: var(--minus); }
.layout { margin-top: 24px; padding-bottom: 110px; }

/* ---------- редактор: блок ---------- */
.block { margin-bottom: 24px; }
.block-head { border-radius: var(--radius) var(--radius) 0 0; }
.block-foot { border-radius: 0 0 var(--radius) var(--radius); }
.block-head { display: flex; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.block-num { background: var(--ink); color: var(--acid); flex: none; padding: 6px 12px; border-radius: 999px;
  font-family: var(--display); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.block-head .title { flex: 1; min-width: 220px; }
.block-head .title input { font-family: var(--display); font-weight: 800; font-size: 17px; text-transform: uppercase;
  border-color: transparent; padding-left: 4px; }
.block-head .title input:hover { border-color: var(--line); }
.block-opts { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.block-opts select { width: auto; padding: 5px 8px; }
.block-opts input { width: 90px; padding: 5px 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; background: var(--soft); }
.seg button { border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 12px; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* строки-конструктор */
.scroll { overflow-x: auto; }
.grid { min-width: 1110px; }
.g-row { display: grid; grid-template-columns: 26px minmax(230px, 1.5fr) 180px minmax(190px, 1.2fr) 180px 160px 30px;
  gap: 12px; padding: 14px 20px; align-items: start; }
.g-head { position: sticky; top: 0; z-index: 6; padding-top: 10px; padding-bottom: 10px; font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; background: var(--soft); border-bottom: 1px solid var(--line); }
.g-head .r, .g-row .r { text-align: right; }
.g-line { border-bottom: 1px solid var(--line); position: relative; }
.g-line:hover { background: #fcfcfa; }
.g-line .n { font-family: var(--display); font-weight: 800; color: #c4c4bc; padding-top: 8px; }
.stack { display: grid; gap: 6px; }
.pair { display: flex; gap: 6px; }
.pair > :first-child { flex: 1; min-width: 80px; }
.pair select { width: 74px; flex: none; }
.inline { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.inline input.num { width: 64px; padding: 5px 8px; }
.inline label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.who-pill { display: inline-flex; gap: 0; font-size: 11px; width: max-content; }
.who-pill button { white-space: nowrap; }
.who-pill button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); padding: 2px 9px; cursor: pointer; font-weight: 600; }
.who-pill button:first-child { border-radius: 999px 0 0 999px; }
.who-pill button:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.who-pill button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.money { font-variant-numeric: tabular-nums; padding-top: 7px; }
.money b { font-size: 16px; }
.money small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.brk { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; margin-top: 6px; font-size: 11px; color: var(--muted); text-align: left; }
.brk span:nth-child(even) { text-align: right; white-space: nowrap; }
.pay-vat { margin-top: 5px; padding: 3px 6px; border-radius: 6px; background: #fff8b8; color: #5c5200; font-size: 11px; text-align: left; }
.pay-vat b { font-size: 12px; }
.linkish { background: none; border: 0; padding: 0; color: var(--muted); font-size: 11px; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.linkish:hover { color: var(--ink); }
.l-acts { display: flex; flex-direction: column; gap: 0; align-items: center; opacity: .35; transition: opacity .15s; }
.l-acts .btn.icon { padding: 2px 6px; }
.g-line:hover .l-acts, .l-acts:focus-within { opacity: 1; }
.l-acts .has { color: var(--acid-ink); opacity: 1; }
.details { grid-column: 2 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -4px; }
.details label.f span { font-weight: 500; }
.details textarea.int { background: #fffcea; }
.add-line { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.add-line .btn { border-style: dashed; }
.block-foot { display: flex; gap: 32px; justify-content: flex-end; padding: 14px 20px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.block-foot div { text-align: right; }
.block-foot small { display: block; color: var(--muted); font-size: 11px; }
.block-foot .tot b { font-size: 17px; }
.block-foot .tot { padding: 2px 10px; border-radius: 8px; background: var(--acid-soft); }
.add-block { width: 100%; padding: 14px; border: 1.5px dashed #cfcfc7; background: transparent; border-radius: var(--radius); }
.add-block:hover { border-color: var(--ink); background: var(--panel); }
.meta { margin-top: 12px; font-size: 12px; color: var(--muted); }
.plus { color: var(--plus); }
.minus { color: var(--minus); }

/* ---------- нижняя панель итогов ---------- */
.summary { position: fixed; left: var(--side); right: 0; bottom: 0; z-index: 15; background: var(--panel);
  border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(0,0,0,.25);
  display: flex; align-items: center; gap: 30px; padding: 14px 36px; flex-wrap: wrap; }
.summary .kpi { font-variant-numeric: tabular-nums; }
.summary .kpi small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.summary .kpi b { font-size: 16px; }
.summary .kpi.main b { font-family: var(--display); font-weight: 900; font-size: 26px;
  background: linear-gradient(transparent 58%, var(--acid) 58%, var(--acid) 90%, transparent 90%); }
.summary .acts { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.summary .note { font-size: 11px; color: var(--muted); max-width: 190px; }
.dirty { color: var(--warn); font-size: 12px; font-weight: 600; }

.toast { position: fixed; bottom: 96px; left: calc(50% + var(--side) / 2); transform: translateX(-50%); background: var(--ink); color: var(--acid);
  padding: 10px 20px; border-radius: 999px; z-index: 50; font-weight: 700; }

/* ---------- справочники ---------- */
.settings { display: grid; gap: 22px; }
table.dict { width: 100%; border-collapse: collapse; }
table.dict th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px; text-transform: uppercase; letter-spacing: .04em; }
table.dict td { padding: 4px 8px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
.chk { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- вход ---------- */
body.login-page { background: var(--ink); overflow: hidden; position: relative; }
body.login-page::before { content: ""; position: fixed; right: -80px; top: 6%; width: 760px; height: 260px;
  background: url(/static/brand/scribble-acid.svg) center / contain no-repeat; transform: rotate(-8deg); opacity: .9; }
body.login-page::after { content: ""; position: fixed; left: 7%; bottom: 10%; width: 110px; height: 110px;
  background: url(/static/brand/spark.svg) center / contain no-repeat; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; position: relative; z-index: 1; }
.login { width: 100%; max-width: 390px; padding: 34px 30px 30px; border: 0; border-radius: 22px; position: relative; }
.login-badge { width: 84px; height: 84px; position: absolute; top: -42px; right: 26px; transform: rotate(10deg); }
.login h1 { font-size: 44px; margin: 4px 0 8px; }
.login .tagline { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.login form { display: grid; gap: 14px; }
.login .err { color: var(--minus); min-height: 18px; font-size: 13px; }
.login .btn.primary { padding: 12px; font-size: 15px; }

@media (max-width: 1100px) {
  :root { --side: 76px; }
  .side { padding: 18px 12px; }
  .side-brand span, .side nav a span, .side .tagline, .side .who span { display: none; }
  .side-brand { margin: 0 0 20px; justify-content: center; }
  .side-new { font-size: 0; padding: 10px; }
  .side-new::before { content: "+"; font-size: 20px; line-height: 1; }
  .side nav a { justify-content: center; font-size: 0; }
  .ico { width: 12px; height: 12px; }
  main { padding: 24px 20px; }
  .summary { padding: 12px 20px; gap: 18px; }
  .editor-head, .editor-head .more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  :root { --side: 0px; }
  .side { position: sticky; top: 0; width: auto; height: 60px; inset: 0 0 auto 0; flex-direction: row; align-items: center; padding: 8px 16px; gap: 10px; }
  .side::after, .side-foot { display: none; }
  .side-brand { margin: 0; }
  .side-brand img { width: 38px; height: 38px; }
  .side-new { width: auto; margin: 0 0 0 auto; }
  .side nav { display: flex; }
  main { margin-left: 0; padding: 18px 16px; }
  .summary { left: 0; padding: 10px 16px; gap: 10px; }
  .summary .kpi:not(.main), .summary .note, .summary #del, .summary #copy { display: none; }
  .summary .kpi.main b { font-size: 20px; }
  .summary .acts { margin-left: 0; width: 100%; gap: 6px; }
  .summary .acts .btn { padding: 6px 10px; font-size: 12px; flex: 1; }
  h1 { font-size: 28px; }
  .editor-head, .editor-head .more { grid-template-columns: 1fr; }
}

/* закреплённая строка заголовков: на широком экране таблица помещается целиком, прокрутка вбок не нужна */
@media (min-width: 1420px) { .scroll { overflow: visible; } }
.proj { display: flex; gap: 4px; align-items: center; }
.proj input { background: var(--acid-soft); border-color: #b9f5a6; font-weight: 600; }
.proj .btn { font-size: 11px; }
.cur-tag { align-self: center; font-size: 12px; color: var(--muted); flex: none; width: auto; }
.seg { width: max-content; }

.g-row > * { min-width: 0; }
.proj input { flex: 1; min-width: 0; }
.proj .btn { flex: none; }
.inline select.mini { width: 70px; padding: 4px 6px; }

/* нижняя панель: показатели и аванс от клиента */
.summary .kpis { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.summary .kpi em.sub { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 2px; }
.summary .kpi em.sub.rest { color: var(--ink); }
.summary .kpi em.sub b { font-size: 11px; }
.summary .kpi.adv { background: #e3e5ff; border-radius: 10px; padding: 6px 12px; }
.summary .kpi.adv small { color: #1b24c9; }
.summary .adv-in { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.summary .adv-in input { width: 120px; padding: 4px 8px; font-weight: 700; }
/* оплаты от клиента */
.pays { margin-bottom: 20px; border-left: 4px solid #2b35ff; }
.pays h2 { margin-right: 8px; }
.pays-grid { display: grid; grid-template-columns: 26px 160px 160px 90px minmax(160px, 1fr) 32px; gap: 8px 12px; align-items: center; margin-top: 14px; max-width: 900px; }
.pays-grid .p-head { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pays-grid .n { color: #c4c4bc; font-weight: 700; }
.pays-sum { font-variant-numeric: tabular-nums; font-size: 13px; }
.summary .adv-in input[type=date] { width: 140px; font-weight: 500; }
.summary .adv-btn { border: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.summary .adv-btn b { color: #1b24c9; font-size: 14px; }
.summary .adv-btn:hover { background: #d3d6ff; }
.summary .adv-btn small, .summary .adv-btn b { display: block; }
.inline input.num.wide { width: 92px; }

/* напоминание (ПИНФЛ и т.п.) */
.modal-wrap { position: fixed; inset: 0; background: rgba(20,20,20,.45); z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal { max-width: 420px; width: 100%; padding: 26px 26px 22px; text-align: center; border: 0; }
.modal-ico { width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 50%; background: #ffe2ea; color: var(--minus);
  display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 26px; }
.modal h2 { margin-bottom: 8px; }
.modal p { margin: 0 0 18px; color: var(--ink-2); }
.pinfl { display: inline-block; width: max-content; font-size: 11px; font-weight: 700; color: var(--minus); background: #ffe2ea; border-radius: 999px; padding: 1px 8px; }
.modal p.big { font-size: 17px; font-weight: 600; color: var(--ink); }

/* комментарий для клиента в конце строки расхода */
.client-note { grid-column: 2 / -1; margin-top: -4px; }
.client-note input { font-size: 12px; background: var(--soft); border-color: transparent; }
.client-note input:hover, .client-note input:focus { background: var(--panel); }
/* штраф агентства */
.penalty { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: #fff0f4; }
.penalty .pen-label { font-weight: 700; color: var(--minus); }
.penalty .pair input { width: 130px; }
.penalty > input { width: 260px; }
.pays-sum { margin-top: 12px; }

/* узкая колонка «Автор» в списке бюджетов */
table.list th.author, table.list td.author { width: 1%; white-space: nowrap; padding-left: 8px; padding-right: 8px; font-size: 12px; color: var(--muted); }
table.list .title { word-break: break-word; }
table.list th:first-child, table.list td:first-child { width: 30%; min-width: 240px; }

/* плановая дата оплаты подрядчику под суммой «на руки» */
.paydate { margin-top: 2px; }
.paydate span { font-weight: 500; font-size: 11px; }
.paydate input { padding: 5px 8px; font-size: 12px; }
table.list td.proj-no { width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.list th.proj-no { width: 1%; min-width: 96px; white-space: normal; }
table.list th .small { text-transform: none; letter-spacing: 0; font-weight: 500; }

/* загрузка в Agency и архив */
.btn.agency-go { background: var(--acid); border-color: var(--ink); color: var(--ink); font-family: var(--display); font-weight: 900;
  text-transform: uppercase; letter-spacing: .02em; padding: 10px 18px; box-shadow: 3px 3px 0 var(--ink); }
.btn.agency-go:hover { background: var(--ink); color: var(--acid); }
.btn.agency-go:disabled { opacity: .6; }
.archived-banner { background: var(--ink); color: var(--acid); border-radius: 10px; padding: 10px 14px; font-weight: 700; margin-bottom: 12px; }
.tag.archived { background: var(--ink); color: var(--acid); }
.agency-log { margin-top: 20px; }
.agency-log tr.bad td { background: #fff0f4; }
.modal.wide { max-width: 860px; text-align: left; }
.modal .prev td, .modal .prev th { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.modal .problems { background: #fff0f4; border-radius: 10px; padding: 12px 16px; color: var(--minus); }
.modal .warn { background: #fff8b8; border-radius: 8px; padding: 8px 12px; font-weight: 600; }
.modal .steps li { margin: 6px 0; }
.modal .r { text-align: right; }
.agency-link { display: flex; align-items: center; gap: 8px; width: 100%; background: transparent; border: 0; color: rgba(255,255,255,.75);
  font: inherit; font-size: 13px; padding: 8px 4px; cursor: pointer; text-align: left; }
.agency-link:hover { color: #fff; }
.agency-link .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff6b9a; flex: none; }
.agency-link .dot.on { background: var(--acid); }

/* справка о программе */
.help { max-width: 1060px; }
.h-hero { position: relative; overflow: hidden; display: flex; gap: 26px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 22px; padding: 26px 30px; margin-bottom: 16px; box-shadow: var(--shadow); }
.h-hero::before { content: ""; position: absolute; right: -70px; top: 50%; width: 320px; height: 110px; margin-top: -30px;
  background: url(/static/brand/scribble-acid.svg) center / contain no-repeat; opacity: .9; transform: rotate(-10deg); pointer-events: none; }
.h-hero::after { content: ""; position: absolute; right: 28px; top: 20px; width: 34px; height: 34px;
  background: url(/static/brand/spark.svg) center / contain no-repeat; }
.h-art { width: 104px; height: 104px; flex: none; border-radius: 50%; background: var(--acid); display: grid; place-items: center;
  box-shadow: 5px 5px 0 var(--ink); transform: rotate(-8deg); }
.h-hero h1 { font-family: "Unbounded", var(--display); font-weight: 700; font-size: 34px; line-height: 1.12; text-transform: none;
  letter-spacing: -.02em; background: none; }
.h-hero h1 .mark { background: linear-gradient(transparent 58%, var(--acid) 58%, var(--acid) 92%, transparent 92%); padding: 0 4px; }
.h-hero p { margin: 12px 0 0; max-width: 540px; font-size: 15px; line-height: 1.55; color: var(--ink-2); position: relative; z-index: 1; }
.h-badge { width: 84px; height: 84px; }
.h-route { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; position: sticky; top: 0; z-index: 5; padding: 8px 0; background: var(--bg); }
.h-route a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; border-radius: 999px; background: var(--panel);
  border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 600; }
.h-route a b { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--acid); display: grid; place-items: center; font-size: 11px; }
.h-route a:hover { border-color: var(--ink); background: var(--acid-soft); }
.h-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.h-step { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-left: 6px solid var(--acid);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); scroll-margin-top: 60px; transition: box-shadow .3s; }
.h-step.is-ag { border-left-color: var(--blue); }
.h-step:first-child, .h-step:last-child { grid-column: 1 / -1; }
.h-step.flash { box-shadow: 0 0 0 4px var(--acid); }
.h-num { width: 40px; height: 40px; border-radius: 50%; background: var(--ink); color: var(--acid); flex: none;
  display: grid; place-items: center; font-family: "Unbounded", var(--display); font-weight: 800; font-size: 17px; }
.h-body { min-width: 0; }
.h-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 6px; }
.h-head h3 { margin: 0; font-family: "Unbounded", var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.h-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.h-tag.pr { background: var(--acid-soft); color: var(--acid-ink); }
.h-tag.ag { background: #e3e5ff; color: #1b24c9; }
.h-step p, .h-step li { margin: 0; line-height: 1.5; font-size: 13.5px; color: var(--ink-2); }
.h-step ol { margin: 2px 0 0; padding-left: 18px; }
.h-step ol li { margin: 3px 0; }
.h-step b { color: var(--ink); }
.h-step p + ol, .h-step ol + p { margin-top: 6px; }
.h-note { display: block; color: var(--muted); font-size: 12.5px; }
.h-foot { margin-top: 16px; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.h-foot::before { content: ""; width: 22px; height: 22px; background: url(/static/brand/spark.svg) center / contain no-repeat; }
@media (max-width: 900px) { .h-list { grid-template-columns: 1fr; } .h-hero { flex-direction: column; align-items: flex-start; } .h-hero::after { display: none; } }


/* окно сопоставления подрядчиков */
.cmap { background: #f5f6ff; border-left: 4px solid var(--blue); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.cmap h3 { margin: 0 0 4px; font-family: "Unbounded", var(--display); font-size: 14px; }
.cmap-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid #e3e5ff; }
.cmap-opts { display: grid; gap: 6px; }
.cmap-opts .pair input { min-width: 260px; }
.cmap .sugg { font-size: 12px; color: var(--muted); }
/* метки «в программе / в Agency» внутри шагов справки */
.h-mixed i { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-right: 4px; white-space: nowrap; }
.h-mixed i.pr { background: var(--acid-soft); color: var(--acid-ink); }
.h-mixed i.ag { background: #e3e5ff; color: #1b24c9; }
.h-mixed li { margin: 6px 0; }
.cmap-opts .btn { justify-self: start; }

/* вход: пароль скрыт стилем, чтобы браузер не предлагал его запомнить */
.secret { -webkit-text-security: disc; text-security: disc; }
.login .info { background: #fff8b8; color: #5c5200; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: -8px 0 16px; }

/* предупреждение перед выходом по бездействию */
.idle-count { font-family: var(--display); font-weight: 900; font-size: 44px; margin: 6px 0 12px; }

/* пользователи: состояние входа */
.tag.locked { background: #ffe1dc; color: #a3190a; }
.user-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.new-pass { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: .06em;
  background: var(--soft); border-radius: 10px; padding: 12px 16px; margin: 12px 0; user-select: all; }

/* справочники: заголовок раздела с кнопкой «+ Добавить …», строка нового элемента подсвечена */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.dict tr.new-row td { background: var(--acid-soft); }
.dict tr.new-row td:first-child { box-shadow: inset 4px 0 0 var(--acid); }
