/* ── Заявки v2 ─────────────────────────────────────────────────────────
   Inbox = the same messenger card as «Чаты» (list on paper-2, the booking on
   the right); board = status columns. Card internals (.bk-card, .bk-tab*,
   .bk-pipeline, .bk-money…) keep their rules in styles.css. */

.bk-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.bk-search { position: relative; display: block; flex: 0 1 340px; }
.bk-search svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; fill: none; stroke: var(--subtle); stroke-width: 2; stroke-linecap: round;
  pointer-events: none;
}
.bk-search input { width: 100%; margin: 0; padding-left: 38px; border-radius: var(--r-pill); }
.bk-mine {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.bk-mine:hover { border-color: var(--field-border); color: var(--ink); }
.bk-mine.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }

/* KPI strip */
.bk-kpis {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--stroke); border-radius: var(--r-lg); overflow: hidden;
}
.bk-kpis:empty { display: none; }
.bk-kpi {
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; min-width: 0;
  background: transparent; border: 0; border-radius: 0;
  box-shadow: inset -1px 0 0 var(--divider), inset 0 -1px 0 var(--divider);
}
.bk-kpi.is-click { cursor: pointer; }
.bk-kpi.is-click:hover { background: var(--paper-2); }
.bk-kpi-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.bk-kpi-value {
  font-family: var(--font-ui); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  color: var(--ink); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap;
}
.bk-kpi-sub { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.bk-kpi-lost { display: block; margin-top: 2px; color: var(--ink-2); }
.bk-kpi.is-hot .bk-kpi-value { color: var(--amber); }

/* Inbox */
.bk-inbox {
  display: grid; grid-template-columns: 400px minmax(0, 1fr);
  height: max(560px, calc(100vh - 290px));
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--sh-card);
}
.bk-list-panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: var(--paper-2); border-right: 1px solid var(--divider);
}
.bk-tabs-row {
  display: flex; gap: 2px; margin: 14px 12px 8px; padding: 3px;
  background: var(--elevated); border-radius: var(--r-md);
  overflow-x: auto; scrollbar-width: none;
}
.bk-tabs-row::-webkit-scrollbar { display: none; }
.bk-ltab {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 0; background: none; border-radius: var(--r-sm); padding: 6px 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--subtle); white-space: nowrap;
}
.bk-ltab:hover { color: var(--ink); }
.bk-ltab.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(43, 54, 85, .12); }
.bk-ltab-n { font-size: 11px; opacity: .65; font-variant-numeric: tabular-nums; }
.bk-ltab.hot .bk-ltab-n {
  opacity: 1; min-width: 18px; padding: 0 5px; line-height: 17px; text-align: center;
  background: var(--accent); color: #fff; border-radius: var(--r-pill);
}
.bk-list-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 14px; }
.bk-list-empty { padding: 48px 16px; text-align: center; color: var(--subtle); font-size: 13.5px; }

.bk-item {
  position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 12px; padding: 10px; margin-bottom: 1px;
  cursor: pointer; font-size: 14px; color: var(--ink);
  transition: background .12s ease, box-shadow .12s ease;
}
.bk-item:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.bk-item.active { background: var(--surface); box-shadow: 0 1px 3px rgba(43, 54, 85, .10), inset 3px 0 0 var(--accent); }
.bk-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bk-item-top { display: flex; align-items: center; gap: 8px; }
.bk-item-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-item-date { flex: 0 0 auto; font-size: 11.5px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.bk-item-tour { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-item-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--subtle); }
.bk-item-money { color: var(--green); font-weight: 700; font-variant-numeric: tabular-nums; }

