/* ТАС Снаб Групп — пилот. Светлая тема по умолчанию, тёмная переключается. */
:root {
  --bg: #F3F5F9;
  --bg2: #EAEEF5;
  --panel: #FFFFFF;
  --panel2: #F8FAFD;
  --line: #E4E8F0;
  --line2: #CBD3E1;
  --ink: #1B2232;
  --ink2: #4E5A6E;
  --ink3: #8A95A8;
  --accent: #4F7BE6;
  --accent2: #3862C8;
  --accent-soft: #EAF0FD;
  --mint: #2FB38A;
  --mint-soft: #E6F6F0;
  --amber: #E8A33D;
  --amber-soft: #FDF3E2;
  --rose: #E06C6C;
  --rose-soft: #FBE9E9;
  --violet: #8A6FE0;
  --violet-soft: #EFEAFB;
  --shadow: 0 1px 2px rgba(20, 30, 60, .04), 0 8px 24px rgba(20, 30, 60, .06);
  --shadow2: 0 2px 6px rgba(20, 30, 60, .08), 0 16px 40px rgba(20, 30, 60, .10);
  --rail: 248px;
  --rail-min: 72px;
  --top: 60px;
  --r: 14px;
  --cyan: #22D3EE;
  --g1a: #5EEAD4; --g1b: #0EA5E9;   /* график: в работе */
  --g2a: #BEF264; --g2b: #16A34A;   /* график: успешные */
  --gline: #F59E0B;                 /* график: линия выручки */
  --p1: #4F7BE6; --p2: #22D3EE; --p3: #8A6FE0; --p4: #E8A33D; --p5: #F472B6; --p6: #2FB38A;
  --kpis-bg: var(--panel);
  --head: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}
:root[data-theme="dark"] {
  --bg: #0E1117; --bg2: #141924; --panel: #171C27; --panel2: #1D2330;
  --line: rgba(255,255,255,.08); --line2: rgba(255,255,255,.18);
  --ink: #EEF1F6; --ink2: #AEB7C8; --ink3: #6F7A90;
  --accent: #6D93F0; --accent2: #86A6F5; --accent-soft: rgba(109,147,240,.14);
  --mint: #45CF9F; --mint-soft: rgba(69,207,159,.14);
  --amber: #F2B33D; --amber-soft: rgba(242,179,61,.14);
  --rose: #F07070; --rose-soft: rgba(240,112,112,.14);
  --violet: #A08BF0; --violet-soft: rgba(160,139,240,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow2: 0 2px 6px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.5);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 14px/1.5 var(--body); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(79,123,230,.25); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- каркас: рельс + топбар объединены ---------- */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: 100vh; transition: grid-template-columns .22s ease; }
.shell.min { grid-template-columns: var(--rail-min) 1fr; }
.rail {
  position: sticky; top: 0; height: 100vh; background: var(--panel);
  display: flex; flex-direction: column; padding: 14px 12px; z-index: 20; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 6px 16px; border-bottom: 1px solid var(--line); min-height: 60px; }
.brand .logo { width: 36px; height: 36px; color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.brand .logo svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.brand .t { font: 700 14px/1.15 var(--head); letter-spacing: .01em; white-space: nowrap; }
.brand .s { font: 600 9.5px/1.2 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); margin-top: 3px; white-space: nowrap; }
.min .brand .t, .min .brand .s, .min .nav a span, .min .nav .grp, .min .rail .foot, .min .nav .badge { display: none; }
.min .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.min .nav a { justify-content: center; padding: 10px 0; }
.nav { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; overflow-x: hidden; }
.nav .grp { font: 700 10px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--ink3); padding: 14px 10px 6px; white-space: nowrap; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--ink2); font-weight: 600; font-size: 13.5px; white-space: nowrap; transition: background .15s, color .15s; position: relative; }
.nav a:hover { background: var(--bg2); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent2); }
.nav a .badge { margin-left: auto; font: 700 10.5px/1 var(--mono); background: var(--bg2); color: var(--ink3); padding: 4px 7px; border-radius: 20px; }
.nav a.on .badge { background: rgba(79,123,230,.18); color: var(--accent2); }
.rail .foot { padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink3); line-height: 1.5; white-space: nowrap; }
.rail .foot b { color: var(--ink2); font-weight: 600; }

