/* Панель клиента поверх списка. Отдельный файл, чтобы правки контура не
   пересекались с общими стилями таблиц и оболочки. */

.cust-inspector {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 92vw);
  max-width: 100vw;
  box-sizing: border-box;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--new-surface, #fff);
  border-left: 1px solid var(--new-line, #e2e6ec);
  box-shadow: -22px 0 64px -34px rgba(16, 24, 40, .48);
  font-size: 13px;
}
.cust-inspector[hidden] { display:none; }

.cust-inspector__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--new-line, #e2e6ec);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft, #e8f5f1) 76%, #fff), #fff 72%);
}
.cust-inspector__eyebrow {
  display: block;
  font-size:  12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent, #0b8068);
  margin-bottom: 3px;
}
.cust-inspector__head b { display:block; max-width:330px; overflow-wrap:anywhere; font-size:19px; line-height:1.22; letter-spacing:-.02em; }
.cust-inspector__x {
  margin-left: auto;
  width:34px; height:34px; border:1px solid var(--new-line, #e2e6ec);
  background: #fff;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  color: var(--new-muted, #667085);
  padding: 0;
  border-radius: 50%;
  transition: transform .16s ease, color .16s ease, background .16s ease;
}
.cust-inspector__x:hover { background: #fff3ef; color: #b54708; transform: rotate(90deg); }

.cust-inspector__body { flex: 1; overflow-y: auto; overscroll-behavior:contain; padding:16px 20px 22px; }
.cust-inspector__loading,
.cust-inspector__fail { color: var(--new-muted, #667085); margin: 0; }

.cust-inspector__source { display:grid; gap:5px; margin-bottom:18px; padding:13px 14px; border:1px solid #cde7dd; border-radius:14px; background:#f4fbf8; }
.cust-inspector__source.is-unavailable { border-color:#efd7cc; background:#fff8f4; }
.cust-inspector__source span,.cust-inspector__section-head span { color:var(--new-muted, #667085); font-size:10px; font-weight:800; letter-spacing:.11em; text-transform:uppercase; }
.cust-inspector__source b { font-size:14px; line-height:1.3; }
.cust-inspector__source p { margin:0; color:var(--new-muted,#667085); font-size:12px; line-height:1.45; }
.cust-inspector__section { display:grid; gap:10px; }
.cust-inspector__section-head { display:grid; gap:3px; }
.cust-inspector__section-head h3 { margin:0; font-size:14px; letter-spacing:-.01em; }
.cust-inspector__facts { margin: 0; display: grid; gap: 7px; }
.cust-inspector__facts > div {
  display: grid;
  grid-template-columns:minmax(0,1fr) minmax(80px,.9fr);
  gap: 12px;
  align-items: baseline;
  padding: 10px 12px;
  border:1px solid var(--new-line, #e2e6ec);
  border-radius:10px;
  background: var(--new-surface, #fff);
}
.cust-inspector__facts dt { color: var(--new-muted, #667085); font-size: 12px; }
.cust-inspector__facts dd { min-width:0; margin:0; overflow-wrap:anywhere; text-align:right; font-weight:650; font-variant-numeric:tabular-nums; }
.cust-inspector__classification { margin-top:16px; padding-top:15px; border-top:1px solid var(--new-line, #e2e6ec); }
.cust-inspector__classification summary { display:flex; align-items:center; justify-content:space-between; gap:10px; color:#1d2939; font-size:13px; font-weight:750; cursor:pointer; }
.cust-inspector__classification summary span { display:grid; min-width:22px; height:22px; place-items:center; border-radius:999px; background:#edf7f3; color:var(--accent,#0b8068); font-size:11px; }
.cust-inspector__classification .cust-inspector__facts { margin-top:12px; }

.cust-inspector__note { margin: 12px 0 0; font-size:  12px; color: var(--new-muted, #667085); line-height: 1.5; }

.cust-inspector__foot {
  display: flex;
  gap: 8px;
  position:sticky; bottom:0; align-items:center; padding:12px 20px;
  border-top: 1px solid var(--new-line, #e2e6ec);
  background:#fff;
  box-shadow:0 -10px 22px rgba(16,24,40,.05);
}
.cust-inspector__foot .btn { min-width:0; flex:1; text-align:center; }

@media (max-width: 720px) {
  .cust-inspector { width:100%; border-left:0; }
  .cust-inspector__head { padding:16px; }
  .cust-inspector__body { padding:14px 16px 18px; }
  .cust-inspector__foot { gap:6px; padding:10px 16px; }
  .cust-inspector__foot .btn { padding-left:8px; padding-right:8px; font-size:11px; }
}
@media (prefers-reduced-motion: reduce) { .cust-inspector__x { transition:none; } }

.customer-source-link-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 24px;
  overflow: auto;
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  color: #1e293b;
  background: #fff;
  box-shadow: 0 24px 72px #0f172a26;
}
.customer-source-link-dialog::backdrop { background: #0f172a66; }
.customer-source-link-dialog .card-hd { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.customer-source-link-dialog h3 { margin: 0; font-size: 20px; }
.customer-source-link-dialog h4 { margin: 20px 0 12px; font-size: 16px; }
.customer-source-link-dialog label { display: grid; gap: 6px; margin: 12px 0; font-size: 14px; }
.customer-source-link-dialog input,
.customer-source-link-dialog select,
.customer-source-link-dialog textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; background: #fff; color: inherit; }
.customer-source-link-dialog textarea { min-height: 88px; resize: vertical; }
.customer-source-link-dialog [data-candidates] { display: grid; gap: 8px; margin: 16px 0; }
.customer-source-link-dialog [data-candidates] .btn { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.customer-source-link-dialog [data-notice] { padding: 12px; border-radius: 8px; background: #f1f5f9; font-size: 14px; line-height: 1.5; }
.customer-source-link-dialog [data-history] { max-height: 240px; overflow: auto; font-size: 13px; }
