/* CRM портала — новый дизайн (30.10.2026).
   Строится на токенах gt-new.css: белые карточки, радиус 18, красный акцент.
   Ничего не переопределяет в старом дизайне: классы живут только под .crm-page. */
body.gt.crm-page { --crm-side: 236px; --crm-top: 64px; }

.crm-shell { min-height: 100vh; display: flex; flex-direction: column; }
.crm-top {
  position: sticky; top: 0; z-index: 40; height: var(--crm-top);
  display: flex; align-items: center; gap: 14px; padding: 0 26px;
  background: rgba(244,244,246,.86); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--pd-line);
}
.crm-top .crm-crumb { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.crm-top .crm-crumb b { font-size: 16px; letter-spacing: -.02em; }
.crm-top .crm-crumb span { font-size: 12px; color: var(--pd-ink3); }
.crm-search {
  margin-left: auto; position: relative; width: min(420px, 34vw);
}
.crm-search input {
  width: 100%; height: 38px; border: 1px solid var(--pd-line); border-radius: 12px;
  background: #fff; padding: 0 38px 0 36px; font: inherit; font-size: 13px;
  color: var(--pd-ink); outline: none; transition: border-color .15s, box-shadow .15s;
}
.crm-search input:focus { border-color: #cfcfd6; box-shadow: 0 0 0 4px rgba(17,17,20,.04); }
.crm-search .ic { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--pd-ink3); }
.crm-search kbd {
  position: absolute; right: 8px; top: 9px; font: 10px/1 var(--pd-mono);
  color: var(--pd-ink3); border: 1px solid var(--pd-line); border-radius: 6px; padding: 3px 5px;
}
.crm-topbtn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--pd-line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--pd-ink2);
  position: relative; transition: background .15s, border-color .15s;
}
.crm-topbtn:hover { background: #fafafb; border-color: #dcdce3; }
.crm-topbtn .ic { width: 17px; height: 17px; }
.crm-topbtn .crm-dot {
  position: absolute; top: 7px; right: 8px; min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 8px; background: var(--pd-red); color: #fff; font: 700 9px/15px var(--pd-mono);
  text-align: center; box-shadow: 0 0 0 2px #fff;
}
.crm-ava {
  width: 34px; height: 34px; border-radius: 50%; background: #111114; color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; letter-spacing: .02em;
}

.crm-body { flex: 1; display: flex; min-height: 0; }
.crm-side {
  width: var(--crm-side); flex: 0 0 var(--crm-side); padding: 20px 14px 30px;
  border-right: 1px solid var(--pd-line); background: #f7f7f9;
  position: sticky; top: var(--crm-top); height: calc(100vh - var(--crm-top));
  overflow: auto;
}
.crm-new {
  width: 100%; height: 40px; border: 0; border-radius: 12px; cursor: pointer;
  background: #111114; color: #fff; font: 600 13px/1 inherit; letter-spacing: -.01em;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 8px 18px -14px rgba(17,17,20,.8); transition: background .15s, transform .15s;
}
.crm-new:hover { background: #26262c; transform: translateY(-1px); }
.crm-new .ic { width: 15px; height: 15px; }
.crm-nav { margin-top: 18px; display: flex; flex-direction: column; gap: 3px; }
.crm-nav-cap {
  font: 500 9px/1 var(--pd-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--pd-ink3); padding: 13px 10px 7px;
}
.crm-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--pd-ink2); font-size: 13px; font-weight: 500; transition: background .14s,color .14s;
}
.crm-nav a:hover { background: #efeff2; color: var(--pd-ink); }
.crm-nav a { position: relative; }
.crm-nav a.is-on { background: #fff; color: var(--pd-ink); box-shadow: 0 1px 2px rgba(17,17,20,.05); }
.crm-nav a.is-on::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--pd-red);
}
.crm-nav a .ic { width: 17px; height: 17px; color: var(--pd-ink3); }
.crm-nav a.is-on .ic { color: var(--pd-red); }
.crm-nav a .n { margin-left: auto; font: 500 10px/1 var(--pd-mono); color: var(--pd-ink3); }
.crm-nav a .n.hot { color: var(--pd-red); }
.crm-side-foot { margin-top: 22px; padding: 12px 10px; border-top: 1px solid var(--pd-line); }
.crm-side-foot b { display: block; font-size: 11.5px; }
.crm-side-foot span { display: block; font-size: 10.5px; color: var(--pd-ink3); margin-top: 3px; line-height: 1.4; }
.crm-side-foot a { color: var(--pd-red); font-weight: 600; }