/* топбар: закруглённый стык с рельсом */
main { min-width: 0; display: flex; flex-direction: column; background: var(--panel); }
.content { flex: 1; background: var(--bg); border-top-left-radius: 22px; display: flex; flex-direction: column; min-height: calc(100vh - var(--top)); }
.topbar { position: sticky; top: 0; z-index: 15; height: var(--top); background: var(--panel); display: flex; align-items: center; gap: 12px; padding: 0 22px 0 14px; }
.topbar .burger { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); display: grid; place-items: center; }
.topbar .burger:hover { background: var(--bg2); color: var(--ink); }
.topbar .crumbs { font: 600 13px/1 var(--body); color: var(--ink3); display: flex; align-items: center; gap: 8px; }
.topbar .crumbs b { color: var(--ink); font-weight: 700; }
.topbar .search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 36px; width: 300px; color: var(--ink3); }
.topbar .search input { border: 0; background: transparent; outline: 0; width: 100%; color: var(--ink); }
.topbar .ic { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); display: grid; place-items: center; position: relative; }
.topbar .ic:hover { background: var(--bg2); }
.topbar .ic .dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--rose); border: 2px solid var(--panel); }
.topbar .user { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.topbar .user:hover { background: var(--bg2); }
.ava { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font: 700 12px/1 var(--head); color: #fff; background: var(--accent); flex-shrink: 0; }
.ava.m { background: var(--mint); } .ava.a { background: var(--amber); } .ava.v { background: var(--violet); } .ava.r { background: var(--rose); }
.topbar .user .n { font-weight: 700; font-size: 13px; line-height: 1.1; }
.topbar .user .r { font-size: 10.5px; color: var(--ink3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

.page { padding: 22px 24px 48px; max-width: none; width: 100%; }
.page.wide { max-width: none; }
.page.flush { padding: 0; max-width: none; flex: 1; display: flex; }

/* ---------- типографика ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ph h1 { font: 700 24px/1.15 var(--head); letter-spacing: -.01em; }
.ph .sub { color: var(--ink3); font-size: 13px; margin-top: 4px; }
.ph .acts { display: flex; gap: 8px; flex-wrap: wrap; }
h2.sec { font: 700 15px/1.2 var(--head); margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
h2.sec .cnt { font: 600 11px/1 var(--mono); color: var(--ink3); background: var(--bg2); padding: 4px 7px; border-radius: 20px; }
.eyebrow { font: 700 10.5px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.muted { color: var(--ink3); }
.mono { font-family: var(--mono); font-size: .93em; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- кнопки / поля ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font-weight: 700; font-size: 13px; transition: all .15s; white-space: nowrap; }
.btn:hover { background: var(--bg2); border-color: var(--ink3); }
.btn.p { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.p:hover { background: var(--accent2); border-color: var(--accent2); }
.btn.m { background: var(--mint); border-color: var(--mint); color: #fff; }
.btn.g { background: transparent; border-color: transparent; color: var(--ink2); }
.btn.g:hover { background: var(--bg2); color: var(--ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.inp, select.inp, textarea.inp { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); outline: 0; width: 100%; transition: border-color .15s, box-shadow .15s; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,123,230,.15); }
textarea.inp { height: auto; padding: 10px 12px; min-height: 80px; resize: vertical; }
.inp.sm { height: 30px; padding: 0 9px; font-size: 13px; border-radius: 8px; }
.inp.num { text-align: right; font-family: var(--mono); font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11.5px; font-weight: 700; color: var(--ink3); letter-spacing: .04em; text-transform: uppercase; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink2); font-weight: 700; font-size: 12.5px; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .sp { flex: 1; }

/* ---------- карточки / плитки ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card .hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card .hd h3 { font: 700 14px/1.2 var(--head); }
.card .bd { padding: 16px 18px; }
.grid { display: grid; gap: 14px; }
.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)); } .g5 { grid-template-columns: repeat(5, minmax(0,1fr)); } .g6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; } .g-1-2 { grid-template-columns: 1fr 2fr; } .g-3-2 { grid-template-columns: 3fr 2fr; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.kpi .l { font-size: 11.5px; font-weight: 700; color: var(--ink3); letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 7px; }
.kpi .v { font: 700 26px/1.1 var(--head); letter-spacing: -.02em; }
.kpi .v small { font-size: 14px; color: var(--ink3); font-weight: 600; margin-left: 4px; }
.kpi .d { font-size: 12px; color: var(--ink3); }
.kpi .d b { color: var(--mint); font-weight: 700; }
.kpi .d b.neg { color: var(--rose); }
.kpi .ico { position: absolute; right: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.kpi .ico.m { color: var(--mint); background: var(--mint-soft); } .kpi .ico.a { color: var(--amber); background: var(--amber-soft); } .kpi .ico.v { color: var(--violet); background: var(--violet-soft); } .kpi .ico.r { color: var(--rose); background: var(--rose-soft); }

/* ---------- чипы / статусы ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 20px; font-size: 11px; font-weight: 700; background: var(--bg2); color: var(--ink2); white-space: nowrap; }
.chip.b { background: var(--accent-soft); color: var(--accent2); } .chip.m { background: var(--mint-soft); color: var(--mint); } .chip.a { background: var(--amber-soft); color: #B87A1E; } .chip.r { background: var(--rose-soft); color: var(--rose); } .chip.v { background: var(--violet-soft); color: var(--violet); }
.chip .dt { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fake { display: inline-flex; align-items: center; gap: 4px; font: 600 9.5px/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); border: 1px dashed var(--line2); border-radius: 5px; padding: 2px 5px; vertical-align: middle; margin-left: 5px; cursor: help; }
.fake::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 12.5px; color: var(--ink2); background: var(--bg2); border: 1px dashed var(--line2); }
.note.warn { background: var(--amber-soft); border-color: rgba(232,163,61,.4); }
.note svg { margin-top: 2px; }

/* ---------- таблицы ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel2); position: sticky; top: 0; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.go:hover td { background: var(--panel2); cursor: pointer; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .t { font-weight: 700; color: var(--ink); }
.tbl .s { color: var(--ink3); font-size: 12px; }
.tbl input.inp { height: 30px; }
.tbl tfoot td { background: var(--panel2); font-weight: 700; }
.tscroll { overflow: auto; max-height: calc(100vh - 230px); border-radius: var(--r); }
.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink3); }
.pager .sp { flex: 1; }

/* ---------- стадии-стрелки ---------- */
.stages { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 2px; }
.stages .st { flex: 1; min-width: 120px; height: 36px; display: flex; align-items: center; justify-content: center; padding: 0 16px 0 20px; font-size: 12px; font-weight: 700; color: var(--ink3); background: var(--bg2); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); cursor: pointer; white-space: nowrap; transition: all .15s; }
.stages .st:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.stages .st.done { background: var(--accent-soft); color: var(--accent2); }
.stages .st.cur { background: var(--accent); color: #fff; }
.stages .st.won { background: var(--mint); color: #fff; } .stages .st.lost { background: var(--rose); color: #fff; }
.stages .st:hover:not(.cur) { filter: brightness(.96); }

/* ---------- канбан ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 272px; background: var(--bg2); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col .ch { padding: 12px 14px 10px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.col .ch .dot { width: 8px; height: 8px; border-radius: 50%; }
.col .ch b { font-size: 12.5px; }
.col .ch .cnt { margin-left: auto; font: 600 11px/1 var(--mono); color: var(--ink3); }
.col .ch .sum { font: 600 11px/1 var(--mono); color: var(--ink2); }
.col .cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.dc { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.dc:hover { transform: translateY(-1px); box-shadow: var(--shadow2); }
.dc.drag { opacity: .4; }
.dc .t { font-weight: 700; font-size: 13px; line-height: 1.3; margin-bottom: 4px; }
.dc .c { font-size: 12px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc .f { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--ink3); }
.dc .f b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.dc .ava { width: 22px; height: 22px; border-radius: 7px; font-size: 9px; }

/* ---------- вкладки ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { height: 40px; padding: 0 14px; border: 0; background: transparent; color: var(--ink3); font-weight: 700; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--accent2); border-color: var(--accent); }
.tabs button .cnt { margin-left: 6px; font: 600 10.5px/1 var(--mono); background: var(--bg2); padding: 3px 6px; border-radius: 10px; color: var(--ink3); }

/* ---------- key/value ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv .k { color: var(--ink3); font-weight: 600; }
.kv .v { color: var(--ink); }
.kv .v a { color: var(--accent2); font-weight: 600; }

/* ---------- таймлайн ---------- */
.tl { display: flex; flex-direction: column; }
.tl .e { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 8px 0; position: relative; }
.tl .e::before { content: ""; position: absolute; left: 12px; top: 28px; bottom: -8px; width: 1px; background: var(--line); }
.tl .e:last-child::before { display: none; }
.tl .e .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent2); }
.tl .e .ic.m { background: var(--mint-soft); color: var(--mint); } .tl .e .ic.a { background: var(--amber-soft); color: var(--amber); } .tl .e .ic.v { background: var(--violet-soft); color: var(--violet); } .tl .e .ic.g { background: var(--bg2); color: var(--ink3); }
.tl .e .tx { font-size: 13px; }
.tl .e .tx b { font-weight: 700; }
.tl .e .dt { font-size: 11px; color: var(--ink3); font-family: var(--mono); }

/* ---------- графики ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, var(--accent), #8FB0F3); min-height: 3px; transition: height .4s; position: relative; }
.bars .b i.m { background: linear-gradient(180deg, var(--mint), #86DCC0); }
.bars .b i:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; font: 600 10.5px/1 var(--mono); background: var(--ink); color: var(--panel); padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.bars .b span { font-size: 10.5px; color: var(--ink3); font-family: var(--mono); }
.hbar { display: grid; grid-template-columns: 160px 1fr 70px; gap: 10px; align-items: center; font-size: 12.5px; padding: 5px 0; }
.hbar .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); font-weight: 600; }
.hbar .tr { height: 10px; background: var(--bg2); border-radius: 5px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.hbar .tr i.m { background: var(--mint); } .hbar .tr i.a { background: var(--amber); } .hbar .tr i.r { background: var(--rose); } .hbar .tr i.v { background: var(--violet); }
.hbar .v { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--ink); }
.donut { width: 130px; height: 130px; }

/* ---------- модалка / тост ---------- */
.mback { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--panel); border-radius: 16px; box-shadow: var(--shadow2); width: min(640px, 100%); max-height: 90vh; overflow: auto; }
.modal.lg { width: min(1000px, 100%); }
.modal .hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .hd h3 { font: 700 16px/1.2 var(--head); }
.modal .bd { padding: 20px; }
.modal .ft { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow2); z-index: 200; display: flex; align-items: center; gap: 8px; animation: up .2s ease; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- логин ---------- */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% -10%, rgba(79,123,230,.12), transparent), radial-gradient(900px 500px at 100% 100%, rgba(47,179,138,.10), transparent), var(--bg); padding: 20px; }
.login .box { width: 400px; max-width: 100%; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow2); padding: 28px 28px 22px; }
.login .box .brand { border: 0; padding: 0 0 18px; }
.login .box h2 { font: 700 18px/1.2 var(--head); margin-bottom: 4px; }
.login .box .sub { color: var(--ink3); font-size: 12.5px; margin-bottom: 16px; }
.login .pick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.login .pick button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); text-align: left; }
.login .pick button:hover, .login .pick button.on { border-color: var(--accent); background: var(--accent-soft); }
.login .pick .n { font-weight: 700; font-size: 13px; }
.login .pick .r { font-size: 11px; color: var(--ink3); }

