

.drill-popup {
  border: 1px solid rgba(255, 255, 255, 0.60);
  border-radius: var(--glass-radius);
  background: rgba(255, 255, 255, 0.70);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.08),
    0 1px 3px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  position: relative;
}

.drill-popup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, 0.9) 20%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.9) 80%,
    transparent
  );
  pointer-events: none;
  z-index: 1;
}

.drill-popup-modal {
  width: min(960px, 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.92);
}

.drill-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.drill-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.50);
}
.drill-title {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.drill-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.drill-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.drill-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--transition-fast), color var(--transition-fast);
  line-height: 1;
}
.drill-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.drill-export-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: var(--brand-color);
  color: #fff;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition-fast);
  line-height: 1;
  flex-shrink: 0;
}
.drill-export-btn:hover {
  background: var(--brand-color-hover);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.drill-export-btn:active {
  transform: scale(0.95);
}

.drill-body {
  padding: 12px 16px 16px;
}

.drill-popup-modal .drill-body {
  overflow: auto;
  flex: 1 1 auto;
}

.drill-table-wrap {
  overflow-x: auto;
}

.drill-table {
  width: auto;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.4;
}

.drill-th {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border-bottom: 2px solid rgba(0, 0, 0, 0.06);
  transition: color var(--transition-fast);
}
.drill-th:hover {
  color: var(--brand-color);
}
.drill-th-active {
  color: var(--text-primary);
}

.drill-td {
  padding: 6px 12px;
  white-space: nowrap;
  border-bottom: 1px solid var(--table-border);
  vertical-align: middle;
  color: var(--text-primary);
}

.drill-dot-sm {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}

.drill-link {
  color: var(--brand-color);
  text-decoration: none;
  font-weight: 500;
}
.drill-link:hover {
  text-decoration: underline;
}

.drill-count {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}

.drill-popup-info {
  width: min(440px, 92vw);
  max-height: 80vh;
}
.drill-popup-info .drill-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drill-info-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.drill-info-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.drill-info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
  line-height: 1.35;
}
.drill-info-link {
  color: var(--brand-color);
  text-decoration: none;
  font-weight: 500;
  word-break: break-all;
}
.drill-info-link:hover { text-decoration: underline; }

.drill-loading,
.drill-empty {
  color: #888;
  text-align: center;
  padding: 16px 0;
}
.drill-error {
  color: #c00;
  text-align: center;
  padding: 16px 0;
}

/* Номер сделки — кнопка, а не ссылка: на стенде вести некуда. Гасим
   собственный вид кнопки, чтобы в таблице она читалась как ссылка. */
.drill-crm-stub {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--brand-color);
  cursor: pointer;
}

/* Подсказка вместо перехода в CRM. position:fixed — координаты считаются от
   getBoundingClientRect() кнопки, а таблица прокручивается внутри попапа. */
.drill-crm-tip {
  position: fixed;
  z-index: 10050;
  max-width: 320px;
  padding: 12px 14px;
  border: 1px solid var(--brand-color-dim-hover);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  font-size: 13px;
  line-height: 1.45;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
}

.drill-crm-tip.is-in {
  opacity: 1;
  transform: translateY(0);
}

.drill-crm-tip b {
  color: var(--brand-color);
}

.drill-crm-tip-note {
  color: #777;
  font-size: 12px;
}