.crm-main { flex: 1; min-width: 0; padding: 24px 30px 90px; }
.crm-page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.crm-page-head h1 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.crm-page-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--pd-ink3); }
.crm-page-head .crm-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.crm-btn {
  height: 36px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--pd-line);
  background: #fff; color: var(--pd-ink2); font: 600 12px/1 inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s;
}
.crm-btn:hover { border-color: #d6d6dd; color: var(--pd-ink); background: #fcfcfd; }
.crm-btn.primary { background: var(--pd-red); border-color: var(--pd-red); color: #fff; }
.crm-btn.primary:hover { background: var(--pd-red-h); }
.crm-btn.ghost { background: transparent; border-color: transparent; }
.crm-btn .ic { width: 14px; height: 14px; }
.crm-btn[disabled] { opacity: .5; cursor: default; }

.crm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.crm-kpi {
  background: #fff; border: 1px solid var(--pd-line); border-radius: var(--pd-r);
  padding: 16px 18px 15px; position: relative; overflow: hidden;
}
.crm-kpi .k { font-size: 11.5px; color: var(--pd-ink3); display: flex; align-items: center; gap: 6px; }
.crm-kpi .k .ic { width: 13px; height: 13px; }
.crm-kpi .v { font-size: 27px; font-weight: 700; letter-spacing: -.035em; line-height: 1.1; margin-top: 9px; font-variant-numeric: tabular-nums; }
.crm-kpi .s { font-size: 11px; color: var(--pd-ink3); margin-top: 5px; }
.crm-kpi .s b { color: var(--pd-ink2); font-weight: 600; }
.crm-kpi.accent .v { color: var(--pd-red); }

.crm-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 14px; align-items: start; }
.crm-card {
  background: #fff; border: 1px solid var(--pd-line); border-radius: var(--pd-r);
  overflow: hidden;
}
.crm-card-h { display: flex; align-items: center; gap: 9px; padding: 16px 18px 12px; }
.crm-card-h h2 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.crm-card-h .sub { font-size: 11px; color: var(--pd-ink3); }
.crm-card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.crm-card-b { padding: 0 18px 16px; }
.crm-card-f { padding: 10px 16px; border-top: 1px solid var(--pd-line-soft); font-size: 11.5px; color: var(--pd-ink3); display: flex; gap: 8px; align-items: center; }
.crm-link { color: var(--pd-red); font-weight: 600; font-size: 11.5px; }

.crm-agenda { display: flex; flex-direction: column; }
.crm-agenda-row {
  display: flex; align-items: flex-start; gap: 11px; padding: 10px 0; border-top: 1px solid var(--pd-line-soft);
}
.crm-agenda-row:first-child { border-top: 0; }
.crm-check {
  width: 19px; height: 19px; border-radius: 6px; border: 1.5px solid #d3d3da; background: #fff;
  flex: 0 0 auto; cursor: pointer; display: grid; place-items: center; margin-top: 1px; transition: .15s;
}
.crm-check:hover { border-color: var(--pd-red); }
.crm-check.done { background: var(--pd-green); border-color: var(--pd-green); color: #fff; }
.crm-agenda-row .t { flex: 1; min-width: 0; }
.crm-agenda-row .t b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.crm-agenda-row .t span { display: block; font-size: 10.5px; color: var(--pd-ink3); margin-top: 3px; }
.crm-agenda-row .t span.late { color: var(--pd-red); }
.crm-chip {
  font: 500 9.5px/1 var(--pd-mono); letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid var(--pd-line); border-radius: 999px; padding: 4px 7px; color: var(--pd-ink3);
  white-space: nowrap;
}
.crm-chip.red { color: var(--pd-red); border-color: rgba(213,0,28,.25); background: rgba(213,0,28,.04); }
.crm-chip.green { color: var(--pd-green); border-color: rgba(15,143,102,.25); background: rgba(15,143,102,.05); }
.crm-chip.blue { color: #2563eb; border-color: rgba(37,99,235,.22); background: rgba(37,99,235,.04); }

.crm-funnel { display: flex; flex-direction: column; gap: 9px; }
.crm-frow { display: grid; grid-template-columns: 128px 1fr 44px; gap: 9px; align-items: center; cursor: pointer; }
.crm-frow .nm { font-size: 11.5px; color: var(--pd-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-frow .bar { height: 7px; border-radius: 4px; background: #f0f0f3; overflow: hidden; }
.crm-frow .bar i { display: block; height: 100%; border-radius: 4px; background: #b8b8c3; opacity: .9; }
.crm-frow .n { text-align: right; font: 600 11px/1 var(--pd-mono); color: var(--pd-ink2); }
.crm-frow:hover .nm { color: var(--pd-ink); }

.crm-feed { display: flex; flex-direction: column; }
.crm-feed-row { display: flex; gap: 11px; padding: 11px 0; border-top: 1px solid var(--pd-line-soft); }
.crm-feed-row:first-child { border-top: 0; }
.crm-ava-s { width: 26px; height: 26px; border-radius: 50%; background: #f0f0f3; color: var(--pd-ink2); display: grid; place-items: center; font-size: 9px; font-weight: 700; flex: 0 0 auto; }
.crm-feed-row .x { min-width: 0; flex: 1; }
.crm-feed-row .x b { font-size: 12px; font-weight: 600; }
.crm-feed-row .x p { margin: 2px 0 0; font-size: 11.5px; color: var(--pd-ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-feed-row .x i { display: block; font-style: normal; font-size: 10px; color: var(--pd-ink3); margin-top: 3px; }

.crm-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.crm-toolbar .grow { flex: 1; }
.crm-seg { display: inline-flex; background: #ececf0; border-radius: 10px; padding: 3px; gap: 2px; }
.crm-seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 11px; font: 600 11.5px/1 inherit; color: var(--pd-ink3); cursor: pointer; }
.crm-seg button.is-on { background: #fff; color: var(--pd-ink); box-shadow: 0 1px 2px rgba(17,17,20,.08); }

.crm-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.crm-col { flex: 0 0 300px; max-width: 300px; background: #f2f2f5; border-radius: 16px; padding: 10px; }
.crm-colhead { display: flex; align-items: center; gap: 7px; padding: 3px 5px 9px; }
.crm-colhead .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pd-red); }
.crm-colhead .nm { font-size: 11.5px; font-weight: 600; }
.crm-colhead .n { font: 500 10px/1 var(--pd-mono); color: var(--pd-ink3); margin-left: 2px; }
.crm-colhead .sum { margin-left: auto; font: 500 9.5px/1 var(--pd-mono); color: var(--pd-ink3); }
.crm-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.crm-dcard {
  background: #fff; border: 1px solid #e6e6eb; border-radius: 13px; padding: 11px 12px;
  cursor: grab; transition: box-shadow .15s, transform .15s, border-color .15s;
}
.crm-dcard:hover { border-color: #d8d8df; box-shadow: 0 6px 18px -14px rgba(17,17,20,.45); transform: translateY(-1px); }
.crm-dcard.dragging { opacity: .45; }
.crm-dcard .top { display: flex; gap: 8px; align-items: flex-start; }
.crm-dcard .nm { font-size: 12px; font-weight: 600; line-height: 1.3; flex: 1; min-width: 0; }
.crm-dcard .amt { font: 600 10.5px/1 var(--pd-mono); color: var(--pd-ink); white-space: nowrap; }
.crm-dcard .car { font-size: 10.5px; color: var(--pd-ink3); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-dcard .meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.crm-dcard .meta .who { width: 20px; height: 20px; border-radius: 50%; background: #f0f0f3; color: var(--pd-ink2); font-size: 8px; font-weight: 700; display: grid; place-items: center; }
.crm-dcard .meta .age { margin-left: auto; font: 500 9px/1 var(--pd-mono); color: var(--pd-ink3); }
.crm-dcard .meta .age.late { color: var(--pd-red); }
.crm-dcard .dc-sub { font-size: 11px; color: var(--pd-ink2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-dcard .dc-car { font-size: 10.5px; color: var(--pd-ink3); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-dcard .dc-vin { font: 500 9px/1 var(--pd-mono); color: #8b8b96; }
.crm-dcard .dc-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.crm-dcard .dc-badge { font: 500 9px/1.25 inherit; color: var(--pd-ink2); background: #f4f4f7; border: 1px solid #ececf1; border-radius: 6px; padding: 3px 5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-dcard .dc-badge.chat { color: #fff; background: var(--pd-red); border-color: var(--pd-red); font-weight: 600; }
.crm-dcard .dc-next { margin-top: 6px; font-size: 9.5px; color: var(--pd-ink2); background: #fafafa; border-left: 2px solid #d8d8df; padding: 3px 6px; border-radius: 0 5px 5px 0; }
.crm-dcard .dc-next.late { color: var(--pd-red); border-left-color: var(--pd-red); background: rgba(213,0,28,.04); }
.crm-dcard .meta .dc-mgr { font-size: 9.5px; color: var(--pd-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 76px; }

.crm-emptycol { text-align: center; color: var(--pd-ink3); font-size: 11px; padding: 18px 0; }
.crm-more { width: 100%; border: 1px dashed #d6d6dd; background: transparent; color: var(--pd-ink3); border-radius: 9px; padding: 7px; font-size: 10.5px; cursor: pointer; margin-top: 7px; }

/* Карточка клиента/сделки — шторка справа */
.crm-backdrop { position: fixed; inset: 0; background: rgba(17,17,20,.32); z-index: 70; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.crm-backdrop.open { opacity: 1; visibility: visible; }
.crm-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 96vw); background: #fff; z-index: 80;
  transform: translateX(102%); transition: transform .28s var(--pd-ease); display: flex; flex-direction: column;
  box-shadow: -20px 0 60px -30px rgba(17,17,20,.4);
}
.crm-drawer.open { transform: none; }
.crm-dh { padding: 16px 20px 13px; border-bottom: 1px solid var(--pd-line); display: flex; gap: 10px; align-items: flex-start; }
.crm-dh .x { margin-left: auto; }
.crm-dh h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; line-height: 1.25; }
.crm-dh .sub { margin-top: 5px; font-size: 11.5px; color: var(--pd-ink3); display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.crm-dclose { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--pd-line); background: #fff; cursor: pointer; color: var(--pd-ink3); font-size: 18px; line-height: 1; }
.crm-dbody { flex: 1; overflow: auto; padding: 16px 20px 30px; }
.crm-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--pd-line); margin: 0 -20px 14px; padding: 0 20px; position: sticky; top: 0; background: #fff; z-index: 2; }
.crm-tabs button { border: 0; background: none; padding: 10px 10px 11px; font: 600 11.5px/1 inherit; color: var(--pd-ink3); cursor: pointer; border-bottom: 2px solid transparent; }
.crm-tabs button.is-on { color: var(--pd-ink); border-bottom-color: var(--pd-red); }
.crm-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.crm-field { min-width: 0; }
.crm-field label { display: block; font: 500 9px/1 var(--pd-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--pd-ink3); margin-bottom: 5px; }
.crm-field .val { font-size: 12.5px; line-height: 1.35; min-height: 18px; }
.crm-field .val.mono { font-family: var(--pd-mono); font-size: 11.5px; }
.crm-field input, .crm-field select, .crm-field textarea {
  width: 100%; border: 1px solid var(--pd-line); border-radius: 9px; padding: 7px 9px;
  font: 12.5px/1.35 inherit; color: var(--pd-ink); background: #fff; outline: none;
}
.crm-field input:focus, .crm-field select:focus, .crm-field textarea:focus { border-color: #cfcfd6; }
.crm-sect { margin-top: 18px; }
.crm-sect-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.crm-sect-h h3 { margin: 0; font: 600 10px/1 var(--pd-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--pd-ink3); }
.crm-sect-h .right { margin-left: auto; }
.crm-note { background: #f7f7f9; border: 1px solid var(--pd-line-soft); border-radius: 10px; padding: 10px 12px; font-size: 11.5px; color: var(--pd-ink2); }
.crm-timeline { display: flex; flex-direction: column; gap: 0; }
.crm-tl { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--pd-line-soft); }
.crm-tl:first-child { border-top: 0; }
.crm-tl .ic-wrap { width: 26px; height: 26px; border-radius: 8px; background: #f2f2f5; display: grid; place-items: center; flex: 0 0 auto; color: var(--pd-ink2); }
.crm-tl .ic-wrap .ic { width: 13px; height: 13px; }
.crm-tl .x { flex: 1; min-width: 0; }
.crm-tl .x b { font-size: 11.5px; }
.crm-tl .x p { margin: 3px 0 0; font-size: 12px; color: var(--pd-ink2); white-space: pre-wrap; }
.crm-tl .x i { font-style: normal; font-size: 9.5px; color: var(--pd-ink3); display: block; margin-top: 4px; }
.crm-compose { display: flex; gap: 8px; margin-top: 10px; }
.crm-compose textarea { flex: 1; min-height: 38px; max-height: 140px; resize: vertical; border: 1px solid var(--pd-line); border-radius: 10px; padding: 9px 11px; font: 12.5px/1.4 inherit; outline: none; }
.crm-compose textarea:focus { border-color: #cfcfd6; }

.crm-tasks { display: flex; flex-direction: column; gap: 6px; }
.crm-task { display: flex; align-items: flex-start; gap: 10px; background: #fff; border: 1px solid var(--pd-line); border-radius: 12px; padding: 11px 13px; }
.crm-task .t { flex: 1; min-width: 0; }
.crm-task .t b { font-size: 12.5px; font-weight: 600; display: block; }
.crm-task .t span { font-size: 10.5px; color: var(--pd-ink3); display: block; margin-top: 3px; }
.crm-task .t span.late { color: var(--pd-red); }
.crm-task.done { opacity: .55; }
.crm-task.done b { text-decoration: line-through; }
.crm-cal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 7px; margin-bottom: 16px; }
.crm-cal .d { background: #fff; border: 1px solid var(--pd-line); border-radius: 11px; padding: 9px; min-height: 72px; }
.crm-cal .d.today { border-color: rgba(213,0,28,.35); box-shadow: 0 0 0 3px rgba(213,0,28,.05); }
.crm-cal .d .n { font: 600 9px/1 var(--pd-mono); color: var(--pd-ink3); text-transform: uppercase; }
.crm-cal .d .v { font-size: 17px; font-weight: 700; margin-top: 4px; }
.crm-cal .d .c { font-size: 9.5px; color: var(--pd-ink3); margin-top: 5px; }
.crm-cal .d .c.red { color: var(--pd-red); }

.crm-inbox { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 12px; min-height: 560px; }
.crm-chatlist { background: #fff; border: 1px solid var(--pd-line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.crm-chatlist .h { padding: 12px 14px; border-bottom: 1px solid var(--pd-line-soft); }
.crm-chatlist .list { overflow: auto; }
.crm-chat { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--pd-line-soft); cursor: pointer; }
.crm-chat:hover, .crm-chat.is-on { background: #fafafb; }
.crm-chat .t { min-width: 0; flex: 1; }
.crm-chat .t b { font-size: 12px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-chat .t p { margin: 3px 0 0; font-size: 11px; color: var(--pd-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-chat .u { width: 18px; height: 18px; border-radius: 50%; background: var(--pd-red); color: #fff; font: 700 9px/18px var(--pd-mono); text-align: center; }
.crm-thread { background: #fff; border: 1px solid var(--pd-line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.crm-msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #fafafb; }
.crm-msg { max-width: 72%; padding: 9px 11px; border-radius: 12px; font-size: 12.5px; line-height: 1.4; background: #fff; border: 1px solid var(--pd-line); align-self: flex-start; }
.crm-msg.out { align-self: flex-end; background: #111114; color: #fff; border-color: #111114; }
.crm-msg .m { display: block; font-size: 9px; opacity: .55; margin-top: 4px; }

.crm-empty { text-align: center; padding: 30px 18px; }
.crm-empty .crm-btn { margin-top: 12px; }
.crm-empty .ic { width: 34px; height: 34px; color: #c9c9d0; margin: 0 auto 10px; display: block; }
.crm-empty b { display: block; font-size: 13px; }
.crm-empty p { margin: 5px auto 0; max-width: 380px; font-size: 11.5px; color: var(--pd-ink3); line-height: 1.5; }
.crm-skel { background: linear-gradient(90deg,#f1f1f4 25%,#e9e9ee 37%,#f1f1f4 63%); background-size: 400% 100%; animation: crm-sh 1.2s ease infinite; border-radius: 8px; }
@keyframes crm-sh { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

.crm-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); z-index: 200;
  background: #111114; color: #fff; border-radius: 11px; padding: 10px 15px; font-size: 12px;
  opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw;
}
.crm-toast.show { opacity: 1; transform: translate(-50%,0); }
.crm-toast.err { background: #a10d1d; }

.crm-cmd { position: fixed; inset: 0; z-index: 120; background: rgba(17,17,20,.4); display: none; padding-top: 12vh; }
.crm-cmd.open { display: block; }
.crm-cmd-box { width: min(620px, 92vw); margin: 0 auto; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
.crm-cmd-box input { width: 100%; border: 0; border-bottom: 1px solid var(--pd-line); padding: 16px 18px; font: 15px/1 inherit; outline: none; }
.crm-cmd-res { max-height: 52vh; overflow: auto; padding: 6px; }
.crm-cmd-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.crm-cmd-row:hover { background: #f5f5f7; }
.crm-cmd-row .k { font: 500 9px/1 var(--pd-mono); color: var(--pd-ink3); text-transform: uppercase; border: 1px solid var(--pd-line); border-radius: 5px; padding: 4px 5px; }
.crm-cmd-row b { font-size: 12px; font-weight: 600; }
.crm-cmd-row span { font-size: 10.5px; color: var(--pd-ink3); margin-left: auto; }

.crm-notif { position: fixed; top: 66px; right: 18px; width: 360px; max-width: 94vw; background: #fff; border: 1px solid var(--pd-line); border-radius: 14px; box-shadow: 0 24px 60px -24px rgba(17,17,20,.35); z-index: 90; display: none; overflow: hidden; }
.crm-notif.open { display: block; }
.crm-notif .h { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--pd-line-soft); }
.crm-notif .h b { font-size: 12.5px; }
.crm-notif .h button { margin-left: auto; border: 0; background: none; color: var(--pd-red); font-size: 10.5px; font-weight: 600; cursor: pointer; }
.crm-notif .list { max-height: 60vh; overflow: auto; }
.crm-notif-row { padding: 11px 14px; border-bottom: 1px solid var(--pd-line-soft); }
.crm-notif-row.unread { background: #fff8f8; }
.crm-notif-row b { font-size: 12px; display: block; }
.crm-notif-row p { margin: 3px 0 0; font-size: 11px; color: var(--pd-ink3); }

@media (max-width: 1180px) {
  .crm-grid { grid-template-columns: 1fr; }
  .crm-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 980px) {
  body.gt.crm-page { --crm-top: 56px; }
  .crm-top { padding: 0 14px; gap: 9px; }
  .crm-top .crm-crumb span { display: none; }
  .crm-search { width: auto; flex: 1; margin-left: 0; }
  .crm-search kbd { display: none; }
  .crm-body { flex-direction: column; }
  .crm-side {
    width: 100%; flex: none; height: auto; position: sticky; top: var(--crm-top); z-index: 30;
    border-right: 0; border-bottom: 1px solid var(--pd-line); padding: 9px 12px; overflow-x: auto;
    display: flex; align-items: center; gap: 8px; background: rgba(247,247,249,.96); backdrop-filter: blur(10px);
  }
  .crm-new { width: auto; flex: 0 0 auto; padding: 0 13px; height: 34px; }
  .crm-nav { flex-direction: row; margin: 0; gap: 4px; }
  .crm-nav-cap, .crm-side-foot, .crm-nav a .n { display: none; }
  .crm-nav a { padding: 8px 10px; white-space: nowrap; background: #fff; border: 1px solid var(--pd-line); }
  .crm-nav a.is-on { background: #111114; color: #fff; border-color: #111114; }
  .crm-nav a.is-on .ic { color: #fff; }
  .crm-main { padding: 16px 14px 96px; }
  .crm-page-head h1 { font-size: 21px; }
  .crm-cal { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .crm-inbox { grid-template-columns: 1fr; min-height: 0; }
  .crm-chatlist { max-height: 280px; }
  .crm-thread { min-height: 360px; }
  .crm-drawer { width: 100vw; }
  .crm-fields { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .crm-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .crm-kpi { padding: 12px 13px; }
  .crm-kpi .v { font-size: 22px; }
  .crm-cal { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .crm-board .crm-col { flex-basis: 84vw; max-width: 84vw; }
}

/* ── Доработки после дизайн-проверки (DeepSeek vision, 30.10.2026) ── */
.crm-page *, .crm-page *::before, .crm-page *::after { box-sizing: border-box; }
.crm-new { background: #fff; color: var(--pd-ink); border: 1px solid var(--pd-line); box-shadow: none; }
.crm-new:hover { background: #fafafb; border-color: #d8d8df; transform: none; }
.crm-new .ic { color: var(--pd-red); }
.crm-kpi .s { font-size: 11.5px; color: var(--pd-ink2); }
.crm-kpi .k { font-size: 12px; }

/* Клиенты — табличная раскладка вместо «простыни» */
.crm-table { width: 100%; }
.crm-trow {
  display: grid; grid-template-columns: minmax(0,2.1fr) minmax(0,1.2fr) 92px 110px 96px;
  gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--pd-line-soft);
  cursor: pointer;
}
.crm-trow:first-child { border-top: 0; }
.crm-trow.head { cursor: default; padding-top: 2px; padding-bottom: 7px; }
.crm-trow.head span { font: 500 9px/1 var(--pd-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--pd-ink3); }
.crm-trow .who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crm-trow .who b { font-size: 12.5px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-trow .who i { font-style: normal; font-size: 10.5px; color: var(--pd-ink3); display: block; margin-top: 2px; }
.crm-trow .cell { font-size: 11.5px; color: var(--pd-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-trow .cell.dim { color: var(--pd-ink3); font-size: 10.5px; }
.crm-trow:hover { background: #fafafb; }
@media (max-width: 760px) {
  .crm-trow { grid-template-columns: minmax(0,1.8fr) 84px 80px; }
  .crm-trow .cell.mgr, .crm-trow .cell.date, .crm-trow.head span:nth-child(2), .crm-trow.head span:nth-child(5) { display: none; }
}

/* Локальный вход — отдельная страница без rail */
.crm-login-page { padding-left: 0 !important; display: grid; place-items: center; min-height: 100vh; }
.crm-login { width: 100%; display: grid; place-items: center; padding: 20px; }
.crm-login-card {
  width: min(380px, 100%); background: #fff; border: 1px solid var(--pd-line);
  border-radius: 20px; padding: 30px 28px 22px; box-shadow: var(--pd-shadow);
}
.crm-login-brand { font: 700 11px/1 var(--pd-mono); letter-spacing: .14em; color: var(--pd-red); }
.crm-login-brand span { color: var(--pd-ink); }
.crm-login-card h1 { margin: 14px 0 6px; font-size: 23px; letter-spacing: -.03em; }
.crm-login-card > p { margin: 0 0 18px; font-size: 12px; color: var(--pd-ink3); line-height: 1.5; }
.crm-login-card form { display: flex; flex-direction: column; gap: 11px; }
.crm-login-card .crm-field label { margin-bottom: 5px; }
.crm-login-card input { width: 100%; border: 1px solid var(--pd-line); border-radius: 10px; padding: 9px 11px; font: 13px/1.3 inherit; }
.crm-login-submit { width: 100%; height: 40px; margin-top: 6px; }
.crm-login-err { background: #fff5f5; border: 1px solid rgba(213,0,28,.2); color: #a10d1d; border-radius: 10px; padding: 9px 11px; font-size: 12px; margin-bottom: 12px; }
.crm-login-foot { margin-top: 16px; display: flex; gap: 8px; justify-content: center; font-size: 11px; color: var(--pd-ink3); }
.crm-login-foot a { color: var(--pd-red); font-weight: 600; }

/* Контраст и ритм: подписи читаются, «дорогие» мелочи не теряются */
body.gt.crm-page { --pd-ink3: #5c5c66; }
.crm-topnew { height: 38px; padding: 0 14px; border-radius: 12px; flex: 0 0 auto; }
.crm-task.done b { text-decoration: none; }
.crm-task.done .crm-chip { color: var(--pd-green); border-color: rgba(15,143,102,.3); }
.crm-cal .d .c:empty { display: none; }
.crm-trow .cell { font-size: 12px; }
.crm-kpi .s { font-size: 12px; }
.crm-feed-row .x i { font-size: 10.5px; }
.crm-nav a .n { font-size: 10.5px; }
@media (max-width: 980px) {
  .crm-topnew { padding: 0 11px; }
  .crm-topnew span { display: none; }
}
.crm-cal .d .n:first-child { font-size: 9px; }
.crm-cal .d.picked { border-color: var(--pd-red); background: #fff8f8; }
.crm-cal .d[data-day] { cursor: pointer; }
.crm-cal .d[data-day]:hover { border-color: #cfcfd6; }
.crm-cal .d.dow { background: transparent; border: 0; min-height: 0; padding: 0 0 2px; text-align: center; }
.crm-backdrop.open { backdrop-filter: blur(2px); }
.crm-drawer { border-left: 1px solid var(--pd-line); }
.crm-board { scroll-snap-type: x proximity; }
.crm-col { scroll-snap-align: start; }
.crm-dcard .nm { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.crm-dcard .car { white-space: nowrap; }
.crm-tabs button.is-on { background: #f6f6f8; border-radius: 8px 8px 0 0; }
.crm-kpi { min-height: 96px; display: flex; flex-direction: column; }
.crm-kpi .s { margin-top: auto; }
.crm-agenda-row .t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 980px) {
  .crm-side { mask-image: linear-gradient(90deg, #000 92%, transparent); }
}
.crm-dh > div:first-child { padding-right: 8px; }
.crm-backdrop { background: rgba(17,17,20,.46); }
.crm-backdrop.open { backdrop-filter: blur(3px); }
.crm-agenda-row .t { padding-right: 4px; }
.crm-frow { grid-template-columns: 150px 1fr 40px; gap: 11px; }
quick-btn { width: 100%; }

/* Оргструктура и роли */
.crm-org { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 14px; align-items: start; }
.crm-org-side { background: #fff; border: 1px solid var(--pd-line); border-radius: 14px; padding: 8px; position: sticky; top: calc(var(--crm-top) + 14px); max-height: calc(100vh - var(--crm-top) - 40px); overflow: auto; }
.crm-org-node { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--pd-ink2); }
.crm-org-node:hover { background: #f6f6f8; }
.crm-org-node.is-on { background: #111114; color: #fff; }
.crm-org-node.is-on .n { color: rgba(255,255,255,.65); }
.crm-org-node .nm { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-org-node .n { font: 500 9.5px/1 var(--pd-mono); color: var(--pd-ink3); }
.crm-rolechips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.crm-rolechips .crm-chip { cursor: pointer; background: #fff; }
.crm-rolechips .crm-chip.is-on { background: #111114; color: #fff; border-color: #111114; }
.crm-people { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.crm-person { display: grid; grid-template-columns: 36px minmax(0,1fr) auto; grid-template-areas: "ava who role" "meta meta meta"; gap: 6px 9px; align-items: center; border: 1px solid var(--pd-line); border-radius: 12px; padding: 10px 11px; }
.crm-person .ava { grid-area: ava; width: 36px; height: 36px; border-radius: 50%; background: #f0f0f3; color: var(--pd-ink2); display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.crm-person .who { grid-area: who; min-width: 0; }
.crm-person .who b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-person .who span { display: block; font-size: 10.5px; color: var(--pd-ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-person .meta { grid-area: meta; display: flex; gap: 10px; flex-wrap: wrap; font-size: 10.5px; color: var(--pd-ink3); }
.crm-person .meta a { color: var(--pd-ink2); }
.crm-role-sel { grid-area: role; border: 1px solid var(--pd-line); border-radius: 8px; padding: 4px 5px; font: 10.5px/1.2 inherit; color: var(--pd-ink2); background: #fff; max-width: 120px; }
@media (max-width: 980px) {
  .crm-org { grid-template-columns: 1fr; }
  .crm-org-side { position: static; max-height: 240px; }
  .crm-people { grid-template-columns: 1fr; }
}
.crm-org-node.lvl0 { font-weight: 600; color: var(--pd-ink); }
.crm-org-node.lvl1 { font-weight: 500; }
.crm-person .ava { position: relative; overflow: hidden; }
.crm-person .ava img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.crm-rolecatalog { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.crm-rolecard { border: 1px solid var(--pd-line); border-radius: 11px; padding: 10px 11px; }
.crm-rolecard .top { display: flex; align-items: center; gap: 8px; }
.crm-rolecard .top b { font-size: 12px; }
.crm-rolecard .top .crm-chip { margin-left: auto; }
.crm-rolecard p { margin: 5px 0 0; font-size: 10.5px; color: var(--pd-ink3); line-height: 1.4; }
.crm-rolecard i { display: block; margin-top: 5px; font-style: normal; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--pd-ink3); }
@media (max-width: 980px) { .crm-rolecatalog { grid-template-columns: 1fr; } }
.crm-channels { display: flex; flex-direction: column; gap: 9px; }
.crm-chrow { display: grid; grid-template-columns: 150px 1fr 42px 92px; gap: 10px; align-items: center; }
.crm-chrow .nm { font-size: 11.5px; color: var(--pd-ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-chrow .bar { height: 7px; border-radius: 4px; background: #f0f0f3; overflow: hidden; }
.crm-chrow .bar i { display: block; height: 100%; border-radius: 4px; background: var(--pd-red); opacity: .75; }
.crm-chrow .n { text-align: right; font: 600 10.5px/1 var(--pd-mono); color: var(--pd-ink2); }
.crm-chrow .sum { text-align: right; font: 500 9.5px/1 var(--pd-mono); color: var(--pd-ink3); }
@media (max-width: 760px) { .crm-chrow { grid-template-columns: 110px 1fr 34px; } .crm-chrow .sum { display: none; } }

/* CRM — самостоятельное рабочее место: левый rail портала скрыт,
   вернуться на главную можно кнопкой «Портал» в шапке (30.10.2026). */
body.gt.crm-page { padding-left: 0; padding-bottom: 0; }
.crm-portal {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px;
  border: 1px solid var(--pd-line); border-radius: 10px; background: #fff;
  font-size: 12px; font-weight: 600; color: var(--pd-ink2); flex: 0 0 auto;
}
.crm-portal:hover { background: #fafafb; color: var(--pd-ink); }
.crm-portal .ic { width: 12px; height: 12px; transform: rotate(180deg); }

/* Карточка сделки — на весь экран */
.crm-drawer { width: 100vw; max-width: 100vw; }
.crm-drawer .crm-dh,
.crm-drawer .crm-tabs,
.crm-drawer .crm-dbody { width: 100%; max-width: 1280px; margin-left: auto; margin-right: auto; }
.crm-drawer .crm-tabs { margin-bottom: 14px; }
@media (min-width: 1200px) {
  .crm-drawer .crm-fields { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 980px) {
  .crm-top .crm-crumb { display: none; }
}
@media (max-width: 560px) {
  .crm-ava { display: none; }
  .crm-portal { padding: 0 8px; }
}

/* Карточка — крупная модалка почти на всё окно (не edge-to-edge). */
.crm-drawer {
  top: 3.5vh; bottom: auto; left: 50%; right: auto;
  width: min(1320px, 93vw); height: 93vh; max-width: none;
  border-radius: 20px; border: 1px solid var(--pd-line);
  transform: translate(-50%, 14px) scale(.985);
  opacity: 0; visibility: hidden;
  transition: transform .26s var(--pd-ease), opacity .2s, visibility .2s;
  box-shadow: 0 40px 120px -40px rgba(17,17,20,.55);
}
.crm-drawer.open { transform: translate(-50%, 0) scale(1); opacity: 1; visibility: visible; }
@media (max-width: 980px) {
  .crm-drawer { width: 96vw; height: 94vh; top: 3vh; border-radius: 16px; }
}
@media (max-width: 560px) {
  .crm-drawer { width: 97vw; height: 96vh; top: 2vh; border-radius: 14px; }
}
.crm-callwrap { height: calc(93vh - 190px); min-height: 520px; }
.crm-callframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fafafa; display: block; }
@media (max-width: 980px) { .crm-callwrap { height: calc(94vh - 180px); } }
.crm-approve-actions { display: flex; gap: 6px; margin-left: auto; flex: 0 0 auto; }
.crm-approve-actions .crm-btn { height: 28px; padding: 0 8px; font-size: 10.5px; }

/* Карточка сделки — рабочее место без вкладок (30.10.2026) */
.crm-drawer { width: min(1480px, 97vw); height: 97vh; top: 1.5vh; }
@media (max-width: 980px) { .crm-drawer { width: 98vw; height: 98vh; top: 1vh; } }
.dw { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(320px, .88fr); gap: 14px; align-items: start; }
.dw-main, .dw-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dw-card { border: 1px solid var(--pd-line); border-radius: 14px; background: #fff; overflow: hidden; }
.dw-h { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--pd-line-soft); flex-wrap: wrap; }
.dw-h h2 { margin: 0; font-size: 13px; letter-spacing: -.02em; }
.dw-h .sub { font-size: 10.5px; color: var(--pd-ink3); }
.dw-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dw-b { padding: 12px 14px; }
.dw-fields { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px 14px; }
.dw-fields .crm-field label { margin-bottom: 4px; }
.dw-fields input, .dw-fields select { width: 100%; border: 1px solid var(--pd-line); border-radius: 9px; padding: 7px 9px; font: 12.5px/1.3 inherit; }
.dw-car-main { display: flex; align-items: flex-start; gap: 10px; }
.dw-car-main > div { flex: 1; min-width: 0; }
.dw-car-main b { font-size: 14px; display: block; }
.dw-car-sub { display: block; font: 10.5px/1.3 var(--pd-mono); color: var(--pd-ink3); margin-top: 3px; }
.dw-car-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 12px; }
.dw-car-grid div { background: #f8f8fa; border-radius: 9px; padding: 8px 9px; min-width: 0; }
.dw-car-grid i { display: block; font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: .07em; color: var(--pd-ink3); }
.dw-car-grid b { display: block; margin-top: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-car-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dw-empty { text-align: center; padding: 14px 8px; }
.dw-empty b { font-size: 13px; }
.dw-empty p { margin: 4px 0 12px; font-size: 11.5px; color: var(--pd-ink3); }
.dw-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-top: 1px solid var(--pd-line-soft); }
.dw-row:first-child { border-top: 0; }
.dw-row-t { flex: 1; min-width: 0; }
.dw-row-t b { display: block; font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-row-t span { display: block; font-size: 10.5px; color: var(--pd-ink3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-row > i { font-style: normal; font-size: 9.5px; color: var(--pd-ink3); }
.dw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pd-red); flex: 0 0 auto; }
.dw-note { background: #f8f8fa; border: 1px solid var(--pd-line-soft); border-radius: 9px; padding: 9px 10px; font-size: 11px; color: var(--pd-ink3); }
.dw-client { display: flex; align-items: center; gap: 10px; }
.dw-client b { display: block; font-size: 13px; }
.dw-client span { display: block; font-size: 10.5px; color: var(--pd-ink3); margin-top: 2px; }
.dw-client-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }
.dw-history summary { cursor: pointer; padding: 11px 14px; font-size: 12px; font-weight: 600; color: var(--pd-ink2); }
.dw-history summary::marker { color: var(--pd-red); }
@media (max-width: 1050px) {
  .dw { grid-template-columns: 1fr; }
  .dw-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 700px) {
  .dw-side { grid-template-columns: 1fr; }
  .dw-fields, .dw-car-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* AI-подсказки — отдельное модальное окно поверх карточки */
.crm-callmodal { position: fixed; inset: 0; z-index: 150; background: rgba(17,17,20,.55); backdrop-filter: blur(4px); padding: 2vh 2vw; display: none; }
.crm-callmodal.open { display: block; }
.crm-callbox { width: min(1400px, 96vw); height: 96vh; margin: 0 auto; background: #fff; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 40px 120px -40px rgba(0,0,0,.6); }
.crm-callhead { display: flex; align-items: center; gap: 9px; padding: 11px 14px; border-bottom: 1px solid var(--pd-line); }
.crm-callhead b { font-size: 13px; }
.crm-callhead .sub { font-size: 10.5px; color: var(--pd-ink3); }
.crm-callhead .crm-dclose { margin-left: auto; }
.crm-callbox iframe { flex: 1; width: 100%; border: 0; display: block; }
@media (max-width: 700px) { .crm-callmodal { padding: 1vh 1vw; } .crm-callbox { width: 98vw; height: 98vh; } }
#crmDrawerTabs:empty { display: none; }
.crm-drawer .crm-dh, .crm-drawer .crm-tabs, .crm-drawer .crm-dbody { max-width: 1400px; }
.dw-fields input, .dw-fields select, .dw .crm-compose input, .dw .crm-compose textarea { background: #fafafb; }
.dw .crm-empty { padding: 16px 8px; }

/* ── Карточка «Отдел оценки»: большое рабочее место ─────────────────── */
.sp-mask { position: fixed; inset: 0; z-index: 95; background: rgba(17,17,20,.42);
  backdrop-filter: blur(7px); display: flex; align-items: center; justify-content: center; padding: 2vh 2vw; }
.sp-modal { width: min(1280px, 96vw); height: 93vh; background: var(--pd-paper);
  border: 1px solid rgba(255,255,255,.65); border-radius: 22px; box-shadow: 0 40px 100px -40px rgba(17,17,20,.55);
  display: flex; flex-direction: column; overflow: hidden; }
.sp-loading { padding: 22px; }
.sp-head { display: flex; align-items: flex-start; gap: 18px; padding: 18px 22px 15px;
  background: rgba(255,255,255,.88); border-bottom: 1px solid var(--pd-line); }
.sp-head-main { flex: 1; min-width: 0; }
.sp-kicker { font: 600 9px/1 var(--pd-mono); letter-spacing: .13em; text-transform: uppercase; color: var(--pd-ink3); }
.sp-head h1 { margin: 6px 0 0; font-size: 21px; line-height: 1.15; letter-spacing: -.035em; }
.sp-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.sp-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--pd-line); background: #fff; color: var(--pd-ink2); font: 600 9.5px/1.2 inherit; text-decoration: none; }
.sp-badge.stage { background: #fff; color: var(--pd-ink); border-color: #dcdce3; }
.sp-badge.stage .sp-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pd-red); display: inline-block; }
.sp-badge.docs { background: rgba(213,0,28,.06); color: var(--pd-red); border-color: rgba(213,0,28,.22); }
.sp-badge.link { color: var(--pd-ink3); }
.sp-head-act { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.sp-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 318px; }
.sp-main { overflow: auto; padding: 16px 18px 24px; }
.sp-side { overflow: auto; padding: 16px 16px 24px; background: #f7f7f9; border-left: 1px solid var(--pd-line); }
.sp-sec { background: #fff; border: 1px solid var(--pd-line); border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.sp-sec > header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 10px; border-bottom: 1px solid var(--pd-line-soft); }
.sp-sec > header > div { display: flex; align-items: center; gap: 8px; }
.sp-sec-ic { width: 24px; height: 24px; border-radius: 8px; background: #f2f2f5; color: var(--pd-ink2);
  display: grid; place-items: center; font: 700 10px/1 var(--pd-mono); }
.sp-sec h2 { margin: 0; font-size: 12.5px; letter-spacing: -.01em; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding: 13px 16px 16px; }
.sp-field { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sp-field.wide { grid-column: 1 / -1; }
.sp-field > label { min-height: 12px; }
.sp-field label { font: 600 9px/1.2 var(--pd-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--pd-ink3); }
.sp-field input, .sp-field select, .sp-field textarea, .sp-side-card select, .sp-side-card textarea {
  width: 100%; border: 1px solid var(--pd-line); border-radius: 10px; background: #fff;
  padding: 8px 10px; font: 12.5px/1.35 inherit; color: var(--pd-ink); outline: none; }
.sp-field input:focus, .sp-field select:focus, .sp-field textarea:focus { border-color: #bdbdc7; box-shadow: 0 0 0 3px rgba(17,17,20,.05); }
.sp-field input.mono { font-family: var(--pd-mono); font-size: 11px; letter-spacing: .01em; }
.sp-field textarea { resize: vertical; min-height: 66px; }
.sp-hint { display: block; font: 400 10px/1.3 inherit; text-transform: none; letter-spacing: 0; color: #9a9aa4; margin-top: 2px; }
.sp-read { min-height: 34px; display: flex; align-items: center; font-size: 12.5px; }
.sp-read a { color: var(--pd-ink); text-decoration: none; border-bottom: 1px solid #d9d9e0; }
.sp-brandmodel { grid-column: 1 / -1; padding: 12px; background: #fafafc; border: 1px solid var(--pd-line-soft); border-radius: 12px; }
.sp-bm-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: 7px; margin-top: 5px; }
.sp-bm-row input { font-weight: 600; }
.sp-bm-note { font-size: 10.5px; color: #777782; margin-top: 6px; }
.sp-checks { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px 8px; margin-top: 3px; }
.sp-check { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--pd-line-soft); border-radius: 7px; background: #fcfcfd; cursor: pointer; }
.sp-check input { width: 13px; height: 13px; accent-color: var(--pd-red); }
.sp-check span { font: 500 10.5px/1.2 inherit; color: var(--pd-ink2); }
.sp-file { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 11.5px; color: var(--pd-ink2); }
.sp-eval-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--pd-line-soft); margin: 0 16px 4px; border: 1px solid var(--pd-line-soft); border-radius: 10px; overflow: hidden; }
.sp-eval-strip > div { background: #fbfbfc; padding: 9px 10px; display: flex; flex-direction: column; gap: 4px; }
.sp-eval-strip span { font: 500 8.5px/1.2 var(--pd-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--pd-ink3); }
.sp-eval-strip b { font: 600 14px/1 var(--pd-mono); color: var(--pd-ink); letter-spacing: -.03em; }
.sp-eval-strip b.up { color: var(--pd-green); }
.sp-eval-strip b.down { color: var(--pd-red); }
.sp-docsbar { display: flex; align-items: center; gap: 8px; margin: 10px 16px 0; padding: 10px 12px; border: 1px solid #ecd9dd; background: #fff8f9; border-radius: 11px; }
.sp-docsbar > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sp-docsbar b { font-size: 11.5px; }
.sp-docsbar span { font-size: 10px; color: var(--pd-ink3); }
.sp-side-card { background: #fff; border: 1px solid var(--pd-line); border-radius: 14px; padding: 13px 14px; margin-bottom: 14px; }
.sp-side-kicker { font: 600 9px/1 var(--pd-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--pd-ink3); margin-bottom: 8px; }
.sp-side-head { display: flex; align-items: center; justify-content: space-between; }
.sp-person { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.sp-ava { width: 34px; height: 34px; border-radius: 50%; background: #111114; color: #fff; display: grid; place-items: center; font: 700 10px/1 var(--pd-mono); }
.sp-person > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-person b { font-size: 12.5px; }
.sp-person span { font: 500 10.5px/1.2 var(--pd-mono); color: var(--pd-ink3); }
.sp-client .crm-btn { width: 100%; margin-top: 4px; }
.sp-deal-title { display: block; font-size: 12px; line-height: 1.3; margin-bottom: 6px; }
.sp-deal-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--pd-ink3); margin-bottom: 4px; }
.sp-deal-meta span:last-child { text-align: right; }
.sp-side-card .crm-btn { width: 100%; margin-top: 6px; }
.sp-side-note { margin-top: 6px; font-size: 9.5px; color: var(--pd-ink3); }
.sp-stage select { font-weight: 600; }
.sp-act { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-top: 1px solid var(--pd-line-soft); }
.sp-act:first-of-type { border-top: 0; }
.sp-act > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-act b { font-size: 10.5px; line-height: 1.25; }
.sp-act span { font-size: 9px; color: var(--pd-ink3); }
.sp-act .crm-btn { width: auto; padding: 4px 7px; font-size: 9px; }
.sp-miniadd { display: flex; gap: 5px; margin-top: 7px; }
.sp-miniadd input { flex: 1; }
.sp-miniadd .crm-btn { width: 34px; padding: 0; }
.sp-side-card textarea { min-height: 58px; resize: vertical; }
.sp-side-card > .crm-btn { margin-top: 7px; }
.sp-empty { font-size: 10.5px; color: var(--pd-ink3); padding: 4px 0; }
.sp-foot { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: rgba(255,255,255,.96);
  border-top: 1px solid var(--pd-line); box-shadow: 0 -10px 30px -24px rgba(17,17,20,.5); z-index: 2; }
.sp-dirty { font: 500 9.5px/1 var(--pd-mono); color: var(--pd-ink3); }
.sp-dirty.on { color: #a35a00; }
.sp-foot-note { margin-left: auto; font: 500 9.5px/1 var(--pd-mono); color: var(--pd-ink3); }
.sp-foot .crm-btn { min-height: 38px; }
.sp-foot .crm-btn[data-close]:not(.primary) { background: #fff; border-color: var(--pd-line); }
.sp-docs-box { width: min(620px, 94vw); max-width: 620px !important; padding: 0; }
.sp-docs-head { display: flex; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--pd-line); }
.sp-docs-head > div { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sp-docs-head b { font-size: 14px; }
.sp-docs-head span { font-size: 11px; color: var(--pd-ink3); }
.sp-docs-body { display: flex; gap: 18px; padding: 16px 18px 20px; }
.sp-qr { width: 190px; height: 190px; flex: 0 0 auto; border: 1px solid var(--pd-line); border-radius: 14px; padding: 10px; background: #fff; display: grid; place-items: center; }
.sp-qr img { width: 100%; height: 100%; object-fit: contain; }
.sp-qr-empty { font-size: 11px; color: var(--pd-ink3); }
.sp-docs-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sp-code { font: 700 26px/1 var(--pd-mono); letter-spacing: .18em; color: var(--pd-ink); }
.sp-docs-note { font-size: 10px; color: var(--pd-ink3); }
.sp-docs-info .crm-btn { width: 100%; }
.sp-docs-info .crm-note { margin-top: 3px; }
@media (max-width: 900px) {
  .sp-mask { padding: 0; }
  .sp-modal { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .sp-head { padding: 14px 15px 12px; flex-direction: column; gap: 10px; }
  .sp-head h1 { font-size: 18px; }
  .sp-head-act { width: 100%; justify-content: flex-start; }
  .sp-head-act .crm-btn { flex: 1 1 auto; }
  .sp-body { grid-template-columns: 1fr; overflow: auto; }
  .sp-main, .sp-side { overflow: visible; padding: 12px 12px 18px; }
  .sp-side { border-left: 0; border-top: 1px solid var(--pd-line); }
  .sp-grid { grid-template-columns: 1fr; }
  .sp-field.wide, .sp-brandmodel { grid-column: 1; }
  .sp-eval-strip { grid-template-columns: 1fr 1fr; margin: 0 12px 4px; }
  .sp-docsbar { margin: 9px 12px 0; flex-wrap: wrap; }
  .sp-docsbar .crm-btn { flex: 1 1 auto; }
  .sp-foot { position: sticky; bottom: 0; padding: 9px 12px; }
  .sp-foot-note { display: none; }
  .sp-docs-body { flex-direction: column; align-items: center; }
  .sp-qr { width: 220px; height: 220px; }
}
.sp-stage-now { font: 600 10px/1 var(--pd-mono); color: var(--pd-red); }
.sp-divider { height: 1px; background: var(--pd-line-soft); margin: 12px 0; }
.sp-clientdeal .crm-btn { width: 100%; margin-top: 7px; }
.sp-miniadd .crm-btn { width: auto; padding: 0 11px; font-size: 10.5px; white-space: nowrap; }
.sp-side-card textarea + .crm-btn { width: 100%; }
.sp-work { margin-top: 2px; }
.sp-sec-note { font: 400 10px/1.2 inherit; color: var(--pd-ink3); }
.sp-work-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; padding: 13px 16px 16px; }
.sp-work-col { min-width: 0; display: flex; flex-direction: column; }
.sp-work-col + .sp-work-col { border-left: 1px solid var(--pd-line-soft); padding-left: 18px; }
.sp-work-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sp-work-head b { font-size: 11px; }
.sp-work-col textarea { width: 100%; min-height: 76px; border: 1px solid var(--pd-line); border-radius: 10px; padding: 8px 10px; font: 12.5px/1.4 inherit; resize: vertical; }
.sp-work-col > .crm-btn { margin-top: 7px; align-self: flex-start; }
@media (max-width: 900px) {
  .sp-work-grid { grid-template-columns: 1fr; gap: 14px; }
  .sp-work-col + .sp-work-col { border-left: 0; border-top: 1px solid var(--pd-line-soft); padding-left: 0; padding-top: 12px; }
}
.sp-sum-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--pd-line-soft); }
.sp-sum-row:first-of-type { border-top: 0; }
.sp-sum-row span { font-size: 9.5px; color: var(--pd-ink3); }
.sp-sum-row b { font: 600 12px/1 var(--pd-mono); color: var(--pd-ink); }
.sp-sum-row.accent b { color: var(--pd-red); }
.sp-sum-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 9.5px; padding: 3px 0; }
.sp-sum-meta span { color: var(--pd-ink3); }
.sp-sum-meta b { font-weight: 500; text-align: right; color: var(--pd-ink2); }
.sp-checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-dirty.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #c47a00; margin-right: 5px; vertical-align: 1px; }
@media (max-width: 900px) { .sp-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-field.req > label::after { content: " *"; color: var(--pd-red); font-weight: 700; }
.sp-bm-row { align-items: center; }