/* ---------- iframe-страницы ---------- */
.frame { flex: 1; width: 100%; border: 0; min-height: calc(100vh - var(--top)); background: #0f1117; }
.framebar { position: absolute; right: 24px; top: calc(var(--top) + 10px); z-index: 5; }

/* ---------- КП печать ---------- */
.kp { background: #fff; color: #111; width: 210mm; min-height: 297mm; padding: 18mm 16mm; margin: 0 auto; font: 11pt/1.4 'Manrope', Arial, sans-serif; box-shadow: var(--shadow2); border-radius: 4px; }
.kp h1 { font: 800 18pt/1.2 'Manrope', Arial, sans-serif; margin: 0 0 4px; }
.kp .hdr { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #1B2232; padding-bottom: 10px; margin-bottom: 14px; }
.kp .req { font-size: 9.5pt; color: #444; line-height: 1.45; }
.kp table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 10pt; }
.kp th, .kp td { border: 1px solid #C9CED8; padding: 6px 8px; }
.kp th { background: #F1F3F7; text-align: left; font-weight: 700; font-size: 9pt; }
.kp td.r, .kp th.r { text-align: right; font-variant-numeric: tabular-nums; }
.kp .tot { display: flex; justify-content: flex-end; }
.kp .tot table { width: 320px; margin: 0; }
.kp .tot td { border: 0; padding: 3px 8px; }
.kp .tot tr:last-child td { font-weight: 800; font-size: 12pt; border-top: 2px solid #1B2232; }
.kp .sig { margin-top: 30px; display: flex; justify-content: space-between; font-size: 10pt; }
.kp .foot { margin-top: 24px; font-size: 9pt; color: #666; border-top: 1px solid #C9CED8; padding-top: 8px; }
.kp .sheet { page-break-before: always; min-height: 250mm; display: grid; place-items: center; text-align: center; color: #888; border: 2px dashed #C9CED8; border-radius: 8px; margin-top: 20px; }
@media print {
  body { background: #fff; }
  .content { background: #fff; }
  .shell, .topbar, .rail, .noprint { display: none !important; }
  .printroot { display: block !important; }
  .kp { box-shadow: none; margin: 0; width: auto; min-height: auto; padding: 0; }
  @page { size: A4; margin: 14mm; }
}
.printroot { display: none; }

/* ---------- мелочи ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.sp { flex: 1; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }
.empty { padding: 40px; text-align: center; color: var(--ink3); }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.lnk { color: var(--accent2); font-weight: 600; cursor: pointer; }
.lnk:hover { text-decoration: underline; }
.list { display: flex; flex-direction: column; }
.list .it { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.list .it:last-child { border-bottom: 0; }
.list .it .t { font-weight: 700; }
.list .it .s { color: var(--ink3); font-size: 12px; }
.list .it .sp { flex: 1; min-width: 0; }
@media (max-width: 1100px) { .g4, .g5, .g6 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: 1fr 1fr; } .g-2-1, .g-1-2, .g-3-2 { grid-template-columns: 1fr; } .topbar .search { width: 180px; } }
@media (max-width: 760px) { .shell { grid-template-columns: var(--rail-min) 1fr; } .g2, .g3, .g4 { grid-template-columns: 1fr; } .topbar .search { display: none; } }

/* ---------- обзор v2 ---------- */
.mb { margin-bottom: 14px; } .mt { margin-top: 14px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); margin-bottom: 6px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.l-open { background: var(--accent); } .l-won { background: var(--mint); } .l-lost { background: var(--rose); opacity: .55; }
svg.chart { width: 100%; height: 300px; display: block; font-family: var(--mono); }
svg.chart .gl { stroke: var(--line); stroke-width: 1; }
svg.chart .tk { font-size: 11px; fill: var(--ink3); }
svg.chart .vl { font-size: 11px; fill: var(--ink); font-weight: 600; }
svg.chart .b-open { fill: var(--accent); opacity: .85; } svg.chart .b-won { fill: var(--mint); } svg.chart .b-lost { fill: var(--rose); opacity: .5; }
svg.chart .bar { transform-origin: bottom; animation: grow .5s ease both; }
svg.chart .bar:hover .b-open { opacity: 1; }
@keyframes grow { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pp { position: relative; }
.pop { display: none; position: absolute; right: 0; top: 40px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow2); padding: 12px; z-index: 30; min-width: 340px; }
.pop.show { display: block; }
.fl { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--panel2); }
.fl-h { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.fl-h.r { color: var(--rose); } .fl-h.m { color: var(--mint); }
.fl-h .cnt { font: 600 11px/1 var(--mono); background: var(--bg2); color: var(--ink3); padding: 3px 7px; border-radius: 10px; }
.fi { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); font-size: 12.5px; animation: fadein .4s ease both; }
.fi i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); margin-top: 6px; }
.fi.r i { background: var(--rose); box-shadow: 0 0 0 4px var(--rose-soft); } .fi.a i { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); } .fi.m i { background: var(--mint); box-shadow: 0 0 0 4px var(--mint-soft); }
.fi b { font-weight: 700; } .fi .s { color: var(--ink3); font-size: 12px; margin-top: 2px; }
@keyframes fadein { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.mtbl tbody tr { cursor: pointer; animation: fadein .35s ease both; }
.mtbl tr.lvl1 td { font-size: 13.5px; background: var(--panel); }
.mtbl tr.lvl2 td { background: var(--panel2); } .mtbl tr.lvl3 td { background: var(--bg2); font-size: 12.5px; } .mtbl tr.lvl4 td { background: var(--bg); font-size: 12px; cursor: default; }
.mtbl .chev { width: 8px; height: 8px; border-right: 2px solid var(--ink3); border-bottom: 2px solid var(--ink3); transform: rotate(-45deg); transition: transform .2s; margin-right: 4px; flex-shrink: 0; }
.mtbl tr.open > td .chev { transform: rotate(45deg); border-color: var(--accent); }
.mtbl .c-m { color: var(--mint); } .mtbl .c-r { color: var(--rose); }
.mtbl .cv { position: relative; height: 18px; background: var(--bg2); border-radius: 9px; overflow: hidden; }
.mtbl .cv i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--mint), #86DCC0); border-radius: 9px; transition: width .6s ease; }
.mtbl .cv span { position: absolute; inset: 0; display: grid; place-items: center; font: 600 10.5px/1 var(--mono); color: var(--ink); }
.mtbl .rev { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.mtbl .rev i { height: 8px; border-radius: 4px; background: var(--accent); transition: width .6s ease; display: block; max-width: 110px; flex: 0 0 auto; }
.mtbl .rev b { font-family: var(--mono); font-weight: 600; min-width: 80px; text-align: right; white-space: nowrap; }
.mtbl td .s { color: var(--ink3); font-size: 11px; }

/* ---------- v3: таблицы с раскрытием, kpi как khc, график ---------- */
.tbl .chev { width: 8px; height: 8px; border-right: 2px solid var(--ink3); border-bottom: 2px solid var(--ink3); transform: rotate(-45deg); transition: transform .2s; display: inline-block; margin-left: 4px; }
.tbl tr.open > td .chev { transform: rotate(45deg); border-color: var(--accent); }
.tbl th.sortable { cursor: pointer; user-select: none; } .tbl th.sortable:hover, .tbl th.sortable.on { color: var(--accent); }
.tbl tr.xrow td { background: var(--panel2); padding: 12px 16px 14px 44px; border-bottom: 1px solid var(--line); white-space: normal; }
.xp { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 22px; font-size: 12.5px; animation: fadein .3s ease both; }
.xh { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); margin-bottom: 6px; }
.xe { display: flex; gap: 10px; padding: 3px 0; }
.tbl.mini td { padding: 4px 8px 4px 0; border-bottom: 1px dashed var(--line); font-size: 12px; white-space: normal; }
.tbl.mini tr:last-child td { border-bottom: 0; }
.tbl td.c-r { color: var(--rose); font-weight: 700; } .tbl td.c-m { color: var(--mint); }
.tbl .rev { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.tbl .rev i { height: 7px; border-radius: 4px; background: var(--accent); display: block; flex: 0 0 auto; max-width: 100px; }
.tbl .rev b { font-family: var(--mono); font-weight: 600; min-width: 72px; text-align: right; white-space: nowrap; }
.tbl.dt td { white-space: nowrap; } .tbl.dt td.t { white-space: normal; min-width: 180px; }
.mtbl .det { margin-left: auto; opacity: 0; transition: opacity .15s; } .mtbl tr:hover .det { opacity: 1; }
.mtbl td:first-child { min-width: 420px; }
/* флаги без границ */
.fi { border-top: 0; padding: 7px 8px; border-radius: 9px; margin-bottom: 2px; }
.fi:hover { background: var(--bg2); }
.fl { background: transparent; border: 0; padding: 4px 0; }
.fl-h { padding: 0 8px 6px; }
/* график */
svg.chart .b-open { fill: url(#gO); opacity: 1; } svg.chart .b-won { fill: url(#gW); } svg.chart .b-lost { fill: var(--ink3); opacity: .28; }
svg.chart .ln { fill: none; stroke: var(--gline); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--gline) 50%, transparent)); }
svg.chart .pt { fill: var(--gline); stroke: var(--panel); stroke-width: 1.5; } svg.chart .tk2 { fill: var(--gline); }
.l-open { background: linear-gradient(180deg, var(--g1a), var(--g1b)); } .l-won { background: linear-gradient(180deg, var(--g2a), var(--g2b)); } .l-lost { background: var(--ink3); opacity: .35; } .l-line { background: var(--gline); height: 3px !important; border-radius: 2px; width: 16px !important; }
/* kpi как khc */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.kpi2 { position: relative; padding: 18px 18px 16px; border: 0; border-radius: 0; box-shadow: none; background: transparent; min-height: 150px; }
.kpi2 + .kpi2 { border-left: 1px solid var(--line); }
.kpi2 .l { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); }
.kpi2 .v { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.kpi2 .v small { font-size: 16px; color: var(--ink3); font-weight: 600; margin-left: 3px; }
.kpi2 .sub { font-size: 12px; color: var(--ink2); margin: 2px 0 8px; }
.kpi2 .st { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink3); font-weight: 600; line-height: 1.5; }
.kpi2 .st i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink3); flex-shrink: 0; }
.kpi2 .st.r { color: var(--rose); } .kpi2 .st.r i { background: var(--rose); } .kpi2 .st.m { color: var(--mint); } .kpi2 .st.m i { background: var(--mint); } .kpi2 .st.b { color: var(--accent2); } .kpi2 .st.b i { background: var(--accent); }
.spark { position: absolute; right: 12px; bottom: 12px; width: 130px; height: 44px; overflow: visible; }
.spark .line { fill: none; stroke: var(--mint); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: var(--mint); opacity: .12; } .spark .dot { fill: var(--mint); stroke: var(--panel); stroke-width: 2; filter: drop-shadow(0 0 5px var(--mint)); }
.spark.r .line { stroke: var(--rose); } .spark.r .dot { fill: var(--rose); filter: drop-shadow(0 0 5px var(--rose)); } .spark.r .area { fill: var(--rose); }
.spark.c .line { stroke: var(--cyan); } .spark.c .area { fill: var(--cyan); } .spark.c .dot { fill: var(--cyan); filter: drop-shadow(0 0 5px var(--cyan)); }
.spark.v .line { stroke: var(--violet); } .spark.v .area { fill: var(--violet); } .spark.v .dot { fill: var(--violet); filter: drop-shadow(0 0 5px var(--violet)); }
:root[data-theme="dark"] { --kpis-bg: linear-gradient(180deg, #171C27, #131824); }
.kpis { background: var(--kpis-bg); }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi2 + .kpi2 { border-left: 0; border-top: 1px solid var(--line); } }

.kpi2 { padding-right: 150px; }
.mtbl td { white-space: nowrap; }
.tbl .rev .trk { width: 90px; height: 7px; background: var(--bg2); border-radius: 4px; overflow: hidden; display: block; flex: 0 0 auto; }
.tbl .rev .trk i { height: 100%; max-width: none; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.tbl.dt td.t { min-width: 140px; }

.kpi2 { padding: 16px 16px 58px; min-height: 172px; }
.spark { left: 10px; right: 10px; bottom: 8px; width: auto; height: 46px; }
.kpi2 .st { font-size: 11px; }
.mtbl td:first-child { min-width: 300px; }
.mtbl td, .mtbl th { padding: 9px 9px; }
.tbl .rev .trk { width: 64px; }
.tbl .rev b { min-width: 62px; }

.cwrap { position: relative; }
svg.chart .hz { fill: transparent; }
svg.chart .bar.hi .hz { fill: var(--ink); opacity: .05; }
svg.chart .bar.hi .b-open, svg.chart .bar.hi .b-won { filter: brightness(1.15); }
svg.chart .bar.hi .b-lost { opacity: .45; }
.ctip { position: absolute; pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow2); padding: 10px 12px; min-width: 280px; z-index: 20; font-size: 12.5px; }
.ctip.show { opacity: 1; transform: none; }
.ctip .th { font-weight: 800; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); margin-bottom: 6px; }
.ctip .tr { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; padding: 3px 0; }
.ctip .tr i { width: 10px; height: 10px; border-radius: 3px; display: block; }
.ctip .tr span { color: var(--ink2); }
.ctip .tr b { font-family: var(--mono); font-weight: 700; min-width: 32px; text-align: right; }
.ctip .tr em { font-style: normal; font-family: var(--mono); color: var(--ink3); min-width: 110px; text-align: right; }
.ctip .tr.tot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.ctip .tr.tot span, .ctip .tr.tot em { color: var(--ink); font-weight: 700; }
.ctip .tf { margin-top: 6px; font-size: 11.5px; color: var(--gline); }

/* таблицы в ширину экрана */
.tbl.dt { table-layout: fixed; width: 100%; }
.tbl.dt td, .tbl.dt th { overflow: hidden; text-overflow: ellipsis; padding-left: 10px; padding-right: 10px; }
.tbl.dt td.t { white-space: nowrap; min-width: 0; }
.tbl.dt td.ell { white-space: nowrap; }
.tbl.dt span.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.tbl.dt .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-flex; }
.tbl.dt .chip > span, .tbl.dt .chip { white-space: nowrap; }
.tbl.dt tr.xrow td { white-space: normal; overflow: visible; }
.tscroll { overflow-x: hidden; }

.tbl.dt td.r.mono { white-space: nowrap; }
.tbl.dt .btn.xs { padding: 0 7px; }

.tbl.dt td:first-child { overflow: visible; text-overflow: clip; padding-left: 12px; }
.tbl.dt .chev { margin-left: 0; }
.tbl.dt th { white-space: normal; line-height: 1.2; text-overflow: clip; }
.tbl { table-layout: auto; }
.card > .tbl, .tscroll > .tbl { max-width: 100%; }
.tbl td { overflow-wrap: anywhere; }

.tbl.dt td:last-child { overflow: visible; text-overflow: clip; }
.tbl.dt td.r.mono { padding-right: 12px; }

/* ---------- скроллбары ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink3); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }
.col .cards { scrollbar-width: thin; scrollbar-color: transparent transparent; padding-right: 6px; }
.col .cards::-webkit-scrollbar { width: 6px; }
.col .cards::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.col:hover .cards { scrollbar-color: var(--line2) transparent; }
.col:hover .cards::-webkit-scrollbar-thumb { background: var(--line2); }
.kanban { scrollbar-width: thin; padding-bottom: 6px; }
.kanban::-webkit-scrollbar { height: 8px; }
.kanban::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.kanban::-webkit-scrollbar-track { margin: 0 4px; }
.nav::-webkit-scrollbar { width: 4px; } .nav { scrollbar-color: transparent transparent; } .rail:hover .nav { scrollbar-color: var(--line) transparent; } .rail:hover .nav::-webkit-scrollbar-thumb { background: var(--line); }
.nav::-webkit-scrollbar-thumb { background: transparent; }
.tscroll::-webkit-scrollbar-thumb { background: var(--line2); }
.modal::-webkit-scrollbar { width: 6px; }

.seg button svg.i { width: 15px; height: 15px; }
.card .hd .row.wrap { gap: 8px; }

.ctrls { padding: 10px 18px 0; }
.ctrls .row.wrap { gap: 8px; }

.scopebar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin-bottom: 14px; border-radius: 12px; background: var(--amber-soft); border: 1px solid rgba(232,163,61,.45); color: var(--ink); font-size: 13px; }
.scopebar svg { color: var(--amber); flex-shrink: 0; } .scopebar span { flex: 1; } .scopebar b { color: #B87A1E; }
:root[data-theme="dark"] .scopebar b { color: var(--amber); }
.chip .x { font-style: normal; cursor: pointer; margin-left: 2px; opacity: .7; } .chip .x:hover { opacity: 1; }
.seg button svg.i { margin-right: 5px; vertical-align: -3px; }

/* ---------- страница данных ---------- */
.tree { font: 11.5px/1.55 var(--mono); color: var(--ink2); white-space: pre; overflow-x: auto; }
svg.erd { width: 100%; height: auto; display: block; }
svg.erd .ent rect { fill: var(--panel2); stroke: var(--line2); stroke-width: 1; }
svg.erd .ent.m rect { stroke: var(--mint); } svg.erd .ent.v rect { stroke: var(--violet); } svg.erd .ent.a rect { stroke: var(--amber); } svg.erd .ent.r rect { stroke: var(--rose); } svg.erd .ent.c rect { stroke: var(--cyan); }
svg.erd .et { font-size: 13px; font-weight: 800; fill: var(--ink); }
svg.erd .es { font-size: 10.5px; fill: var(--ink3); font-family: var(--mono); }
svg.erd .ln { stroke: var(--ink3); stroke-width: 1.2; fill: none; opacity: .7; }
svg.erd .ar { fill: var(--ink3); }
svg.erd .ll { font-size: 10px; fill: var(--ink3); font-family: var(--mono); }
.kico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent2); }
.kico svg.i { width: 15px; height: 15px; }
.kico.m { background: var(--mint-soft); color: var(--mint); } .kico.a { background: var(--amber-soft); color: var(--amber); } .kico.r { background: var(--rose-soft); color: var(--rose); } .kico.v { background: var(--violet-soft); color: var(--violet); } .kico.c { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.flowrow { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; }
.fstep { flex: 1; min-width: 130px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.fstep .fic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent2); display: grid; place-items: center; margin-bottom: 4px; }
.fstep b { font-size: 13px; } .fstep span { font-size: 11.5px; color: var(--ink3); line-height: 1.35; }
.farr { display: grid; place-items: center; color: var(--ink3); flex-shrink: 0; }

