/* CRM обзвона франшиз — «рабочий стол» в цветах Алтая: снег, кедр, мёд, озеро.
   Один шрифт — Golos Text, цифры табличные. Смелость потрачена в двух местах: тёмно-кедровая
   боковая колонна с «тропами» прогресса по нишам и пульт звонка в карточке. Остальное тихое. */

@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/golos-latin.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; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/golos-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/golos-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/golos-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  --snow: #F3F5F1;        /* фон страницы — холодный, не кремовый */
  --paper: #FFFFFF;
  --ink: #18251F;
  --ink-2: #4A5A51;
  --ink-3: #7A877F;
  --line: #DCE3DC;
  --line-2: #EBEFEA;
  --cedar: #1E5A43;       /* основной */
  --cedar-deep: #123628;  /* боковая колонна */
  --cedar-wash: #E5EFE8;
  --snow-cap: #EAF1EC;
  --focus: #2F6B8A;

  --t-stone: #6F7C74; --t-rose: #B8453A; --t-honey: #A86E12; --t-lake: #2B6585;
  --t-violet: #64559A; --t-cedar: #1E6B48; --t-brick: #7E3A2E;

  --r-s: 6px; --r-m: 10px; --r-l: 14px;
  --fs-xs: 12px; --fs-s: 13px; --fs-m: 14px; --fs-l: 16px; --fs-xl: 20px; --fs-2xl: 28px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--snow); color: var(--ink); font: 400 var(--fs-m)/1.45 "Golos Text", system-ui, sans-serif; }
a { color: var(--cedar); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); font-size: var(--fs-s); }
.hint { color: var(--ink-2); font-size: var(--fs-s); margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; vertical-align: -3px; }
code { font: 500 12.5px/1.3 ui-monospace, "SFMono-Regular", Menlo, monospace; background: var(--line-2); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; }

.h1 { font-size: var(--fs-2xl); line-height: 1.15; font-weight: 650; letter-spacing: -0.015em; margin: 0; }
.h2 { font-size: var(--fs-l); font-weight: 650; margin: 0; }
.h3 { font-size: var(--fs-m); font-weight: 650; margin: 0; display: flex; gap: 6px; align-items: baseline; }
.sub { color: var(--ink-2); margin: 4px 0 0; }

/* тона этапов: одна переменная --tone на элемент */
.tone-stone { --tone: var(--t-stone); } .tone-rose { --tone: var(--t-rose); } .tone-honey { --tone: var(--t-honey); }
.tone-lake { --tone: var(--t-lake); } .tone-violet { --tone: var(--t-violet); } .tone-cedar { --tone: var(--t-cedar); }
.tone-brick { --tone: var(--t-brick); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--ink-3)); flex: none; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.main { padding: 28px 32px 120px; min-width: 0; }

