@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/static/fonts/manrope-cyrillic-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/static/fonts/manrope-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/static/fonts/manrope-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url(/static/fonts/manrope-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --deep: #0E2158; --deep-2: #132a6b; --royal: #1B3F9E; --royal-2: #2F5FD0; --gold: #E8B33C; --gold-soft: #FCEFC7;
  --bg: #F4F6FA; --surface: #FFFFFF; --surface-2: #F8F9FC; --line: #E6EAF2; --line-2: #D8DEEA;
  --ink: #0F1A33; --ink-2: #3A4560; --muted: #69738C; --faint: #9AA3B8;
  --hover: #F5F8FE; --sel: #EDF2FF;
  --ok: #1E8E3E; --warn: #B7791F; --err: #C53030;
  --chart: #2F5FD0; --chart-soft: #A9BDF0; --grid: #EDF0F5;
  --radius: 14px; --radius-s: 10px;
  --shadow: 0 1px 2px rgba(14,33,88,.05), 0 2px 8px rgba(14,33,88,.04);
  --shadow-l: 0 10px 40px rgba(14,33,88,.18);
  --st-new: #2a78d6; --st-no_answer: #eda100; --st-contacted: #4a3aa7; --st-kp_sent: #e87ba4; --st-meeting: #1baf7a; --st-won: #008300; --st-lost: #8a92a5;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.45; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--royal); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #cfdcff; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 15px; height: 15px; }
svg.i.l { width: 22px; height: 22px; }

/* ---------------- layout */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--deep) 0%, #0b1a47 100%); color: #dfe6f7; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 22px; }
.brand .mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--gold), #f3cd73); color: var(--deep);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.02em; box-shadow: 0 4px 14px rgba(232,179,60,.35); }
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: -.01em; }
.brand span { font-size: 11.5px; color: #9fb0d9; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #c7d2ee; font-weight: 600; position: relative; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(255,255,255,.1); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav .cnt { margin-left: auto; font-size: 11.5px; background: rgba(232,179,60,.18); color: #f6d58a; padding: 1px 8px; border-radius: 20px; }
.side .foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); }
.side .me { display: flex; gap: 10px; align-items: center; }
.side .me b { color: #fff; font-size: 13px; display: block; }
.side .me span { font-size: 11.5px; color: #93a3cc; }
.side .me button { margin-left: auto; background: none; border: 0; color: #9fb0d9; cursor: pointer; padding: 6px; border-radius: 8px; }
.side .me button:hover { background: rgba(255,255,255,.08); color: #fff; }
.side .run { font-size: 11.5px; color: #8da0cf; margin: 0 0 12px; padding: 0 8px; display: flex; gap: 7px; align-items: center; }
.side .run .dot { width: 7px; height: 7px; border-radius: 50%; background: #43c27a; box-shadow: 0 0 0 3px rgba(67,194,122,.18); }
.side .run .dot.err { background: #f06a6a; box-shadow: 0 0 0 3px rgba(240,106,106,.18); }
.side .run .dot.run { background: var(--gold); animation: pulse 1.2s infinite; }
.side .run .faint { color: #6f82b3; }
.side .run .dot { flex-shrink: 0; }
@keyframes pulse { 50% { opacity: .35; } }

.main { min-width: 0; padding: 26px 30px 60px; }
.head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.head h1 { font-size: 24px; margin: 0; letter-spacing: -.02em; font-weight: 800; }
.head .sub { color: var(--muted); margin-top: 3px; }
.head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------- controls */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); font-weight: 650; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: #c6cfe0; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.pri { background: var(--royal); border-color: var(--royal); color: #fff; box-shadow: 0 2px 6px rgba(27,63,158,.25); }
.btn.pri:hover { background: #17378a; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--deep); }
.btn.gold:hover { background: #e0a82a; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(14,33,88,.05); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn.sm.icon { width: 30px; }
.btn.danger { color: var(--err); }
.inp, .sel, textarea.inp { height: 36px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); padding: 0 12px; outline: none; min-width: 0;
  transition: border-color .12s, box-shadow .12s; }
textarea.inp { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.inp:focus, .sel:focus, textarea.inp:focus { border-color: var(--royal-2); box-shadow: 0 0 0 3px rgba(47,95,208,.14); }
.sel { padding-right: 30px; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2369738C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 9px; color: var(--faint); }
.search .inp { padding-left: 36px; width: 100%; }
label.fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.seg { display: inline-flex; background: #EBEFF6; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 30px; padding: 0 11px; border-radius: 8px; cursor: pointer; font-weight: 650; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 3px rgba(14,33,88,.12); color: var(--ink); }
.toggle { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
  cursor: pointer; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.toggle.on { border-color: var(--royal-2); background: var(--sel); color: var(--royal); }
.chk { width: 16px; height: 16px; accent-color: var(--royal); cursor: pointer; }

/* dropdown multi-select */
.dd { position: relative; }
.dd > .btn .cnt { background: var(--royal); color: #fff; border-radius: 20px; font-size: 11px; padding: 0 6px; min-width: 18px; text-align: center; }
.dd .menu { position: absolute; z-index: 40; top: 40px; left: 0; min-width: 240px; max-width: 340px; max-height: 360px; overflow: auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-l); padding: 6px; }
.dd .menu .opt { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; cursor: pointer; }
.dd .menu .opt:hover { background: var(--hover); }
.dd .menu .opt .c { margin-left: auto; color: var(--faint); font-size: 12px; }
.dd .menu .mh { padding: 4px 6px 6px; }
.dd .menu .mf { border-top: 1px solid var(--line); margin-top: 4px; padding: 6px 4px 2px; display: flex; justify-content: space-between; }

/* ---------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card > .ch { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card > .ch h3 { margin: 0; font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.card > .ch .sub { color: var(--muted); font-size: 12.5px; }
.card > .cb { padding: 14px 18px 18px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1.55fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }

/* ---------------- chips */
.prio { display: inline-grid; place-items: center; width: 28px; height: 24px; border-radius: 7px; font-weight: 800; font-size: 12.5px; flex: none; }
.prio.A { background: var(--gold-soft); color: #7A4F00; box-shadow: inset 0 0 0 1px #f1d88f; }
.prio.B { background: #E3EBFB; color: var(--royal); box-shadow: inset 0 0 0 1px #cbd9f6; }
.prio.C, .prio.X { background: #EEF0F4; color: #5C6780; box-shadow: inset 0 0 0 1px #e0e4ec; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 20px; font-size: 12px; font-weight: 650; white-space: nowrap;
  background: #EEF1F7; color: var(--ink-2); }
.chip .d { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip.st { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.chip.hot { background: #FFF1E6; color: #A4450A; }
.chip.new { background: #E6F6EE; color: #1E7B45; }
.chip.warn { background: #FFF6E0; color: #8A5A00; }
.chip.gray { background: #F0F2F6; color: var(--muted); }
.chip.btn-chip { cursor: pointer; }
.chip.xs { height: 19px; padding: 0 7px; font-size: 11px; gap: 4px; }
.chip.xs svg.i.s { width: 12px; height: 12px; }
.av { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 11px; font-weight: 750; flex: none; letter-spacing: -.02em; }
.av.l { width: 32px; height: 32px; font-size: 12.5px; }
.av.none { background: #E7EBF3; color: var(--faint); }

/* ---------------- status tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 12px 11px; cursor: pointer; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 7px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--royal); }
.tabs button .n { font-size: 12px; color: var(--faint); font-weight: 600; }

/* ---------------- filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters .search { flex: 1 1 280px; max-width: 420px; }
.more { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.more .inp { width: 150px; }

/* ---------------- table */
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tbl-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 1060px; table-layout: fixed; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.tbl th.sort { cursor: pointer; user-select: none; }
.tbl th.sort:hover { color: var(--ink); }
.tbl td { padding: 10px 10px; border-bottom: 1px solid #EEF1F6; vertical-align: middle; overflow: hidden; }
.tbl th { padding-left: 10px; padding-right: 10px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .08s; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.sel { background: var(--sel); }
.tbl tbody tr.open { background: #E8EEFD; box-shadow: inset 3px 0 0 var(--royal); }
.tbl .co b { font-weight: 700; display: block; }
.tbl .co .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin-top: 3px; white-space: nowrap; overflow: hidden; }
.tbl .co .meta > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.tbl .ct a { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; min-width: 0; }
.tbl .ct a:hover { color: var(--royal); }
.tbl .money { font-weight: 700; }
.tbl .date-cell b { font-weight: 650; display: block; }
.tbl .date-cell span { font-size: 12px; color: var(--muted); display: block; }
.overdue { color: var(--err); font-weight: 700; }
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.bulk { position: sticky; top: 10px; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--deep); color: #fff; padding: 8px 10px 8px 16px; border-radius: 12px;
  box-shadow: var(--shadow-l); margin-bottom: 10px; }
.bulk .sel { background-color: #fff; color: var(--ink); height: 32px; }
.bulk .btn { height: 32px; }

/* ---------------- drawer */
.scrim { position: fixed; inset: 0; background: rgba(9,18,46,.32); z-index: 50; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100vw); background: var(--bg); z-index: 51; box-shadow: var(--shadow-l); display: flex; flex-direction: column;
  animation: slide .2s cubic-bezier(.2,.8,.2,1); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer .dh { background: var(--surface); border-bottom: 1px solid var(--line); padding: 18px 22px 14px; }
.drawer .dh h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; line-height: 1.25; }
.drawer .db { overflow-y: auto; padding: 18px 22px 40px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.drawer .db > * { flex-shrink: 0; }
.steps { display: flex; gap: 4px; margin-top: 14px; flex-wrap: wrap; }
.steps button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 20px; height: 30px; padding: 0 12px; cursor: pointer; font-weight: 650; font-size: 12.5px;
  display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.steps button:hover { border-color: #bfc9dc; }
.steps button.on { color: #fff; border-color: transparent; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv > span:nth-child(odd) { color: var(--muted); }
.contact-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.contract { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.contract .top { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.contract .top h4 { margin: 0 0 3px; font-size: 14.5px; font-weight: 750; }
.contract .facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); background: var(--surface-2); }
.contract .facts > div { padding: 10px 14px; border-right: 1px solid var(--line); }
.contract .facts > div:last-child { border-right: 0; }
.contract .facts span { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.contract .facts b { font-size: 13.5px; }
.contract .body { padding: 12px 16px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.quote { border-left: 3px solid var(--line-2); padding: 6px 12px; background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--ink-2); white-space: pre-wrap; }
.quote.sup { border-left-color: var(--gold); background: #FFFBF0; }
.quote .who { font-size: 11.5px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .03em; }
.quote.clip { max-height: 132px; overflow: hidden; position: relative; }
.quote.clip::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 36px; background: linear-gradient(transparent, #FFFBF0); }
.quote.clip.cust::after { background: linear-gradient(transparent, var(--surface-2)); }
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 9px 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: -6px; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #EEF1F7; color: var(--muted); }
.tl .ic.comment { background: #E3EBFB; color: var(--royal); }
.tl .ic.kp { background: var(--gold-soft); color: #7A4F00; }
.tl .ic.status { background: #EDE9FB; color: #4a3aa7; }
.tl .t { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.tl .m { font-size: 12px; color: var(--faint); margin-top: 2px; }
.tl .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 12px 12px 12px; padding: 9px 12px; }

/* ---------------- modal */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(9,18,46,.4); animation: fade .15s; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-l); width: min(980px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; overflow: hidden; }
.modal.s { width: min(520px, 100%); }
.modal .mh { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { margin: 0; font-size: 17px; }
.modal .mb { padding: 16px 20px; overflow: auto; }
.modal .mf { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; align-items: center; }
.kp-grid { display: grid; grid-template-columns: 260px 1fr; gap: 18px; }
.kp-grid textarea { width: 100%; min-height: 470px; font-size: 14px; }
.ai-box { background: linear-gradient(135deg, #F3F0FF, #EEF4FF); border: 1px solid #DCD6FA; border-radius: 12px; padding: 12px; }

/* ---------------- board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 272px; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.col { background: #EBEFF6; border-radius: 14px; padding: 10px; min-height: 200px; transition: background .12s, box-shadow .12s; }
.col.drop { background: #DFE7F8; box-shadow: inset 0 0 0 2px var(--royal-2); }
.col .colh { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.col .colh b { font-size: 13.5px; }
.col .colh .n { font-size: 12px; color: var(--muted); font-weight: 650; background: #fff; border-radius: 20px; padding: 0 8px; }
.col .colh .s { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.kcard { background: var(--surface); border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(14,33,88,.08); cursor: grab; border: 1px solid transparent; }
.kcard:hover { border-color: #c9d4ec; }
.kcard.drag { opacity: .45; }
.kcard .nm { font-weight: 700; font-size: 13.5px; line-height: 1.3; margin: 6px 0 4px; }
.kcard .ft { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.col .more-n { text-align: center; font-size: 12px; color: var(--muted); padding: 6px; }

/* ---------------- dashboard */
.kpis { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 650; }
.kpi .v { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 6px; line-height: 1.1; }
.kpi .d { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.kpi.hero { background: linear-gradient(135deg, var(--deep) 0%, var(--royal) 100%); color: #fff; border: 0; position: relative; overflow: hidden; }
.kpi.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; border: 22px solid rgba(232,179,60,.18); }
.kpi.hero .l, .kpi.hero .d { color: #c3cff0; }
.kpi.hero .v { font-size: 48px; }
.kpi.hero .d b { color: var(--gold); }
.list-rows .lr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #EEF1F6; cursor: pointer; }
.list-rows .lr:last-child { border-bottom: 0; }
.list-rows .lr:hover .nm { color: var(--royal); }
.list-rows .nm { font-weight: 650; }
.hbars .hb { padding: 5px 0 6px; }
.hbars .hb .lab { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
.hbars .track { position: relative; height: 18px; display: flex; align-items: center; gap: 8px; }
.hbars .bar { height: 14px; background: var(--chart); border-radius: 0 4px 4px 0; min-width: 2px; transition: filter .1s; }
.hbars .hb:hover .bar { filter: brightness(1.12); }
.hbars .val { font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap .axis { font-size: 11px; fill: var(--muted); }
.chart-wrap .vlabel { font-size: 11.5px; font-weight: 700; fill: var(--ink-2); }
.tip { position: absolute; pointer-events: none; background: var(--deep); color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px)); box-shadow: var(--shadow-l); z-index: 3; }
.tip b { font-size: 14px; display: block; }
.funnel .fs { display: grid; grid-template-columns: 112px 1fr 44px; align-items: center; gap: 10px; padding: 5px 0; }
.funnel .fs .bar { height: 22px; border-radius: 0 4px 4px 0; background: var(--chart); min-width: 2px; }
.wk-stats { display: flex; gap: 28px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.wk-stats b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.wk-stats span { font-size: 12.5px; color: var(--muted); }
.feed .fi { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #EEF1F6; font-size: 13px; }
.feed .fi:last-child { border-bottom: 0; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini th { text-align: right; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.mini th:first-child, table.mini td:first-child { text-align: left; }
table.mini td { text-align: right; padding: 8px; border-bottom: 1px solid #EEF1F6; }

/* ---------------- settings */
.set-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.set-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; }
.set-nav button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-weight: 650; color: var(--ink-2); display: flex; gap: 9px; align-items: center; }
.set-nav button:hover { background: rgba(14,33,88,.05); }
.set-nav button.on { background: var(--surface); color: var(--royal); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.ph-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-list code { background: #EEF1F7; padding: 3px 8px; border-radius: 6px; font-size: 12px; cursor: pointer; font-family: ui-monospace, Menlo, monospace; }
.ph-list code:hover { background: #E3EBFB; color: var(--royal); }

/* ---------------- login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: radial-gradient(circle at 20% 20%, #23479f 0, transparent 45%), linear-gradient(160deg, var(--deep), #081440); color: #fff; padding: 56px; display: flex; flex-direction: column; gap: 36px; position: relative; overflow: hidden; }
.login .art::after { content: ""; position: absolute; right: -18vh; bottom: -24vh; width: 40vh; height: 40vh; border-radius: 50%; border: 6vh solid rgba(232,179,60,.14); }
/* текст по центру высоты, чуть выше середины — вровень с формой входа; на низких экранах подъём = 0 */
.login { --lift: clamp(0px, 18vh - 100px, 120px); }
.login .art .pitch { margin: auto 0; padding-bottom: var(--lift); position: relative; top: calc(-1 * min(36px, var(--lift))); z-index: 1; }
.login .art h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; margin: 0 0 16px; max-width: 520px; }
.login .art p { color: #b9c6ea; font-size: 16px; max-width: 460px; margin: 0; }
.login .art .stats { display: flex; gap: 34px; margin-top: 36px; }
.login .art .stats b { display: block; font-size: 28px; color: var(--gold); }
.login .art .stats span { color: #9fb0d9; font-size: 13px; }
.login .frm { display: grid; place-items: center; padding: 40px 40px calc(40px + var(--lift)); }
.login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login form h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.login form .inp { height: 44px; }
.login form .btn { height: 44px; justify-content: center; font-size: 15px; }
.err-box { background: #FDECEC; color: #9B2C2C; border-radius: 10px; padding: 10px 12px; font-size: 13px; }

/* ---------------- misc */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--deep); color: #fff; padding: 11px 16px; border-radius: 11px; box-shadow: var(--shadow-l); display: flex; gap: 9px; align-items: center; animation: up .2s; font-weight: 600; }
.toast.err { background: #9B2C2C; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; }
.spin { width: 20px; height: 20px; border: 2.5px solid #d3dbec; border-top-color: var(--royal); border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }
.loading-fade { opacity: .55; transition: opacity .15s; pointer-events: none; }
.sec-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 750; margin: 6px 0 -4px; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.link-btn { background: none; border: 0; color: var(--royal); cursor: pointer; padding: 0; font-weight: 650; }
.link-btn:hover { text-decoration: underline; }
kbd { font-family: inherit; font-size: 11px; background: #fff; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }

/* ---------------- mobile */
.mob-cards { display: none; }
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi.hero { grid-column: 1 / -1; }
  .g2, .g3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 62px; flex-direction: row; padding: 6px 8px; z-index: 45; }
  .side .brand, .side .foot, .side .run { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex-direction: column; gap: 2px; font-size: 10.5px; padding: 6px 8px; }
  .nav a.on::before { display: none; }
  .nav .cnt { display: none; }
  .main { padding: 18px 16px 90px; }
  .head h1 { font-size: 21px; }
  .tbl-wrap .tbl-scroll { display: none; }
  .mob-cards { display: flex; flex-direction: column; }
  .mob-cards .mc { padding: 13px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
  .login { grid-template-columns: 1fr; }
  .login .art { display: none; }
  .kp-grid { grid-template-columns: 1fr; }
  .kp-grid textarea { min-height: 340px; }
  .set-layout { grid-template-columns: 1fr; }
  .set-nav { flex-direction: row; overflow-x: auto; position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .contract .facts { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .drawer .dh, .drawer .db { padding-left: 16px; padding-right: 16px; }
  .modal-wrap { padding: 0; }
  .modal { max-height: 100vh; height: 100%; border-radius: 0; }
}
