/* TeamGuide · Продажи — токены из brand-kit TeamGuide 2.0 «Сумерки» */
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url("fonts/onest-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url("fonts/onest-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url("fonts/onest-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url("fonts/onest-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url("fonts/onest-cyrillic-600-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url("fonts/onest-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Geologica"; font-weight: 400; font-display: swap; src: url("fonts/geologica-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geologica"; font-weight: 400; font-display: swap; src: url("fonts/geologica-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Geologica"; font-weight: 500; font-display: swap; src: url("fonts/geologica-cyrillic-500-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Geologica"; font-weight: 500; font-display: swap; src: url("fonts/geologica-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122, U+2212; }

:root {
  --bg: #f3f0eb; --s1: #ffffff; --s2: #f0ece5; --s3: #e4ded4;
  --line: rgba(60,45,25,0.12); --fg: #1f1b17; --fg2: #3a332c; --muted: #6f655b;
  --acc: #8c6428; --acc-strong: #6e4e1e; --on-acc: #fff; --tint: rgba(140,100,40,0.1);
  --ok: #277a50; --warn: #a35c12; --bad: #be4a35; --info: #3a69a8;
  --scrim: rgba(20,14,8,0.45); --shadow: 0 1px 2px rgba(40,28,10,.06), 0 4px 14px rgba(40,28,10,.06);
  --r: 12px; --font: "Onest", system-ui, -apple-system, sans-serif; --display: "Geologica", var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #2c2925; --s1: #36322d; --s2: #423d37; --s3: #4d4740;
    --line: rgba(255,255,255,0.1); --fg: #f5f0e9; --fg2: #ddd5ca; --muted: #ada399;
    --acc: #e0c18c; --acc-strong: #f0d9ae; --on-acc: #1b150c; --tint: rgba(224,193,140,0.14);
    --ok: #86cda4; --warn: #e8a866; --bad: #ea8b78; --info: #93b4de;
    --scrim: rgba(10,8,6,0.6); --shadow: 0 1px 2px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 24px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); }
.top-in { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 500; text-decoration: none; white-space: nowrap; }
.brand i { width: 26px; height: 26px; border-radius: 7px; background: var(--acc); display: inline-block; position: relative; }
.brand i::after { content: ""; position: absolute; inset: 7px 6px; border-top: 3px solid var(--on-acc); border-bottom: 3px solid var(--on-acc); }
.brand b { color: var(--muted); font-weight: 400; }
nav.tabs { display: flex; gap: 4px; flex: 1; }
nav.tabs a { text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--fg2); }
nav.tabs a.on { background: var(--tint); color: var(--acc-strong); font-weight: 500; }
.me { display: flex; gap: 8px; align-items: center; }
.me .name { color: var(--muted); font-size: 13px; }

main { max-width: 1400px; margin: 0 auto; padding: 20px 16px 60px; }
.head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { flex: 1; min-width: 0; }
.crumb { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-block; margin-bottom: 6px; }
.crumb:hover { color: var(--acc); }

/* кнопки и поля */
.btn { border: 1px solid var(--line); background: var(--s1); padding: 8px 14px; border-radius: 10px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 38px; }
.btn:hover { border-color: var(--acc); }
.btn.pri { background: var(--acc); color: var(--on-acc); border-color: var(--acc); font-weight: 500; }
.btn.pri:hover { background: var(--acc-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--fg); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
input.i, select.i, textarea.i { width: 100%; border: 1px solid var(--line); background: var(--s1); border-radius: 10px; padding: 8px 10px; min-height: 38px; color: var(--fg); font-size: 15px; }
textarea.i { min-height: 80px; resize: vertical; }
input.i:focus, select.i:focus, textarea.i:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--tint); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.grid .wide { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer; background: var(--s1); font-size: 14px; color: var(--fg); }
.chip input { accent-color: var(--acc); margin: 0; }
.chip:has(input:checked) { background: var(--tint); border-color: var(--acc); }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--s2); color: var(--fg2); white-space: nowrap; }
.badge.trial { background: var(--tint); color: var(--acc-strong); }
.badge.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.badge.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }

/* воронка */
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x proximity; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.col { background: var(--s2); border-radius: var(--r); padding: 10px; min-height: 200px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px;
  flex: 1 1 260px; min-width: 240px; }
.col.is-empty { flex: 0 1 132px; min-width: 112px; }
.col.is-empty .col-h h3 { font-weight: 500; color: var(--muted); }
.col.drop { outline: 2px dashed var(--acc); outline-offset: -2px; }
.col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 4px; gap: 8px; }
.col-h h3 { font-size: 14px; }
.col-h .sum { font-size: 12px; color: var(--muted); }
.col.lost { opacity: .85; }
.deal { background: var(--s1); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; display: block; box-shadow: var(--shadow); cursor: pointer; }
.deal:hover { border-color: var(--acc); }
.deal[draggable="true"] { cursor: grab; }
.deal .t { font-weight: 500; }
.deal .c { color: var(--muted); font-size: 13px; }
.deal .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-top: 6px; font-size: 13px; flex-wrap: wrap; }
.deal .next { margin-top: 6px; font-size: 13px; color: var(--fg2); }
.deal .next.late { color: var(--bad); }
.bar { height: 4px; background: var(--s3); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--acc); }
.empty { color: var(--muted); font-size: 13px; text-align: center; padding: 16px 4px; }

