/* HR Stalker CRM — в духе WEEEK, цвета бренда: красный #F02018, чёрный, белый */
:root {
  --bg: #F3F3F5; --panel: #fff; --ink: #1E1F24; --ink2: #3D3F47; --muted: #8C8F99; --line: #ECECF0; --line2: #E2E2E8;
  --hover: #F1F1F4; --active: #E8E8EC;
  --accent: #F02018; --accent-ink: #fff; --accent-soft: #FFEDEB; --accent-line: #FBC7C2;
  --danger: #E5281C; --danger-bg: #FFF1F0; --ok: #22A55B; --ok-bg: #E9F7EF;
  --warn: #E7A600; --warn-bg: #FFF9E6; --info: #3B82F6; --info-bg: #EFF5FF;
  --p3: #F02018; --p3-bg: #FFF6F5; --p2: #F2B705; --p2-bg: #FFFCEF; --p1: #3B82F6; --p1-bg: #F6F9FF;
  --radius: 12px; --shadow: 0 1px 2px rgba(20,20,30,.04), 0 2px 8px rgba(20,20,30,.04);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
button { font: inherit; }

/* ---------- каркас */
.layout { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; padding: 12px 10px; display: flex; flex-direction: column; gap: 1px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.wsrow { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px 0; }
.ws { display: flex; align-items: center; gap: 9px; padding: 6px 8px 6px; font-weight: 700; font-size: 15px; text-decoration: none; }
.bell { position: relative; border: 0; background: transparent; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.bell:hover { background: var(--hover); }
.bellcount { position: absolute; top: 1px; right: 0; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; line-height: 16px; padding: 0 4px; }
.ws .logo-img { width: 30px; height: 30px; }
.ws .logo { width: 28px; height: 28px; border-radius: 7px; background: var(--ink); color: #fff; display: grid; place-items: center;
  font-size: 12px; letter-spacing: .5px; position: relative; overflow: hidden; }
.ws .logo::after { content: ""; position: absolute; right: 4px; top: 4px; bottom: 4px; width: 2px; background: var(--accent); }
.search { display: flex; align-items: center; gap: 6px; margin: 0 2px 10px; padding: 0 10px; height: 34px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 9px; color: var(--muted); }
.search input { border: 0 !important; padding: 0 !important; background: transparent !important; height: 100%; outline: none; box-shadow: none !important; }
.side a.nav, .side .nav { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 7px 10px; border-radius: 8px;
  color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side a.nav:hover { background: var(--hover); }
.side a.nav.on { background: var(--active); color: var(--ink); font-weight: 500; }
.side .ico { width: 18px; text-align: center; color: var(--muted); flex: none; font-size: 15px; }
.side .label { font-size: 12px; color: var(--muted); margin: 14px 10px 4px; display: flex; justify-content: space-between; align-items: center; }
.side .label a { text-decoration: none; font-size: 16px; line-height: 1; color: var(--muted); }
.side .label a:hover { color: var(--accent); }
.pj { width: 18px; height: 18px; border-radius: 5px; color: #fff; font-size: 9px; font-weight: 700; display: grid; place-items: center; flex: none; }
.side .me { margin-top: auto; padding: 10px 8px 2px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.av { width: 26px; height: 26px; border-radius: 50%; background: #E9E3F8; color: #5B46B0; font-size: 10px; font-weight: 600;
  display: inline-grid; place-items: center; flex: none; }
.av.sm { width: 20px; height: 20px; font-size: 8.5px; }
.main { flex: 1; min-width: 0; margin: 8px 8px 8px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px 26px; min-height: calc(100vh - 16px); }
h1 { font-size: 24px; margin: 0 0 18px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 600; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.top h1 { margin: 0; }

/* ---------- панель инструментов (как в WEEEK) */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.tb { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--panel);
  border: 1px solid var(--line); color: var(--ink2); text-decoration: none; cursor: pointer; white-space: nowrap; }
.tb:hover { background: var(--hover); }
.tb.on { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-soft); }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 8px; text-decoration: none; color: var(--ink2); white-space: nowrap; }
.seg a.on { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); }
.tb select, .toolbar select { border: 0; background: transparent; height: 100%; padding: 0 4px; width: auto; box-shadow: none !important; }

/* ---------- кнопки, бейджи, карточки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: var(--accent); color: var(--accent-ink);
  height: 36px; padding: 0 14px; border-radius: 9px; cursor: pointer; text-decoration: none; font-weight: 500; white-space: nowrap; }
.btn:hover { filter: brightness(.95); }
.btn.light { background: var(--hover); color: var(--ink); font-weight: 400; }
.btn.ghost { background: transparent; color: var(--ink2); border: 1px dashed var(--line2); font-weight: 400; }
.btn.danger { background: var(--danger); }
.btn.dark { background: var(--ink); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--hover); font-size: 12px; color: var(--ink2); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.muted { color: var(--muted); }
.messages { list-style: none; padding: 0; margin: 0 0 14px; }
.messages li { background: var(--ok-bg); padding: 10px 14px; border-radius: 9px; margin-bottom: 6px; }
.alert { display: block; text-decoration: none; padding: 10px 14px; border-radius: 10px; margin-bottom: 8px; background: var(--warn-bg); border: 1px solid #F4E2A6; }
.alert.critical { background: var(--danger-bg); border-color: var(--accent-line); }
.hintcard { background: var(--info-bg); border-color: #D5E5FD; }

/* ---------- доска сделок (воронки) */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 272px; background: var(--bg); border-radius: var(--radius); padding: 8px; }
.col.won { background: var(--ok-bg); }
.col.lost { background: #F7F1F1; }
.col h3 { font-size: 13.5px; font-weight: 600; margin: 4px 6px 2px; display: flex; justify-content: space-between; gap: 6px; }
.col .hint { font-size: 11.5px; color: var(--muted); margin: 0 6px 8px; min-height: 15px; }
.drop { min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.deal { background: var(--panel); border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); cursor: grab; text-decoration: none; display: block; }
.deal:hover { border-color: var(--line2); box-shadow: var(--shadow); }
.deal.overdue { box-shadow: inset 3px 0 0 var(--danger); }
.deal .t { font-weight: 600; }
.deal .m { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; margin-top: 4px; }
.sortable-ghost { opacity: .4; }
.chip { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 6px; background: var(--hover); font-size: 12px; }
.chip.critical { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.chip.soon { background: var(--warn-bg); color: #8a5a00; }
.deal.meet-critical { border-color: var(--danger); box-shadow: 0 0 0 2px var(--danger-bg); }
.deal.meet-soon { border-color: #E9C46A; }
.card.meet-critical { border-color: var(--danger); }

/* этапы в карточке сделки */
.stages { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.stages button { border: 0; padding: 7px 12px; font-size: 13px; background: var(--hover); border-radius: 8px; cursor: pointer; color: var(--ink2); }
.stages button.done { background: var(--active); }
.stages button.cur { background: var(--ink); color: #fff; }
.stages button.won { background: var(--ok-bg); color: var(--ok); }

/* ленты и таблицы */
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 10px 0; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed .system { color: var(--muted); }
.rows { width: 100%; border-collapse: collapse; }
.rows th { text-align: left; font-weight: 400; color: var(--muted); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rows td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rows tr.click:hover td { background: #FAFAFB; cursor: pointer; }
.rows tr.p3 td { background: var(--p3-bg); } .rows tr.p2 td { background: var(--p2-bg); }
.rows tr.done td.n { text-decoration: line-through; color: var(--muted); }
.rows tr.grp td { font-weight: 500; color: var(--ink); background: #fff; padding-top: 16px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
.task .body { flex: 1; min-width: 0; }
.task .acts { display: flex; gap: 6px; flex: none; }
.task.over .when { color: var(--danger); }
details.done-form summary { list-style: none; }
details.done-form[open] { flex-basis: 100%; }

/* ---------- формы */
form p { margin: 0 0 12px; }
label { display: block; font-size: 13px; color: var(--ink2); margin-bottom: 4px; }
input[type=text], input[type=url], input[type=password], input[type=number], input[type=email], input[type=date], input[type=time],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; }
.helptext { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.errorlist { color: var(--danger); padding-left: 16px; margin: 4px 0; font-size: 13px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.inline > * { flex: 1 1 160px; }
.inline > button { flex: 0 0 auto; }
.top .inline > *, .top form.inline { flex: 0 0 auto; }
.top form.inline { flex-wrap: nowrap; }
.top form.inline select { width: auto; }
#id_watchers, #id_members, ul#id_watchers, ul#id_members { list-style: none; padding: 0; columns: 2; }
#id_watchers label, #id_members label { display: flex; gap: 6px; color: var(--ink); }
ul#id_color { list-style: none; padding: 0; display: flex; gap: 8px; }
ul#id_color label { font-size: 0; }
ul#id_color input { appearance: none; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; margin: 0; }
ul#id_color input:checked { outline: 3px solid var(--ink); outline-offset: 2px; }
p.found input, p.found select { border-color: var(--ok); background: var(--ok-bg); }
input[type=file] { font: inherit; }
.login { max-width: 360px; margin: 12vh auto; }
dialog.card { max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(20,20,30,.3); }

/* ---------- карточки задач (планер, доски проектов) */
.tcard { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 9px;
  cursor: pointer; display: block; text-decoration: none; transition: box-shadow .15s; }
.tcard:hover { box-shadow: var(--shadow); border-color: var(--line2); }
.tcard.p3 { background: var(--p3-bg); border-color: #F8D7D3; } .tcard.p3::before { background: var(--p3); }
.tcard.p2 { background: var(--p2-bg); border-color: #F5E7B0; } .tcard.p2::before { background: var(--p2); }
.tcard.p1 { background: var(--p1-bg); border-color: #DCE7FB; } .tcard.p1::before { background: var(--p1); }
.tcard::before { content: ""; position: absolute; top: -1px; right: 14px; width: 26px; height: 4px; border-radius: 0 0 3px 3px; }
.tcard.done .ttl { text-decoration: line-through; color: var(--muted); }
.tcard .meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; flex-wrap: wrap; }
.num { background: var(--hover); border-radius: 5px; padding: 0 5px; font-size: 11px; color: var(--muted); }
.age { color: var(--danger); background: var(--danger-bg); border-radius: 5px; padding: 0 5px; font-size: 11px; }
.path { font-size: 11px; color: var(--ok); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.path span + span::before { content: " › "; color: var(--muted); }
.path.crm { color: var(--info); }
.tcard .ttl { font-size: 13.5px; color: var(--ink); margin-bottom: 8px; word-break: break-word; }
.tcard .foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.tcard .foot .sp { flex: 1; }
.check { width: 18px; height: 18px; border-radius: 50%; border: 1.6px solid #B9BCC6; background: #fff; flex: none; display: inline-grid;
  place-items: center; cursor: pointer; padding: 0; color: #fff; font-size: 11px; line-height: 1; }
.check:hover { border-color: var(--ok); }
.check.on { background: var(--ok); border-color: var(--ok); }
.progress { height: 3px; background: var(--line); border-radius: 2px; margin: 6px 0 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }
.tag { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 5px; background: #EEF0FF; color: #4B55C8; }
.overdue-d { color: var(--danger); }
.avs { display: inline-flex; vertical-align: middle; }
.avs .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.av.lead { background: #FFE3E0; color: var(--accent); }
.due { font-size: 11.5px; color: var(--ink2); white-space: nowrap; }
.due.soon { color: #B07800; background: var(--warn-bg); border-radius: 5px; padding: 0 5px; }
.due.over { color: #fff; background: var(--danger); border-radius: 5px; padding: 0 5px; }

/* неделя */
.week { display: flex; gap: 10px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; }
.day { flex: 0 0 270px; }
.day h3 { font-size: 14px; font-weight: 400; color: var(--muted); margin: 2px 4px 8px; }
.day.today h3 { color: var(--accent); font-weight: 500; }
.day .list { display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.addline { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border: 1px solid var(--line);
  border-radius: 10px; color: var(--muted); background: var(--panel); cursor: pointer; width: 100%; margin-bottom: 8px; }
.addline:hover { color: var(--accent); border-color: var(--accent-line); }
.addform input { height: 38px; margin-bottom: 8px; }
.sub-h { font-size: 12px; color: var(--muted); text-align: center; margin: 2px 0; }
.sub-h.danger { color: var(--danger); }

/* месяц */
.month { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.month .wd { padding: 8px 10px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month .wd.we { color: var(--accent); }
.mcell { min-height: 128px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.mcell.out { background: #F7F7F9; }
.mcell .dn { text-align: right; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.mcell.today .dn { color: var(--accent); font-weight: 600; }
.mcell .mt { display: flex; gap: 6px; align-items: center; font-size: 12.5px; padding: 5px 7px; border-radius: 7px; background: var(--panel);
  border: 1px solid var(--line); margin-bottom: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; }
.mcell .mt span { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.mcell .mt.p3 { border-color: #F3B9B3; background: var(--p3-bg); } .mcell .mt.p2 { border-color: #F0D98A; background: var(--p2-bg); }
.mcell .mt.done span { text-decoration: line-through; color: var(--muted); }

/* доски проектов */
.pboard { display: flex; gap: 12px; align-items: flex-start; }
.boards { flex: 0 0 280px; background: var(--bg); border-radius: var(--radius); padding: 8px; }
.boards a.b { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 8px; text-decoration: none; }
.boards a.b.on { border-color: var(--accent); }
.boards a.b .n { font-weight: 500; margin-bottom: 4px; }
.kcols { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; flex: 1; padding-bottom: 12px; }
.kcol { flex: 0 0 272px; }
.kcol h3 { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 14px; font-weight: 500;
  margin: 0 0 8px; display: flex; justify-content: space-between; }
.kcol .list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.pcard { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.pcard:hover { box-shadow: var(--shadow); }

/* ---------- панель задачи справа */
.panel-wrap { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.panel-wrap.open { pointer-events: auto; }
.panel-wrap .shade { position: absolute; inset: 0; background: rgba(20,20,30,.08); opacity: 0; transition: opacity .2s; }
.panel-wrap.open .shade { opacity: 1; }
.panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(660px, 100%); background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -8px 0 30px rgba(20,20,30,.08); transform: translateX(100%); transition: transform .22s ease; overflow-y: auto; }
.panel-wrap.open .panel { transform: none; }
.ph { display: flex; align-items: center; gap: 8px; padding: 12px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0;
  background: var(--panel); z-index: 2; }
.ph .sp { flex: 1; }
.pbody { padding: 18px 26px 40px; }
.pbody .acts { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.btn.outline { background: #fff; color: var(--accent); border: 1.5px solid var(--accent-line); }
.btn.outline.done { color: var(--ok); border-color: #BDE5CC; }
.pbody input.ttl-input { font-size: 24px; font-weight: 600; border: 0; padding: 2px 0; box-shadow: none; margin-bottom: 4px; }
.parent-link { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; display: inline-block; text-decoration: none; cursor: pointer; }
.props { display: grid; grid-template-columns: 170px 1fr; row-gap: 2px; align-items: center; margin: 14px 0 18px; }
.props .k { color: var(--muted); display: flex; gap: 8px; align-items: center; min-height: 34px; }
.props .v select, .props .v input { border-color: transparent; background: transparent; padding: 6px 8px; }
.props .v select:hover, .props .v input:hover { background: var(--hover); }
.props .v form { margin: 0; }
.props .v .row { display: flex; gap: 6px; align-items: center; }
.sec { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.sec h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.subrow { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.subrow.done span { text-decoration: line-through; color: var(--muted); }
.comment { background: var(--bg); border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.mention-drop { position: absolute; bottom: calc(100% + 4px); left: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.15); z-index: 200; min-width: 180px; overflow: hidden; }
.mention-drop .mitem { padding: 7px 14px; cursor: pointer; font-size: 14px; }
.mention-drop .mitem:hover { background: var(--bg); }
strong.mention { color: var(--accent); font-weight: 600; }
.duebox .reasonrow { display: none; gap: 6px; margin-top: 6px; }
.duebox.changed .reasonrow, .duebox .reasonrow.err { display: flex; }
.duebox .reasonrow input { border-color: var(--accent-line) !important; background: #fff !important; }
.tagsline { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- отчёты */
.frow { display: grid; grid-template-columns: 200px 1fr 80px; gap: 10px; align-items: center; padding: 4px 0; }
.fname { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbar { position: relative; height: 24px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.fbar i { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); border-right: 2px solid var(--accent); }
.fbar span { position: relative; font-size: 12px; padding-left: 8px; line-height: 24px; }
.fnow { text-align: right; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpis b { font-size: 17px; }

/* воронка — горизонтальные полосы от одной линии, подпись у конца */
.funnels { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 14px; }
.fcard h2 { margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.tile { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.tl { font-size: 12px; color: var(--muted); }
.tv { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tp { font-size: 13px; font-weight: 500; color: var(--muted); }
.fchart { position: relative; }
.frow2 { display: grid; grid-template-columns: 180px 1fr 74px; gap: 10px; align-items: center; min-height: 30px; padding: 2px 0; border-radius: 6px; position: relative; }
.frow2:hover { background: var(--hover); }
.flabel { font-size: 13px; line-height: 1.2; color: var(--ink2); display: flex; gap: 5px; align-items: center; }
.okicon { color: var(--ok); font-weight: 700; }
.ftrack { display: flex; align-items: center; gap: 6px; height: 22px; border-left: 1px solid var(--line2); }
.ftrack i { display: block; height: 22px; background: var(--accent); border-radius: 0 4px 4px 0; flex: none; }
.ftrack i.won { background: var(--ok); }
.ftrack b { font-size: 13px; font-variant-numeric: tabular-nums; }
.ftrack span { font-size: 12px; }
.fnow2 { font-size: 11.5px; color: var(--muted); text-align: right; white-space: nowrap; }
.fstep { height: 16px; padding-left: 190px; display: flex; align-items: center; }
.fstep span { font-size: 11px; color: var(--muted); }
.frow2[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 190px; bottom: calc(100% + 4px); z-index: 5; background: var(--ink); color: #fff;
  font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; }
.ftable { margin-top: 10px; } .ftable summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.fempty { text-align: center; padding: 26px 0 10px; color: var(--ink2); }
@media (max-width: 860px) { .funnels { grid-template-columns: 1fr; } .tiles { grid-template-columns: 1fr 1fr; } .frow2 { grid-template-columns: 110px 1fr 56px; } .fstep { padding-left: 120px; } }

/* уведомления — панель справа */
.panel.narrow { width: min(520px, 100%); }
.nhead { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.nhead h2 { margin: 0; font-size: 20px; flex: 1; }
.ntabs { display: flex; gap: 4px; padding: 10px 14px; background: #fff; position: sticky; top: 61px; z-index: 2; border-bottom: 1px solid var(--line); }
.ntabs form { flex: 1; }
.ntabs button { width: 100%; border: 0; background: var(--bg); border-radius: 8px; padding: 7px 6px; cursor: pointer; color: var(--ink2); font-size: 13px; }
.ntabs button.on { background: #fff; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.nitem { display: flex; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); position: relative; }
.nitem:hover { background: #FAFAFB; }
.nitem.new::before { content: ""; position: absolute; left: 7px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.nicon { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; flex: none; font-size: 15px; }
.nbody { flex: 1; min-width: 0; text-decoration: none; display: block; }
.nbody b { font-weight: 600; display: block; }
.nbody .nd { font-size: 12.5px; color: var(--ink2); }
.nmeta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.nacts { display: flex; flex-direction: column; gap: 2px; opacity: 0; }
.nitem:hover .nacts { opacity: 1; }
.nacts button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 12px; padding: 2px 4px; border-radius: 5px; }
.nacts button:hover { background: var(--hover); color: var(--ink); }
.nset { margin: 12px 18px; padding: 14px; border-radius: 12px; background: var(--bg); }
.nempty { text-align: center; color: var(--muted); padding: 60px 20px; }
.tgbtn { display: inline-flex; gap: 6px; align-items: center; border: 0; background: var(--info-bg); color: #1b6fd1; border-radius: 9px; padding: 0 12px; height: 34px; cursor: pointer; font: inherit; white-space: nowrap; font-size: 13px; }
.nhead h2 { white-space: nowrap; }
.notif { display: block; padding: 12px 18px; border-bottom: 1px solid var(--line); text-decoration: none; }
.notif:hover { background: var(--hover); }
.notif.new { background: #FFF8F7; box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- календарь */
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); margin: 4px 0 10px; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }
.lg { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.lg.meeting, .ev.meeting, .blk.meeting { background: #FFE3E0; border: 1px solid #F6B5AE; }
.lg.tentative, .ev.tentative, .blk.tentative { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #FFE3E0 4px, #FFE3E0 8px); border: 1px dashed #F08A80; }
.lg.client, .ev.client, .blk.client { background: #E3EEFF; border: 1px solid #B8CFF7; }
.lg.external, .ev.external, .blk.external { background: repeating-linear-gradient(45deg, #EEEFF2, #EEEFF2 4px, #E2E3E8 4px, #E2E3E8 8px); border: 1px solid #D6D7DD; }
.lg.off { background: #F4F4F6; border: 1px solid var(--line); }
.wk { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wkhours { flex: 0 0 52px; margin-top: 34px; border-right: 1px solid var(--line); }
.wkhours span { display: block; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; box-sizing: border-box; border-top: 1px solid var(--line); }
.wkday { flex: 1; min-width: 0; border-right: 1px solid var(--line); }
.wkday:last-child { border-right: 0; }
.wkhead { height: 34px; display: grid; place-items: center; font-size: 13px; color: var(--ink2); border-bottom: 1px solid var(--line); }
.wkday.today .wkhead { color: var(--accent); font-weight: 600; }
.wkcol { position: relative; cursor: copy; background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 48px; }
.wkcol .off, .tltrack .off { position: absolute; left: 0; right: 0; background: rgba(240,240,244,.8); pointer-events: none; }
.ev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 2px 6px; font-size: 11.5px; overflow: hidden; cursor: default; z-index: 1; display: flex; align-items: flex-start; gap: 2px; }
.ev > a, .ev > span:not(.drag-handle) { flex: 1; min-width: 0; text-decoration: none; display: block; }
.ev a { text-decoration: none; }
.people { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pchip { display: inline-flex; gap: 5px; align-items: center; padding: 4px 10px; border-radius: 16px; background: var(--bg); cursor: pointer; font-size: 13px; color: var(--ink2); margin: 0; }
.pchip input { display: none; }
.pchip.on { background: var(--accent-soft); color: var(--accent); }
.tl { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tlhead, .tlrow { display: flex; border-bottom: 1px solid var(--line); }
.tlrow:last-child { border-bottom: 0; }
.tlname { flex: 0 0 210px; padding: 8px 12px; display: flex; gap: 8px; align-items: center; font-size: 13px; border-right: 1px solid var(--line); }
.tlaxis { flex: 1; display: flex; }
.tlaxis span { flex: 1; font-size: 11px; color: var(--muted); padding: 8px 0 6px 4px; border-left: 1px solid var(--line); }
.tltrack { flex: 1; position: relative; min-height: 46px; cursor: copy;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: calc(100% / 13) 100%; }
.tltrack .off { top: 0; bottom: 0; left: auto; right: auto; }
.blk { position: absolute; top: 6px; bottom: 6px; max-height: 34px; margin: auto 0; border-radius: 6px; font-size: 11px; padding: 0 5px; overflow: hidden; white-space: nowrap; line-height: 32px; z-index: 1; color: var(--ink2); }
.blk a { text-decoration: none; color: var(--ink); }
ul#id_people { list-style: none; padding: 0; columns: 2; }
.sched td { padding: 5px 6px; }
.sched input[type=time] { width: 92px; padding: 6px; }
.sched td { white-space: nowrap; }
.sched tr.dayoff input[type=time], .sched td.dayoff input[type=time] { opacity: .35; }
ul#id_people label { display: flex; gap: 6px; color: var(--ink); }

/* ---------- сообщения */
.unread { background: var(--accent); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; line-height: 18px; font-weight: 600; }
.wait { font-size: 11.5px; color: #8a5a00; background: var(--warn-bg); border-radius: 5px; padding: 0 6px; }
.wait.lvl1 { color: #fff; background: var(--danger); }
.wait.lvl2 { color: #fff; background: #9E0E07; font-weight: 600; animation: panic 1.2s ease-in-out infinite; }
@keyframes panic { 50% { background: var(--accent); } }
.chatwrap { display: flex; height: calc(100vh - 62px); margin: -22px -26px; border-radius: 14px; overflow: hidden; }
.tlist { width: 380px; flex: none; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #FCFCFD; }
.tsearch { padding: 12px 12px 6px; }
.ttabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.ttabs a { font-size: 12.5px; padding: 3px 9px; border-radius: 7px; text-decoration: none; color: var(--ink2); }
.ttabs a.on { background: var(--accent-soft); color: var(--accent); }
.titems { overflow-y: auto; flex: 1; }
.titem { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); text-decoration: none; }
.titem:hover { background: var(--hover); }
.titem.on { background: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.tr1, .tr2, .tr3 { display: flex; align-items: center; gap: 6px; }
.tr1 .tname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tr2 { margin-top: 2px; } .tr2 .tlast { flex: 1; min-width: 0; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr3 { margin-top: 4px; } .tr3:empty { display: none; }
.titem.hasnew .tname { font-weight: 700; }
.titem.hasnew .tlast { color: var(--ink2); }
.newline { display: flex; align-items: center; gap: 10px; color: var(--accent); font-size: 12px; font-weight: 600; margin: 6px 0; }
.newline::before, .newline::after { content: ""; flex: 1; height: 1px; background: var(--accent-line); }
.unread[hidden], .bellcount[hidden] { display: none; }
.tback { display: block; padding: 10px 14px; text-decoration: none; color: var(--accent); font-size: 13px; border-bottom: 1px solid var(--line); }
.tfolder { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.tfolder b { flex: 1; }
.ticon { color: var(--muted); font-weight: 600; width: 14px; text-align: center; }
.titem.topic { padding-left: 18px; }
.ttopic { color: var(--ink2); }
.kind { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.k-client { background: var(--accent); } .k-internal { background: var(--info); } .k-leads { background: var(--ok); }
.tview { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.thead { display: flex; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.tlinks { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tlinks select { width: auto; max-width: 230px; height: 32px; padding: 4px 8px; font-size: 13px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 20px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 72%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; position: relative; align-self: flex-start; }
.msg.team { align-self: flex-end; background: #FFF4F2; border-color: #F8D7D3; }
.msg .mh { font-size: 12px; margin-bottom: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.msg .mt { white-space: normal; word-break: break-word; }
.tagc { font-size: 10.5px; background: var(--info-bg); color: var(--info); border-radius: 4px; padding: 0 4px; }
.mtask { position: absolute; top: 4px; right: 6px; display: none; }
.msg:hover .mtask { display: block; }
.mtask button { border: 1px solid var(--line2); background: #fff; border-radius: 6px; font-size: 11px; cursor: pointer; padding: 1px 6px; color: var(--ink2); }
.reply { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); align-items: flex-end; }
.reply textarea { flex: 1; }
.empty { margin: auto; text-align: center; color: var(--ink2); max-width: 360px; }

@media (max-width: 860px) {
  .chatwrap { flex-direction: column; height: auto; margin: 0; }
  .tlist { width: auto; max-height: 40vh; }
  .layout { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; }
  .side .label, .side .me, .search { display: none; }
  .main { margin: 0; border-radius: 0; padding: 16px; }
  .cols { grid-template-columns: 1fr; }
  .props { grid-template-columns: 130px 1fr; }
}

/* ---------- настройки */
.setup { display: flex; gap: 22px; align-items: flex-start; }
.snav { flex: 0 0 214px; position: sticky; top: 14px; display: flex; flex-direction: column; gap: 1px; }
.snav-h { font-size: 12px; color: var(--muted); margin: 2px 10px 6px; text-transform: uppercase; letter-spacing: .06em; }
.snav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; text-decoration: none; color: var(--ink2); }
.snav a:hover { background: var(--hover); }
.snav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.snav .si { width: 20px; text-align: center; flex: none; }
.snav a.adv { color: var(--muted); font-size: 13px; }
.snav-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.sbody { flex: 1; min-width: 0; max-width: 1080px; }
.lead { margin: -8px 0 18px; max-width: 760px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.sgrid.two { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
.sgrid.two > .card, .sgrid.two > form.card { margin-bottom: 0; }
.sgrid.two > div > .card { margin-bottom: 14px; }
.scard { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; transition: box-shadow .15s, border-color .15s; position: relative; overflow: hidden; }
.scard:hover { box-shadow: var(--shadow); border-color: var(--line2); }
.scard:hover .sc-go { color: var(--accent); transform: translateX(2px); }
.scard.warn { border-color: var(--accent-line); }
.scard.warn::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.sc-top { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.sc-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; font-size: 16px; flex: none; }
.sc-go { margin-left: auto; color: var(--muted); transition: transform .15s; }
.sc-val { font-size: 18px; font-weight: 600; margin: 12px 0 4px; letter-spacing: -.01em; }
.sc-ok { font-size: 12.5px; color: var(--muted); }
.sc-warn { font-size: 12.5px; color: var(--danger); }
.fld { margin-bottom: 12px; min-width: 0; }
.fld > label { font-weight: 500; }
.fld .req { color: var(--accent); font-style: normal; }
.fld .static { padding: 8px 0; color: var(--ink2); }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.frow.three { grid-template-columns: 1fr 1fr 2fr; }
.swrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line);
  cursor: pointer; margin: 0; color: var(--ink); font-size: 14px; }
.swrow .swtext b { font-weight: 500; display: block; }
input.sw { appearance: none; -webkit-appearance: none; width: 40px; height: 23px; border-radius: 12px; background: #D7D8DE; position: relative;
  cursor: pointer; flex: none; margin: 0; transition: background .18s; }
input.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .18s; }
input.sw:checked { background: var(--accent); }
input.sw:checked::after { left: 20px; }
input.sw:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.chipset > div { display: flex; flex-wrap: wrap; gap: 6px; }
.chipset > div > div { display: contents; }
.chipset label { display: inline-flex; align-items: center; margin: 0; padding: 5px 12px; border: 1px solid var(--line2); border-radius: 999px;
  cursor: pointer; color: var(--ink2); background: #fff; user-select: none; transition: all .12s; position: relative; }
.chipset label:hover { border-color: var(--accent-line); }
.chipset input { position: absolute; opacity: 0; pointer-events: none; }
.chipset label:has(input:checked) { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); font-weight: 500; }
.chipset label:has(input:checked)::before { content: "\2713"; margin-right: 5px; }
.sbar { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 12px 0; background: linear-gradient(transparent, var(--panel) 30%); margin-top: 6px; z-index: 3; }
.sbar.flat { position: static; background: none; padding-bottom: 0; }
.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--bg); color: var(--ink2); margin: 0 4px 4px 0; }
.pill.danger { background: var(--danger-bg); color: var(--danger); }
.flags { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12.5px; }
.flags span { color: #B5B7BF; }
.flags span::before { content: "\2715  "; }
.flags span.y { color: var(--ok); }
.flags span.y::before { content: "\2713  "; }
.badge.dark { background: var(--ink); color: #fff; }
.who { display: flex; align-items: center; gap: 10px; }
.stable tr.off td { opacity: .5; }
.rows tr.sel td { background: var(--accent-soft); }
.dim { opacity: .4; pointer-events: none; }
.sticky { position: sticky; top: 14px; }
.tablewrap { overflow-x: auto; }
.melink { flex: 1; min-width: 0; text-decoration: none; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
.melink:hover { background: var(--hover); }
.bignum { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 10px; }
.bignum.bad { color: var(--danger); }
ul.checks { list-style: none; padding: 0; margin: 0; }
ul.checks li { padding: 5px 0 5px 24px; position: relative; }
ul.checks li::before { content: "\2713"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
/* этапы воронки */
#stages { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.stage { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; border-left: 4px solid #C9CBD3; }
.stage.k-won { border-left-color: var(--ok); }
.stage.k-lost { border-left-color: var(--danger); }
.stage.err { border-color: var(--danger); }
.stage.gone { opacity: .45; }
.stage.gone .st-name input { text-decoration: line-through; }
.st-main { display: flex; align-items: center; gap: 10px; padding: 7px 10px; }
.st-main .handle { cursor: grab; color: var(--muted); padding: 0 2px; user-select: none; }
.st-name { flex: 1; min-width: 120px; }
.st-name input { border-color: transparent; font-weight: 500; }
.st-name input:hover { border-color: var(--line2); }
.st-kind select { width: 120px; }
.st-limit { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.st-limit input { width: 64px; }
.st-deals { width: 74px; text-align: right; }
.st-more { display: none; padding: 4px 14px 10px 36px; border-top: 1px solid var(--line); }
.stage.open .st-more { display: block; }
.del { margin: 0; cursor: pointer; display: inline-flex; align-items: center; opacity: .55; }
.del:hover, .del:has(input:checked) { opacity: 1; }
.del input { display: none; }
/* шкала ответа клиенту */
.timeline { display: flex; margin: 0 0 18px; background: var(--bg); border-radius: var(--radius); padding: 14px 18px; }
.tl-step { flex: 1; display: flex; flex-direction: column; gap: 2px; position: relative; padding-top: 20px; font-size: 13px; }
.tl-step::before { content: ""; position: absolute; top: 5px; left: 0; right: 0; height: 2px; background: var(--line2); }
.tl-step .tl-dot { position: absolute; top: 0; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.tl-step.lvl1 .tl-dot { background: var(--danger); }
.tl-step.lvl2 .tl-dot { background: #9E0E07; }
.tl-step b { font-size: 15px; }
.tl-step span:last-child { color: var(--ink2); padding-right: 14px; }
@media (max-width: 860px) {
  .setup { flex-direction: column; gap: 10px; }
  .snav { position: static; flex: none; width: 100%; flex-direction: row; overflow-x: auto; gap: 4px; }
  .snav-h, .snav-sep { display: none; }
  .snav a { white-space: nowrap; }
  .sgrid.two { grid-template-columns: 1fr; }
  .frow, .frow.three { grid-template-columns: 1fr; }
  .timeline { flex-direction: column; gap: 12px; }
  .st-main { flex-wrap: wrap; }
}

/* ---------- воронки и сделки как в WEEEK (входящие, подбор) */
.wboard { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding: 12px; margin: 0 -12px; background: var(--bg);
  border-radius: var(--radius); min-height: calc(100vh - 150px); }
.wcol { flex: 0 0 268px; display: flex; flex-direction: column; gap: 8px; }
.wcol-h { background: var(--panel); border-radius: 10px; padding: 9px 12px 8px; border: 1px solid var(--line); }
.wcol-t { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.wcol-t span:last-child { overflow: hidden; text-overflow: ellipsis; }
.wcol-t .dots { color: #C5C7CF; font-size: 12px; }
.wcol-s { font-size: 12px; color: var(--muted); margin: 8px 0 0 20px; }
.wcol-s b { color: var(--accent); font-weight: 500; }
.wcol.won .wcol-h { box-shadow: inset 0 3px 0 var(--ok); }
.wcol.lost .wcol-h { box-shadow: inset 0 3px 0 var(--danger); }
.wadd { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; color: var(--muted); text-decoration: none; font-size: 13px; }
.wadd:hover { color: var(--accent); border-color: var(--accent-line); }
.wadd span { font-size: 16px; line-height: 1; }
button.wadd { width: 100%; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.wqnew { display: block; background: var(--panel); border: 1px solid var(--accent-line); border-radius: 10px; padding: 10px; }
.wqnew textarea { width: 100%; border: 0; resize: none; padding: 0; font: inherit; font-size: 13.5px; background: none; outline: none; }
.wqnew[hidden], .wadd[hidden] { display: none; }
.wqnew-a { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.wqnew-a small { margin-left: auto; color: var(--muted); font-size: 11px; }
.wcol .drop { gap: 8px; min-height: 80px; }
/* доска по высоте экрана (включается скриптом на широком экране) */
.board.fit, .wboard.fit { align-items: stretch; overflow-y: hidden; min-height: 0; scrollbar-width: auto; }
.board.fit > .col, .wboard.fit > .wcol { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.board.fit .drop, .wboard.fit .drop { flex: 1 1 auto; min-height: 60px; overflow-y: auto; padding: 0 4px 6px 0; margin-right: -4px; scrollbar-width: thin; }
.board.fit > .col { align-self: flex-start; }
.board.fit, .wboard.fit { cursor: grab; }
.board.fit.panning, .wboard.fit.panning { cursor: grabbing; user-select: none; }
.board.fit .deal, .wboard.fit .wcard, .board.fit .drop, .wboard.fit .drop { cursor: pointer; }
.wcard { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 10px;
  text-decoration: none; cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.wcard:hover { box-shadow: var(--shadow); border-color: var(--line2); }
.wcard.meet-critical { border-color: var(--danger); }
.wc-t { font-size: 13.5px; color: var(--ink); word-break: break-word; margin-bottom: 10px; }
.wc-m { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.wc-late { margin-left: auto; color: var(--danger); }
.av.xs { width: 20px; height: 20px; font-size: 8.5px; }
.av.xs.none { background: #fff; color: var(--muted); border: 1px dashed #C5C7CF; }
.av.sq { border-radius: 6px; background: var(--bg); color: var(--ink2); }
.wc-task { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 6px 0 8px; border-top: 2px solid var(--line); margin-bottom: 6px; }
.wc-task.over { border-top-color: var(--danger); }
.wc-task .ck { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid #B9BCC6; flex: none; }
.wc-task i { margin-left: auto; font-style: normal; color: var(--muted); font-size: 11px; }
.wc-task.over i { color: var(--danger); }
.wc-sum { background: var(--bg); border-radius: 6px; padding: 4px 9px; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.wc-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wc-chips span { display: flex; align-items: center; gap: 7px; background: var(--bg); border-radius: 7px; padding: 6px 8px; font-size: 12.5px;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wc-chips span:only-child { grid-column: 1 / -1; }
.wc-chips i { font-style: normal; font-size: 8.5px; color: var(--muted); flex: none; }
.wcard .chip { margin: 0 0 8px; }
.deal-panel { width: min(700px, 100%); overflow: hidden; }
.deal-panel iframe { border: 0; width: 100%; height: 100%; display: block; }
/* встроенная страница (сделка в панели справа) */
.layout.embed .main { margin: 0; border: 0; border-radius: 0; padding: 0 24px 0; min-height: 100vh; }
/* карточка сделки */
.wd { max-width: 720px; margin: 0 auto; padding-bottom: 8px; }
.wd.in-panel { max-width: none; }
.wd-crumb { margin-bottom: 8px; }
.wd-top { display: flex; align-items: center; gap: 10px; padding: 18px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.in-panel .wd-top { position: sticky; top: 0; background: var(--panel); z-index: 5; }
.wd-top form { margin: 0; }
.wbtn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 9px; border: 0; cursor: pointer; font-weight: 500; }
.wbtn i { width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; }
.wbtn.win { background: var(--ok-bg); color: var(--ok); }
.wbtn.lose { background: var(--danger-bg); color: var(--danger); }
.wbtn:hover { filter: brightness(.97); }
.wstatus { padding: 7px 14px; border-radius: 9px; font-weight: 500; }
.wstatus.won { background: var(--ok-bg); color: var(--ok); }
.wstatus.open { background: var(--hover); color: var(--ink2); }
.wguar { display: inline-block; background: #EAF2FF; color: #2558B8; border-radius: 8px; padding: 5px 10px; font-size: 12.5px; margin: -4px 0 12px; }
.wguar a { color: inherit; }
.wguar.done, .wc-guar.done { background: var(--hover); color: var(--ink2); }
.wc-guar { display: inline-block; background: #EAF2FF; color: #2558B8; border-radius: 6px; padding: 2px 8px; font-size: 11.5px; margin: -4px 0 8px; }
.wmenu { position: relative; }
.wmenu > summary { list-style: none; }
.wmenu > summary::-webkit-details-marker { display: none; }
.wmenu-list { position: absolute; right: 0; top: 36px; z-index: 20; min-width: 240px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; }
.wmenu-list form { margin: 0; }
.wmenu-list button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px;
  font: inherit; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.wmenu-list button:hover { background: var(--hover); }
.wmenu-list button.danger { color: var(--danger); }
.wstatus.lost { background: var(--danger-bg); color: var(--danger); }
.wd-author { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.wd-author .av { vertical-align: middle; }
.wicon { width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 8px; cursor: pointer;
  color: var(--muted); font-size: 16px; text-decoration: none; }
.wicon:hover { background: var(--hover); color: var(--ink); }
.wsteps { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; scrollbar-width: thin; }
.wstep { flex: 1 0 auto; min-width: 70px; max-width: 220px; border: 0; background: none; cursor: pointer; padding: 0 2px 8px; text-align: left;
  font-size: 12.5px; color: var(--ink2); border-bottom: 3px solid var(--line); display: flex; gap: 6px; white-space: nowrap; }
.wstep span { overflow: hidden; text-overflow: ellipsis; }
.wstep:hover { border-bottom-color: var(--line2); color: var(--ink); }
.wstep.done { color: var(--ok); border-bottom-color: #9ED8B5; }
.wstep.done span { text-decoration: line-through; }
.wstep.cur { color: var(--ink); font-weight: 600; border-bottom-color: var(--ok); }
.wstep.cur i { font-style: normal; font-weight: 400; color: var(--muted); }
.wstep.won:not(.cur) { color: var(--muted); }
.wd-title { font-size: 25px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 8px; cursor: text; word-break: break-word; }
.wd-title-input { font-size: 22px !important; font-weight: 600; margin-bottom: 8px; }
.wd-acts { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap; }
.wd-acts a, .wd-acts label { color: var(--muted); text-decoration: none; cursor: pointer; margin: 0; font-size: 13px; }
.wd-acts a:hover, .wd-acts label:hover { color: var(--accent); }
.wfields { display: flex; flex-direction: column; margin-bottom: 14px; }
.wf { display: grid; grid-template-columns: 190px 1fr; align-items: center; min-height: 36px; gap: 10px; }
.wf.top { align-items: start; padding-top: 6px; }
.wf-l { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-l b { width: 16px; text-align: center; font-weight: 400; font-size: 13px; flex: none; }
.wf-v { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.wf-v.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.wf-v input:not([type=checkbox]), .wf-v select.bare { border: 1px solid transparent; background: transparent; padding: 6px 8px; margin-left: -8px; border-radius: 7px;
  font: inherit; color: var(--ink); width: 100%; box-shadow: none; }
.wf-v input:not([type=checkbox]):hover, .wf-v select.bare:hover { background: var(--hover); }
.wf-v input:not([type=checkbox]):focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wf-v input::placeholder { color: #C0C2CA; }
.wf-v input.ok { background: var(--ok-bg); }
.wf-v input.bad { border-color: var(--danger); background: var(--danger-bg); }
.wf-v em { font-style: normal; color: var(--ink2); font-weight: 500; }
.wf-v form { margin: 0; width: 100%; }
.wf-open { text-decoration: none; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.wf-open:hover { background: var(--hover); color: var(--accent); }
.pjx { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 8.5px; font-weight: 700; margin-right: 4px; }
.who2 { display: flex; align-items: center; gap: 10px; }
.who2 small { display: block; color: var(--muted); font-size: 12px; }
.who2 a { text-decoration: none; }
details.attach summary { display: inline-block; background: none; padding: 4px 0; color: #B5B7BF; cursor: pointer; list-style: none; font-size: 13.5px; }
details.attach summary::-webkit-details-marker { display: none; }
details.attach summary:hover { color: var(--accent); }
form.mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
form.mini input:not([type=checkbox]) { flex: 1 1 140px; width: auto; margin: 0; border: 1px solid var(--line2) !important; background: #fff !important; }
form.mini.row { flex-wrap: nowrap; margin: 0; }
form.mini.row input[type=datetime-local] { flex: 0 0 190px; }
label.ck { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 12.5px; white-space: nowrap; }
.wd-hint { background: var(--info-bg); border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 12px; color: var(--ink2); }
.wd-desc { border: 0 !important; border-top: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important;
  padding: 16px 2px !important; font-size: 14.5px; min-height: 64px; box-shadow: none !important; resize: none; overflow: hidden; margin-bottom: 8px; }
.wd-desc::placeholder { color: #B5B7BF; }
.wsec { border-bottom: 1px solid var(--line); padding: 10px 0; }
.wsec > summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.wsec > summary::-webkit-details-marker { display: none; }
.wsec > summary::before { content: "›"; color: var(--muted); font-size: 18px; line-height: 1; transition: transform .15s; width: 12px; }
.wsec[open] > summary::before { transform: rotate(90deg); }
.wcount { color: var(--muted); font-weight: 400; font-size: 13px; }
.wsec-act { margin: 0 0 0 auto; font-weight: 400; font-size: 13px; color: var(--ink2); cursor: pointer; }
.wsec-act:hover { color: var(--accent); }
.wsec .card { border: 0; padding: 4px 0; margin: 0; }
.wsec .card h2 { display: none; }
.wnew { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.wnew > span { color: var(--muted); font-size: 16px; }
.wnew #newTask { flex: 1; border-color: transparent; }
.wnew #newTask:focus { border-color: var(--accent); }
.wnew input[type=datetime-local] { width: 190px; }
.wnew select { width: 150px; }
.wthread { padding: 6px 0; }
.wfile { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.wfile a { flex: 1; text-decoration: none; }
.wfile form { margin: 0; }
.wcomments { padding: 14px 0 6px; }
.wcomment { display: flex; gap: 10px; padding: 8px 0; }
.wnocom { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0 10px; }
.wcomment-form { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 0; background: var(--panel); padding: 10px 0 14px; }
.wcomment-form textarea { resize: none; border-radius: 12px; background: var(--bg); border-color: var(--bg); min-height: 42px; }
@media (max-width: 560px) {
  .wf { grid-template-columns: 120px 1fr; }
  .wd-top { flex-wrap: wrap; }
  form.mini.row, .wnew { flex-wrap: wrap; }
}

/* ---------- защита данных (все, кроме директора и ролей с «Может копировать») */
body.protect { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.protect input, body.protect textarea, body.protect select, body.protect [contenteditable] { -webkit-user-select: text; user-select: text; }
.wmark { position: fixed; inset: 0; z-index: 9999; pointer-events: none; background-repeat: repeat; }
@media print { body.protect > * { display: none !important; }
  body.protect::after { content: "Печать из CRM недоступна"; display: block; padding: 40px; font-size: 20px; } }

/* ---------- мониторинг hh.ru (программа мониторинга → холодные продажи) */
.mtiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.mtile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.mtile b { display: block; font-size: 26px; font-weight: 600; color: var(--accent); line-height: 1.1; }
.mtile span { font-size: 12.5px; color: var(--muted); }
.mbar { align-items: center; }
.mbar .seg { flex-wrap: wrap; }
.mbar .tb { height: 32px; font-size: 13px; }
.msearch { max-width: 260px; margin-left: auto; }
.mtable { padding: 0; overflow: hidden; }
.mrow { display: grid; grid-template-columns: minmax(0, 1fr) 150px 90px 200px; gap: 12px; align-items: center; padding: 11px 16px; }
.mhead { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--bg); }
.mhead a { color: inherit; text-decoration: none; } .mhead a.on { color: var(--accent); font-weight: 600; }
.mco { border-bottom: 1px solid var(--line); }
.mco > summary { list-style: none; cursor: pointer; }
.mco > summary::-webkit-details-marker { display: none; }
.mco > summary:hover { background: var(--hover); }
.mname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mname a { color: var(--ink); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mname i { font-style: normal; color: var(--muted); transition: transform .15s; }
.mco[open] .mname i { transform: rotate(90deg); }
.mdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mdot.ok { background: var(--ok); } .mdot.new { background: var(--accent); }
.mcount { display: inline-block; min-width: 32px; text-align: center; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.mdays { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mbarline { flex: 1; height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.mbarline i { display: block; height: 100%; max-width: 100%; background: var(--ok); }
.mbarline i.mid { background: #D9A400; } .mbarline i.old { background: var(--danger); }
.mvacs { padding: 4px 16px 12px 40px; background: var(--bg); }
.mvac { display: grid; grid-template-columns: minmax(0, 1fr) 170px 150px auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.mvac:last-child { border-bottom: 0; }
.mvac.isnew .mvn { font-weight: 600; }
.mvn { color: var(--ink); text-decoration: none; } .mvn:hover { color: var(--accent); }
.mright { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.mpages { justify-content: center; margin: 14px 0; }
.regframe { width: 100%; height: calc(100vh - 130px); border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 860px) { .mrow { grid-template-columns: minmax(0, 1fr) 70px; } .mrow > :nth-child(2), .mrow > :nth-child(4) { display: none; }
  .mvac { grid-template-columns: 1fr; } .mtiles { grid-template-columns: 1fr; } .msearch { max-width: none; margin: 0; } }

.side .nav.sub { padding-left: 28px; font-size: 13px; }

/* ---------- новая сделка / редактирование: как карточка воронки */
.dform { max-width: 760px; }
.dpipes { margin: 4px 0 8px; }
.dcard { padding: 18px 22px; }
.dcard .wf { min-height: 42px; border-bottom: 1px solid var(--line); }
.dcard .wf:last-child { border-bottom: 0; }
.dcard .wf.bad .wf-l { color: var(--danger); }
.dcard .wf-v input:not([type=checkbox]), .dcard .wf-v select { width: 100%; }
.dcard .wf-v em { font-style: normal; color: var(--muted); font-size: 12px; }
.ferr { color: var(--danger); font-size: 12.5px; margin: -4px 0 6px 200px; }
.dupwarn { background: #FEF3C7; border: 1px solid #D97706; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; color: #92400E; }
.dupwarn a { color: inherit; } .dupwarn .ck { display: flex; gap: 6px; align-items: center; margin-top: 8px; font-weight: 600; }
@media (max-width: 560px) { .ferr { margin-left: 0; } }
.dcard .inline .btn { flex: none; }

/* ---------- карточка холодной сделки — как окно лида в hh-crm, в наших цветах */
.lead { max-width: 640px; margin: 0 auto; }
.lead.in-modal { max-width: none; padding: 26px 28px 22px; }
.lead-h { display: flex; align-items: center; gap: 6px; }
.lead-h h2 { flex: 1; font-size: 21px; font-weight: 600; margin: 0; }
.lead .msub { color: var(--muted); font-size: 13px; margin: 4px 0 18px; line-height: 1.55; }
.lead .msub a { color: var(--accent); }
.lead .ll { display: block; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin: 0 0 6px; }
.lead input:not([type=checkbox]), .lead select, .lead textarea { width: 100%; font: inherit; font-size: 14px; padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--bg); margin: 0 0 16px; box-sizing: border-box; }
.lead input:focus, .lead select:focus, .lead textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.lead textarea { resize: vertical; min-height: 60px; }
.lead .ok { border-color: var(--ok) !important; } .lead .bad { border-color: var(--danger) !important; background: var(--danger-bg) !important; }
.lead .lopen { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--accent); margin-left: 6px; }
.lalert { border-radius: 12px; padding: 11px 14px; font-size: 13.5px; margin-bottom: 14px; }
.lalert.soon { background: #FEF3C7; border: 1.5px solid #FCD34D; color: #78350F; }
.lalert.critical { background: #FEE2E2; border: 1.5px solid #F87171; color: #7F1D1D; }
.lreason { display: flex; gap: 8px; margin: -8px 0 16px; } .lreason select { margin: 0; }
.mreminder { display: flex; gap: 12px; margin: -4px 0 16px; padding: 14px 16px; background: #FFF3CD; border: 1.5px solid #F59E0B; border-radius: 12px; }
.mreminder .mr-icon { font-size: 22px; } .mreminder .mr-title { font-weight: 700; color: #92400E; margin-bottom: 4px; }
.mreminder .mr-text { font-size: 13px; color: #78350F; line-height: 1.45; }
.mreminder .mr-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: #B45309; text-decoration: none; border-bottom: 1px dashed #B45309; }
.mreminder-alert { background: #FEE2E2; border-color: #EF4444; animation: pulse-border 2s ease-in-out infinite; }
.mreminder-alert .mr-title { color: #991B1B; }
.mreminder-alert .mr-text { color: #7F1D1D; }
.mreminder-alert .mr-link { color: #DC2626; border-bottom-color: #DC2626; }
@keyframes pulse-border { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); } 50% { box-shadow: 0 0 0 4px rgba(239,68,68,.15); } }
.mention-drop { position: absolute; bottom: calc(100% + 4px); left: 0; background: var(--card); border: 1.5px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.22); z-index: 9999; min-width: 200px; overflow: hidden; }
.mention-drop .mitem { padding: 9px 16px; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink); background: var(--card); }
.mention-drop .mitem:hover { background: var(--accent-soft); color: var(--accent); }
.ccard { background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 12px; padding: 16px 18px 4px; margin: 4px 0 18px; }
.ccard-t { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.ccard input:not([type=checkbox]), .ccard textarea { background: #fff; margin-bottom: 12px; }
.cmeet { border-top: 1px solid var(--accent-line); padding-top: 12px; margin-bottom: 12px; }
.cmrow { display: flex; align-items: center; gap: 10px; } .cmrow span { font-size: 12.5px; color: var(--muted); min-width: 100px; }
.cmrow input { flex: 1; margin-bottom: 8px !important; } .cmrow input.alert { border-color: var(--danger); background: var(--danger-bg); }
.lck { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); margin: 0 0 4px; }
.lrow { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 34px 10px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); margin-bottom: 8px; }
.lrow input:not([type=checkbox]), .lrow select { margin: 0 !important; font-size: 13px; padding: 7px 10px; background: #fff; }
.lrow .wide { grid-column: span 2; }
.lrow .ldel { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--danger); cursor: pointer; font-size: 13px; }
.ltask { border-color: #F59E0B; background: #FFFBEB; } .ltask.done { border-color: #86CFA0; background: #F0FDF4; } .ltask.over { border-color: var(--danger); background: var(--danger-bg); }
.lover { font-size: 11.5px; font-weight: 700; color: var(--danger); }
.lempty { margin: 0 0 8px; }
.ladd { font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; margin: 0 0 18px; }
.ladd:hover { background: var(--accent); color: #fff; }
.ldocs { margin-bottom: 8px; } .ldocs > summary { cursor: pointer; list-style: none; } .ldocs .card { box-shadow: none; }
.lactions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.lactions form { margin: 0; }
.ldanger { border: 0; background: none; color: var(--danger); font: inherit; font-size: 13px; cursor: pointer; } .ldanger:hover { text-decoration: underline; }
.lead-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(20, 24, 31, .45); display: none; justify-content: center; align-items: flex-start; padding: 30px 16px; }
.lead-wrap.open { display: flex; }
.lead-wrap iframe { width: min(660px, 100%); height: calc(100vh - 60px); border: 0; border-radius: 16px; background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.25); }

/* ---------- журнал действий (директор) */
.jnav { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.jlog { padding: 6px 0; }
.jrow { display: grid; grid-template-columns: 80px 1fr; gap: 10px; padding: 7px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.jrow:last-child { border-bottom: 0; }
.jrow .jt { font-variant-numeric: tabular-nums; color: var(--muted); } .jrow .ja { font-weight: 500; }
.jrow.visit { color: var(--muted); background: var(--bg); } .jrow.visit .ja { font-weight: 400; }
.jrow .jd a { color: var(--accent); }
@media (max-width: 560px) { .jrow { grid-template-columns: 60px 1fr; } .jrow .jd { grid-column: span 2; } }
.lreason[hidden] { display: none; }

.jpeople { display: flex; flex-direction: column; gap: 8px; }
.jperson { display: grid; grid-template-columns: 36px minmax(0, 1fr) 90px 150px 120px; gap: 14px; align-items: center; padding: 12px 16px; text-decoration: none; color: var(--ink); }
.jperson:hover { border-color: var(--accent-line); box-shadow: var(--shadow); }
.jperson.off { opacity: .7; }
.jperson .av { width: 34px; height: 34px; font-size: 12px; }
.jpn b, .jps b { display: block; } .jpn small, .jps small { color: var(--muted); font-size: 12px; }
.jps b { font-size: 18px; font-weight: 600; } .jps.last { font-size: 13px; }
.jdays { margin: -4px 0 12px; display: flex; gap: 8px; flex-wrap: wrap; } .jdays a { color: var(--muted); } .jdays a.on { color: var(--accent); font-weight: 600; }
.jrow.download { background: #FFFBEB; }
@media (max-width: 760px) { .jperson { grid-template-columns: 36px 1fr 70px; } .jperson .jps:nth-of-type(n+2) { display: none; } }
.jps.last small { display: block; }

/* ---------- блок «Проект» в карточке подбора (реестр проектов) */
.wproj { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 6px; margin: 4px 0 16px; background: var(--bg); }
.wproj-t { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink2); margin-bottom: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.wproj-t .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.wproj-d { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.wproj-d b { color: var(--accent); }
.wproj .wf-v input[type=date] { width: auto; }
.wcount { display: inline-flex; align-items: center; gap: 4px; }
.wcount input { width: 64px !important; text-align: center; margin: 0 !important; }
.wcount button { width: 28px; height: 28px; border: 1px solid var(--line2); background: #fff; border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1; }
.wcount button:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- реестр проектов подбора */
.regtable { padding: 0; overflow-x: auto; }
.regtable table { min-width: 1250px; }
.regtable th { position: sticky; top: 0; background: var(--bg); white-space: nowrap; }
.regtable td.rc { text-align: center; }
.regtable tr.rguar td { background: #EAF2FF; }
.wproj .wf { grid-template-columns: 250px 1fr; }
.wproj .wf-l { white-space: normal; }

/* ---------- реестр проектов: таблица как в Excel */
.xltop { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.xltop h1 { margin: 0; font-size: 20px; }
.xlfilters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.xlfilters select { height: 32px; padding: 0 8px; font-size: 13px; width: auto; }
.xlfilters .tb { height: 30px; font-size: 13px; }
.xlkpi { font-size: 12.5px; color: var(--muted); margin-left: auto; } .xlkpi b { color: var(--accent); }
.xlwrap { overflow: auto; border: 1px solid #D4D7DD; border-radius: 8px; background: #fff; }
table.xl { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
table.xl th, table.xl td { border-right: 1px solid #E1E3E8; border-bottom: 1px solid #E1E3E8; padding: 0; height: 26px; white-space: nowrap; }
table.xl th { position: sticky; top: 0; z-index: 3; background: #F3F4F6; font-weight: 600; font-size: 11.5px; color: #4B5160; padding: 4px 6px; white-space: normal; line-height: 1.2; text-align: left; }
table.xl td.c-no, table.xl th.c-no { position: sticky; left: 0; width: 34px; min-width: 34px; text-align: center; color: var(--muted); background: #F7F8FA; }
table.xl td.c-co, table.xl th.c-co { position: sticky; left: 34px; min-width: 150px; max-width: 190px; background: #fff; box-shadow: 1px 0 0 #D4D7DD; }
table.xl th.c-no, table.xl th.c-co { z-index: 4; background: #F3F4F6; }
table.xl td.c-no, table.xl td.c-co { z-index: 2; }
table.xl td.c-co a { display: block; padding: 0 6px; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
table.xl td.c-co a:hover { color: var(--accent); text-decoration: underline; }
table.xl input, table.xl select { width: 100%; height: 26px; border: 0; border-radius: 0; background: transparent; font: inherit; font-size: 12px; padding: 0 6px; margin: 0; box-shadow: none; }
table.xl input:focus, table.xl select:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: #fff; }
table.xl td.c-vac { min-width: 200px; position: relative; } table.xl td.c-vac .xg { position: absolute; right: 4px; top: 5px; font-size: 11px; }
table.xl td.c-d { min-width: 118px; } table.xl td.c-rec { min-width: 140px; } table.xl td.c-st { min-width: 190px; }
table.xl td.c-n { min-width: 54px; } table.xl td.c-n input { text-align: center; }
table.xl td.c-f { min-width: 64px; text-align: center; background: #F7F8FA; color: #2A2F3A; font-weight: 600; font-variant-numeric: tabular-nums; }
table.xl td.c-com { min-width: 220px; }
table.xl .xlst { padding: 0 6px; color: var(--muted); }
table.xl tr:hover td:not(.c-f):not(.c-no) { background: #FBFBFD; }
table.xl tr.paused td { background: #FFF7E6 !important; }
table.xl tr.guar td.c-vac { background: #EAF2FF; }
table.xl td.ok { box-shadow: inset 0 0 0 2px var(--ok); } table.xl td.bad { box-shadow: inset 0 0 0 2px var(--danger); }
table.xl tr.xladd td { background: #FAFAFB; } table.xl tr.xladd td.muted { padding: 0 8px; font-size: 11.5px; }
.xlrec { margin-top: 12px; } .xlrec summary { cursor: pointer; }
table.xl input[type=date][value=""]:not(:focus) { color: transparent; }
table.xl input[type=date][value=""]:hover { color: #B5B9C2; }
table.xl td.c-ar, table.xl th.c-ar { min-width: 58px; text-align: center; }
table.xl .xab { border: 0; background: none; cursor: pointer; font-size: 14px; padding: 2px 8px; border-radius: 5px; }
table.xl .xab:hover { background: var(--hover); }
table.xl .xco { display: block; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
table.xl td.c-g { min-width: 70px; }

/* ---------- меню слева в стиле WEEEK: линейные иконки, активный пункт — белая плашка */
svg.i { display: block; flex: none; }
.side { width: 244px; padding: 10px 8px; gap: 0; }
.ws { font-size: 15px; letter-spacing: -.01em; }
.bell { display: grid; place-items: center; color: #6F7480; }
.bell:hover { color: var(--ink); background: rgba(20, 24, 40, .06); }
.search { height: 32px; margin: 2px 2px 10px; background: #fff; border: 0; box-shadow: inset 0 0 0 1px var(--line); color: #9A9EA9; gap: 8px; }
.search:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); }
.search input { font-size: 13px; }
.side a.nav, .side .nav { height: 32px; padding: 0 10px; gap: 10px; font-size: 13.5px; color: #2B2E36; border-radius: 8px; flex: none; }
.side .ico { width: 18px; height: 18px; display: grid; place-items: center; color: #6F7480; font-size: 0; }
.side a.nav:hover { background: rgba(20, 24, 40, .05); }
.side a.nav:hover .ico { color: #2B2E36; }
.side a.nav.on { background: #fff; color: #14161B; font-weight: 500; box-shadow: 0 1px 2px rgba(16, 24, 40, .07), 0 0 0 1px rgba(16, 24, 40, .04); }
.side a.nav.on .ico { color: var(--accent); }
.side .nav.sub { padding-left: 30px; font-size: 13px; height: 30px; }
.side .label { font-size: 11.5px; font-weight: 500; color: #9A9EA9; margin: 16px 10px 4px; }
.side .label a { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: #9A9EA9; }
.side .label a:hover { background: rgba(20, 24, 40, .06); color: var(--ink); }
.side .unread { background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; line-height: 18px;
  border-radius: 9px; padding: 0 5px; text-align: center; }
.side .me { border-top: 1px solid var(--line); margin-top: auto; padding: 10px 6px 0; }
.side .me .av { width: 30px; height: 30px; font-size: 11px; }
.melogout { border: 0; background: transparent; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #9A9EA9; cursor: pointer; }
.melogout:hover { background: rgba(20, 24, 40, .06); color: var(--danger); }

/* ---------- сообщения как в Telegram, в фирменных цветах */
.chatwrap.tg { background: #fff; }
.tg .tlist { width: 360px; background: #fff; }
.tgtop { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; }
.tg .tsearch { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 19px; background: #F1F2F4; color: #9A9EA9; }
.tg .tsearch input { border: 0 !important; background: transparent !important; padding: 0 !important; height: 100%; box-shadow: none !important; font-size: 14px; outline: none; }
.tg .tsearch:focus-within { background: #fff; box-shadow: inset 0 0 0 2px var(--accent); }
.tgicon { width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: #707579; cursor: pointer; flex: none; }
.tgicon:hover { background: #F1F2F4; color: var(--ink); }
.tg .ttabs { padding: 2px 10px 8px; gap: 2px; border-bottom: 1px solid #EEF0F2; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tg .ttabs a { font-size: 13px; font-weight: 500; padding: 6px 11px; border-radius: 16px; color: #707579; white-space: nowrap; }
.tg .ttabs a:hover { background: #F1F2F4; }
.tg .ttabs a.on { background: var(--accent-soft); color: var(--accent); }
.tg .titems { padding: 4px 6px; }
.tg .titem { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border: 0; border-radius: 12px; margin-bottom: 1px; color: var(--ink); }
.tg .titem:hover { background: #F4F4F5; }
.tg .titem.on { background: var(--accent); box-shadow: none; }
.tg .titem.on, .tg .titem.on .tlast, .tg .titem.on .ttime, .tg .titem.on .tauthor, .tg .titem.on .ttopic, .tg .titem.on .tclient { color: #fff !important; }
.tg .titem.on .unread { background: #fff; color: var(--accent); }
.tgavl { width: 50px; height: 50px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 17px;
  position: relative; letter-spacing: .02em; background: #9AA0AA; }
.tgavl.hash { background: #E7E9EC; color: #707579; }
.tg .titem.on .tgavl.hash { background: rgba(255, 255, 255, .25); color: #fff; }
.tgavl .kdot { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #fff; background: #9AA0AA; }
.tgavl .kdot.k-client { background: #30A46C; } .tgavl .kdot.k-leads { background: #0090FF; }
.tg .tbody { flex: 1; min-width: 0; }
.tg .tr1 .tname { font-weight: 600; font-size: 14.5px; }
.tg .ttime { font-size: 12px; color: #9A9EA9; flex: none; }
.tg .tr2 { margin-top: 3px; }
.tg .tr2 .tlast { font-size: 13.5px; color: #707579; }
.tg .tauthor { color: var(--ink2); }
.tg .ttopic { color: var(--accent); font-weight: 500; margin-right: 2px; }
.tg .titem.hasnew .tname { font-weight: 700; }
.tg .unread { background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; min-width: 22px; height: 22px; line-height: 22px;
  border-radius: 11px; padding: 0 7px; text-align: center; flex: none; }
.tg .tr3 { margin-top: 3px; gap: 8px; } .tclient { font-size: 12px; color: #9A9EA9; }
.tforum { color: #9A9EA9; display: inline-flex; }
.tg .tback { display: flex; align-items: center; gap: 6px; padding: 8px 10px; color: var(--accent); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.tg .tfolder { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; border-bottom: 1px solid #EEF0F2; margin-bottom: 4px; }
.tg .tfolder .tgavl { width: 42px; height: 42px; font-size: 15px; }
/* шапка чата */
.tg .tview { background: #fff; }
.tg .thead { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid #EEF0F2; flex-wrap: nowrap; }
.tg .thead .tgavl { width: 42px; height: 42px; font-size: 15px; }
.thtitle { flex: 1; min-width: 0; } .thtitle b { font-size: 15px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thtitle .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .thtitle a { color: var(--accent); }
.tg .tlinks { display: none; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #EEF0F2; background: #FAFAFB; flex-wrap: wrap; }
.tg .tlinks.open { display: flex; }
.tg .tlinks label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: #9A9EA9; min-width: 200px; }
.tg .tlinks select { height: 32px; font-size: 13px; }
/* лента сообщений */
.tgbg { background-color: #F3EEEA; background-image: radial-gradient(rgba(226, 38, 43, .07) 1.2px, transparent 1.3px); background-size: 22px 22px; }
.tg .msgs { padding: 12px 8% 16px; gap: 2px; }
.tgday { display: flex; justify-content: center; margin: 12px 0 8px; position: sticky; top: 4px; z-index: 2; }
.tgday span { background: rgba(70, 50, 45, .38); color: #fff; font-size: 12.5px; font-weight: 500; padding: 4px 11px; border-radius: 14px; }
.tg .newline { margin: 10px -8%; padding: 4px 0; background: rgba(255, 255, 255, .7); color: var(--accent); justify-content: center; }
.tg .newline::before, .tg .newline::after { display: none; }
.tgm { display: flex; align-items: flex-end; gap: 8px; position: relative; max-width: 100%; }
.tgm.first { margin-top: 6px; }
.tgm.out { justify-content: flex-end; }
.tgav { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; }
.tgb { max-width: min(560px, 72%); background: #fff; border-radius: 16px; padding: 6px 10px 6px 11px; box-shadow: 0 1px 1.5px rgba(60, 40, 40, .13); position: relative; }
.tgm.in .tgb { border-bottom-left-radius: 6px; } .tgm.in:not(.last) .tgb { border-top-left-radius: 6px; }
.tgm.in.first .tgb { border-top-left-radius: 16px; }
.tgm.out .tgb { background: #FFE2DE; border-bottom-right-radius: 6px; } .tgm.out:not(.last) .tgb { border-top-right-radius: 6px; }
.tgm.out.first .tgb { border-top-right-radius: 16px; }
.tgm.in.last .tgb::before { content: ""; position: absolute; left: -6px; bottom: 0; width: 12px; height: 14px; background: #fff;
  clip-path: path("M12 0 C12 8 9 13 0 14 L12 14 Z"); }
.tgm.out.last .tgb::after { content: ""; position: absolute; right: -6px; bottom: 0; width: 12px; height: 14px; background: #FFE2DE;
  clip-path: path("M0 0 C0 8 3 13 12 14 L0 14 Z"); }
.tgn { font-size: 13px; font-weight: 600; margin-bottom: 1px; display: flex; gap: 6px; align-items: center; }
.tgc { font-size: 10.5px; font-weight: 600; color: #30A46C; background: #E6F6EC; border-radius: 6px; padding: 0 5px; }
.tgt { font-size: 14.5px; line-height: 1.38; word-break: break-word; white-space: normal; }
.tgt a { color: #0B70D4; }
.tgtime { float: right; margin: 6px 0 -4px 10px; font-size: 11.5px; color: #8E9399; display: inline-flex; align-items: center; gap: 2px; position: relative; top: 4px; }
.tgm.out .tgtime { color: #C46A63; }
.tgtask { display: none; align-self: center; margin: 0; }
.tgm:hover .tgtask { display: block; }
.tgtask button { border: 0; background: rgba(255, 255, 255, .85); width: 30px; height: 30px; border-radius: 50%; color: #707579; cursor: pointer; display: grid; place-items: center; }
.tgtask button:hover { color: var(--accent); }
.tgm.out .tgtask { order: -1; }
.tgempty { margin: auto; background: rgba(70, 50, 45, .32); color: #fff; padding: 6px 14px; border-radius: 16px; font-size: 13.5px; }
.tgempty.big { font-size: 14px; }
.tg .empty.tgbg { flex: 1; display: flex; }
/* строка ответа */
.tgreply { display: flex; align-items: flex-end; gap: 8px; padding: 10px 8% 14px; background: transparent; border: 0; }
.tg .reply.tgreply { border-top: 0; }
.tgreply textarea { flex: 1; resize: none; border: 0 !important; border-radius: 22px !important; padding: 11px 16px !important; min-height: 44px; max-height: 160px;
  font-size: 14.5px; box-shadow: 0 1px 2px rgba(60, 40, 40, .15) !important; background: #fff !important; line-height: 1.4; }
.tgsend { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 1px 3px rgba(226, 38, 43, .35); flex: none; }
.tgsend:hover { filter: brightness(1.06); } .tgsend:disabled { opacity: .45; cursor: default; }
.tgsend .i { transform: translateX(-1px); }
.tg section.tview { display: flex; flex-direction: column; }
.tg .tview .msgs, .tg .tview .tgreply { }
.tview:has(.tgbg) { background: #F3EEEA; }
@media (max-width: 860px) { .tg .tlist { width: auto; } .tg .msgs, .tgreply { padding-left: 10px; padding-right: 10px; } .tgb { max-width: 86%; } }
.chatwrap.tg { height: calc(100vh - 16px); margin-bottom: -22px; }
.tgday { position: static; }
.side .search, .side .wsrow, .side .me, .side .label { flex: none; }
.tg .ttabs { flex-wrap: wrap; overflow: visible; gap: 4px; padding: 2px 10px 10px; }
.tg .ttabs a { padding: 5px 10px; font-size: 12.5px; background: #F4F4F5; }
.tg .ttabs a.on { background: var(--accent-soft); }
/* оплаты в карточке */
.wpay { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.wpay select.bare { width: auto !important; flex: none; padding-right: 22px; }
.wpay label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.wpay label.paid { color: var(--ok); font-weight: 600; }
.wpay input[type=date] { width: auto !important; flex: none; }
.cpay { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cpayh { margin: 4px 0 6px; }
/* ---------- отчёт-дашборд */
.rtop { flex-wrap: wrap; gap: 10px; }
.rtools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rtools .tb { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; height: 36px; }
.rtools .tb input[type=date] { border: 0; padding: 0; width: auto; height: auto; }
.rtools .tb select { border: 0; height: auto; padding: 0 4px; }
.mswitch { display: inline-flex; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; height: 36px; overflow: hidden; }
.mswitch a, .mswitch .off { width: 32px; height: 100%; display: grid; place-items: center; color: var(--ink2); text-decoration: none; font-size: 18px; }
.mswitch a:hover { background: var(--accent-soft); color: var(--accent); }
.mswitch .off { color: #D0D3D9; }
.mswitch b { padding: 0 10px; min-width: 120px; text-align: center; font-size: 14px; }
.seg.sm a { padding: 6px 10px; font-size: 13px; }
.rsub { margin: -6px 0 14px; }
.kpirow { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.kpi.big { background: linear-gradient(135deg, #fff 0%, var(--accent-soft) 140%); border-color: #F5C6C4; }
.kl { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.kv { font-size: 22px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.kv.warn { color: #C2410C; }
.ks { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kbar { height: 6px; border-radius: 3px; background: #F1E3E2; margin-top: 10px; overflow: hidden; }
.kbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.rfun { margin-bottom: 14px; }
.rfh { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.rfh h2 { margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips span { background: #F4F4F5; border-radius: 16px; padding: 4px 10px; font-size: 12.5px; color: var(--ink2); }
.chips span.ok { background: #E6F6EC; color: #1E7A4A; } .chips span.bad { background: #FDECEC; color: #B42318; }
.tscroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.rt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rt th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: right; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: bottom; line-height: 1.25; }
.rt th span { font-weight: 400; color: #A3A7B0; }
.rt td { text-align: right; padding: 7px 8px; border-bottom: 1px solid #F1F2F4; white-space: nowrap; }
.rt .st { text-align: left; white-space: normal; min-width: 190px; }
.rt tbody tr:hover td { background: #FBFBFC; }
.rt tr.won td { background: #F5FBF7; }
.rt tr.tot td { font-weight: 600; border-top: 2px solid var(--line); }
.rt .fc { min-width: 110px; }
.rbar { position: relative; display: flex; align-items: center; justify-content: flex-end; height: 24px; }
.rbar i { position: absolute; left: 0; top: 4px; bottom: 4px; background: var(--accent-soft); border-radius: 5px; max-width: 100%; }
.rbar i.won { background: #CDEBD8; }
.rbar b { position: relative; padding-right: 2px; }
.rt .rwk { color: var(--ink2); background: #FCFCFD; } .rt th.rwk { background: #FCFCFD; }
.rt .wp { color: #A3A7B0; font-size: 12px; margin-left: 1px; }
.rt .neg { color: #B42318; font-weight: 600; } .rt .pos { color: #1E7A4A; font-weight: 600; }
.pp { display: inline-block; min-width: 44px; text-align: center; border-radius: 10px; padding: 1px 7px; font-weight: 600; font-size: 12.5px; }
.pp.good { background: #E6F6EC; color: #1E7A4A; } .pp.mid { background: #FFF4E0; color: #B45309; } .pp.low { background: #FDECEC; color: #B42318; }
input.plan { width: 64px; height: 28px; padding: 2px 6px; text-align: right; border: 1px dashed #D8DBE0; background: #FFFDF5; border-radius: 6px; font-size: 13px; }
input.plan.wide { width: 110px; }
input.plan:focus { border-style: solid; border-color: var(--accent); background: #fff; outline: none; }
input.plan.bad { border-color: #B42318; }
.rnote { margin: 8px 0 0; }
.rgrid { grid-template-columns: minmax(0, 1fr); margin-bottom: 14px; }
.rgrid > .card { min-width: 0; }
.rpays { margin-top: 10px; } .rpays summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.rmiss { margin-top: 12px; font-size: 13px; } .rmiss a { color: inherit; text-decoration: underline; }
.trend { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding: 6px 2px 0; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.tcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-decoration: none; color: var(--muted); gap: 3px; min-width: 0; }
.tcol i { display: block; width: 100%; max-width: 34px; background: #F3C9C7; border-radius: 6px 6px 0 0; min-height: 2px; }
.tcol:hover i, .tcol.on i { background: var(--accent); }
.tcol .tval { font-size: 10.5px; color: var(--ink2); white-space: nowrap; }
.tcol .tm { font-size: 11px; padding-bottom: 4px; }
.tcol.on .tm { color: var(--accent); font-weight: 700; }
.rtrend td, .rtrend th { font-size: 13px; }
.rsrc { margin-bottom: 14px; }
@media (max-width: 1100px) { .kpirow { grid-template-columns: repeat(2, 1fr); } .kpi.big { grid-column: 1 / -1; } .rgrid { grid-template-columns: 1fr; } }
/* «Мои задачи»: группы раскрываются и сворачиваются */
tr.grp td { cursor: pointer; user-select: none; }
tr.grp .caret { display: inline-block; transition: transform .15s; margin-right: 4px; color: var(--muted); }
tr.grp.closed .caret { transform: rotate(-90deg); }
tr.grp:hover td { background: #FAFAFB; }

/* платежи по месяцам (аутсорсинг) */
.wpays { gap: 6px !important; }
.wprow { display: flex; align-items: center; gap: 12px; }
.wprow form { margin: 0; width: auto; }
.wprow .linkbtn { border: 0; background: none; color: var(--muted); cursor: pointer; }
.wprow .linkbtn:hover { color: var(--danger); }
.wpadd { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wf-v .wpadd input { width: auto !important; margin-left: 0 !important; border: 1px solid var(--line) !important; background: #fff !important; }
.wf-v .wpadd input[name=amount] { width: 110px !important; }
.wf-v .wpadd input[name=comment] { flex: 1; min-width: 160px; }

/* ответы, вложения, отметки — как в Telegram */
.tgq { display: block; border-left: 3px solid var(--accent); background: rgba(240, 32, 24, .08); border-radius: 6px; padding: 3px 8px; margin: 2px 0 5px; text-decoration: none; color: inherit; font-size: 13px; line-height: 1.3; max-width: 100%; overflow: hidden; }
.tgq b { display: block; color: var(--accent); font-weight: 600; }
.tgq span { display: block; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgm.flash .tgb { animation: tgflash 1.5s; }
@keyframes tgflash { 0%, 60% { box-shadow: 0 0 0 3px rgba(240, 32, 24, .45); } 100% { box-shadow: 0 1px 1.5px rgba(60, 40, 40, .13); } }
.tgfile { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 4px 2px; min-width: 200px; }
.tgfi { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.tgfile.old .tgfi { background: #9AA4AE; }
.tgfile b { display: block; font-size: 14px; font-weight: 600; word-break: break-all; }
.tgfile small { color: #707579; font-size: 12.5px; }
.tgfile:hover b { color: var(--accent); }
.tgimg { display: block; margin: 2px -4px 4px; }
.tgimg img { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; }
.tgacts { display: none; align-self: center; gap: 4px; }
.tgm:hover .tgacts { display: flex; }
.tgm .tgacts .tgtask { display: block; }
.tgm.out .tgacts { order: -1; }
.tgrep { border: 0; background: rgba(255, 255, 255, .85); width: 30px; height: 30px; border-radius: 50%; color: #707579; cursor: pointer; display: grid; place-items: center; }
.tgrep:hover { color: var(--accent); }
.tgreply { flex-direction: column; align-items: stretch; }
.tgrow { display: flex; align-items: flex-end; gap: 8px; }
.tgta { flex: 1; position: relative; display: flex; }
.tgta textarea { flex: 1; }
.tgbar { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px; padding: 6px 10px; margin: 0 54px 6px 46px; box-shadow: 0 1px 1.5px rgba(60, 40, 40, .13); }
.tgbar[hidden] { display: none; }
.tgbar-i { color: var(--accent); display: grid; }
.tgbar-t { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 8px; font-size: 13px; line-height: 1.3; }
.tgbar-t b { display: block; color: var(--accent); }
.tgbar-t span { display: block; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tgbar-x { border: 0; background: none; color: #707579; cursor: pointer; display: grid; }
.tgclip { width: 38px; height: 44px; display: grid; place-items: center; color: #707579; cursor: pointer; flex: none; }
.tgclip:hover { color: var(--accent); }
.tgmic { width: 36px; height: 44px; background: none; border: 0; cursor: pointer; font-size: 18px; opacity: .55; flex: none; padding: 0; }
.tgmic:hover { opacity: 1; }
.tgmic.recording { opacity: 1; animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100%{filter:none} 50%{filter:drop-shadow(0 0 4px #e53935)} }
.tgaudio-wrap { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.tgaudio { display: block; max-width: 260px; height: 38px; }
.tgspeed { flex-shrink: 0; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink2); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tgspeed:hover { background: var(--hover); color: var(--accent); border-color: var(--accent-line); }
.tgmention { position: absolute; bottom: calc(100% + 6px); left: 0; min-width: 240px; max-height: 260px; overflow: auto; margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .16); z-index: 20; }
.tgmention[hidden] { display: none; }
.tgmention li { padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.tgmention li.on, .tgmention li:hover { background: rgba(240, 32, 24, .1); color: var(--accent); }
@media (max-width: 860px) { .tgbar { margin-left: 0; margin-right: 0; } }

/* календарь: чей календарь, «как видит команда» */
.calwho { width: auto; padding: 6px 10px; border-radius: 10px; }
.seg.sm a { padding: 5px 10px; font-size: 13px; }
.evlock { font-style: normal; font-size: 11px; opacity: .7; }

.ev.external.own { background: #EEF1FB; border: 1px solid #C9D2F0; color: #24304F; }

/* календарь: свободное рабочее время — зелёное, занятое — красное */
.wkcol, .tltrack { background-color: #E6F6EA; }
.wkcol .off, .tltrack .off { background: #F1F1F4; }
.lg.free { background: #E6F6EA; border: 1px solid #BFE3C9; }
.lg.meeting, .ev.meeting, .blk.meeting,
.lg.client, .ev.client, .blk.client,
.lg.external, .ev.external, .blk.external,
.ev.external.own { background: #FDDCD9; border: 1px solid #F3A39B; color: #5A1712; }
.lg.tentative, .ev.tentative, .blk.tentative { background: repeating-linear-gradient(45deg, #FFF1F0, #FFF1F0 4px, #FDDCD9 4px, #FDDCD9 8px); border: 1px dashed #EE7F74; color: #5A1712; }
.ev a, .blk a { color: #5A1712; }

/* свободные окна — зелёные рамки, клик проходит сквозь них (новая встреча) */
.wkcol, .tltrack { background-color: #fff; }
.wkcol .free, .tltrack .free { position: absolute; background: #E6F6EA; border: 1.5px solid #6CC487; border-radius: 7px; pointer-events: none; box-sizing: border-box; }
.wkcol .free { left: 3px; right: 3px; }
.tltrack .free { top: 6px; bottom: 6px; }
.wkcol .free span { display: block; font-size: 10.5px; color: #2E7D46; padding: 2px 6px; white-space: nowrap; overflow: hidden; }

/* календарь: просмотр по другому часовому поясу */
.caltz { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; }
.caltz select { width: auto !important; max-width: 280px; padding: 5px 8px; border-radius: 10px; font-size: 13px; }
.tzalert { background: #EAF3FF; border-color: #BFD7F6; }

/* команда — неделя: 7 мини-дорожек на человека */
.tlweek .tlday { flex: 1; min-width: 0; text-align: center; font-size: 12px; color: var(--ink2); padding: 8px 0 6px; border-left: 1px solid var(--line); text-decoration: none; }
.tlweek .tlday:hover { color: var(--accent); }
.tlweek .tlday.today { color: var(--accent); font-weight: 600; }
.tltrack.mini { min-width: 0; min-height: 40px; background-image: none; border-left: 1px solid var(--line); }
.tltrack.mini .free { top: 5px; bottom: 5px; border-radius: 5px; }
.tltrack.mini .blk { top: 5px; bottom: 5px; max-height: none; padding: 0; border-radius: 4px; }
.tltrack.mini .blk a { position: absolute; inset: 0; }

a.pchip { text-decoration: none; }

/* встречи календаря в карточке сделки */
.dmeets { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.dmeet { font-size: 13px; text-decoration: none; color: var(--ink); padding: 3px 8px; border-radius: 7px; background: #FDDCD9; border: 1px solid #F3A39B; }
.dmeet.past { opacity: .55; }
.dmeet:hover { border-color: var(--accent); }
.dmeets .btn { margin-top: 2px; }

.dealpick { background: #E6F6EA; border-color: #BFE3C9; }

.wd.viewonly input, .wd.viewonly select, .wd.viewonly textarea, .wd.viewonly form button { pointer-events: none; }

/* клиент ждёт ответа дольше 15 минут — чат наверху и мигает красным */
@keyframes tgalarm { 0%, 100% { background: #FFE1DE; box-shadow: inset 4px 0 0 #F02018; } 50% { background: #FFF6F5; box-shadow: inset 4px 0 0 #FF8A80; } }
.titem.alarm { animation: tgalarm 1.2s ease-in-out infinite; }
.titem.alarm:not(.on) .tname { color: #C4140E; }
.titem.alarm.on { animation: none; }
@media (prefers-reduced-motion: reduce) { .titem.alarm { animation: none; background: #FFE1DE; } }

/* два уровня: 15 мин — жёлтое предупреждение (медленно), 30 мин — красный «пожар» (быстро) */
@keyframes tgwarn { 0%, 100% { background: #FFF1C9; box-shadow: inset 4px 0 0 #F2A900; } 50% { background: #FFFBEE; box-shadow: inset 4px 0 0 #FFD666; } }
@keyframes tgfire { 0%, 100% { background: #FFC9C4; box-shadow: inset 6px 0 0 #E00F08; } 50% { background: #FFF1F0; box-shadow: inset 6px 0 0 #FF6A60; } }
.titem.alarm1 { animation: tgwarn 2s ease-in-out infinite; }
.titem.alarm2 { animation: tgfire .7s ease-in-out infinite; }
.titem.alarm1:not(.on) .tname { color: #8A5A00; }
.titem.alarm2:not(.on) .tname { color: #C4140E; }
.titem.alarm.on { animation: none; }
.wait.lvl1 { background: #FFF1C9; color: #8A5A00; font-weight: 600; }
.wait.lvl2 { background: #E00F08; color: #fff; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .titem.alarm1 { animation: none; background: #FFF1C9; } .titem.alarm2 { animation: none; background: #FFC9C4; } }

/* события «на весь день» (задачи на день) — строкой над сеткой, время не занимают */
.wkallday { border-bottom: 1px solid var(--line); padding: 3px; box-sizing: border-box; background: #FAFAFC; overflow: hidden; }
.wknote { font-size: 11.5px; line-height: 20px; height: 20px; margin-bottom: 4px; padding: 0 7px; border-radius: 6px; background: #EEF1FB; border: 1px solid #C9D2F0; color: #24304F; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }

.wkallday[title] { cursor: copy; }
a.wknote.crm { display: block; text-decoration: none; background: #FDDCD9; border-color: #F3A39B; color: #5A1712; }
a.wknote.crm.pending { background: repeating-linear-gradient(45deg, #FFF1F0, #FFF1F0 4px, #FDDCD9 4px, #FDDCD9 8px); border-style: dashed; }

/* задачи на день — фиолетовые, чтобы не путать со встречами (красные) и свободным временем (зелёное) */
.wknote, a.wknote.crm, .lg.daytask { background: #EFE7FF; border: 1px solid #B79CF2; color: #3C1F78; }
a.wknote.crm.pending { background: repeating-linear-gradient(45deg, #F7F2FF, #F7F2FF 4px, #EFE7FF 4px, #EFE7FF 8px); border: 1px dashed #9B78E8; }
a.wknote.crm:hover { border-color: #7A4FE0; }
a.wknote.crm { cursor: grab; user-select: none; -webkit-user-drag: none; }
a.wknote.crm:active { cursor: grabbing; }
.ev[data-pk] { user-select: none; }
.drag-handle { cursor: grab; opacity: .5; flex-shrink: 0; padding: 0 4px 0 0; min-width: 10px; text-align: center; font-size: 13px; }
.drag-handle:hover { opacity: 1; }
.drag-handle:active { cursor: grabbing; }
.ev-dragging { opacity: .35; }
.wkallday.drag-over { background: #EDE7FF; outline: 2px dashed #7A4FE0; }
.wkcol.drag-over { background: rgba(122,79,224,.06); outline: 2px dashed #7A4FE0; }

/* «Мои задачи»: фильтры, полоска цвета воронки, встречи из календаря */
.tfilters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: -4px 0 14px; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchips .pchip { text-decoration: none; }
.tlegend { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 4px; }
.sw.meet { background: #F02018; } .sw.cold { background: #3B82F6; } .sw.sale { background: #F59E0B; } .sw.hire { background: #22A55A; } .sw.proj { background: #A0A4AE; }
.tlist tr[class*="st-"] td:first-child { box-shadow: inset 4px 0 0 var(--stc, transparent); }
.tlist tr.st-meet { --stc: #F02018; } .tlist tr.st-cold { --stc: #3B82F6; } .tlist tr.st-sale { --stc: #F59E0B; }
.tlist tr.st-hire { --stc: #22A55A; } .tlist tr.st-proj { --stc: #C9CCD3; }
.tlist tr.mrow td { background: #FFF6F5; }
.tline { display: inline-flex; gap: 8px; align-items: flex-start; }
.tsub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.mico { width: 22px; text-align: center; }
.tdeal { display: flex; flex-direction: column; line-height: 1.25; }
.tdeal b { font-weight: 600; font-size: 13px; }
.tdeal small { color: var(--muted); font-size: 11.5px; }
.tlist tr.cgrp td { background: #F7F8FA; font-weight: 600; }

.dealsel { margin: 10px 0; }
.dealsel .dps { margin-bottom: 6px; }
.dealsel select { width: 100%; padding: 4px; border-radius: 10px; }
.dealsel select optgroup { font-weight: 600; color: var(--muted); font-style: normal; }
.dealsel select option { font-weight: 400; color: var(--ink); padding: 3px 8px; }

.rows.tlist { width: 100%; }
.dealsel .dps { display: block; width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }

/* кружки у сообщений: клиент — красный, наши — чёрный */
.tgav.cl { background: #F02018; }
.tgav.team { background: #1F2329; }
.thead .noreply { margin: 0 6px 0 auto; }
.thead .noreply + .tgicon { margin-left: 0; }

/* точка у чата в списке: чат с клиентом — красная, наши (внутренние, заявки) — чёрная */
.tgavl .kdot.k-client { background: #F02018; }
.tgavl .kdot.k-internal, .tgavl .kdot.k-leads { background: #9AA0AA; }

/* «Мои задачи»: календарь недели отдельно от задач */
.agenda h2 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.agenda h2 a { margin-left: auto; }
.agday { display: flex; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line); }
.agday:first-of-type { border-top: 0; }
.agdate { flex: 0 0 110px; display: flex; flex-direction: column; font-size: 13px; text-transform: none; }
.agitems { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.agit { display: flex; gap: 10px; align-items: baseline; padding: 5px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.agit.meet, .agit.google { background: #FDECEA; box-shadow: inset 3px 0 0 #F02018; }
.agit.daytask { background: #F3EDFF; box-shadow: inset 3px 0 0 #8B5CF6; }
a.agit:hover { filter: brightness(.97); }
.agtime { flex: 0 0 92px; font-weight: 600; font-size: 12.5px; }
.agtitle { flex: 1; min-width: 0; }
.agsrc { white-space: nowrap; }
.tlist-h { margin: 18px 0 6px; font-size: 17px; }

/* выбор проекта: воронка → этап → проекты */
.dealsel .dsrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dealsel .dsrow select { flex: 1 1 200px; width: auto; }
.dealsel .dsrow input { flex: 1 1 180px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.dealsel .dslist { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-height: 40px; }
.dealsel .dsitem { text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink); }
.dealsel .dsitem:hover { background: #F4F5F7; }
.dealsel .dsitem.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dealsel .dscur { margin-bottom: 8px; padding: 7px 10px; border-radius: 8px; background: var(--accent-soft); font-size: 14px; }
.dealsel .dsx { border: 0; background: none; cursor: pointer; color: var(--muted); margin-left: 6px; }

/* отчёт: «сейчас на этапе» — сразу после названия этапа */
.rt td.rnow { font-weight: 700; background: #F4F5F7; text-align: center; }
.rt th.rnow { background: #F4F5F7; }

/* ТЗ 20.10: без красного — выбранный чат и названия тем спокойные серые */
.tg .titem.on { background: #E6E8EC; box-shadow: none; }
.tg .titem.on, .tg .titem.on .tlast, .tg .titem.on .tauthor, .tg .titem.on .tclient { color: var(--ink) !important; }
.tg .titem.on .ttime { color: #707579 !important; }
.tg .titem.on .ttopic { color: var(--ink2) !important; }
.tg .titem.on .unread { background: var(--accent); color: #fff; }
.tg .titem.on .tgavl.hash { background: #D5D8DE; color: #555; }
.tg .ttopic { color: var(--ink2); font-weight: 600; }
.tgq { border-left-color: #9AA0AA; background: rgba(0, 0, 0, .05); }
.tgq b { color: var(--ink); }
.tgm.flash .tgb { animation: tgflash2 1.5s; }
@keyframes tgflash2 { 0%, 60% { box-shadow: 0 0 0 3px rgba(110, 118, 130, .45); } 100% { box-shadow: 0 1px 1.5px rgba(60, 40, 40, .13); } }

/* ссылки из полей описания — кликабельные под полем */
.tlinks { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 6px; font-size: 13px; }
.tlinks .lnk { color: #2563EB; text-decoration: none; word-break: break-all; -webkit-user-select: text; user-select: text; }
.tlinks .lnk:hover { text-decoration: underline; }
.tlinks .lcopy { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 2px; }
body.protect a[href^="http"] { -webkit-user-select: text; user-select: text; }

.dealsel .dsitem small { color: var(--muted); font-weight: 400; }

.srcseg { margin: 0 0 6px; display: inline-flex; flex-wrap: wrap; }

/* финансы */
.fintabs { margin: 0 0 14px; display: inline-flex; }
.finform .frow { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.finform label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 140px; }
.finform label.amt { width: 140px; min-width: 120px; }
.finform label.grow { flex: 1 1 220px; }
.finform .flabel { font-size: 12.5px; color: var(--muted); margin: 4px 0; }
.fincats { margin: 0 0 10px; flex-wrap: wrap; }
table.rows td.r, table.rows th.r { text-align: right; white-space: nowrap; }
.fintotal tr.gen td { background: #FAFAFB; }
.fintotal tr.tot td { border-top: 2px solid var(--line); }
.fintotal .neg { color: var(--danger); }

/* база знаний */
.kb { display: flex; gap: 18px; align-items: flex-start; min-height: calc(100vh - 60px); }
.kbside { flex: 0 0 270px; position: sticky; top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; max-height: calc(100vh - 40px); overflow: auto; }
.kbhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kbsearch input { width: 100%; margin-bottom: 8px; }
.kbtree, .kbtree ul { list-style: none; margin: 0; padding: 0; }
.kbtree ul { padding-left: 14px; }
.kbtree li.closed > ul { display: none; }
.kbtree li.closed > a .kbtw { transform: rotate(-90deg); }
.kbtree a { display: flex; gap: 6px; align-items: center; padding: 5px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.3; }
.kbtree a:hover { background: #F4F5F7; }
.kbtree a.on { background: var(--accent-soft); font-weight: 600; }
.kbtw { width: 14px; color: var(--muted); font-size: 11px; transition: transform .15s; }
.kbtree li:not(.has) > a { padding-left: 28px; }
.kbmain { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 34px 30px; }
.kbtitle { display: flex; gap: 10px; align-items: center; margin: 6px 0 2px; }
.kbtitle input { flex: 1; border: 0; font-size: 30px; font-weight: 700; padding: 4px 0; outline: none; background: none; }
.kbicon { border: 0; background: none; font-size: 30px; cursor: pointer; padding: 0; }
.kbbar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 0; margin: 10px 0 14px; }
.kbbar button { border: 0; background: none; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--ink2); }
.kbbar button:hover { background: #F0F1F4; color: var(--ink); }
.kbbar .sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.kbbody { min-height: 340px; outline: none; font-size: 15.5px; line-height: 1.65; -webkit-user-select: text; user-select: text; }
.kbbody:empty::before { content: attr(data-placeholder); color: var(--muted); }
.kbbody h2 { font-size: 23px; margin: 22px 0 8px; } .kbbody h3 { font-size: 18.5px; margin: 18px 0 6px; }
.kbbody blockquote { margin: 10px 0; padding: 10px 14px; border-left: 4px solid #F5B400; background: #FFF9E6; border-radius: 6px; }
.kbbody img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.kbbody a { color: #2563EB; }
.kbbody ul.todo { list-style: none; padding-left: 4px; }
.kbbody ul.todo li.done { color: var(--muted); text-decoration: line-through; }
.kbbody hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.kbfoot { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.kbfiles { display: flex; flex-wrap: wrap; gap: 6px 14px; } .kbfiles a { font-size: 13.5px; }
.kbmore summary { cursor: pointer; } .kbmore > * + * { margin-top: 10px; }
.kbver { display: flex; gap: 8px; align-items: center; }
.kbfound { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); margin-bottom: 8px; }
.kbfound:hover { background: #F7F8FA; }
.kbempty form { display: flex; gap: 8px; max-width: 560px; } .kbempty input { flex: 1; }
@media (max-width: 900px) { .kb { flex-direction: column; } .kbside { position: static; flex: none; width: 100%; } .kbmain { padding: 16px; } }

.tsearchbox input { min-width: 280px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fff; }

/* «Все задачи»: панель фильтров */
.tfbar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.tfbar label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.tfbar select, .tfbar input { width: auto; min-width: 130px; padding: 6px 8px; font-size: 13.5px; }

/* карточка задачи проекта: к какой сделке привязана */
.tcard .tdeal { font-size: 12px; color: var(--text); background: #F4F1FA; border-radius: 6px; padding: 3px 6px; margin: 4px 0 2px; line-height: 1.3; }
.tcard .tdeal span { display: block; color: var(--muted); font-size: 11px; }

/* доски задач по высоте экрана (fitboard.js) */
.pboard > .kcols { min-width: 0; }
.kcols.fit, .week.fit { align-items: stretch; overflow-y: hidden; min-height: 0; cursor: grab; }
.kcols.fit > .kcol, .week.fit > .day { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.kcols.fit .list, .week.fit .list { flex: 1 1 auto; min-height: 60px; overflow-y: auto; padding: 0 4px 6px 0; margin-right: -4px; scrollbar-width: thin; }
.kcols.fit.panning, .week.fit.panning { cursor: grabbing; user-select: none; }
.kcols.fit .tcard, .week.fit .tcard { cursor: pointer; }

/* отметка «выполнено» у задач на день и встреч (календарь, «Мои задачи») */
button.mdone { flex: 0 0 auto; width: 15px; height: 15px; margin: 0 5px 0 0; padding: 0; border: 1.5px solid currentColor; border-radius: 4px; background: #fff; color: inherit; font-size: 10px; line-height: 12px; cursor: pointer; vertical-align: -2px; opacity: .75; }
button.mdone:hover { opacity: 1; }
button.mdone.on { background: #22A06B; border-color: #22A06B; color: #fff; opacity: 1; }
.agit button.mdone { align-self: center; }
a.wknote.done, .ev a.done, a.agit.done { text-decoration: line-through; opacity: .55; }

.wknote.done, .ev span.done { text-decoration: line-through; opacity: .55; }
.agit.done .agtitle, .agit.done .agtime { text-decoration: line-through; opacity: .55; }
textarea.cmt { flex: 1; min-height: 38px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.4; }
