* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #1f2933;
  background: #f3f5f7;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  color: #fff;
  background: #c8191e;
  border-radius: 6px;
}

.topbar h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
}

.topbar p {
  margin: 8px 0 0;
  font-size: 14px;
  opacity: .9;
}

.admin-link {
  flex: 0 0 auto;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .65);
  padding: 8px 14px;
  border-radius: 4px;
}

.form {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 6px;
}

.section {
  padding: 22px 24px;
  border-bottom: 1px solid #edf1f5;
}

.section:last-of-type {
  border-bottom: 0;
}

.section h2 {
  margin: 0 0 16px;
  color: #c8191e;
  font-size: 17px;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label span {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
}

.multi-select {
  position: relative;
}

.multi-trigger {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  padding: 8px 10px;
  color: #374151;
  font: inherit;
  font-weight: 400;
  text-align: left;
  background: #fff;
  cursor: pointer;
}

.multi-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 340px;
  overflow: hidden;
  border: 1px solid #cfd8e3;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
}

.multi-panel input[type="search"] {
  border: 0;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0;
}

.multi-options {
  max-height: 292px;
  overflow: auto;
  padding: 6px 0;
}

.option-group-title {
  padding: 8px 12px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  background: #f8fafc;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
}

.option-row:hover {
  background: #fff1f2;
}

.option-row input {
  width: auto;
  min-height: auto;
}

.option-row span {
  margin: 0;
  font-weight: 400;
}

textarea {
  resize: vertical;
  line-height: 1.7;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(200, 25, 30, .18);
  border-color: #c8191e;
}

.inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-bottom: 16px;
}

.inline-fields label,
.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.inline-fields input {
  width: auto;
  min-height: auto;
}

.full {
  display: block;
  margin-top: 16px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px 26px;
}

button {
  border: 0;
  border-radius: 4px;
  padding: 10px 24px;
  color: #fff;
  font: inherit;
  font-weight: 700;
  background: #c8191e;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

#message {
  font-size: 14px;
}

#message.success {
  color: #15803d;
}

#message.error {
  color: #b91c1c;
}

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

  .grid,
  .grid.three {
    grid-template-columns: 1fr;
  }
}