.bk-av {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em; line-height: 1;
  background: linear-gradient(145deg, color-mix(in srgb, var(--av, var(--accent)) 72%, #fff), var(--av, var(--accent)));
}
.bk-av.lg { width: 46px; height: 46px; font-size: 16px; }
.bk-who {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--av, var(--ink-2)); color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
}
.bk-wait {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--elevated); color: var(--ink-2); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.bk-wait.hot { background: var(--red-weak); color: var(--red); }
.bk-resp { font-size: 12.5px; color: var(--green); font-weight: 600; }

/* Repeat requests of one person: ×N on the newest, the rest folded under it */
.bk-dup {
  flex: 0 0 auto; padding: 0 7px; line-height: 18px; border-radius: var(--r-pill);
  background: var(--accent-weak); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.bk-dup:hover { background: var(--accent); color: #fff; }
.bk-group.open { background: color-mix(in srgb, var(--accent) 4%, transparent); border-radius: 12px; margin-bottom: 4px; }
.bk-group-rest { margin-left: 52px; padding-bottom: 6px; border-left: 2px solid var(--accent-weak); }
.bk-item.sub { padding: 7px 10px; }
.bk-item.sub .bk-item-name { font-weight: 600; font-size: 13px; }
.bk-more {
  display: block; width: 100%; margin-top: 6px; padding: 9px; border: 1px dashed var(--field-border);
  border-radius: var(--r-md); background: none; color: var(--ink-2); font-weight: 600; cursor: pointer;
}
.bk-more:hover { color: var(--accent-ink); border-color: var(--accent); }

/* Card column */
.bk-card-panel { min-width: 0; min-height: 0; overflow-y: auto; padding: 20px 24px; }
.bk-card-empty {
  height: 100%; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.bk-card-empty svg { width: 120px; }
.bk-card-empty .ce-a { fill: var(--accent-weak); }
.bk-card-empty .ce-b { fill: var(--surface); }
.bk-card-head { align-items: center; }
.bk-card-head .bk-card-headline { flex: 1; }
.bk-back { display: none; }
.bk-workbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0;
  padding: 10px 12px; background: var(--paper-2); border: 1px solid var(--divider); border-radius: var(--r-md);
}
.bk-assignee { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--subtle); font-weight: 600; }
.bk-assignee select { margin: 0; min-width: 160px; padding-top: 6px; padding-bottom: 6px; }
.bk-contacted { margin-left: auto; }

/* Cancel with a reason */
.bk-reason {
  margin-top: 12px; padding: 14px; border-radius: var(--r-md);
  background: var(--red-weak); border: 1px solid color-mix(in srgb, var(--red) 25%, transparent);
}
.bk-reason-title { font-weight: 700; margin-bottom: 8px; }
.bk-reason-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.bk-reason-chip {
  padding: 6px 12px; border-radius: var(--r-pill); border: 1px solid var(--field-border);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer;
}
.bk-reason-chip:hover { border-color: var(--red); color: var(--ink); }
.bk-reason-chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.bk-reason-note { width: 100%; margin: 0 0 10px; }
.bk-reason-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-lost {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--elevated); font-size: 13.5px;
}

/* Board */
.bk-board-wrap { position: relative; }
.bk-board {
  display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 12px;
  overflow-x: auto; padding-bottom: 6px; align-items: start;
}
.bk-col {
  display: flex; flex-direction: column; min-width: 0; min-height: 200px;
  background: var(--paper-2); border: 1px solid var(--divider); border-radius: var(--r-lg);
  transition: border-color .12s ease, background .12s ease;
}
.bk-col.over { border-color: var(--accent); background: var(--accent-weak); }
.bk-col-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.bk-col-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--subtle); flex: 0 0 auto; }
.bk-col-dot.requested { background: var(--amber); }
.bk-col-dot.confirmed { background: var(--blue); }
.bk-col-dot.prepaid   { background: var(--accent); }
.bk-col-dot.paid      { background: var(--green); }
.bk-col-title { font-weight: 700; font-size: 13.5px; }
.bk-col-n { font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.bk-col-sum { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-col-more { padding: 0 14px 6px; font-size: 11.5px; color: var(--subtle); }
.bk-col-body {
  display: flex; flex-direction: column; gap: 8px; padding: 4px 10px 12px;
  max-height: max(420px, calc(100vh - 380px)); overflow-y: auto;
}
.bk-col-empty { padding: 24px 8px; text-align: center; font-size: 12.5px; color: var(--subtle); }
.bk-bcard {
  display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; cursor: grab;
  background: var(--surface); border: 1px solid var(--stroke); border-radius: 12px; box-shadow: var(--sh-1);
  transition: box-shadow .12s ease, transform .12s ease, opacity .12s ease;
}
.bk-bcard:hover { box-shadow: 0 6px 18px -10px rgba(43, 54, 85, .45); transform: translateY(-1px); }
.bk-bcard.dragging { opacity: .45; cursor: grabbing; }
.bk-bcard-top { display: flex; align-items: center; gap: 8px; }
.bk-bcard-name { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-bcard-tour { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-bcard-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--subtle); }
.bk-bcard-date { margin-left: auto; font-variant-numeric: tabular-nums; }
.bk-drop-cancel {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); z-index: 60;
  padding: 16px 28px; border-radius: var(--r-pill); border: 2px dashed var(--red);
  background: var(--surface); color: var(--red); font-weight: 700; box-shadow: var(--sh-2);
  transition: transform .18s ease, background .12s ease; pointer-events: none;
}
.bk-drop-cancel.show { transform: translate(-50%, 0); pointer-events: auto; }
.bk-drop-cancel.over { background: var(--red); color: #fff; }
.bk-board-hint { margin-top: 10px; }

@media (max-width: 1200px) {
  .bk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-inbox { grid-template-columns: 320px minmax(0, 1fr); }
}
