/* ================================================================
   CRM HINTS — подсказки для CRM-панели
   ================================================================ */

@keyframes hint-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(100, 116, 139, 0.55); }
  65%  { box-shadow: 0 0 0 10px rgba(100, 116, 139, 0); }
  100% { box-shadow: 0 0 0 0 rgba(100, 116, 139, 0); }
}

/* ── Кнопка-иконка ? ──────────────────────────────────────── */
.hint-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: #94a3b8;
  font-family: 'Manrope', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  border: 1.5px solid #cbd5e1;
  cursor: pointer;
  flex-shrink: 0;
  animation: hint-pulse 1.8s ease-out infinite;
  transition: color 0.15s, border-color 0.15s;
  position: absolute;
  z-index: 50;
}
.hint-btn:hover {
  color: #64748b;
  border-color: #94a3b8;
}
.hint-btn.is-active {
  color: #475569;
  border-color: #64748b;
  animation: none;
}

/* Позиции для разных типов */
.hint-btn--h2 {
  top: auto;
  bottom: 2px;
  left: 112%;
  transform: translateY(0%);
}
.hint-btn--overlay {
  top: 14px;
  right: 14px;
}
.hint-btn--inline {
  top: 50%;
  left: calc(100% + 30px);
  transform: translateY(-50%);
}
.hint-btn--after {
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
}
.hint-btn--before {
  top: 50%;
  right: calc(100% + 10px);
  transform: translateY(-50%);
}
.hint-btn--above {
  bottom: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
}

/* ── Затемнение фона ──────────────────────────────────────── */
.hint-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.hint-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Всплывающий попап ────────────────────────────────────── */
.hint-popup {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.11), 0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 14px 16px;
  width: 400px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
.hint-popup.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Уголок влево — попап справа от иконки */
.hint-popup::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -9px;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 9px solid rgba(0, 0, 0, 0.09);
}
.hint-popup::after {
  content: '';
  position: absolute;
  top: 50%;
  left: -7px;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 8px solid #fff;
}

/* Уголок вправо — попап слева от иконки */
.hint-popup--left::before {
  left: auto; right: -9px;
  border-right: none;
  border-left: 9px solid rgba(0, 0, 0, 0.09);
}
.hint-popup--left::after {
  left: auto; right: -7px;
  border-right: none;
  border-left: 8px solid #fff;
}

/* Уголок сверху — попап ниже иконки */
.hint-popup--below::before,
.hint-popup--below::after {
  top: auto; left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: none;
}
.hint-popup--below::before {
  top: -9px;
  border-bottom: 9px solid rgba(0, 0, 0, 0.09);
}
.hint-popup--below::after {
  top: -7px;
  border-bottom: 8px solid #fff;
}

/* Уголок снизу — попап выше иконки */
.hint-popup--above-icon::before,
.hint-popup--above-icon::after {
  top: auto; left: var(--arrow-x, 50%);
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-right: none;
}
.hint-popup--above-icon::before {
  bottom: -9px;
  border-top: 9px solid rgba(0, 0, 0, 0.09);
}
.hint-popup--above-icon::after {
  bottom: -7px;
  border-top: 8px solid #fff;
}

.hint-popup p {
  margin: 0 0 8px;
  font-size: 13px;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  line-height: 1.65;
  color: #444;
}
.hint-popup p:last-child { margin-bottom: 0; }

/* ── Плавающий переключатель ──────────────────────────────── */
.hint-toggle {
  display: none !important;
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 100px;
  padding: 9px 14px 7px 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.06);
  font-family: 'Manrope', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.15s;
}
.hint-toggle:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.13), 0 1px 4px rgba(0, 0, 0, 0.07);
}
.hint-toggle__label {
  white-space: nowrap;
}

/* Трек переключателя */
.hint-toggle__track {
  display: inline-flex;
  align-items: center;
  width: 32px;
  height: 18px;
  border-radius: 100px;
  background: #e2e8f0;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.hint-toggle.is-on .hint-toggle__track {
  background: #0066cc;
}
.hint-toggle__thumb {
  position: absolute;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1);
}
.hint-toggle.is-on .hint-toggle__thumb {
  transform: translateX(14px);
}

.hint-toggle__state {
  font-size: 0.6875rem;
  color: #888;
  min-width: 22px;
}
.hint-toggle.is-on .hint-toggle__state {
  color: #0066cc;
}

@media (max-width: 767px) {
  .hint-btn--h2 { bottom: 2px; left: 106%; }
}
