/* стили: deals (экран «Сделки»: доска, список, карточка сделки) */

/* ---------- верх: направления, сводка, панель ---------- */
.dl-pipes { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.dl-pipes::-webkit-scrollbar { display: none; }
.dl-pipes .tabs { flex-wrap: nowrap; }
.dl-pipes .tabs button { white-space: nowrap; }

.dl-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.dl-k { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--sh); text-align: left; min-width: 0; position: relative; }
.dl-k b { font: 500 22px/1.15 var(--head); letter-spacing: -.03em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-k small { font-size: 12px; color: var(--mute); }
.dl-k-m { background: var(--hero); border-color: transparent; color: var(--hero-ink); }
.dl-k-m .up, .dl-k-m small { color: var(--hero-mute); }
.dl-k-a { transition: border-color .15s, box-shadow .15s, transform .15s; }
.dl-k-a em { font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--blue); margin-top: 2px; }
.dl-k-a:hover { border-color: var(--blue); transform: translateY(-1px); }
.dl-k-a.has b { color: var(--red); }
.dl-k-a.on { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 14%, transparent); }

.dl-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.dl-q { flex: 1 1 280px; max-width: 420px; min-width: 0; }
.dl-q input::-webkit-search-cancel-button { cursor: pointer; }
.dl-ag { width: auto; min-width: 180px; max-width: 240px; flex: 0 1 auto; }
.dl-bar .seg button { display: inline-flex; align-items: center; gap: 6px; }
.dl-bar .seg svg.i { width: 15px; height: 15px; }
.dl-flt { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--blue-bg); color: #23318f; font-size: 13px; }
.dl-flt .lnk { font-size: 13px; }
.dl-tip { display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.dl-tip svg.i { width: 14px; height: 14px; }

/* ---------- доска ---------- */
.dl-board { display: flex; align-items: stretch; gap: 12px; overflow-x: auto; margin-top: 16px; padding: 2px 2px 14px; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #cfd4e4 transparent; }
.dl-board::-webkit-scrollbar { height: 10px; }
.dl-board::-webkit-scrollbar-thumb { background: #cfd4e4; border-radius: 99px; border: 3px solid var(--bg); }
.dl-col { flex: 0 0 276px; display: flex; flex-direction: column; min-height: 380px; background: color-mix(in srgb, var(--bg2) 60%, var(--bg)); border: 1px solid transparent; border-radius: 18px; transition: background .15s, border-color .15s; }
.dl-col, .dl-card, .dl-cards { min-width: 0; }
.dl-ch { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.dl-ch b { flex: 1; font-size: 13px; line-height: 1.25; min-width: 0; }
.dl-ch i { font: 600 11px var(--mono); font-style: normal; color: var(--ink2); background: var(--paper); padding: 2px 8px; border-radius: 99px; }
.dl-n { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--paper); font: 600 10.5px var(--mono); color: var(--mute); }
.dl-rd { font: 700 10.5px var(--mono); color: #fff; background: var(--red); padding: 2px 7px; border-radius: 99px; }
.dl-gate { display: flex; align-items: flex-start; gap: 6px; margin: 0 12px 8px; padding: 6px 9px; border-radius: 9px; background: var(--paper); font-size: 11px; line-height: 1.35; color: var(--ink2); }
.dl-gate svg.i { width: 13px; height: 13px; color: var(--gold, var(--amber)); margin-top: 1px; }
.dl-cards { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 0 8px 10px; }
.dl-empty { flex: 1; min-height: 90px; display: grid; place-items: center; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--mute); font-size: 12px; text-align: center; padding: 12px; }
.dl-sep { display: flex; align-items: center; gap: 8px; margin: 6px 4px 0; font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.dl-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dl-sep i { font-style: normal; order: 1; }
.dl-cfoot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--mute); }
.dl-cfoot b { font: 600 12px var(--mono); color: var(--ink); }
.dl-col.dl-over { background: var(--blue-bg); border-color: var(--blue); border-style: dashed; }
.dl-col.dl-over.dl-lock { background: var(--amber-bg); border-color: var(--amber); }

/* карточка */
.dl-card { position: relative; display: flex; flex-direction: column; gap: 7px; padding: 12px 12px 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(11,18,48,.05); cursor: grab; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; outline: none; }
.dl-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: transparent; }
.dl-card.dl-red::before { background: var(--red); }
.dl-card.dl-amber::before { background: var(--amber); }
.dl-card:hover { border-color: #cdd3e6; box-shadow: var(--sh); transform: translateY(-1px); }
.dl-card:focus-visible { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
.dl-card.dl-closed { cursor: pointer; opacity: .62; background: color-mix(in srgb, var(--paper) 60%, transparent); box-shadow: none; }
.dl-card.dl-closed:hover { opacity: 1; }
.dl-ct { display: flex; align-items: flex-start; gap: 6px; }
.dl-ct b { flex: 1; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-chain { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--violet-bg); color: var(--violet); }
.dl-chain svg.i { width: 13px; height: 13px; }
.dl-cl { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink2); font-weight: 600; min-width: 0; }
.dl-cl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-cl svg.i { width: 13px; height: 13px; color: var(--mute); }
.dl-ob { font-size: 12px; color: var(--mute); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dl-nx { display: flex; align-items: flex-start; gap: 7px; padding: 8px 9px; border-radius: 10px; background: var(--bg); font-size: 12px; line-height: 1.35; }
.dl-nx svg.i { width: 14px; height: 14px; margin-top: 1px; color: var(--blue); }
.dl-nx span { display: block; font-weight: 600; color: var(--ink); }
.dl-nx small { display: block; font-size: 11.5px; color: var(--mute); margin-top: 1px; }
.dl-nx.dl-none { background: var(--red-bg); color: var(--red); font-weight: 700; }
.dl-nx.dl-none span { color: var(--red); }
.dl-nx.dl-none svg.i { color: var(--red); }
.dl-closed .dl-nx { background: transparent; padding: 0; align-items: center; gap: 8px; }
.dl-hot { display: inline-flex; align-self: flex-start; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 99px; background: var(--amber-bg); color: var(--amber); font-size: 11.5px; font-weight: 700; }
.dl-hot svg.i { width: 13px; height: 13px; }
.dl-cf { display: flex; align-items: center; gap: 7px; padding-top: 2px; min-height: 32px; }
.dl-cf .sp { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-fee { font: 600 11.5px var(--mono); color: var(--ink2); background: var(--bg); padding: 3px 7px; border-radius: 7px; white-space: nowrap; }
.dl-mv { display: inline-flex; gap: 2px; }
.dl-mv .btn.ic.sm { width: 28px; height: 28px; border-radius: 8px; color: var(--ink2); }
.dl-mv .btn[disabled] { opacity: .25; }
@media (hover: hover) {
  .dl-mv { opacity: 0; transition: opacity .15s; }
  .dl-card:hover .dl-mv, .dl-card:focus-within .dl-mv { opacity: 1; }
}

/* перетаскивание */
.dl-ghost { position: fixed; z-index: 120; pointer-events: none; margin: 0; transform: rotate(2.5deg); box-shadow: var(--sh-l); border-color: var(--blue); cursor: grabbing; opacity: .97; }
.dl-card.dl-lift { opacity: .35; border-style: dashed; box-shadow: none; transform: none; }
body.dl-dragging, body.dl-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }

/* ---------- список ---------- */
.dl-list .t td { vertical-align: top; }
.dl-list .t tbody tr { position: relative; }
.dl-list .t tbody tr.dl-tr-red td:first-child { box-shadow: inset 4px 0 0 var(--red); }
.dl-list .t tbody tr.dl-tr-amber td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
.dl-list .t tbody tr.dl-tr-done { opacity: .6; }
.dl-sort { display: inline-flex; align-items: center; gap: 4px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.dl-sort svg.i { width: 12px; height: 12px; opacity: 0; }
.dl-sort:hover { color: var(--ink); }
.dl-sort.on { color: var(--blue); }
.dl-sort.on svg.i { opacity: 1; }
.dl-hl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.dl-hl i { width: 9px; height: 9px; border-radius: 50%; background: var(--mute); }
.dl-hl-red { color: var(--red); } .dl-hl-red i { background: var(--red); }
.dl-hl-amber { color: var(--amber); } .dl-hl-amber i { background: var(--amber); }
.dl-hl-ok { color: var(--green); } .dl-hl-ok i { background: var(--green); }
.dl-hl-done { color: var(--mute); }
.dl-tt { display: block; font-size: 13.5px; min-width: 200px; }
.dl-tt svg.i { width: 13px; height: 13px; color: var(--violet); vertical-align: -2px; }
.dl-prog { height: 4px; border-radius: 99px; background: var(--bg2); overflow: hidden; margin: 5px 0 3px; min-width: 70px; }
.dl-prog i { display: block; height: 100%; border-radius: 99px; background: var(--blue); }

/* ---------- карточка сделки (боковая панель) ---------- */
.dl-sub { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; margin-left: 6px; color: var(--ink2); font-weight: 600; }
.dl-sub .av.sm { width: 20px; height: 20px; font-size: 8.5px; }
.dw-h .tag svg.i { width: 12px; height: 12px; }
.dl-box { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.dl-bh { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dl-bh .sec-t { flex: 1; margin: 0; }

/* лента этапов */
.dl-rib { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-st { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px 0 5px; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink2); transition: border-color .15s, background .15s; }
.dl-st i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 10.5px var(--mono); font-style: normal; background: var(--bg2); color: var(--mute); flex: none; }
.dl-st i svg.i { width: 12px; height: 12px; stroke-width: 2.4; }
.dl-st:hover { border-color: var(--blue); }
.dl-st.done { background: var(--green-bg); border-color: transparent; color: #0a5c3b; }
.dl-st.done i { background: var(--green); color: #fff; }
.dl-st.on { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); box-shadow: 0 6px 16px -8px rgba(11,18,48,.5); }
.dl-st.on i { background: var(--blue); color: #fff; }
.dl-st[disabled] { cursor: default; }
.dl-st .dl-lk { width: 13px; height: 13px; color: var(--amber); }
.dl-ribf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line2); }

/* следующее действие */
.dl-next { border-width: 1px; }
.dl-next.dl-h-red { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); box-shadow: inset 4px 0 0 var(--red); }
.dl-next.dl-h-amber { border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); box-shadow: inset 4px 0 0 var(--amber); }
.dl-cur { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--blue-bg); }
.dl-cur > svg.i { color: var(--blue); width: 20px; height: 20px; }
.dl-cur b { display: block; font-size: 14px; }
.dl-cur.late { background: var(--red-bg); }
.dl-cur.late > svg.i { color: var(--red); }
.dl-nf { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.dl-nf .f.sp { flex: 1 1 260px; }
.dl-nf .f:not(.sp) { flex: 0 1 220px; }
.dl-next .chip.on, .dl-rs .chip.on { background: var(--blue-bg); color: var(--blue); border-color: var(--blue); }
.dl-next .chip { height: 32px; font-size: 12.5px; }

.dl-lnk { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 600; flex-wrap: wrap; }
.dl-lnk:hover { color: var(--blue); }
.dl-lnk svg.i { width: 14px; height: 14px; color: var(--blue); }
.dl-box .kv select.in.sm { width: auto; max-width: 100%; }

/* сроки */
.dl-dl { gap: 10px !important; padding: 10px 0 !important; }
.dl-dl > svg.i { color: var(--amber); }
.dl-add { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.dl-add select.in { flex: 1 1 200px; width: auto; }
.dl-add input.in { flex: 0 1 160px; width: auto; }

/* документы */
.dl-docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dl-doc { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-align: left; background: var(--paper); transition: border-color .15s, background .15s; min-width: 0; }
.dl-doc:hover { border-color: var(--blue); }
.dl-doc b { display: block; font-size: 12.5px; line-height: 1.3; }
.dl-doc small { display: block; font-size: 11px; color: var(--mute); margin-top: 2px; line-height: 1.3; }
.dl-cb { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid #cfd4e4; display: grid; place-items: center; color: transparent; margin-top: 1px; transition: .15s; }
.dl-cb svg.i { width: 13px; height: 13px; stroke-width: 2.6; }
.dl-doc.on { background: var(--green-bg); border-color: transparent; }
.dl-doc.on .dl-cb { background: var(--green); border-color: var(--green); color: #fff; }
.dl-doc.need { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); background: var(--red-bg); }
.dl-doc.need small { color: var(--red); font-weight: 700; }
.dl-doc .dl-lk { width: 14px; height: 14px; color: var(--amber); margin-top: 3px; }
.dl-more { margin-top: 12px; }
.dl-more summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--blue); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.dl-more summary::-webkit-details-marker { display: none; }
.dl-more summary::before { content: "+"; font: 600 14px var(--mono); }
.dl-more[open] summary::before { content: "−"; }

/* цепочка */
.dl-chn { display: flex; flex-direction: column; gap: 8px; position: relative; }
.dl-cn { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); }
.dl-cn .sp { min-width: 180px; }
.dl-cn b { font-size: 13px; }
.dl-cn.me { background: var(--violet-bg); border-color: transparent; }
.dl-cn .dl-prog i { background: var(--violet); }

/* комиссия */
.dl-fee-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dl-fee-h .price { font-size: 22px; }
.dl-fee-in { width: 170px; }
.dl-split { display: flex; flex-direction: column; margin-top: 12px; border-top: 1px solid var(--line2); }
.dl-sr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line2); flex-wrap: wrap; }
.dl-sr .sp { min-width: 120px; }
.dl-pin { display: inline-flex; align-items: center; gap: 4px; }
.dl-pin input { width: 62px; }
.dl-pin span { font-size: 12px; color: var(--mute); font-weight: 700; }
.dl-pc { width: 62px; text-align: right; font: 600 13px var(--mono); padding-right: 9px; }
.dl-auto { width: 32px; text-align: center; }
.dl-sum-r { width: 110px; text-align: right; font-size: 13px; }

/* история */
.dl-note { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.dl-note textarea { min-height: 60px; }
.dl-hist { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; position: relative; }
.dl-hist li { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.dl-hist li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 36px; bottom: -6px; width: 1.5px; background: var(--line2); }
.dl-hi { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); color: var(--ink2); }
.dl-hi svg.i { width: 14px; height: 14px; }
.dl-hist .k-stage .dl-hi { background: var(--blue-bg); color: var(--blue); }
.dl-hist .k-close .dl-hi, .dl-hist .k-done .dl-hi { background: var(--green-bg); color: var(--green); }
.dl-hist .k-doc .dl-hi { background: var(--gold-bg, var(--amber-bg)); color: var(--gold, var(--amber)); }
.dl-hist .k-deadline .dl-hi { background: var(--amber-bg); color: var(--amber); }
.dl-hist .k-split .dl-hi, .dl-hist .k-agent .dl-hi { background: var(--violet-bg); color: var(--violet); }

/* модалки: ворота, отказ, новая сделка */
.dl-gl { display: flex; flex-direction: column; gap: 8px; }
.dl-gi { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; flex-wrap: wrap; transition: background .2s; }
.dl-gi b { font-size: 13.5px; }
.dl-gi .sp { min-width: 160px; }
.dl-gx { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-bg); color: var(--amber); flex: none; }
.dl-gi.ok { background: var(--green-bg); border-color: transparent; }
.dl-gi.ok .dl-gx { background: var(--green); color: #fff; }
.dl-rs { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-rs .chip { height: auto; min-height: 34px; padding: 6px 12px; text-align: left; }
.dl-nbox { padding: 14px; border-radius: 14px; background: var(--bg); }
.dl-me { height: 40px; font-weight: 600; }

@media (max-width: 1100px) {
  .dl-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .dl-col { flex-basis: 252px; min-height: 300px; }
  .dl-cf .sp { visibility: hidden; }
  .dl-q { max-width: none; flex-basis: 100%; }
  .dl-ag { flex: 1 1 auto; max-width: none; }
  .dl-docs { grid-template-columns: minmax(0, 1fr); }
  .dl-box { padding: 14px; }
  .dl-st span { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dl-fee-in { width: 100%; }
  .dl-sum-r { width: auto; margin-left: auto; }
}
@media (max-width: 520px) {
  .dl-sum { gap: 8px; }
  .dl-k { padding: 12px; }
  .dl-k b { font-size: 18px; }
  .dl-k small { font-size: 11px; }
  .dl-col { flex-basis: 84vw; }
  .dl-bar .seg { flex: 1; } .dl-bar .seg button { flex: 1; justify-content: center; }
  .dl-nf .f:not(.sp) { flex-basis: 100%; }
  .dl-ribf .btn { flex: 1; }
}
