.system-settings-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
  max-width: var(--system-admin-page-max-width, 1320px);
  padding: 18px 20px 96px;
}

.system-settings-workbar {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d8e1e7;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.system-settings-metric {
  align-items: center;
  background: #f5f8fa;
  border: 1px solid #d8e1e7;
  border-radius: 6px;
  display: flex;
  gap: 10px;
  min-height: 40px;
  padding: 8px 12px;
}

.system-settings-metric span {
  color: #5b6b76;
  font-size: 12px;
  font-weight: 700;
}

.system-settings-metric strong {
  color: #1d2b34;
  font-size: 14px;
  font-weight: 800;
}

.system-settings-actions {
  align-items: end;
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.system-settings-save-state {
  align-items: center;
  background: #f5f8fa;
  border: 1px solid #d8e1e7;
  border-radius: 999px;
  display: inline-flex;
  gap: 8px;
  line-height: 1;
  max-width: min(360px, 42vw);
  min-height: 30px;
  overflow: hidden;
  padding: 6px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.system-settings-save-state.error {
  background: #fff0ed;
  border-color: #e0aaa2;
  color: #9a3027;
}

.system-settings-save-state.error span,
.system-settings-save-state.error strong {
  color: #9a3027;
}

.system-settings-save-state span {
  color: #5b6b76;
  font-size: 12px;
  font-weight: 700;
}

.system-settings-save-state strong {
  color: #1d2b34;
  font-size: 14px;
  font-weight: 800;
  min-width: 48px;
}

.system-settings-icon-button {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 18px;
  height: 38px;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  width: 38px;
}

#saveSettingsButton {
  background: #2c7892;
  border-color: #25677d;
  color: #ffffff;
}

#saveSettingsButton:hover:not(:disabled) {
  background: #24677d;
  border-color: #205d72;
  color: #ffffff;
}

#saveSettingsButton:disabled {
  background: #a7b2bc;
  border-color: #98a4ae;
  color: #ffffff;
}

.system-settings-button-icon {
  display: block;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 17px;
}

.system-settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.system-settings-section {
  background: #ffffff;
  border: 1px solid #c8d3db;
  border-radius: 8px;
  overflow: hidden;
}

.system-settings-section-header {
  align-items: center;
  background: #eef6f3;
  border-bottom: 1px solid #c4d7d1;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.system-settings-section-header h2 {
  align-items: center;
  color: #173f38;
  display: flex;
  font-size: 17px;
  gap: 8px;
  margin: 0;
}

.system-settings-section-header h2::before {
  background: #1f7a6c;
  border-radius: 999px;
  content: "";
  display: inline-block;
  height: 18px;
  width: 4px;
}

.system-settings-badge {
  background: #eef3f6;
  border: 1px solid #cfdbe3;
  border-radius: 999px;
  color: #50616d;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
}

.system-settings-badge.is-configured {
  background: #e8f5f1;
  border-color: #9ccfc0;
  color: #166657;
}

.system-settings-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  padding: 16px;
}

.system-settings-field-wide {
  grid-column: span 2;
}

.system-settings-field,
.system-settings-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.system-settings-field span,
.system-settings-toggle span {
  color: #50616d;
  font-size: 12px;
  font-weight: 700;
}

.system-settings-field input,
.system-settings-field select {
  background: #ffffff;
  border: 1px solid #c8d3db;
  border-radius: 6px;
  color: #1f2d36;
  font-size: 14px;
  min-height: 38px;
  padding: 8px 10px;
}

.system-settings-field input[readonly],
.system-settings-field select:disabled {
  background: #f5f8fa;
  color: #63727d;
}

.system-settings-toggle {
  align-items: center;
  align-self: end;
  background: #f5f8fa;
  border: 1px solid #d8e1e7;
  border-radius: 6px;
  box-sizing: border-box;
  flex-direction: row;
  height: 38px;
  min-height: 38px;
  padding: 8px 10px;
}

.system-settings-toggle input {
  height: 16px;
  margin: 0;
  width: 16px;
}

.system-settings-field input:focus,
.system-settings-field select:focus,
.system-settings-toggle:focus-within {
  border-color: #1f7a6c;
  box-shadow: 0 0 0 3px rgba(31, 122, 108, 0.16);
  outline: none;
}

.system-settings-field input:invalid {
  border-color: #d25555;
}

@media (max-width: 900px) {
  .system-settings-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .system-settings-field-wide {
    grid-column: span 2;
  }
}

@media (max-width: 760px) {
  .system-settings-main {
    padding: 12px 12px 84px;
  }

  .system-settings-workbar {
    align-items: stretch;
    flex-direction: column;
  }

  .system-settings-actions {
    align-items: stretch;
    flex-wrap: wrap;
    margin-left: 0;
    width: 100%;
  }

  .system-settings-save-state {
    flex: 1 1 auto;
    justify-content: space-between;
    min-width: 0;
  }

  .system-settings-grid {
    grid-template-columns: 1fr;
  }

  .system-settings-field-wide {
    grid-column: auto;
  }
}