/* стрелки флагов на одной высоте */
.fi { align-items: center; }
.fi .btn.xs { width: 30px; padding: 0; justify-content: center; opacity: .55; }
.fi:hover .btn.xs { opacity: 1; }
/* селекты */
:root { color-scheme: light; } :root[data-theme="dark"] { color-scheme: dark; }
select.inp { -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A95A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
select.inp:hover { border-color: var(--ink3); }
select.inp.sm { background-position: right 8px center; background-size: 14px; padding-right: 28px; }
select.inp option { background: var(--panel); color: var(--ink); padding: 8px; }
input[type="date"].inp { cursor: pointer; }
input[type="date"].inp::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
/* цвет колонок канбана */
.col { --cc: var(--accent); border-top: 3px solid var(--cc); background: color-mix(in srgb, var(--cc) 7%, var(--bg2)); }
.col .ch b { color: var(--ink); }
.col .ch .cnt { color: var(--cc); font-weight: 700; }
.dc { border-left: 3px solid color-mix(in srgb, var(--cc) 70%, transparent); }
.dc:hover { border-left-color: var(--cc); }
:root[data-theme="dark"] .col { background: color-mix(in srgb, var(--cc) 10%, var(--bg2)); }

/* ширина колонок канбана фиксирована */
.col { flex: 0 0 280px; width: 280px; max-width: 280px; min-width: 0; }
.col .cards, .dc { min-width: 0; }
.dc .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc .c, .dc .f { min-width: 0; }
.dc .f b { white-space: nowrap; }

.kpi2.clickable { cursor: pointer; transition: background .15s; }
.kpi2.clickable:hover { background: var(--bg2); }
.kpi2 .more { position: absolute; top: 14px; right: 14px; color: var(--ink3); opacity: 0; transition: opacity .15s; }
.kpi2.clickable:hover .more { opacity: 1; }
.modal .xh { margin-top: 2px; }
.modal .list .it .t { font-size: 13px; }

.page .kpis.flat .kpi2 { padding-bottom: 16px; min-height: 0; }

/* скруглённый стык едет вместе с липким топбаром */
.topbar::after { content: ""; position: absolute; left: 0; top: 100%; width: 22px; height: 22px; background: var(--panel); -webkit-mask: radial-gradient(circle at 100% 100%, transparent 21.5px, #000 22px); mask: radial-gradient(circle at 100% 100%, transparent 21.5px, #000 22px); pointer-events: none; }
@media print { .topbar::after { display: none; } }

/* ---------- пастельные темы (2 цвета каждая) ---------- */
:root[data-theme="lavender"] {
  color-scheme: light;
  --bg: #F3F0FA; --bg2: #E9E4F5; --panel: #FFFFFF; --panel2: #F8F6FD; --line: #E4DEF2; --line2: #CDC3E6;
  --ink: #2A2540; --ink2: #5C557A; --ink3: #948CB0;
  --accent: #8B7BD8; --accent2: #6F5EC4; --accent-soft: #EEEAFB;
  --mint: #5FB8A3; --mint-soft: #E4F4EF; --amber: #D9A066; --amber-soft: #FBF0E3; --rose: #D97B8E; --rose-soft: #FBE9ED; --violet: #8B7BD8; --violet-soft: #EEEAFB; --cyan: #5FB8A3;
  --g1a: #C4B8F0; --g1b: #8B7BD8; --g2a: #A9E3D3; --g2b: #5FB8A3; --gline: #D9A066;
  --p1: #8B7BD8; --p2: #5FB8A3; --p3: #B39CDB; --p4: #D9A066; --p5: #D97B8E; --p6: #7FA6D8;
  --kpis-bg: linear-gradient(180deg, #FFFFFF, #F8F6FD); --shadow: 0 1px 2px rgba(80, 60, 140, .05), 0 8px 24px rgba(80, 60, 140, .08);
}
:root[data-theme="sand"] {
  color-scheme: light;
  --bg: #F8F3EC; --bg2: #EFE7DC; --panel: #FFFCF8; --panel2: #FAF5EE; --line: #EADFD0; --line2: #D6C6B0;
  --ink: #3A2E24; --ink2: #6E5E4E; --ink3: #A2927F;
  --accent: #D08A5B; --accent2: #B8703F; --accent-soft: #F9ECE2;
  --mint: #8FA98B; --mint-soft: #EDF2EC; --amber: #D4A64A; --amber-soft: #FAF0D9; --rose: #D28077; --rose-soft: #F9E8E5; --violet: #A58BB4; --violet-soft: #F1EAF4; --cyan: #8FA98B;
  --g1a: #F0C9A8; --g1b: #D08A5B; --g2a: #C8D8C4; --g2b: #8FA98B; --gline: #A58BB4;
  --p1: #D08A5B; --p2: #8FA98B; --p3: #A58BB4; --p4: #D4A64A; --p5: #D28077; --p6: #7FA0B5;
  --kpis-bg: linear-gradient(180deg, #FFFCF8, #FAF5EE); --shadow: 0 1px 2px rgba(120, 90, 50, .05), 0 8px 24px rgba(120, 90, 50, .08);
}
:root[data-theme="sea"] {
  color-scheme: light;
  --bg: #EDF5F6; --bg2: #E0EDEF; --panel: #FFFFFF; --panel2: #F5FAFB; --line: #D9E8EA; --line2: #BCD4D8;
  --ink: #1F3338; --ink2: #4E6A70; --ink3: #85A0A5;
  --accent: #3F9DAA; --accent2: #2D7F8B; --accent-soft: #E3F2F4;
  --mint: #4FB08E; --mint-soft: #E3F4EE; --amber: #E0A458; --amber-soft: #FBF0E0; --rose: #E8927C; --rose-soft: #FBEAE5; --violet: #7F93C9; --violet-soft: #ECEFF8; --cyan: #3F9DAA;
  --g1a: #A6DCE2; --g1b: #3F9DAA; --g2a: #B5E6D4; --g2b: #4FB08E; --gline: #E8927C;
  --p1: #3F9DAA; --p2: #E8927C; --p3: #7F93C9; --p4: #E0A458; --p5: #D48AA6; --p6: #4FB08E;
  --kpis-bg: linear-gradient(180deg, #FFFFFF, #F5FAFB); --shadow: 0 1px 2px rgba(30, 80, 90, .05), 0 8px 24px rgba(30, 80, 90, .08);
}
/* выбор темы */
.tpick { position: relative; }
.tpop { display: none; position: absolute; right: 0; top: 44px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--shadow2); padding: 10px; z-index: 40; width: 230px; }
.tpop.show { display: block; }
.tpop .th { font: 700 10.5px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink3); padding: 4px 8px 8px; }
.tpop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 8px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; font-weight: 600; font-size: 13px; color: var(--ink); }
.tpop button:hover { background: var(--bg2); }
.tpop button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent2); }
.tpop .sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line2); flex-shrink: 0; }
.tpop small { display: block; font-size: 10.5px; color: var(--ink3); font-weight: 500; }

