/* ============================================================
   V-Alter ЛК — прототип, этап 1. Общая дизайн-система.
   ============================================================ */
:root{
  --bg:#f4f6fa; --card:#ffffff; --line:#e5e9f0; --line-soft:#eef1f6;
  --text:#101c2c; --muted:#6b7a90; --faint:#9aa7ba;
  --accent:#2563eb; --accent-deep:#1d4fd7; --accent-soft:#eaf1ff; --accent-line:#c9dbff;
  --green:#16a34a; --green-soft:#e8f7ee; --green-line:#bfe6cd;
  --amber:#b45309; --amber-soft:#fdf3e3; --amber-line:#f3ddb0;
  --danger:#dc2626; --danger-soft:#fdecec; --danger-line:#f5c6c6;
  --r:14px; --shadow:0 1px 2px rgba(16,28,44,.05), 0 4px 16px rgba(16,28,44,.05);
}
*{box-sizing:border-box; margin:0; padding:0}
html,body{height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Inter,Roboto,Arial,sans-serif;
  background:var(--bg); color:var(--text); font-size:14px; line-height:1.45;
  -webkit-font-smoothing:antialiased;
}
button{font:inherit; cursor:pointer}
a{color:var(--accent); text-decoration:none}
.num{font-variant-numeric:tabular-nums}
svg{display:block}