.rail { background: var(--cedar-deep); color: #D5E3DA; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.rail a { color: inherit; text-decoration: none; }
.rail__brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; color: #fff !important; }
.rail__mark { width: 40px; height: 24px; color: #4E9A76; flex: none; }
.rail__brand b { display: block; font-size: var(--fs-l); letter-spacing: -0.01em; }
.rail__brand small { display: block; font-size: var(--fs-xs); color: #9DB8A8; }
.rail__group { display: flex; flex-direction: column; gap: 2px; }
.rail__caption { font-size: var(--fs-xs); color: #86A493; padding: 0 8px 4px; }
.rail__item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: var(--r-s); font-size: var(--fs-m); background: none; border: 0; color: inherit; font-family: inherit;
  cursor: pointer; text-align: left; width: 100%; }
.rail__item em { font-style: normal; font-size: var(--fs-xs); color: #8FAE9C; font-variant-numeric: tabular-nums; }
.rail__item:hover { background: rgba(255, 255, 255, .06); }
.rail__item.is-active { background: #F3F5F1; color: var(--cedar-deep); font-weight: 600; }
.rail__item.is-active em { color: var(--cedar); }
.rail__niche { grid-template-columns: 1fr auto; row-gap: 5px; line-height: 1.25; }
.rail__niche .trail { grid-column: 1 / -1; width: 100%; height: 3px; display: block; }
.trail__bg { fill: rgba(255, 255, 255, .1); } .trail__touched { fill: #6FA287; } .trail__done { fill: #E4B860; }
.rail__item.is-active .trail__bg { fill: var(--line); } .rail__item.is-active .trail__touched { fill: #7FB197; }
.rail__item.is-active .trail__done { fill: var(--t-honey); }
.rail__waves { display: flex; gap: 6px; padding: 0 6px; flex-wrap: wrap; }
.wave-chip { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); font-size: var(--fs-s); }
.wave-chip em { font-style: normal; color: #8FAE9C; margin-left: 2px; }
.wave-chip.is-active { background: #F3F5F1; color: var(--cedar-deep) !important; border-color: transparent; }
.rail__foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 12px; }
.rail__user { display: flex; gap: 9px; align-items: center; padding: 4px 8px; font-size: var(--fs-s); color: #9DB8A8; }
.rail__logout { grid-template-columns: auto 1fr; }

/* ---------- элементы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-s);
  border: 1px solid transparent; font: 500 var(--fs-m)/1 "Golos Text", system-ui, sans-serif; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; color: var(--ink); background: var(--paper); }
.btn.is-sm { height: 30px; padding: 0 10px; font-size: var(--fs-s); }
.btn.is-lg { height: 44px; font-size: var(--fs-l); }
.btn.is-primary { background: var(--cedar); color: #fff; }
.btn.is-primary:hover { background: #174a37; }
.btn.is-quiet { border-color: var(--line); }
.btn.is-quiet:hover { border-color: var(--ink-3); }
.btn.is-ghost { background: none; color: var(--ink-2); }
.btn.is-ghost:hover { background: var(--line-2); }
.btn.is-danger { background: none; border-color: #E5C3BE; color: var(--t-rose); }
.btn.is-star { background: #FBF1DC; color: #7A5108; border-color: #EBD3A0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.input, .select, .textarea { width: 100%; font: 400 var(--fs-m)/1.35 "Golos Text", system-ui, sans-serif; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; min-height: 36px; }
.textarea { resize: vertical; }
.input:hover, .select:hover, .textarea:hover { border-color: #C3CDC4; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(47, 107, 138, .15); }
.input.is-sm, .select.is-sm { min-height: 30px; padding: 4px 8px; font-size: var(--fs-s); width: auto; }
.select { appearance: none; padding-right: 28px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237A877F' stroke-width='2'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 9px center; }
.check { width: 16px; height: 16px; accent-color: var(--cedar); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: var(--fs-s); color: var(--ink-2); }
.field.is-invalid .input { border-color: var(--t-rose); }
.error { color: var(--t-rose); margin: 0; font-size: var(--fs-s); }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: var(--fs-s);
  font-weight: 500; white-space: nowrap; background: color-mix(in srgb, var(--tone) 11%, white); color: color-mix(in srgb, var(--tone) 80%, black); }
.chip { display: inline-flex; gap: 4px; align-items: center; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink-2); font-size: var(--fs-s); }
.chip em { font-style: normal; color: var(--ink-3); }
.chip.is-active { background: var(--cedar); color: #fff; border-color: var(--cedar); }
.chip.is-active em { color: #CFE3D7; }
.chip.is-xs { padding: 0 7px; font-size: var(--fs-xs); }
.chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 4px; font-size: 11.5px; font-weight: 500;
  background: var(--line-2); color: var(--ink-2); }
.badge.is-tg { background: #E3EFF7; color: #22648A; } .badge.is-wa { background: #E3F3E7; color: #23744A; }
.badge.is-max { background: #ECE8F6; color: #5A4C93; } .badge.is-dept { background: #FBF1DC; color: #7A5108; }

.toast { display: flex; gap: 8px; align-items: center; background: var(--cedar-wash); color: var(--cedar-deep); border: 1px solid #C8DECF;
  padding: 10px 14px; border-radius: var(--r-m); margin-bottom: 18px; font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .35s ease-out; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
}
.empty { text-align: center; padding: 64px 20px; background: var(--paper); border: 1px dashed var(--line); border-radius: var(--r-l); }
.empty p { margin: 0 0 12px; color: var(--ink-2); }
.empty .empty__ttl { font-size: var(--fs-xl); font-weight: 650; color: var(--ink); margin-bottom: 6px; }

/* ---------- список ---------- */
.page-hd { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-hd__tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { position: relative; }
.search .ico { position: absolute; left: 10px; top: 10px; color: var(--ink-3); }
.search .input { padding-left: 32px; width: 300px; }

.funnel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px 16px 8px; margin-bottom: 14px; }
.funnel__bar { display: block; width: 100%; height: 10px; border-radius: 5px; overflow: hidden; margin-bottom: 10px; }
.funnel__bar .seg { fill: var(--tone); }
.funnel__steps { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.funnel__step { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 8px 10px; border-radius: var(--r-m);
  color: var(--ink); text-decoration: none !important; }
.funnel__step span { display: flex; gap: 6px; align-items: center; font-size: var(--fs-s); color: var(--ink-2); grid-column: 1 / -1; white-space: nowrap; }
.funnel__step b { font-size: var(--fs-xl); font-weight: 650; font-variant-numeric: tabular-nums; }
.funnel__step small { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: var(--fs-xs); }
.funnel__step:hover { background: var(--snow); }
.funnel__step.is-active { background: color-mix(in srgb, var(--tone, var(--cedar)) 10%, white); box-shadow: inset 0 -2px 0 var(--tone, var(--cedar)); }

.toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar__sort { display: flex; gap: 8px; align-items: center; color: var(--ink-2); font-size: var(--fs-s); }
.toolbar__sort label { display: flex; gap: 8px; align-items: center; }
.toolbar__tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--ink-3); }

.tbl-wrap { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); overflow-x: auto; }
.tbl-wrap.is-scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line);
  background: #FAFBF9; position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-size: var(--fs-m); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFCFA; }
.tbl tr.is-selected td { background: var(--cedar-wash) !important; }
.tbl tr.is-vip td:first-child { box-shadow: inset 3px 0 0 var(--t-honey); }
.c-sel { width: 36px; } .c-num { text-align: right; white-space: nowrap; }
.c-who { min-width: 180px; max-width: 240px; }
.who { font-weight: 600; color: var(--ink); font-size: var(--fs-l); letter-spacing: -0.005em; }
.who .star { color: var(--t-honey); margin-right: 4px; }
.who__note { font-size: var(--fs-s); color: var(--ink-2); margin-top: 3px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-cat { min-width: 0; }
.mini { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; margin: 0; font-size: var(--fs-s); }
.mini dt { color: var(--ink-3); } .mini dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.c-num b { font-size: var(--fs-l); font-weight: 600; }
.c-contact { white-space: nowrap; }
.tel { color: var(--ink); font-weight: 500; }
.links { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; max-width: 170px; }
.c-stage { white-space: nowrap; } .c-stage .muted { margin-top: 4px; padding-left: 4px; }
.c-survey { white-space: nowrap; }
.meter { display: inline-block; width: 64px; height: 6px; vertical-align: middle; margin-right: 6px; }
.meter.is-lg { width: 140px; }
.meter__bg { fill: var(--line-2); } .meter__fill { fill: var(--cedar); }
.c-next { min-width: 130px; max-width: 220px; font-size: var(--fs-s); }
.due { font-size: var(--fs-xs); color: var(--ink-3); margin: 3px 0 0; }
.due.is-late { color: var(--t-rose); font-weight: 600; } .due.is-today { color: var(--t-honey); font-weight: 600; }

/* панель массовых действий: появляется снизу, когда что-то выбрано */
.bulk { position: fixed; left: calc(256px + 32px); right: 32px; bottom: 16px; z-index: 20; display: flex; gap: 8px; align-items: center;
  background: var(--cedar-deep); color: #E2ECE5; padding: 10px 12px; border-radius: var(--r-l); box-shadow: 0 10px 30px rgba(18, 54, 40, .28);
  transform: translateY(160%); visibility: hidden; }
.bulk.is-open { transform: none; visibility: visible; }
@media (prefers-reduced-motion: no-preference) { .bulk { transition: transform .22s ease-out, visibility .22s; } }
.bulk__count { font-size: var(--fs-s); margin-right: 6px; white-space: nowrap; } .bulk__count b { font-size: var(--fs-l); color: #fff; }
.bulk .input, .bulk .select { background-color: #1C4A38; border-color: #2E5E4B; color: #fff; }
.bulk .input::placeholder { color: #9DB8A8; }
.bulk .input.is-sm { width: 170px; }
.bulk .btn.is-quiet { background: transparent; color: #E2ECE5; border-color: #3B6A57; }
.bulk__more { position: relative; margin-left: auto; }
.bulk__more summary { list-style: none; } .bulk__more summary::-webkit-details-marker { display: none; }
.bulk__pop { position: absolute; right: 0; bottom: calc(100% + 10px); width: 340px; background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-l); padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); }
.bulk__pop .input, .bulk__pop .select { background-color: var(--paper); border-color: var(--line); color: var(--ink); }
.bulk__pop .btn.is-quiet { color: var(--ink); border-color: var(--line); }

/* ---------- карточка ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: var(--fs-s); color: var(--ink-3); margin-bottom: 14px; }
.crumbs__pager { margin-left: auto; display: flex; gap: 4px; align-items: center; color: var(--ink-2); }
.lead-hd { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.lead-hd__who { max-width: 760px; }
.lead-hd__meta { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 10px; font-size: var(--fs-s); color: var(--ink-2); }
.lead-hd__meta > * { display: inline-flex; gap: 5px; align-items: center; }
.lead-hd__act { display: flex; gap: 8px; align-items: center; }
.pill-select { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--tone) 12%, white); color: color-mix(in srgb, var(--tone) 80%, black); font-weight: 600; }
.pill-select select { appearance: none; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right center;
  font: inherit; color: inherit; padding-right: 18px; cursor: pointer; }
.pill-select select:focus { outline: none; } .pill-select:focus-within { box-shadow: 0 0 0 2px var(--focus); }

.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.lead-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lead-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding-bottom: 4px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; } .row.is-end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* пульт звонка */
.desk { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.desk__phones { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px 18px 12px; }
.desk__tel { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: var(--r-m); background: var(--cedar-wash);
  color: var(--cedar-deep); font-size: var(--fs-xl); font-weight: 600; letter-spacing: .01em; text-decoration: none !important; }
.desk__tel .ico { width: 18px; height: 18px; color: var(--cedar); }
.desk__tel:hover { background: #D6E8DC; }
.desk__other { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 16px; }
.link-chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: var(--r-s); border: 1px solid var(--line);
  font-size: var(--fs-s); color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-chip b { font-weight: 600; }
.link-chip.is-tg b { color: #22648A; } .link-chip.is-wa b { color: #23744A; } .link-chip.is-max b { color: #5A4C93; }
.desk__log { background: #F7F9F6; border-top: 1px solid var(--line); padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.desk__stat { display: flex; gap: 16px; font-size: var(--fs-s); color: var(--ink-2); }
.desk__stat b { font-size: var(--fs-l); color: var(--ink); }
.desk__btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.btn.is-call { height: 42px; border: 1px solid color-mix(in srgb, var(--tone) 30%, white); background: var(--paper);
  color: color-mix(in srgb, var(--tone) 85%, black); }
.btn.is-call:hover { background: color-mix(in srgb, var(--tone) 8%, white); }
.btn.is-call.is-main { background: var(--tone); color: #fff; border-color: var(--tone); }
.btn.is-call.is-main:hover { background: color-mix(in srgb, var(--tone) 88%, black); }

.block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; }
.block__hd { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 0;
  border: 1px solid var(--line-2); border-radius: var(--r-m); overflow: hidden; }
.fact { background: var(--paper); padding: 10px 12px; box-shadow: 0 0 0 .5px var(--line-2); }
.fact dt { font-size: var(--fs-xs); color: var(--ink-3); }
.fact dd { margin: 2px 0 0; font-weight: 600; font-size: var(--fs-l); }
.facts__line { margin: 12px 0 0; font-size: var(--fs-m); }
.facts__about { margin: 8px 0 0; color: var(--ink-2); max-width: 75ch; }

.survey__progress { display: inline-flex; gap: 8px; align-items: center; font-size: var(--fs-s); color: var(--ink-2); }
.survey__grp { border: 0; border-top: 1px solid var(--line-2); margin: 0; padding: 14px 0 16px; }
.survey__grp:first-of-type { border-top: 0; padding-top: 0; }
.survey__grp legend { font-weight: 650; font-size: var(--fs-m); padding: 0 0 10px; float: left; width: 100%; }
.grid-fields { clear: both; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 14px; }
.grid-fields .field.is-wide { grid-column: 1 / -1; }
.survey__save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; gap: 12px; align-items: center; padding-top: 8px; }
.survey__save .btn { box-shadow: 0 4px 14px rgba(18, 54, 40, .18); }
[data-dirty-hint] { background: #FBF1DC; color: #7A5108; padding: 4px 10px; border-radius: 999px; }
.company > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.company > summary::-webkit-details-marker { display: none; }
.company > summary .h2::before { content: "▸ "; color: var(--ink-3); }
.company[open] > summary { margin-bottom: 14px; } .company[open] > summary .h2::before { content: "▾ "; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; }
.ev { position: relative; }
.ev::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--paper);
  border: 2px solid var(--ink-3); }
.ev--comment::before { border-color: var(--cedar); background: var(--cedar); }
.ev--call::before { border-color: var(--t-lake); } .ev--status::before { border-color: var(--t-violet); }
.ev--survey::before { border-color: var(--t-honey); } .ev--tg_in::before { border-color: #22648A; background: #22648A; }
.ev__meta { font-size: var(--fs-xs); color: var(--ink-3); } .ev__meta b { color: var(--ink-2); font-weight: 600; }
.ev__text { font-size: var(--fs-s); white-space: pre-wrap; overflow-wrap: anywhere; }
.ev--comment .ev__text { font-size: var(--fs-m); }

/* сводка */
.is-summary td, .is-summary th { white-space: nowrap; }
.is-summary .sticky-col { position: sticky; left: 0; background: var(--paper); z-index: 2; box-shadow: 1px 0 0 var(--line); }
.is-summary th.sticky-col { background: #FAFBF9; z-index: 3; }

/* шаблоны */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tpl-card { color: var(--ink); text-decoration: none !important; } .tpl-card:hover { border-color: var(--cedar); }
.tpl-card__subj { font-weight: 500; }
.tpl-body { font-size: var(--fs-m); line-height: 1.55; }
.vars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.preview__body { white-space: pre-wrap; font-size: var(--fs-s); color: var(--ink-2); }

/* вход */
.login-body { background: var(--cedar-deep); }
.login { min-height: 100vh; display: grid; place-items: center; position: relative; overflow: hidden; padding: 24px; }
.login__ridge { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42vh; }
.login__ridge .r1 { fill: #1B4A37; } .login__ridge .r2 { fill: #24604A; }
.login__form { position: relative; width: min(380px, 100%); background: var(--paper); border-radius: var(--r-l); padding: 28px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.login__brand { margin: 0; color: var(--ink-2); font-size: var(--fs-s); } .login__brand b { color: var(--cedar); margin-right: 4px; }

/* ---------- адаптив ---------- */
@media (max-width: 1280px) {
  .funnel__steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lead-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1080px) {
  .lead-grid { grid-template-columns: 1fr; }
  .lead-side { position: static; max-height: none; }
  .tbl-wrap { overflow-x: auto; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; gap: 10px; padding: 12px; }
  .rail__group { flex-direction: row; flex-wrap: wrap; }
  .rail__caption, .rail__niche .trail { display: none; }
  .rail__item { width: auto; } .rail__foot { margin: 0; border: 0; padding: 0; flex-direction: row; }
  .main { padding: 18px 14px 120px; }
  .bulk { left: 12px; right: 12px; flex-wrap: wrap; }
  .desk__btns { grid-template-columns: 1fr 1fr; }
  .search .input { width: 100%; } .page-hd__tools, .search { width: 100%; }
  .funnel__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.bulk .btn.is-primary { background: #E4B860; color: var(--cedar-deep); } .bulk .btn.is-primary:hover { background: #EFC877; }
