:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --ink: #17212b;
  --muted: #607080;
  --line: #dce3ea;
  --accent: #0c7a75;
  --accent-dark: #075d59;
  --danger: #b42318;
  --success: #197b4b;
  --warning: #a15c07;
  --shadow: 0 12px 34px rgba(24, 39, 75, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
  padding: 0 28px;
  background: #16212a;
  color: #fff;
}

.brand {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0;
}

.brand:hover {
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
}

.nav a {
  color: #eaf2f1;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 22px;
}

.narrow {
  width: min(520px, 100%);
  margin-left: auto;
  margin-right: auto;
}

h1, h2 {
  margin: 0 0 14px;
  line-height: 1.2;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

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

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 700;
  color: #27313b;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #c9d4df;
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

input[type="file"] {
  padding: 9px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

textarea {
  resize: vertical;
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button:hover, .button:hover {
  background: var(--accent-dark);
  text-decoration: none;
}

.link-button {
  background: transparent;
  color: var(--accent);
  padding: 0;
  min-height: auto;
}

.link-button:hover {
  background: transparent;
  text-decoration: underline;
}

.inline-form {
  margin-top: 14px;
}

.alert {
  padding: 12px 14px;
  border-radius: 6px;
  margin: 12px 0;
}

.alert.error {
  background: #fff0ee;
  color: var(--danger);
  border: 1px solid #ffd0ca;
}

.alert.success {
  background: #eaf8f1;
  color: var(--success);
  border: 1px solid #bde7d1;
}

.form-actions {
  grid-column: 1 / -1;
}

.assessment-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
}

.status-panel {
  background: #16212a;
  color: #fff;
  border-radius: 8px;
  padding: 20px;
  height: max-content;
  position: sticky;
  top: 16px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
}

.metric span {
  color: #b9c7d5;
  font-size: 13px;
}

.metric strong {
  font-size: 24px;
}

.bar {
  height: 8px;
  background: rgba(255,255,255,0.18);
  border-radius: 99px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: #44c2b8;
}

.question-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.question-image {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 10px 0 18px;
}

.options-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  display: grid;
  grid-template-columns: 20px 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 400;
  cursor: pointer;
}

.option:hover {
  border-color: var(--accent);
}

.option input {
  width: auto;
}

.option-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #edf4f3;
  color: var(--accent-dark);
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.stat strong {
  font-size: 24px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: #405060;
  background: #f7f9fb;
}

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

.radio-inline, .check {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.radio-inline input, .check input {
  width: auto;
}

.json {
  white-space: pre-wrap;
  background: #101820;
  color: #e8f2f1;
  padding: 16px;
  border-radius: 8px;
  overflow: auto;
}

.document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.document-link {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: #f7faf9;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .grid, .assessment-layout, .stats-grid, .options-admin {
    grid-template-columns: 1fr;
  }

  .status-panel {
    position: static;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
