/**
 * CRM → Настройки AI — в стиле админки video-hub (teal, карточки на всю ширину).
 */
body.vh-page-crm-ai-settings #adminAiContentPage.mk-page {
  margin: 0;
  padding: 0;
  background: transparent;
  min-height: auto;
  font-family: inherit;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-root.vh-ai-settings {
  max-width: none;
  width: 100%;
}

.vh-ai-settings {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vh-ai-hero {
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f0fdfa 0%, #fff 55%, #f8fafc 100%);
}

.vh-ai-hero h1 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.vh-ai-hero__lead {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #64748b;
  max-width: 52rem;
}

.vh-ai-hero__links {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.82rem;
}

.vh-ai-hero__links a {
  color: #0f766e;
  font-weight: 600;
  text-decoration: none;
}

.vh-ai-hero__links a:hover {
  text-decoration: underline;
}

/* Карточки: панели mk внутри страницы AI */
body.vh-page-crm-ai-settings #adminAiContentPage .mk-panel,
body.vh-page-crm-ai-settings #adminAiContentPage .mk-ch-env-panel,
body.vh-page-crm-ai-settings #adminAiContentPage .mk-wh-panel {
  display: block !important;
  max-width: none !important;
  width: 100%;
  margin: 0 !important;
  padding: 22px 24px !important;
  border-radius: 12px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
  box-sizing: border-box;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-panel__title,
body.vh-page-crm-ai-settings #adminAiContentPage .mk-wh-panel__title {
  margin: 0 0 16px !important;
  padding: 0 0 12px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-hint {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #64748b;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-hint--tight {
  margin: 0 0 18px;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-hint a {
  color: #0f766e;
  font-weight: 600;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-hint code {
  font-size: 0.82em;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #334155;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-input:focus,
body.vh-page-crm-ai-settings #adminAiContentPage .mk-textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-btn--primary {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #fff !important;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-btn--primary:hover {
  background: #0d6b63 !important;
  border-color: #0d6b63 !important;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-btn--secondary {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 24px 0;
}

/* Сетка ключей API */
.vh-ai-keys-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 960px) {
  .vh-ai-keys-grid {
    grid-template-columns: 1fr 1fr;
  }
  .vh-ai-keys-grid .vh-ai-keys-block--full {
    grid-column: 1 / -1;
  }
}

.vh-ai-keys-block h4 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.vh-ai-status {
  min-height: 1.2em;
  margin: 8px 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.82rem;
}

.vh-ai-status.mk-status-ok,
body.vh-page-crm-ai-settings #adminAiContentPage #tgBotStatus.mk-status-ok {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

/* Генератор: две колонки на широком экране */
.vh-ai-gen-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1100px) {
  .vh-ai-gen-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.vh-ai-gen-side--preview {
  position: sticky;
  top: 12px;
}

#kieBlock {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-secret-wrap {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-secret-wrap .mk-input {
  flex: 1;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-secret-eye {
  flex-shrink: 0;
  min-width: 44px;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

body.vh-page-crm-ai-settings #adminAiContentPage .mk-wh-row {
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

body.vh-page-crm-ai-settings .admin-main {
  padding: 12px 16px 24px !important;
}
