:root {
  --bg: #f2f0eb; --panel: #fffdf9; --line: #e2ddd3; --line2: #ece8e0;
  --text: #24221f; --muted: #79736b; --faint: #a49e95;
  --brand: #1f1e1c; --brand2: #2b2a27; --brand-soft: #f1ebdf; --gold: #b39560; --gold2: #9c804c; --gold-soft: #f3ecdd;
  --ok: #5e7a58; --ok-soft: #e8eee4; --bad: #a3554c; --bad-soft: #f4e7e3; --warn: #a9843c; --warn-soft: #f5eddb;
  --side: #1c1b19; --side2: #282724; --side-text: #bdb5a8;
  --r: 10px; --shadow: 0 1px 2px rgba(36,34,31,.05), 0 4px 18px rgba(36,34,31,.06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--gold2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; } .grow { flex: 1; } .wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---------- кнопки и поля ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 550; white-space: nowrap; transition: .12s; }
.btn:hover { border-color: #cbd3e1; background: #f8fafc; }
.btn.primary { background: var(--brand2); border-color: var(--brand2); color: #f3ead8; }
.btn.primary:hover { background: var(--brand); }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-soft); border-color: #f5c2c2; }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--line2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }
.input, select.input, textarea.input { width: 100%; height: 36px; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); outline: none; transition: .12s; }
textarea.input { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(179,149,96,.18); }
label.f { display: block; margin-bottom: 12px; } label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 550; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.chk { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; cursor: pointer; }
.chk input { margin-top: 3px; }

/* ---------- вход ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background:
  radial-gradient(1200px 600px at 10% -10%, #e9e1d1 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e4ded3 0, transparent 60%), var(--bg); }
.login-card { width: 360px; background: var(--panel); border-radius: 16px; padding: 32px; box-shadow: 0 10px 40px rgba(15,23,42,.10); }
.logo { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, #cdb07a, #8f7445);
  color: #1c1b19; font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.login-card .logo { margin-bottom: 16px; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ---------- каркас ---------- */
.layout { display: grid; grid-template-columns: 220px 1fr; height: 100vh; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 14px 10px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; font-weight: 700; font-size: 16px; }
.side .brand .logo { width: 32px; height: 32px; font-size: 12px; border-radius: 8px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); font-weight: 520; margin-bottom: 2px; }
.nav a:hover { background: var(--side2); color: #fff; }
.nav a.on { background: var(--side2); color: #f3ead8; box-shadow: inset 3px 0 0 var(--gold); }
.nav a svg { width: 18px; height: 18px; opacity: .9; flex: none; }
.nav .badge { margin-left: auto; background: var(--gold2); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 6px; line-height: 18px; font-weight: 650; }
.side .me { margin-top: auto; padding: 10px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; cursor: pointer; border-radius: 8px; }
.side .me:hover { background: var(--side2); }
.ava { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex: none; }
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); min-height: 60px; }
.content { flex: 1; overflow: auto; padding: 18px 20px; }
.search { position: relative; } .search input { padding-left: 32px; width: 260px; }
.search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--faint); }

