.admin-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, color-mix(in srgb, var(--accent2) 28%, transparent), transparent 30%),
    radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 28%),
    var(--bg);
  color: var(--text);
}

.admin-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-hero h1 {
  margin: 4px 0 6px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.admin-back {
  color: var(--text);
  text-decoration: none;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--card);
  font-weight: 900;
}

.admin-card {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  padding: 20px;
  backdrop-filter: blur(18px);
}

.admin-key-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-status {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 20px;
  color: var(--muted);
  font-weight: 800;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, .95fr) minmax(320px, .75fr);
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-form,
.admin-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.admin-form-compact {
  align-self: start;
}

.admin-preview-card {
  min-width: 0;
}

.admin-form-head,
.admin-toolbar,
.admin-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-form-head h2 {
  margin: 0;
}

.admin-two {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 12px;
}

.admin-input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  color: var(--text);
  font: inherit;
  font-weight: 750;
  outline: none;
}

.admin-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.admin-textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
}

.admin-card label {
  display: grid;
  gap: 6px;
  font-weight: 900;
}

.admin-check {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px !important;
}

.csv-box {
  min-height: 250px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .88rem;
}

.ai-result {
  min-height: 420px;
  max-height: 620px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  color: var(--text);
  font: 800 .86rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.ai-preview,
.ai-news-preview {
  display: grid;
  gap: 12px;
}

.ai-news-preview h3,
.ai-news-preview h4 {
  margin: 0;
}

.ai-news-preview ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.ai-news-list {
  display: grid;
  gap: 10px;
}

.ai-news-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
}

.ai-news-item p {
  margin: 6px 0 0;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(130px, 160px) minmax(220px, 1fr);
  gap: 10px;
  flex: 1;
}

.question-list {
  display: grid;
  gap: 10px;
}

.question-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
}

.question-row.is-off {
  opacity: .55;
}

.question-row h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.question-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
}

.question-answer {
  color: var(--accent);
  font-weight: 900;
}

.question-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-pager {
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 850px) {
  .admin-hero,
  .admin-key-card,
  .admin-grid,
  .admin-toolbar,
  .admin-filters,
  .admin-two,
  .question-row {
    grid-template-columns: 1fr;
  }
  .admin-hero,
  .admin-toolbar {
    display: grid;
  }
  .admin-form-head {
    align-items: flex-start;
  }
}