.page { max-width: none; }
.content { width: 100%; min-width: 0; }
main { width: 100%; min-width: 0; }

/* колонки канбана растягиваются на ширину, минимум 280 */
.col { flex: 1 1 280px; width: auto; max-width: none; min-width: 280px; }
.kanban { width: 100%; }

.kpis { grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); }
.kpi2 { padding: 16px 14px 56px; }
.kpi2 .v { font-size: 30px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- кастомный селект ---------- */
.sel { position: relative; display: inline-block; min-width: 120px; }
.sel-b { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 13px; text-align: left; transition: border-color .15s, box-shadow .15s; }
.sel.sm .sel-b { height: 30px; font-size: 12.5px; border-radius: 8px; }
.sel-b:hover { border-color: var(--ink3); }
.sel.open .sel-b { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.sel-b > svg.i:first-child { width: 15px; height: 15px; color: var(--ink3); }
.sel-b.has { border-color: var(--accent); color: var(--accent2); background: var(--accent-soft); }
.sel-b.has > svg.i:first-child { color: var(--accent2); }
.sel-l { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-n { font: 700 10.5px/1 var(--mono); background: var(--accent); color: #fff; border-radius: 10px; padding: 3px 6px; font-style: normal; }
.sel-c { width: 14px !important; height: 14px !important; color: var(--ink3); transition: transform .2s; flex-shrink: 0; }
.sel.open .sel-c { transform: rotate(180deg); }
.sel-p { display: none; position: absolute; left: 0; top: calc(100% + 6px); min-width: 100%; width: max-content; max-width: 320px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: var(--shadow2); padding: 6px; z-index: 60; animation: up2 .14s ease; }
@keyframes up2 { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.sel-p.show { display: block; }
.sel-s { margin: 2px 2px 6px; width: calc(100% - 4px); }
.sel-a { display: flex; gap: 4px; padding: 0 4px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sel-a button { border: 0; background: transparent; color: var(--accent2); font-size: 11.5px; font-weight: 700; padding: 3px 6px; border-radius: 6px; }
.sel-a button:hover { background: var(--accent-soft); }
.sel-o { max-height: 280px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.sel-i { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.sel-i:hover { background: var(--bg2); }
.sel-i.on { background: var(--accent-soft); color: var(--accent2); }
.sel-i span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sel-i small { font-size: 10.5px; color: var(--ink3); font-weight: 500; }
.sel-i svg.i { width: 15px; height: 15px; color: var(--accent2); }
.sel-i .cb { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line2); flex-shrink: 0; position: relative; background: var(--panel); }
.sel-i.on .cb { background: var(--accent); border-color: var(--accent); }
.sel-i.on .cb::after { content: ""; position: absolute; left: 4.5px; top: 1.5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.sel-i .sw { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.modal .sel, .field .sel { width: 100%; display: block; }
.ctip .tm { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; font-size: 13px; }
.ctip .tm b { font-family: var(--mono); font-size: 14px; color: var(--accent2); }

/* ---------- обзор: топ клиентов / стадии ---------- */
.grid.eq > .card { display: flex; flex-direction: column; } .grid.eq > .card > .bd { flex: 1; }
.tcrow, .strow { border-radius: 12px; transition: background .15s; cursor: pointer; }
.tcrow:hover, .strow:hover { background: var(--bg2); }
.tcrow.open, .strow.open { background: var(--panel2); }
.tcmain, .stmain { display: grid; grid-template-columns: 22px 34px 1fr auto 14px; gap: 12px; align-items: center; padding: 9px 10px; }
.stmain { grid-template-columns: 12px 1fr auto 14px; }
.rank { font: 700 12px/1 var(--mono); color: var(--ink3); text-align: center; }
.tcmain .ava { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.tcbody, .stbody { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.tct, .stt { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 700; line-height: 1.2; }
.tct .lnk { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tct .lnk:hover { color: var(--accent2); }
.tcs, .sts { font: 600 11px/1 var(--mono); color: var(--ink3); }
.tcbar, .stbar { height: 7px; border-radius: 4px; background: var(--bg2); overflow: hidden; }
.tcbar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width .6s ease; }
.stbar i { display: block; height: 100%; border-radius: 4px; background: var(--sc); opacity: .9; transition: width .6s ease; }
.strow.k-lost .stbar i { background: repeating-linear-gradient(135deg, var(--ink3) 0 4px, transparent 4px 8px); opacity: .5; }
.tcm, .stm { font-size: 12px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcv, .stv { font: 700 16px/1 var(--mono); color: var(--ink); white-space: nowrap; }
.tcv small { font-size: 11px; color: var(--ink3); margin-left: 3px; font-weight: 500; }
.strow .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sc) 18%, transparent); }
.strow.k-lost .dot { background: var(--ink3); box-shadow: none; }
.tcrow .chev, .strow .chev { width: 8px; height: 8px; border-right: 2px solid var(--ink3); border-bottom: 2px solid var(--ink3); transform: rotate(45deg); transition: transform .2s; justify-self: end; }
.tcrow.open .chev, .strow.open .chev { transform: rotate(-135deg); border-color: var(--accent); }
.tcx, .stx { padding: 4px 12px 12px 78px; font-size: 12.5px; animation: fadein .25s ease both; }
.stx { padding-left: 34px; }
.tcx .xe, .stx .xe { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.fgrp + .fgrp { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.fgh { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px; font-size: 13px; }
.fgh b { font-size: 13.5px; } .fgh svg.i { width: 15px; height: 15px; color: var(--ink3); } .fgh .muted { font-size: 11.5px; font-family: var(--mono); }
.c-r { color: var(--rose); font-weight: 700; }

.kpis { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }
.kpi2 { padding: 14px 12px 54px; }
.kpi2 .v { font-size: 28px; }
.kpi2 .l { font-size: 10px; letter-spacing: .1em; }

/* ---------- тема «Сумерки»: мягкий тёмно-серый фон + сочные графики ---------- */
:root[data-theme="slate"] {
  color-scheme: dark;
  --bg: #1F2531; --bg2: #2A3140; --panel: #272E3C; --panel2: #2E3646; --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.2);
  --ink: #F2F4F8; --ink2: #BAC3D3; --ink3: #8491A6;
  --accent: #FF8A5B; --accent2: #FFA07F; --accent-soft: rgba(255,138,91,.16);
  --mint: #3DDC97; --mint-soft: rgba(61,220,151,.16); --amber: #FFC857; --amber-soft: rgba(255,200,87,.16); --rose: #FF6B8A; --rose-soft: rgba(255,107,138,.16); --violet: #A78BFA; --violet-soft: rgba(167,139,250,.16); --cyan: #38D9F5;
  --g1a: #38D9F5; --g1b: #3A7BFF;     /* в работе: бирюза → электрик */
  --g2a: #B6F36B; --g2b: #22C55E;     /* успешные: лайм → изумруд */
  --gline: #FF8A5B;                   /* линия выручки: коралл */
  --p1: #3A7BFF; --p2: #38D9F5; --p3: #A78BFA; --p4: #FFC857; --p5: #FF6B8A; --p6: #3DDC97;
  --kpis-bg: linear-gradient(180deg, #2A3140, #252C3A);
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 8px 24px rgba(0,0,0,.28); --shadow2: 0 2px 6px rgba(0,0,0,.35), 0 16px 40px rgba(0,0,0,.45);
}
:root[data-theme="slate"] svg.chart .b-lost { fill: #8491A6; opacity: .35; }
:root[data-theme="slate"] .spark .line { stroke-width: 2.2; }
:root[data-theme="slate"] .tcbar i { background: linear-gradient(90deg, #3A7BFF, #38D9F5); }
:root[data-theme="slate"] .mtbl .cv i { background: linear-gradient(90deg, #3DDC97, #B6F36B); }
:root[data-theme="slate"] .hbar .tr i { background: linear-gradient(90deg, #3A7BFF, #38D9F5); } :root[data-theme="slate"] .hbar .tr i.m { background: linear-gradient(90deg, #22C55E, #B6F36B); }

/* ---------- КП: оригинал PDF и шаблон счёта ---------- */
.pdfwrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
iframe.pdf { width: 100%; height: calc(100vh - 230px); min-height: 700px; border: 0; display: block; background: #525659; }
.kp.inv { font: 10pt/1.35 'Manrope', Arial, sans-serif; }
.kp.inv .warn { font-size: 8.5pt; color: #333; border: 1px solid #999; padding: 6px 8px; margin-bottom: 10px; }
.kp.inv table.bank { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 9.5pt; }
.kp.inv table.bank td { border: 1px solid #333; padding: 5px 8px; vertical-align: top; }
.kp.inv table.bank td.w { width: 45%; }
.kp.inv h1 { font-size: 15pt; font-weight: 800; margin: 6px 0 10px; border-bottom: 2px solid #111; padding-bottom: 6px; }
.kp.inv .req { font-size: 10pt; margin: 3px 0; color: #111; }
.kp.inv table.it { margin: 12px 0 8px; }
.kp.inv table.it th { background: #EFEFEF; border: 1px solid #333; font-size: 9pt; }
.kp.inv table.it td { border: 1px solid #333; }
.kp.inv .tot { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin: 6px 0 10px; }
.kp.inv .tot div { display: flex; gap: 16px; font-size: 10pt; } .kp.inv .tot div span { color: #333; } .kp.inv .tot .big b { font-size: 11.5pt; }
.kp.inv .sig2 { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; }
.kp.inv .stamp { position: relative; display: flex; align-items: flex-end; gap: 24px; }
.kp.inv .st-ring { width: 150px; height: 150px; border-radius: 50%; border: 3px double #3B5BB5; color: #3B5BB5; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: .8; transform: rotate(-8deg); font-weight: 700; }
.kp.inv .st-txt { font-size: 9pt; letter-spacing: .04em; padding: 0 14px; } .kp.inv .st-bin { font-size: 8pt; margin-top: 6px; } .kp.inv .st-c { font-size: 8pt; margin-top: 4px; border-top: 1px solid #3B5BB5; padding-top: 4px; }
.kp.inv .sign { font-size: 10pt; white-space: nowrap; }
.kp.inv ol.cond { margin: 18px 0 0 16px; font-size: 8.5pt; color: #333; }
.kp.inv ol.cond li { margin-bottom: 2px; }

/* ---------- KPI: эргономика и спарклайны в границах карточки ---------- */
.kpi2 { overflow: hidden; padding: 16px 16px 66px; min-height: 196px; }
.kpi2 .l { margin-bottom: 2px; }
.kpi2 .v { margin-top: 6px; }
.kpi2 .sub { margin: 4px 0 10px; line-height: 1.35; }
.kpi2 .st { line-height: 1.4; margin-bottom: 3px; align-items: flex-start; }
.kpi2 .st i { margin-top: 5px; }
.spark { left: 16px; right: 16px; bottom: 12px; height: 42px; overflow: visible; }
.spark .line { stroke-width: 2; }
.spark .area { opacity: .10; }
.spark .dot { r: 3.5; }
.kpi2::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 10px; height: 1px; background: var(--line); }
.kpi2 + .kpi2 { border-left: 1px solid var(--line); }

/* ---------- номенклатура ---------- */
.kpi2.small .v { font-size: 20px; line-height: 1.2; margin-top: 10px; }
.gdot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ntbl tr.grow td { background: var(--panel2); font-size: 13.5px; cursor: pointer; }
.ntbl tr.grow .gdot { background: var(--gc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gc) 18%, transparent); }
.ntbl tr.grow .gname { font-size: 14px; }
.ntbl tr.srow td { background: color-mix(in srgb, var(--panel2) 60%, var(--bg2)); cursor: pointer; font-weight: 600; }
.ntbl tr.prow td { cursor: pointer; }
.ntbl tr.lvl3 td { font-size: 12.5px; }
.ntbl .pn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-weight: 600; }
.ntbl td:first-child .row { min-width: 0; }
.ntbl td:first-child .row > span.pn { flex: 1; }
.ntbl .chev { flex-shrink: 0; }
.ntbl tr.xrow td { padding-left: 60px; }
.abc { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font: 800 11px/1 var(--mono); background: var(--bg2); color: var(--ink3); }
.abc.A { background: var(--mint-soft); color: var(--mint); } .abc.B { background: var(--accent-soft); color: var(--accent2); } .abc.C { background: var(--amber-soft); color: var(--amber); }
.phist { display: flex; align-items: flex-end; gap: 3px; height: 54px; margin: 6px 0; }
.phist i { flex: 1; display: block; background: var(--accent); opacity: .55; border-radius: 3px 3px 1px 1px; min-width: 4px; }
.phist i:hover { opacity: 1; }
.grow2 { padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background .15s; }
.grow2:hover { background: var(--bg2); } .grow2.on { background: var(--accent-soft); outline: 1px solid var(--accent); }
.grow2 .gn { font-size: 13.5px; } .grow2 .s { font-size: 11.5px; color: var(--ink3); margin-top: 3px; }
.gbar { height: 7px; border-radius: 4px; background: var(--bg2); overflow: hidden; margin-top: 6px; }
.gbar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .6s ease; }
.tprow { display: grid; grid-template-columns: 22px 1fr auto; gap: 12px; align-items: center; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.tprow:hover { background: var(--bg2); }
.tprow .tpb { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tprow .tpt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tprow .pn { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tprow .tcbar { margin: 0; } .tprow .s { font-size: 11.5px; }
.abcbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin-bottom: 12px; background: var(--bg2); }
.abcbar i { display: block; height: 100%; } .abcbar .A { background: var(--mint); } .abcbar .B { background: var(--accent); } .abcbar .C { background: var(--amber); }
.abcrow { display: grid; grid-template-columns: 26px 1fr 12px; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.abcrow:hover { background: var(--bg2); } .abcrow .abc { width: 26px; height: 26px; font-size: 12px; } .abcrow .s { font-size: 11.5px; }
.abcrow .chev { width: 7px; height: 7px; border-right: 2px solid var(--ink3); border-bottom: 2px solid var(--ink3); transform: rotate(-45deg); }
.szg + .szg { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.szr { display: grid; grid-template-columns: 90px 1fr 70px; gap: 10px; align-items: center; padding: 3px 0; font-size: 12.5px; cursor: pointer; }
.szr:hover .mono:first-child { color: var(--accent2); } .szr .gbar { margin: 0; height: 6px; } .szr .s { text-align: right; }
.fl-h.b { color: var(--accent2); }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
svg.chart .ns { transition: opacity .15s; } svg.chart .bar:hover .ns { opacity: .85; }

.ntbl tr.grow .chip { flex-shrink: 0; }
.ntbl td:first-child .row > b.gname { white-space: nowrap; }

/* аватары компаний в топе — монохромные, без заливки */
.tcmain .ava { background: transparent !important; border: 1px solid var(--line2); color: var(--ink2); font-weight: 700; }
.tcrow:hover .tcmain .ava { border-color: var(--accent); color: var(--accent2); }

/* номенклатура: вкладки и полоса групп над таблицей */
.nsum { display: flex; gap: 6px; flex-wrap: wrap; }
.nsg { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); font-weight: 600; font-size: 12.5px; }
.nsg i { width: 9px; height: 9px; border-radius: 50%; background: var(--gc); }
.nsg b { color: var(--ink); font-family: var(--mono); font-weight: 600; } .nsg small { color: var(--ink3); font-family: var(--mono); font-size: 11px; }
.nsg:hover { border-color: var(--ink3); } .nsg.on { border-color: var(--gc); background: color-mix(in srgb, var(--gc) 12%, var(--panel)); color: var(--ink); }
.seg button svg.i { vertical-align: -3px; }

/* номенклатура: явные вкладки */
.ntabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.ntabs button { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink2); text-align: left; font-weight: 700; font-size: 14px; transition: all .15s; position: relative; }
.ntabs button svg.i { width: 20px; height: 20px; color: var(--ink3); flex-shrink: 0; }
.ntabs button span { display: flex; flex-direction: column; gap: 2px; }
.ntabs button small { font-size: 11.5px; font-weight: 500; color: var(--ink3); }
.ntabs button:hover { border-color: var(--ink3); color: var(--ink); }
.ntabs button.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent2); box-shadow: inset 0 -3px 0 var(--accent); }
.ntabs button.on svg.i, .ntabs button.on small { color: var(--accent2); }
.ntabs button .dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
@media (max-width: 900px) { .ntabs { grid-template-columns: 1fr; } }

/* логотип в шапке счёта */
.kp.inv .kphead { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.kp.inv .kplogo { display: flex; align-items: center; gap: 8px; color: #1B2232; flex-shrink: 0; padding-right: 14px; border-right: 1px solid #C9CED8; }
.kp.inv .kplogo svg { width: 44px; height: 44px; }
.kp.inv .kplogo b { display: block; font-size: 17pt; font-weight: 800; line-height: 1; letter-spacing: .02em; }
.kp.inv .kplogo span { display: block; font-size: 7pt; letter-spacing: .3em; font-weight: 700; margin-top: 3px; color: #555; }
.kp.inv .kphead .warn { margin-bottom: 0; flex: 1; }