/* ---------- вкладки, бейджи ---------- */
.tabs { display: flex; gap: 2px; background: var(--line2); padding: 3px; border-radius: 9px; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 550; color: var(--muted); }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 20px; font-size: 12px; font-weight: 550; background: var(--line2); color: var(--muted); white-space: nowrap; }
.pill.bad { background: var(--bad-soft); color: var(--bad); } .pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.brand { background: var(--gold-soft); color: var(--gold2); }
.tag { display: inline-block; padding: 0 7px; border-radius: 5px; background: #efe8da; color: #6e5c38; font-size: 11.5px; line-height: 19px; margin: 0 3px 3px 0; }

/* ---------- канбан ---------- */
.board { display: flex; gap: 12px; height: 100%; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.col { flex: 0 0 272px; background: #e8e4dc; border-radius: 12px; display: flex; flex-direction: column; max-height: 100%; }
.col-h { padding: 10px 12px 8px; border-top: 3px solid var(--c); border-radius: 12px 12px 0 0; }
.col-h .t { font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; display: flex; gap: 6px; }
.col-h .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.col-b { padding: 4px 8px 10px; overflow-y: auto; min-height: 60px; flex: 1; }
.col-b.over { background: rgba(179,149,96,.12); border-radius: 0 0 12px 12px; }
.card { background: var(--panel); border-radius: 9px; padding: 10px 11px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(15,23,42,.08); cursor: pointer; border: 1px solid transparent; transition: .1s; }
.card:hover { border-color: #d8c7a3; box-shadow: 0 3px 12px rgba(36,34,31,.10); }
.card.dragging { opacity: .45; }
.card .t { font-weight: 600; margin-bottom: 3px; word-break: break-word; }
.card .c { color: var(--muted); font-size: 12.5px; }
.card .f { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.card .amt { font-weight: 650; color: var(--text); }
.card.notask { border-left: 3px solid var(--warn); }
.card.closed-won { background: #f1f4ee; } .card.closed-lost { background: #f6f7f9; opacity: .8; }

/* ---------- таблицы, панели ---------- */
.panel { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.panel-b { padding: 16px; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f8f5ef; position: sticky; top: 0; }
table.t td { padding: 10px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.t tr.click { cursor: pointer; } table.t tr.click:hover td { background: #faf6ee; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 24px; font-weight: 700; } .stat .l { font-size: 12.5px; color: var(--muted); }
.stat.bad .v { color: var(--bad); } .stat.warn .v { color: var(--warn); }

/* ---------- выезжающая панель (карточка сделки) ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 40; animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1080px, 96vw); background: var(--bg); z-index: 41; display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(15,23,42,.2); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } } @keyframes fade { from { opacity: 0; } }
.drawer-h { background: var(--panel); padding: 14px 20px; border-bottom: 1px solid var(--line); }
.drawer-h .title { font-size: 19px; font-weight: 650; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-left: -6px; outline: none; flex: 1; min-width: 0; }
.drawer-h .title:hover { border-color: var(--line); } .drawer-h .title:focus { border-color: var(--gold); background: var(--panel); }
.stagebar { display: flex; gap: 3px; margin-top: 12px; overflow-x: auto; }
.stagebar button { flex: 1 0 auto; border: 0; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; background: #e9e5dd; color: var(--muted); border-radius: 4px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); padding-left: 16px; }
.stagebar button:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); padding-left: 10px; }
.stagebar button.past { background: color-mix(in srgb, var(--c) 28%, #f2f0eb); color: #2b2a27; }
.stagebar button.cur { background: var(--c); color: #fff; }
.stagebar button:hover:not(.cur) { filter: brightness(.95); }
.stagebar .end { clip-path: none !important; border-radius: 4px; padding-left: 10px; flex: 0 0 auto; margin-left: 6px; }
.drawer-body { flex: 1; display: grid; grid-template-columns: 340px 1fr; min-height: 0; }
.drawer-left { overflow-y: auto; padding: 16px 16px 30px 20px; border-right: 1px solid var(--line); background: var(--panel); }
.drawer-right { display: flex; flex-direction: column; min-height: 0; }
.sect { margin-bottom: 18px; } .sect > h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; align-items: center; font-size: 13.5px; }
.kv > .k { color: var(--muted); }
.kv .input { height: 32px; }
.feed { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column-reverse; gap: 10px; }
.ev { display: flex; gap: 10px; } .ev .ava { width: 28px; height: 28px; font-size: 11px; }
.ev .b { background: var(--panel); border-radius: 10px; padding: 8px 12px; box-shadow: 0 1px 2px rgba(15,23,42,.06); max-width: 640px; }
.ev .m { font-size: 12px; color: var(--faint); margin-bottom: 2px; } .ev .m b { color: var(--muted); font-weight: 600; }
.ev.sys .b { background: transparent; box-shadow: none; padding: 2px 0; color: var(--muted); font-size: 13px; }
.ev.note .b { background: #f8f2e4; } .ev.task .b { border-left: 3px solid var(--gold); }
.ev .txt { white-space: pre-wrap; word-break: break-word; }
.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 12px 20px; }
.composer .tabs { display: inline-flex; margin-bottom: 8px; }
.tasks-box { padding: 10px 20px 0; }
.task-item { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border-radius: 9px; padding: 9px 12px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(15,23,42,.06); }
.task-item.overdue { border-left: 3px solid var(--bad); } .task-item .when { font-size: 12px; font-weight: 600; color: var(--gold2); }
.task-item.overdue .when { color: var(--bad); }
.contact-box { background: #f8f5ef; border: 1px solid var(--line2); border-radius: 10px; padding: 12px; }

/* ---------- модалки и уведомления ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade .12s; }
.modal { background: var(--panel); border-radius: 14px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(15,23,42,.3); }
.modal.wide { max-width: 760px; }
.modal-h { padding: 16px 20px; border-bottom: 1px solid var(--line2); display: flex; align-items: center; }
.modal-b { padding: 18px 20px 6px; } .modal-f { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; }
.x { border: 0; background: transparent; cursor: pointer; font-size: 22px; line-height: 1; color: var(--faint); margin-left: auto; padding: 4px 8px; border-radius: 6px; }
.x:hover { background: var(--line2); color: var(--text); }
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #24221f; color: #f3ead8; padding: 10px 16px; border-radius: 10px; font-weight: 520; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: fade .15s; }
.toast.bad { background: var(--bad); }
.dup-warn { background: var(--warn-soft); border: 1px solid #e6d3a8; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: -4px 0 12px; }
.perm-list { columns: 2; column-gap: 20px; }
.stage-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.stage-row .dot { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.stage-row input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 5px; background: none; cursor: pointer; }
.handle { cursor: grab; color: var(--faint); user-select: none; padding: 0 4px; }

/* ---------- телефон ---------- */
.burger { display: none; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; z-index: 50; transform: translateX(-100%); transition: .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .burger { display: inline-flex; }
  .search input { width: 150px; }
  .content { padding: 12px; } .top { padding: 10px 12px; flex-wrap: wrap; }
  .drawer { width: 100vw; } .drawer-body { grid-template-columns: 1fr; overflow-y: auto; display: block; }
  .drawer-left { border-right: 0; } .feed { max-height: none; overflow: visible; }
  .grid2 { grid-template-columns: 1fr; } .perm-list { columns: 1; }
  .col { flex-basis: 82vw; }
}

/* ---------- чаты ---------- */
.chat-wrap { display: grid; grid-template-columns: 330px 1fr 290px; height: 100%; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.chat-list .tabs { margin: 10px; }
.chat-items { overflow-y: auto; flex: 1; }
.ci { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; }
.ci:hover { background: #faf6ee; } .ci.on { background: var(--gold-soft); }
.ci .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci .p { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci .r { margin-left: auto; text-align: right; font-size: 11.5px; color: var(--faint); flex: none; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ci .u { background: var(--gold2); color: #fff; border-radius: 10px; padding: 0 6px; font-weight: 650; line-height: 17px; }
.ch-badge { font-size: 10.5px; padding: 0 6px; border-radius: 4px; background: #e9e3d6; color: #6e5c38; font-weight: 600; }
.thread { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.thread-h { padding: 12px 16px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bub { max-width: 70%; padding: 8px 12px; border-radius: 12px; background: var(--panel); box-shadow: 0 1px 1px rgba(36,34,31,.06); white-space: pre-wrap; word-break: break-word; }
.bub.out { align-self: flex-end; background: #2b2a27; color: #f3ead8; }
.bub .meta { font-size: 11px; opacity: .65; margin-top: 3px; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.bub.out .meta { color: #e2d6bd; }
.bub.bad { outline: 2px solid var(--bad); } .bub.unk { outline: 2px dashed var(--warn); }
.bub img { max-width: 260px; max-height: 260px; border-radius: 8px; display: block; margin: 2px 0; }
.bub a.file { color: inherit; text-decoration: underline; }
.day-sep { align-self: center; font-size: 11.5px; color: var(--faint); margin: 8px 0; }
.composer2 { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; }
.composer2 textarea { min-height: 42px; max-height: 160px; }
.chat-info { border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; }
.banner { padding: 8px 12px; font-size: 13px; background: var(--warn-soft); border-bottom: 1px solid #e6d3a8; }
.banner.bad { background: var(--bad-soft); border-color: #e9c4bd; }
.empty-chat { display: grid; place-items: center; height: 100%; color: var(--muted); }
.wait { color: var(--warn); font-weight: 600; } .wait.long { color: var(--bad); }
.token-box { font-family: ui-monospace, Consolas, monospace; background: #1f1e1c; color: #f3ead8; padding: 10px 12px; border-radius: 8px; word-break: break-all; user-select: all; }
.dot-on { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--ok); } .dot-off { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--bad); }
pre.diag { background: #f8f5ef; border: 1px solid var(--line2); border-radius: 8px; padding: 8px; font-size: 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; }
@media (max-width: 1100px) { .chat-wrap { grid-template-columns: 300px 1fr; } .chat-info { display: none; } }
@media (max-width: 860px) { .chat-wrap { grid-template-columns: 1fr; } .chat-wrap.open .chat-list { display: none; } .chat-wrap:not(.open) .thread { display: none; } }

.ci .unr { font-size: 12px; color: var(--text); background: #f6f0e3; border-radius: 6px; padding: 3px 6px; margin-top: 3px; }
.ci .unr div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* режим наблюдателя: кнопки изменений скрыты (сервер всё равно запрещает) */
body.ro #add-deal, body.ro #c-add, body.ro #ac-add, body.ro #u-add, body.ro #r-add, body.ro #p-add, body.ro #d-del,
body.ro #d-contact, body.ro .composer, body.ro .composer2, body.ro [data-done], body.ro #c-edit, body.ro #c-deal,
body.ro #th-close, body.ro #upf, body.ro [data-retry], body.ro [data-rec] { display: none !important; }
body.ro .stagebar button, body.ro .drawer-left select, body.ro .drawer-left input, body.ro #d-title { pointer-events: none; }

.tag-hints { font-size: 11.5px; line-height: 22px; margin: 0 0 12px; min-height: 4px; }
.tag-hints a.th { display: inline-block; padding: 0 7px; margin: 0 4px 3px 0; border-radius: 5px; background: #efe8da; color: #6e5c38; text-decoration: none; line-height: 19px; }
.tag-hints a.th:hover { background: #e3d6bb; }
.tag-hints a.th::before { content: "+ "; opacity: .6; }
.kv .tag-hints { margin: 4px 0 0; }

.col-ed { margin-left: auto; color: var(--faint); text-decoration: none; font-weight: 400; opacity: 0; transition: .15s; }
.col-h:hover .col-ed { opacity: 1; } .col-ed:hover { color: var(--gold2); }
.col-add { cursor: pointer; background: transparent; border: 2px dashed #d6cfc2; min-height: 90px; }
.col-add:hover { background: #ebe6dc; } .col-add .t { color: var(--muted); }
#p-new { font-weight: 700; color: var(--gold2); }
.top { flex-wrap: wrap; row-gap: 8px; } .tabs button { white-space: nowrap; } .search input { width: 220px; }

/* переходящая колонка «→ следующая воронка» */
.col-pass { flex: 0 0 176px; background: transparent; }
.col-pass .col-b { min-height: 230px; border-radius: 12px; border: 2px dashed #c9b27f; background: linear-gradient(180deg, #f6efe1, #efe6d2); display: grid; place-items: center; padding: 14px; transition: .15s; }
.col-pass .col-b.over { background: #2b2a27; border-color: #2b2a27; }
.col-pass .col-b.over .pass-in { color: #f3ead8; } .col-pass .col-b.over .pass-arrow { background: #b39560; color: #1c1b19; transform: scale(1.12); }
.pass-in { text-align: center; color: #6e5c38; }
.pass-arrow { width: 46px; height: 46px; border-radius: 50%; margin: 0 auto 10px; display: grid; place-items: center; font-size: 24px; background: #2b2a27; color: #e3cf9f; transition: .15s; }
.pass-t { font-size: 13px; line-height: 1.35; } .pass-t b { font-size: 14px; color: #3d3220; }
.pass-s { font-size: 11px; color: #9a8a68; margin-top: 8px; line-height: 1.35; }
.col-pass .col-b.over .pass-t b { color: #f3ead8; } .col-pass .col-b.over .pass-s { color: #d9c08a; }

/* аватары и режим призрака */
img.ava { object-fit: cover; background: #ddd; }
.ava-xs { width: 20px !important; height: 20px !important; font-size: 9px !important; }
.ava-lg { width: 54px !important; height: 54px !important; font-size: 18px !important; }
.me-ava { position: relative; cursor: pointer; flex: none; display: inline-flex; }
.me-ava .cam { position: absolute; right: -4px; bottom: -4px; font-size: 10px; background: #2b2a27; border-radius: 50%; width: 16px; height: 16px; display: grid; place-items: center; opacity: 0; transition: .15s; }
.me-ava:hover .cam { opacity: 1; }
.side .me { cursor: default; }
.ghost-btn { flex: none; width: 34px; height: 34px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: transparent; color: #8f887c; cursor: pointer; display: grid; place-items: center; transition: .2s; }
.ghost-btn svg { width: 20px; height: 20px; }
.ghost-btn:hover { color: #e3cf9f; border-color: #6b5c3d; }
.ghost-btn.on { background: #b39560; border-color: #b39560; color: #1c1b19; box-shadow: 0 0 0 3px rgba(179,149,96,.25), 0 0 18px rgba(227,207,159,.35); animation: ghostfloat 2.4s ease-in-out infinite; }
@keyframes ghostfloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.side .me.ghost-on { background: rgba(179,149,96,.12); border-radius: 10px; }
.ghost-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; background: #2b2a27; color: #e3cf9f; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ghost-pill svg { width: 16px; height: 16px; }

.card.flash { animation: cardflash 1.3s ease-in-out 2; border-color: #b39560; }
@keyframes cardflash { 0%,100% { box-shadow: 0 1px 2px rgba(36,34,31,.08); } 50% { box-shadow: 0 0 0 4px rgba(179,149,96,.45), 0 6px 22px rgba(179,149,96,.35); } }
.col-pass .col-b.passed { background: #b39560; border-color: #b39560; } .col-pass .col-b.passed .pass-in { color: #1c1b19; }
.search input { width: 190px; } #f-resp { width: 150px !important; } #f-ch { width: 130px !important; }
.top .tabs button { padding: 6px 10px; }
/* вкладки в списке чатов не вылезают за край */
.chat-list .tabs { flex-wrap: wrap; gap: 2px; }
.chat-list .tabs button { padding: 5px 9px; font-size: 12.5px; flex: 1 0 auto; }

details.dfg > summary { cursor: pointer; list-style: none; } details.dfg > summary::-webkit-details-marker { display: none; }
details.dfg > summary h3::before { content: "▸ "; color: var(--faint); } details.dfg[open] > summary h3::before { content: "▾ "; }
.kv textarea.input { min-height: 52px; }

/* доска двигается мышкой */
.board { cursor: grab; user-select: none; -webkit-user-select: none; }
.board.panning { cursor: grabbing; } .board.panning .card { pointer-events: none; }
.board .card { cursor: pointer; }

/* фирменный знак */
.ec-logo { display: block; flex: none; border-radius: 22%; box-shadow: 0 2px 8px rgba(0,0,0,.22); }
.side .brand .brand-name { font-weight: 800; letter-spacing: .02em; }
.side .brand { gap: 11px; letter-spacing: .04em; }
.login-card .logo-wrap { margin-bottom: 16px; }

/* слова-метки в правилах распределения */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--brand-soft, #f3ead9); color: var(--ink, #2a2926); font-size: 13px; border: 1px solid rgba(179,149,96,.35); }
.chip button { border: 0; background: transparent; cursor: pointer; color: #8a8378; font-size: 11px; padding: 2px 5px; border-radius: 50%; }
.chip button:hover { background: rgba(0,0,0,.08); color: #2a2926; }
.chip-add { display: inline-flex; gap: 4px; }
.chip-add .input { width: 140px; height: 30px; padding: 4px 10px; }
.chip-add .btn { min-width: 30px; }

/* знак-строка EC-CRM */
.ec-lockup { display: inline-flex; align-items: flex-end; gap: 1px; line-height: 1; white-space: nowrap; }
.ec-lockup svg { display: block; flex: none; }
.ec-lockup-t { display: inline-block; font-family: Inter, "Segoe UI", Arial, sans-serif; font-weight: 900; letter-spacing: .01em;
  transform: skewX(-20deg); transform-origin: bottom left; line-height: .73; }
.side .brand { padding-left: 4px; }
.login-card .logo-wrap { margin-bottom: 18px; }

/* купюры просчёта над этапом — в одну строку с названием */
.col-h .t { flex-wrap: nowrap; white-space: nowrap; }
.notes { display: inline-flex; gap: 4px; flex: none; }
.notes.edit { cursor: pointer; }
.note { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 19px; padding: 0 5px; border-radius: 3px; font-size: 11px; font-weight: 700; position: relative; letter-spacing: 0; text-transform: none; }
.note.b { background: #1f5fa3; color: #eaf2fb; border: 1px solid #12457c; }
.note.w { background: #fff; color: #2a2926; border: 1px solid #b9b5ab; }
.note::before { content: ""; position: absolute; inset: 2px; border: 1px dashed currentColor; opacity: .35; border-radius: 2px; pointer-events: none; }
.note.big { min-width: 76px; height: 30px; font-size: 13px; }
.rean-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 10px 14px; background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: 10px; }
.rean-bar > b { white-space: nowrap; }

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.rean-open { display: flex; gap: 14px; align-items: center; padding: 12px 14px; margin: 0 0 18px; border: 1px solid rgba(0,0,0,.08); border-radius: 10px; background: #fff; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfcac0; border-radius: 26px; cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: #b39560; }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: .5; cursor: default; }

#top-notes .notes { margin-right: 6px; }
#top-notes .note { height: 26px; min-width: 46px; font-size: 13px; padding: 0 8px; }

.cv-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid rgba(0,0,0,.05); color: var(--ink, #2a2926); }
.cv-row .switch { transform: scale(.8); transform-origin: left center; margin-right: -6px; }
