:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #4b5a6a;
  --accent: #0f766e;
  --border: #d9e2ec;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 56px;
}

h1 {
  margin: 8px 0 8px;
}

.subtitle {
  margin-top: 0;
  color: var(--muted);
}

.required-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 20px rgba(2, 32, 71, 0.04);
}

label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
}

.field-error {
  border-color: #b42318;
}

.field-error-text {
  margin: 0 0 10px;
  color: #b42318;
  font-weight: 600;
}

.question {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  margin-top: 14px;
}

.question:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.q-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.option {
  display: block;
  margin: 7px 0;
  font-weight: 400;
}

.option input {
  width: auto;
  margin-right: 8px;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.admin-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.group-tabs {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #e7eef6;
  color: #1d2733;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
}

.tab-btn.active {
  background: #0f766e;
  color: #ffffff;
}

.mini-btn {
  background: #155e75;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
}

.danger-btn {
  background: #b42318;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.detail-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.detail-item p {
  margin: 8px 0 0;
  font-size: 13px;
}

.detail-verdict {
  font-weight: 700;
}

.detail-item.correct {
  border-color: #86efac;
  background: #f0fdf4;
}

.detail-item.wrong {
  border-color: #fecaca;
  background: #fef2f2;
}

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

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.metric-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 12px;
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin: 6px 0 0;
  font-size: 20px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
}

th {
  background: #f8fafc;
  font-weight: 700;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.hidden {
  display: none;
}

.error {
  color: #b42318;
}

.success {
  color: #067647;
}

@media (max-width: 600px) {
  .container {
    padding: 18px 12px 40px;
  }

  button {
    width: 100%;
  }

  .admin-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