/* ---------- Topbar ---------- */
.topbar{position:sticky; top:0; z-index:50; background:var(--card); border-bottom:1px solid var(--line)}
.topbar-in{max-width:1280px; margin:0 auto; padding:0 20px; height:56px; display:flex; align-items:center; gap:22px}
.brand{display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:.06em; color:var(--text); font-size:14px}
.brand-mark{width:30px;height:30px;border-radius:9px;background:linear-gradient(135deg,#2563eb,#173e9e);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:800;letter-spacing:0}
.op-chip{font-size:10.5px; font-weight:800; letter-spacing:.09em; color:var(--accent-deep); background:var(--accent-soft); border:1px solid var(--accent-line); padding:3px 8px; border-radius:6px}
.nav{display:flex; gap:4px}
.nav a{padding:7px 12px; border-radius:9px; color:var(--muted); font-weight:500}
.nav a.on{color:var(--text); background:var(--line-soft); font-weight:600}
.nav a:hover{color:var(--text)}
.nav a .n{display:inline-block; min-width:17px; padding:1px 5px; margin-left:5px; border-radius:999px; background:var(--danger); color:#fff; font-size:10.5px; font-weight:700; text-align:center}
.rates{margin-left:auto; display:flex; gap:14px; color:var(--muted); font-size:12.5px; white-space:nowrap}
.rates b{color:var(--text); font-weight:600}
.rates .cbr{color:var(--faint)}
.bell{position:relative; width:34px;height:34px;border-radius:9px;border:1px solid var(--line);background:var(--card);display:grid;place-items:center;color:var(--muted)}
.bell:hover{background:var(--line-soft)}
.bell .dot{position:absolute; top:7px; right:8px; width:7px;height:7px;border-radius:50%;background:var(--danger);border:1.5px solid #fff}
.user{display:flex;align-items:center;gap:9px;padding:5px 10px 5px 6px;border:1px solid var(--line);border-radius:11px;background:var(--card)}
.user:hover{background:var(--line-soft)}
/* Аватар: V-знак логотипа (фото профиля — бэклог §26); инициалы скрыты font-size:0 */
.ava{width:26px;height:26px;border-radius:8px;background:#dbe7ff url('/static/logo-mark.svg') center/58% no-repeat;color:transparent;display:grid;place-items:center;font-size:0; flex:0 0 auto}
.user span{font-weight:600; font-size:13px}
.user .chev{color:var(--faint); font-size:10px}
.rates-m{display:none}

/* ---------- Layout ---------- */
.wrap{max-width:1280px; margin:0 auto; padding:20px}
.wrap.narrow{max-width:860px}
.crumbs{display:flex; align-items:center; gap:8px; margin-bottom:12px; color:var(--muted); font-size:13px}
.crumbs a{color:var(--muted)} .crumbs a:hover{color:var(--accent)}
.head{display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:16px}
.head h1{font-size:21px; font-weight:700; letter-spacing:-.01em}
.head time{color:var(--faint); font-size:13px; margin-left:auto}
.head .sp{margin-left:auto}
.cols{display:grid; grid-template-columns:440px 1fr; gap:20px; align-items:start}
.cols.half{grid-template-columns:1fr 1fr}
/* Грид-элементы не ужимаются ниже min-content содержимого — без этого
   широкая строка (например, документ досье) распирает колонку, и вся
   страница уезжает за экран на мобильном */
.cols > *{min-width:0}

/* ---------- Badges ---------- */
.badge{display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border-radius:999px; font-size:12.5px; font-weight:600; white-space:nowrap}
.badge.blue{background:var(--accent-soft); color:var(--accent-deep); border:1px solid var(--accent-line)}
.badge.grn{background:var(--green-soft); color:var(--green); border:1px solid var(--green-line)}
.badge.gray{background:var(--line-soft); color:var(--muted); border:1px solid var(--line)}
.badge.red{background:var(--danger-soft); color:var(--danger); border:1px solid var(--danger-line)}
.badge.act{background:var(--amber-soft); color:var(--amber); border:1px solid var(--amber-line)}
.badge.act::before{content:"⚡"; font-size:11px}
.badge.sm{padding:3px 9px; font-size:11.5px}

/* ---------- Cards / tabs ---------- */
.card{background:var(--card); border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow)}
.card .pad{padding:16px 18px}
.card h3{font-size:15px; font-weight:700; margin-bottom:4px}
.sect-t{padding:16px 18px 4px; font-size:12px; font-weight:700; letter-spacing:.08em; color:var(--faint); text-transform:uppercase}
.tabs{display:flex; gap:2px; padding:6px; border-bottom:1px solid var(--line-soft)}
.tabs button{flex:0 0 auto; border:0; background:none; padding:8px 13px; border-radius:9px; color:var(--muted); font-weight:600; font-size:13.5px}
.tabs button .n{display:inline-block; min-width:18px; padding:1px 5px; margin-left:5px; border-radius:999px; background:var(--line-soft); color:var(--muted); font-size:11px; text-align:center}
.tabs button.on{background:var(--accent-soft); color:var(--accent-deep)}
.tabs button.on .n{background:#d8e6ff; color:var(--accent-deep)}
/* Точка непрочитанного на вкладке «Чат» (видимость управляет JS) */
.tabs .dot{width:8px; height:8px; border-radius:50%; background:var(--danger); margin-left:6px; vertical-align:1px}
.tabs button.m{display:none}
.pane{display:none} .pane.on{display:block}

/* ---------- Info rows ---------- */
.rows{padding:8px 18px}
.row{display:flex; justify-content:space-between; gap:16px; padding:9px 0; border-bottom:1px solid var(--line-soft); font-size:13.5px}
.row:last-child{border-bottom:0}
.row dt{color:var(--muted); flex:0 0 auto}
.row dd{font-weight:550; text-align:right}
.row dd small{display:block; color:var(--faint); font-weight:400}
.row.total dd{font-weight:700; font-size:15px}
.row .fix{color:var(--green); font-size:12px; font-weight:600}

/* ---------- Buttons ---------- */
.btn{border-radius:10px; padding:8px 14px; font-weight:600; font-size:13px; border:1px solid transparent; display:inline-flex; align-items:center; gap:7px}
.btn.pri{background:var(--accent); color:#fff}
.btn.pri:hover{background:var(--accent-deep)}
.btn.sec{background:#fff; border-color:var(--accent-line); color:var(--accent-deep)}
.btn.sec:hover{background:var(--accent-soft)}
.btn.grn{background:var(--green); color:#fff}
.btn.grn:hover{filter:brightness(.94)}
.btn.dgr{background:#fff; border-color:var(--danger-line); color:var(--danger)}
.btn.dgr:hover{background:var(--danger-soft)}
.btn.ghost{background:none; color:var(--muted); border-color:var(--line)}
.btn.ghost:hover{background:var(--line-soft); color:var(--text)}
.btn.lg{padding:11px 18px; font-size:14px; border-radius:12px}
.btn.w{width:100%; justify-content:center}

/* ---------- Action panel ---------- */
.action{margin:14px 16px 16px; padding:14px 16px; border-radius:12px; background:var(--accent-soft); border:1px solid var(--accent-line)}
.action b{display:flex; align-items:center; gap:7px; color:var(--accent-deep); font-size:13.5px}
.action p{color:#3b5273; font-size:13px; margin:6px 0 12px}
.action .btns{display:flex; gap:8px; flex-wrap:wrap}
.action.warn{background:var(--amber-soft); border-color:var(--amber-line)}
.action.warn b{color:var(--amber)} .action.warn p{color:#7a5a1f}

/* ---------- Alerts ---------- */
.alert{display:flex; gap:10px; align-items:flex-start; padding:12px 15px; border-radius:12px; font-size:13px; margin-bottom:16px}
.alert.info{background:var(--accent-soft); border:1px solid var(--accent-line); color:#31517e}
.alert.warn{background:var(--amber-soft); border:1px solid var(--amber-line); color:#7a5a1f}
.alert.err{background:var(--danger-soft); border:1px solid var(--danger-line); color:var(--danger)}
.alert b{font-weight:700}

/* ---------- Timeline ---------- */
.tl{list-style:none; padding:8px 18px 18px}
.tl li{position:relative; padding:0 0 22px 34px}
.tl li:last-child{padding-bottom:2px}
.tl li::before{content:""; position:absolute; left:10px; top:22px; bottom:-2px; width:2px; background:var(--line)}
.tl li:last-child::before{display:none}
.tl li.done::before{background:var(--green-line)}
.tl .dot{position:absolute; left:0; top:1px; width:22px; height:22px; border-radius:50%; display:grid; place-items:center; font-size:11px; font-weight:700; background:#fff; border:2px solid var(--line); color:var(--faint)}
.tl li.done .dot{background:var(--green); border-color:var(--green); color:#fff}
.tl li.cur .dot{border-color:var(--accent); color:var(--accent)}
.tl li.cur .dot::after{content:""; width:8px; height:8px; border-radius:50%; background:var(--accent); animation:pulse 1.8s ease-out infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(37,99,235,.35)} 70%{box-shadow:0 0 0 9px rgba(37,99,235,0)} 100%{box-shadow:0 0 0 0 rgba(37,99,235,0)}}
.tl .t{font-weight:600; font-size:13.5px; color:var(--faint)}
.tl li.done .t, .tl li.cur .t{color:var(--text)}
.tl time{display:block; color:var(--faint); font-size:12px; margin-top:1px}
.tl .note{color:var(--muted); font-size:12.5px; margin-top:2px}
.tl li.cur .hint{margin-top:7px; padding:10px 12px; border-radius:10px; background:var(--accent-soft); border:1px solid var(--accent-line); color:#31517e; font-size:12.5px}
.tl li.fin .dot{border-style:dashed}

/* мини-прогресс этапов в списке заявок */
.stage-mini{display:flex; gap:4px; align-items:center}
.stage-mini i{width:14px; height:5px; border-radius:3px; background:var(--line)}
.stage-mini i.d{background:var(--green)}
.stage-mini i.c{background:var(--accent)}

/* ---------- Files ---------- */
.files{padding:14px 16px 16px; display:grid; gap:10px}
.file{display:flex; align-items:center; gap:12px; padding:11px 12px; border:1px solid var(--line); border-radius:12px; background:#fff}
.file:hover{border-color:var(--accent-line); background:#fbfcff}
.fico{width:38px; height:38px; border-radius:10px; display:grid; place-items:center; font-size:10.5px; font-weight:800; letter-spacing:.03em; background:var(--accent-soft); color:var(--accent-deep); flex:0 0 auto}
.file .fi b{display:block; font-size:13px; font-weight:600; word-break:break-all}
.file .fi span{color:var(--faint); font-size:12px}
.file .end{margin-left:auto; display:flex; gap:6px; align-items:center; flex:0 0 auto;
  flex-wrap:wrap; justify-content:flex-end; row-gap:4px; max-width:62%}
/* Строки людей и документов (заголовок — фраза, не имя файла): не рвём посреди слова */
.file.person .fi, .file.doc .fi{flex:1; min-width:130px}
.file.person .fi b, .file.doc .fi b{word-break:normal; overflow-wrap:break-word}
.file .dl{width:32px; height:32px; border-radius:9px; border:1px solid var(--line); background:#fff; color:var(--muted); display:grid; place-items:center}
.file .dl:hover{color:var(--accent); border-color:var(--accent-line)}
.files .stub{padding:12px; border:1.5px dashed var(--line); border-radius:12px; color:var(--faint); font-size:12.5px; text-align:center}
/* Формы загрузки: input type=file имеет большую врождённую ширину и
   распирает грид на мобильном — разрешаем перенос и ужатие */
.files form,.action form{flex-wrap:wrap}
.files input[type=file],.action input[type=file]{min-width:0; max-width:100%}
/* Строка выбора файла в форме загрузки документа */
.uprow{display:flex; gap:10px; align-items:center; min-width:0; flex-wrap:wrap}

/* ---------- Chat ---------- */
.chat{display:flex; flex-direction:column; min-height:640px; max-height:calc(100vh - 210px)}
.chat.short{min-height:420px; max-height:520px}
.chat-h{display:flex; align-items:center; gap:11px; padding:13px 18px; border-bottom:1px solid var(--line-soft)}
.chat-h .ava{width:34px; height:34px; border-radius:10px; font-size:12px}
.chat-h b{font-size:14px}
.chat-h .st{display:block; font-size:12px; color:var(--green); font-weight:500}
.chat-h .st::before{content:"●"; font-size:8px; vertical-align:1.5px; margin-right:5px}
.chat-h .find{margin-left:auto; color:var(--faint); width:34px;height:34px; border:1px solid var(--line); border-radius:9px; background:#fff; display:grid; place-items:center}
.log{flex:1; overflow-y:auto; padding:18px; display:flex; flex-direction:column; gap:12px; background:#fafbfd}
.day{align-self:center; font-size:11.5px; color:var(--faint); background:var(--line-soft); padding:3px 11px; border-radius:999px}
/* Системная вставка о статусе — лаконичная строка с бейджем дизайн-системы
   (чёрный чип убран — заказчик, 05.07.2026) */
.sys{align-self:center; display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted)}
.sys time{color:var(--faint)}
.msg{max-width:72%; padding:10px 13px; border-radius:14px; font-size:13.5px}
.msg .meta{display:flex; gap:8px; margin-top:5px; font-size:11.5px; color:var(--faint)}
.msg.op{align-self:flex-start; background:#fff; border:1px solid var(--line); border-bottom-left-radius:5px; box-shadow:var(--shadow)}
.msg.op .who{font-size:12px; font-weight:700; color:var(--accent-deep); margin-bottom:3px}
.msg.me{align-self:flex-end; background:var(--accent-soft); border:1px solid var(--accent-line); border-bottom-right-radius:5px}
.msg.me .meta{justify-content:flex-end}
.msg .fmsg{display:flex; align-items:center; gap:11px; margin:2px 0 8px; padding:10px 11px; background:#fbfcff; border:1px solid var(--accent-line); border-radius:11px}
.msg .fmsg b{display:block; font-size:12.5px; word-break:break-all}
.msg .fmsg span{font-size:11.5px; color:var(--faint)}
.composer{display:flex; align-items:center; gap:10px; padding:12px 14px; border-top:1px solid var(--line-soft); background:#fff; border-radius:0 0 var(--r) var(--r)}
.icon-b{width:38px; height:38px; border-radius:11px; border:1px solid var(--line); background:#fff; color:var(--muted); display:grid; place-items:center; flex:0 0 auto}
.icon-b:hover{color:var(--accent); border-color:var(--accent-line)}
.composer input{flex:1; border:1px solid var(--line); border-radius:11px; padding:10px 13px; font:inherit; background:var(--bg)}
.composer input:focus{outline:2px solid var(--accent-line); background:#fff}
.send{width:38px; height:38px; border-radius:11px; border:0; background:var(--accent); color:#fff; display:grid; place-items:center; flex:0 0 auto}
.send:hover{background:var(--accent-deep)}

/* ---------- Toolbar / filters ---------- */
.toolbar{display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap}
.chips{display:flex; gap:6px; flex-wrap:wrap}
.chips button{border:1px solid var(--line); background:#fff; color:var(--muted); border-radius:999px; padding:6px 13px; font-size:12.5px; font-weight:600}
.chips button.on{background:var(--text); border-color:var(--text); color:#fff}
.chips button .n{margin-left:5px; opacity:.65; font-weight:700}
.search{display:flex; align-items:center; gap:8px; flex:1; min-width:180px; max-width:340px; border:1px solid var(--line); border-radius:11px; background:#fff; padding:8px 12px; color:var(--faint)}
.search input{border:0; outline:0; font:inherit; width:100%; background:none; color:var(--text)}

/* ---------- Deal list (клиент) ---------- */
.dlist{display:grid; gap:10px}
.deal-row{display:grid; grid-template-columns:150px 1fr 170px 170px 130px; gap:14px; align-items:center; padding:14px 18px; background:#fff; border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow); color:var(--text)}
.deal-row:hover{border-color:var(--accent-line)}
.deal-row .no b{display:block; font-size:13.5px; font-weight:700}
.deal-row .no span{font-size:12px; color:var(--faint)}
.deal-row .to b{display:block; font-size:13.5px; font-weight:600}
.deal-row .to span{font-size:12px; color:var(--muted)}
.deal-row .sum{text-align:right}
.deal-row .sum b{display:block; font-size:14px; font-weight:700}
.deal-row .sum span{font-size:12px; color:var(--faint)}
.deal-row .st{display:grid; gap:6px; justify-items:start}
.deal-row .st .lb{font-size:12px; color:var(--muted)}
.deal-row .end{text-align:right; font-size:12px; color:var(--faint)}

/* ---------- Tables (оператор) ---------- */
.table-wrap{overflow-x:auto; background:#fff; border:1px solid var(--line); border-radius:var(--r); box-shadow:var(--shadow)}
table.tb{width:100%; border-collapse:collapse; font-size:13px; min-width:760px}
.tb th{font-size:11.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--faint); font-weight:700; text-align:left; padding:12px 14px; border-bottom:1px solid var(--line)}
.tb td{padding:12px 14px; border-bottom:1px solid var(--line-soft); vertical-align:middle}
.tb tr:last-child td{border-bottom:0}
.tb tbody tr:hover{background:#fbfcff; cursor:pointer}
.tb td b{font-weight:650}
.tb td .sub{display:block; font-size:12px; color:var(--faint)}
.tb .r{text-align:right}

/* ---------- Forms ---------- */
.frm .fld{margin-bottom:14px}
.frm label{display:block; font-size:12.5px; color:var(--muted); font-weight:600; margin-bottom:5px}
.frm label .req{color:var(--danger)}
.frm input[type=text],.frm input[type=email],.frm input[type=password],.frm input[type=tel],.frm input[type=number],.frm select,.frm textarea{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:11px; font:inherit; background:#fff; color:var(--text)}
.frm input:focus,.frm select:focus,.frm textarea:focus{outline:2px solid var(--accent-line); border-color:var(--accent-line)}
/* Режим «только просмотр» (отклонённый онбординг): поля видны, но явно неактивны */
.frm input:disabled,.frm select:disabled{background:#f4f6fa; color:var(--muted); -webkit-text-fill-color:var(--muted); opacity:1; cursor:not-allowed}
.frm textarea{resize:vertical; min-height:72px}
.frm .hint{font-size:12px; color:var(--faint); margin-top:4px}
.grid2{display:grid; grid-template-columns:1fr 1fr; gap:0 16px}
.grid3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:0 16px}
.fsect{padding:18px; border-bottom:1px solid var(--line-soft)}
.fsect:last-child{border-bottom:0}
.fsect > h4{font-size:12px; font-weight:700; letter-spacing:.08em; color:var(--faint); text-transform:uppercase; margin-bottom:14px}
.drop{border:1.5px dashed var(--accent-line); background:#fbfcff; border-radius:12px; padding:22px; text-align:center; color:var(--muted); font-size:13px}
.drop b{color:var(--accent-deep)}
.drop span{display:block; font-size:12px; color:var(--faint); margin-top:3px}
.check, .frm label.check{display:flex; gap:8px; align-items:center; font-size:13px;
  color:var(--text); font-weight:500; margin:0; text-transform:none; letter-spacing:0; cursor:pointer}
/* Кастомный чекбокс в духе дизайн-системы (скруглённый, синяя заливка, белая галочка) */
.check input{appearance:none; -webkit-appearance:none; margin:0; width:17px; height:17px; flex:0 0 auto;
  border:1.5px solid var(--line); border-radius:5px; background:#fff; cursor:pointer;
  position:relative; transition:border-color .12s, background .12s}
.check input:hover{border-color:var(--accent-line)}
.check input:checked{background:var(--accent); border-color:var(--accent)}
.check input:checked::after{content:""; position:absolute; left:4.5px; top:1.5px; width:5px; height:9px;
  border:solid #fff; border-width:0 2px 2px 0; transform:rotate(45deg)}
.check input:focus-visible{outline:2px solid var(--accent-line); outline-offset:1px}
/* Ряд чекбоксов, выровненный по высоте соседнего поля ввода */
.checks{display:flex; gap:16px; flex-wrap:wrap; align-items:center; min-height:41px}

/* ---------- Auth ---------- */
.auth-wrap{min-height:calc(100vh - 57px); display:grid; place-items:center; padding:30px 16px}
.auth{width:100%; max-width:420px}
.auth .logo{display:flex; justify-content:center; margin-bottom:18px}
.auth .card{padding:26px}
.auth h1{font-size:19px; text-align:center; margin-bottom:4px}
.auth .sub{text-align:center; color:var(--muted); font-size:13px; margin-bottom:20px}
.seg{display:flex; background:var(--line-soft); border-radius:11px; padding:4px; margin-bottom:20px}
.seg button{flex:1; border:0; background:none; padding:8px; border-radius:8px; font-weight:600; color:var(--muted); font-size:13.5px}
.seg button.on{background:#fff; color:var(--text); box-shadow:var(--shadow)}
.auth .foot{text-align:center; margin-top:14px; font-size:12.5px; color:var(--faint)}

/* ---------- Steps (онбординг) ---------- */
.steps{display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap}
.step{display:flex; align-items:center; gap:8px; padding:8px 14px; background:#fff; border:1px solid var(--line); border-radius:999px; font-size:12.5px; font-weight:600; color:var(--muted)}
.step i{width:20px; height:20px; border-radius:50%; display:grid; place-items:center; font-size:11px; font-style:normal; font-weight:700; background:var(--line-soft); color:var(--faint)}
.step.done{border-color:var(--green-line); color:var(--green)}
.step.done i{background:var(--green); color:#fff}
.step.cur{border-color:var(--accent-line); color:var(--accent-deep); background:var(--accent-soft)}
.step.cur i{background:var(--accent); color:#fff}

/* ---------- Notifications ---------- */
.ntf{display:grid; gap:8px}
.ntf a{display:flex; gap:13px; align-items:flex-start; padding:14px 16px; background:#fff; border:1px solid var(--line); border-radius:var(--r); color:var(--text); box-shadow:var(--shadow)}
.ntf a:hover{border-color:var(--accent-line)}
/* Иконки уведомлений: прозрачный фон, штриховые SVG (заказчик, 05.07.2026) */
.ntf .ic{width:36px; height:36px; display:grid; place-items:center; flex:0 0 auto; background:transparent; color:var(--accent-deep)}
.ntf .ic.warn{color:var(--amber)}
.ntf .ic.grn{color:var(--green)}
.ntf b{display:block; font-size:13.5px; font-weight:650}
.ntf p{font-size:12.5px; color:var(--muted); margin-top:1px}
.ntf time{margin-left:auto; font-size:12px; color:var(--faint); flex:0 0 auto}
.ntf .unread{position:relative}
.ntf .unread::before{content:""; position:absolute; left:6px; top:50%; transform:translateY(-50%); width:6px; height:6px; border-radius:50%; background:var(--accent)}

/* ---------- Прототип-навигатор ---------- */
.pnav-b{position:fixed; right:18px; bottom:18px; z-index:99; display:flex; align-items:center; gap:8px; background:var(--text); color:#fff; border:0; border-radius:999px; padding:10px 16px; font-weight:600; font-size:13px; box-shadow:0 6px 24px rgba(16,28,44,.25)}
.pnav{position:fixed; right:18px; bottom:66px; z-index:99; width:270px; background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:0 12px 40px rgba(16,28,44,.18); padding:14px; display:none}
.pnav.on{display:block}
.pnav h5{font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--faint); margin:10px 0 6px}
.pnav h5:first-child{margin-top:0}
.pnav a{display:block; padding:7px 10px; border-radius:8px; color:var(--text); font-size:13px; font-weight:500}
.pnav a:hover{background:var(--line-soft)}
.pnav a.here{background:var(--accent-soft); color:var(--accent-deep); font-weight:600}

/* ---------- Выравнивание колонок (десктоп) ----------
   Правый столбец (чат) прилипает к экрану и всегда занимает ровно
   его высоту — колонки не «обрываются» на разной высоте. */
@media (min-width:961px){
  /* Чат держит высоту экрана независимо от числа сообщений — иначе
     при коротком диалоге (напр. «Компания») он сжимался до контента и
     выглядел маленьким рядом с высоким чатом заявки (заказчик, 06.07.2026).
     Фиксированная height одинакова для «Компании» и заявки; не sticky —
     скроллится со страницей. min-height страхует низкие экраны. */
  .stick .chat{height:calc(100vh - 150px); min-height:520px; max-height:none}
}

/* ---------- Хаб сотрудника: конвейер + опердень ---------- */
.hub-conv{display:flex; align-items:center; gap:14px; justify-content:space-between}
.hub-node{flex:1; text-align:center; color:var(--text); padding:6px 4px; border-radius:12px}
.hub-node:hover{background:var(--bg)}
.hub-node .n{width:52px; height:52px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:19px; font-weight:700; font-variant-numeric:tabular-nums}
.hub-node .n.amber{background:var(--amber-soft); color:var(--amber); border:1px solid var(--amber-line)}
.hub-node .n.blue{background:var(--accent-soft); color:var(--accent-deep); border:1px solid var(--accent-line)}
.hub-node .n.grn{background:var(--green-soft); color:var(--green); border:1px solid var(--green-line)}
.hub-node b{display:block; font-size:13.5px; margin-top:8px}
.hub-node .sub{display:block; font-size:12px; color:var(--faint); margin-top:2px}
.hub-dash{flex:0 0 46px; border-top:2px dashed var(--line); margin-top:-38px}
.hub-task{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px 18px; border-top:1px solid var(--line-soft); color:var(--text); font-size:14px}
.hub-task:hover{background:var(--bg)}
.hub-task.muted span:first-child{color:var(--muted)}
.hub-ev{display:flex; gap:10px; padding:9px 18px; border-top:1px solid var(--line-soft); font-size:13px; line-height:1.45; color:var(--text)}
a.hub-ev:hover{background:var(--bg)}
.hub-ev time{color:var(--faint); flex:0 0 auto; font-variant-numeric:tabular-nums}
.hub-ev b{font-weight:600}
.hub-ev span{color:var(--muted); overflow-wrap:anywhere}
@media (max-width:960px){
  .hub-conv{flex-direction:column; gap:10px}
  .hub-dash{display:none}
  .hub-node{width:100%}
}

/* ---------- Бургер-меню (мобильная навигация) ---------- */
.burger{display:none; width:34px; height:34px; border-radius:9px; border:1px solid var(--line);
  background:#fff; color:var(--muted); flex:0 0 auto}
.mnav{display:none}

/* ---------- Mobile ---------- */
@media (max-width:960px){
  .topbar-in{padding:0 14px; gap:12px}
  .nav,.rates{display:none}
  .burger{display:grid; place-items:center}
  .topbar-in > .btn.ghost{display:none}   /* «Выйти» дублируется в меню */
  .mnav.open{display:block; position:absolute; top:57px; left:0; right:0; z-index:60;
    background:var(--card); border-bottom:1px solid var(--line);
    padding:10px 14px 14px; box-shadow:0 12px 24px rgba(16,28,44,.08)}
  .mnav a{display:block; padding:12px 12px; border-radius:10px; font-weight:600; color:var(--text)}
  .mnav a.on{background:var(--accent-soft); color:var(--accent-deep)}
  .mnav .sep{border-top:1px solid var(--line-soft); margin:8px 0}
  .mnav .who{padding:4px 12px 8px; font-size:12.5px; color:var(--faint)}
  .bell{margin-left:auto}
  .user span,.user .chev{display:none}
  .user{border:0; padding:0; background:none}
  .rates-m{display:flex; gap:14px; overflow-x:auto; padding:8px 16px; background:var(--card); border-bottom:1px solid var(--line); font-size:12px; color:var(--muted); white-space:nowrap}
  .rates-m b{color:var(--text)}
  .wrap{padding:14px}
  .head h1{font-size:18px}
  .head time{display:none}
  .cols,.cols.half{grid-template-columns:1fr; gap:14px}
  .grid2,.grid3{grid-template-columns:1fr}
  /* Узкий экран: строка документа переносится, а не задаёт мин-ширину */
  .file{flex-wrap:wrap}
  /* Вкладки не липкие — уезжают со скроллом, как и шапка (заказчик, 06.07.2026) */
  .tabs{background:var(--card); border-radius:var(--r) var(--r) 0 0; overflow-x:auto; scrollbar-width:none}
  .tabs::-webkit-scrollbar{display:none}
  .tabs button{padding:8px 11px; white-space:nowrap}
  .tabs button.m{display:block}
  .msg{max-width:86%}
  .deal-row{grid-template-columns:1fr 1fr; gap:10px 14px}
  .deal-row .sum{text-align:left}
  .deal-row .end{display:none}
  /* мобильные вкладки чата на карточке заявки */
  .chat-card{display:none; margin-top:0; border-top:0; border-radius:0 0 var(--r) var(--r)}
  body.v-chat .chat-card{display:block}
  body.v-chat .left .pane{display:none}
  body.v-chat .chat{min-height:0; height:calc(100vh - 205px)}
}

/* ---------- Toast-уведомления (бэклог §29, 06.07.2026) ----------
   Вместо полосы под шапкой: success/info — автоскрытие 5с с прогресс-
   полосой; error — заметный, закрывается вручную. Общий компонент с ERP. */
.toasts{position:fixed; top:68px; right:18px; z-index:200; display:grid; gap:10px; max-width:380px}
.toast-v{position:relative; display:flex; gap:10px; align-items:flex-start; padding:13px 15px; border-radius:13px;
  background:#fff; border:1px solid var(--line); box-shadow:0 8px 30px rgba(16,28,44,.16);
  font-size:13.5px; animation:toast-in .18s ease-out}
.toast-v.ok{border-color:var(--green-line)}
.toast-v.ok .tico{background:var(--green-soft); color:var(--green)}
.toast-v.err{border-color:var(--danger-line); background:#fffafa}
.toast-v.err .tico{background:var(--danger-soft); color:var(--danger)}
.toast-v .tico{width:30px; height:30px; border-radius:9px; display:grid; place-items:center;
  flex:0 0 auto; background:var(--accent-soft); color:var(--accent-deep); font-weight:800}
.toast-v .tx b{display:block; font-weight:700; font-size:13px}
.toast-v .tclose{margin-left:auto; border:0; background:none; color:var(--faint); font-size:16px;
  line-height:1; padding:2px 4px; flex:0 0 auto}
.toast-v .tclose:hover{color:var(--text)}
.toast-v .tbar{position:absolute; left:12px; right:12px; bottom:4px; height:3px; border-radius:2px;
  background:var(--line-soft); overflow:hidden}
.toast-v .tbar i{display:block; height:100%; background:var(--accent); animation:toast-life 5s linear forwards}
@keyframes toast-in{from{opacity:0; transform:translateY(-6px)} to{opacity:1; transform:none}}
@keyframes toast-life{from{width:100%} to{width:0}}
@media (prefers-reduced-motion: reduce){ .toast-v{animation:none} .toast-v .tbar i{animation:none; width:100%} }
@media (max-width:640px){ .toasts{left:14px; right:14px; max-width:none} }

/* ---------- Поиск по чату (бэклог §14) ---------- */
.chat-search{display:flex; align-items:center; gap:9px; padding:9px 14px; border-bottom:1px solid var(--line-soft); background:#fff}
.chat-search input{flex:1; border:1px solid var(--line); border-radius:9px; padding:7px 11px; font:inherit; background:var(--bg)}
.chat-search input:focus{outline:2px solid var(--accent-line); background:#fff}
.chat-search .csn{font-size:12px; color:var(--faint); white-space:nowrap}
.chat-search .csx{border:0; background:none; color:var(--faint); font-size:17px; line-height:1; padding:2px 5px}
.chat-search .csx:hover{color:var(--text)}
.log mark{background:#ffe9a8; border-radius:3px; padding:0 1px}
