/* === Система подсказок (hints) === */

/* Иконка-маркер подсказки */
.hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--color-primary, #6b7280);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  cursor: help;
  vertical-align: middle;
  position: relative;
  line-height: 1;
  user-select: none;
}

.hint::before { content: "i"; }

/* Тултип — появляется при hover/focus */
.hint::after {
  content: attr(data-hint);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 320px;
  min-width: 180px;
  text-align: left;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Стрелка тултипа */
.hint::before { z-index: 1001; position: relative; }

.hint:hover::after,
.hint:focus::after {
  opacity: 1;
  visibility: visible;
}

/* Альтернативная позиция — справа (для узких колонок) */
.hint--right::after {
  bottom: auto;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}

/* Альтернативная позиция — снизу (для элементов вверху страницы) */
.hint--bottom::after {
  bottom: auto;
  top: calc(100% + 8px);
}

/* Баннер-подсказка — для важных инструкций в начале страницы */
.hint-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin: 12px 0;
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
}

.hint-banner__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.hint-banner--warn {
  background: #fffbeb;
  border-left-color: #f59e0b;
}
.hint-banner--warn .hint-banner__icon { background: #f59e0b; }

.hint-banner--success {
  background: #ecfdf5;
  border-left-color: #10b981;
}
.hint-banner--success .hint-banner__icon { background: #10b981; }

/* Inline-подсказка — для пояснения полей форм */
.hint-inline {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
}

/* Руководство — стили для guide.html */
.guide-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.guide-toc {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 20px;
  margin: 16px 0 24px;
}
.guide-toc h3 { margin-top: 0; font-size: 16px; }
.guide-toc ol { margin: 0; padding-left: 20px; }
.guide-toc li { margin: 4px 0; }
.guide-toc a { color: #3b82f6; text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }

.guide-section {
  margin: 32px 0;
  padding: 24px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}
.guide-section h2 {
  margin-top: 0;
  font-size: 22px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 8px;
}
.guide-section h3 {
  margin-top: 20px;
  font-size: 17px;
  color: #374151;
}
.guide-section ul, .guide-section ol { padding-left: 24px; }
.guide-section li { margin: 6px 0; line-height: 1.6; }
.guide-section code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}
.guide-section .kbd {
  display: inline-block;
  padding: 2px 8px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-bottom-width: 2px;
  border-radius: 4px;
  font-size: 13px;
  font-family: monospace;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}
.guide-section .note {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 4px;
  font-size: 14px;
}
.guide-section .warn {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 10px 14px;
  margin: 12px 0;
  border-radius: 4px;
  font-size: 14px;
}

.guide-role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.guide-role-badge--superuser { background: #dbeafe; color: #1e40af; }
.guide-role-badge--operator { background: #d1fae5; color: #065f46; }
.guide-role-badge--observer { background: #fef3c7; color: #92400e; }
