:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --panel-2: #f0f4f8;
  --line: #d9e1ec;
  --line-strong: #b9c7d8;
  --text: #1b2635;
  --muted: #617187;
  --accent: #1268b3;
  --accent-strong: #0b4f8b;
  --success: #137a4b;
  --danger: #b42318;
  --warning: #986100;
  --shadow: 0 8px 24px rgba(25, 42, 70, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 10px clamp(14px, 4vw, 36px);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: #172033;
  color: #fff;
  font-size: 13px;
}

.nav {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav-btn {
  min-width: 72px;
  min-height: 34px;
  padding: 7px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.nav-btn.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 6px rgba(24, 43, 73, 0.12);
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 24px clamp(14px, 4vw, 36px) 48px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel-head,
.panel-body {
  padding: 18px;
}

.panel-head {
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.5;
}

.btn {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-strong);
}

.btn.danger {
  border-color: #f0b4ae;
  color: var(--danger);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

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

.question {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.question-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 15px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
}

.question-title {
  margin: 0;
  line-height: 1.45;
  font-size: 15px;
}

.question-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.options {
  display: grid;
  gap: 8px;
  padding: 14px 15px 16px;
}

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.option input {
  width: 18px;
  height: 18px;
  min-height: 18px;
}

.summary {
  display: grid;
  gap: 10px;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.stat:last-child {
  border-bottom: 0;
}

.muted {
  color: var(--muted);
}

.status {
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
}

.status.success {
  color: var(--success);
  border-color: #b6dec9;
  background: #f0faf4;
}

.status.danger {
  color: var(--danger);
  border-color: #f0b4ae;
  background: #fff4f2;
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 18px;
}

.stack {
  display: grid;
  gap: 16px;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.empty {
  padding: 28px 18px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 900px) {
  .layout,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    width: 100%;
  }

  .nav-btn {
    flex: 1;
  }

  .question-head {
    flex-direction: column;
  }
}