/* стадии в сделке */
.stages { display: flex; gap: 4px; flex-wrap: wrap; }
.stages button { border: 1px solid var(--line); background: var(--s1); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--fg2); }
.stages button.past { background: var(--tint); border-color: transparent; color: var(--acc-strong); }
.stages button.on { background: var(--acc); color: var(--on-acc); border-color: var(--acc); font-weight: 500; }
.stages button.lost.on { background: var(--bad); border-color: var(--bad); color: #fff; }

/* этапы внедрения */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--s2); color: var(--muted); font-weight: 500; }
.steps li.done .n { background: var(--ok); color: #fff; }
.steps li.doing .n { background: var(--acc); color: var(--on-acc); }
.steps li.skip .n { text-decoration: line-through; }
.steps .sn { font-weight: 500; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.steps .sh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 28px; }
.steps .sh .sn { flex: 1; min-width: 140px; }
.steps .sh select { width: auto; min-height: 32px; padding: 4px 8px; font-size: 14px; }
.steps .sf { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.steps .sf[hidden] { display: none; }
.steps .sf .wide { grid-column: 1 / -1; }

/* журнал */
.feed { list-style: none; margin: 12px 0 0; padding: 0; }
.feed li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.feed .meta { font-size: 12px; color: var(--muted); grid-column: 1 / -1; }
.feed .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.feed li.sys .txt { color: var(--muted); font-size: 14px; }
.addnote { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: start; }
.addnote textarea { min-height: 38px; }
@media (max-width: 520px) { .addnote { grid-template-columns: 1fr auto; } .addnote textarea { grid-column: 1 / -1; grid-row: 1; } }

/* таблицы */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr.link { cursor: pointer; }
.tbl tr.link:hover td { background: var(--s2); }
.tbl td.r, .tbl th.r { text-align: right; }

/* сводка */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi .v { font-family: var(--display); font-size: 26px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .l { font-size: 13px; color: var(--muted); }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel .fr { display: grid; grid-template-columns: 120px 1fr 70px; gap: 10px; align-items: center; font-size: 14px; }
.funnel .fb { height: 22px; background: var(--s2); border-radius: 6px; overflow: hidden; }
.funnel .fb i { display: block; height: 100%; background: var(--acc); border-radius: 6px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: space-between; }
.list li:first-child { border-top: 0; }
.list a { text-decoration: none; }
.list a:hover { color: var(--acc); }

/* вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 12px; }
.login .brand { justify-content: center; font-size: 20px; margin-bottom: 8px; }
.err { color: var(--bad); font-size: 14px; min-height: 20px; }

/* модалка */
.modal { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .card { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--fg); color: var(--bg);
  padding: 8px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); color: #fff; }

.search { max-width: 320px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .top-in { flex-wrap: wrap; gap: 8px 12px; }
  nav.tabs { order: 3; flex-basis: 100%; overflow-x: auto; }
  .me .name { display: none; }
  h1 { font-size: 20px; }
  .head h1 { flex-basis: 100%; }
  .board { grid-auto-columns: 84%; }
  .hide-m { display: none; }
  .funnel .fr { grid-template-columns: 96px 1fr 56px; }
}
/* Private marketing screens */
.mkt-tabs,.mkt-filters{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0;align-items:end}.mkt-filters .f{max-width:220px}.mkt-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}.mkt-card{margin:16px 0;overflow:hidden}.mkt-card h2{font-size:23px}.mkt-card h3{margin:22px 0 10px}.mkt-number{font-size:32px}.mkt-scroll{max-width:100%;overflow-x:auto;margin:14px 0}.mkt-scroll table{width:100%;border-collapse:collapse;min-width:480px}.mkt-scroll th,.mkt-scroll td{padding:10px;text-align:left;border-bottom:1px solid var(--line,#ccc)}.mkt-card a{overflow-wrap:anywhere}.mkt-card p{white-space:pre-wrap}.mkt-card pre{overflow:auto;max-width:100%}.mkt-chart{display:grid;gap:8px;margin:20px 0}.mkt-bar-row{display:grid;grid-template-columns:minmax(90px,1fr) 2fr;gap:10px;font-size:12px}.mkt-bar{display:block;min-width:18px;padding:4px;background:#8c6428;color:white;border-radius:4px}.tabs{flex-wrap:wrap}@media(max-width:600px){.mkt-grid{grid-template-columns:1fr}.mkt-filters .f{max-width:100%;flex:1 1 125px}}

.mkt-chart{max-height:280px;overflow-y:auto}.mkt-bar{min-width:0}
